aboutUs.vue 1.0 KB
<template>
	<view class="about_us">
		<editor v-if="content" id="editorShop" :read-only="true" class="ql-container company_induc_word" @ready="onEditorReady"></editor>
	</view>
</template>

<script>
	import App from "../../App.vue"
	export default {
		data() {
			return {
				content:"",
			}
		},
		methods: {
			// 关于我们
			getAboutUs(){
				let url = "/api/about/index";
				App.post(url)
				.then(res=>{
					this.content = res.content
				})
			},
			// 公司详情 后台的富文本数据
			onEditorReady() {
				let t = this;
				uni.createSelectorQuery()
					.select('#editorShop')
					.context(res => {
						this.editorCtx = res.context;
						let content = {
							html: t.content
						};
						this.editorCtx.setContents(content); //设置富文本编辑器的内容
					})
					.exec();
			},
		},
		onLoad() {
			this.getAboutUs();
		}
	}
</script>

<style>
	.about_us{
		padding: 0 30upx;
	}
	.about_img{
		width: 100%;
	}
	.about_content{
		color: #06121E;
		font-size: 28upx;
		margin: 40upx 0;
	}
</style>