aboutUs.vue
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<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>