Browse Source

小程序地址文本功能实现

h5_css
yanyan 3 years ago
parent
commit
57b412ff24
  1. 37
      subpkg/about/about.vue
  2. 37
      subpkg/agreement/agreement.vue
  3. 37
      subpkg/privacy/privacy.vue

37
subpkg/about/about.vue

@ -0,0 +1,37 @@
<template>
<view>
<view v-html="content"></view>
</view>
</template>
<script>
export default {
data() {
return {
content:""
};
},
onLoad() {
this.getAboutContent();
},
methods:{
async getAboutContent() {
const {
data: res
} = await uni.$http.post('/small/project/text/listAll',{type:2})
if (!res.success) return uni.$showMsg()
res.data.forEach(item=>{
this.content = item.content
})
uni.$showMsg('数据请求成功!')
},
}
}
</script>
<style lang="scss">
</style>

37
subpkg/agreement/agreement.vue

@ -0,0 +1,37 @@
<template>
<view>
<view v-html="content"></view>
</view>
</template>
<script>
export default {
data() {
return {
content:""
};
},
onLoad() {
this.getAboutContent();
},
methods:{
async getAboutContent() {
const {
data: res
} = await uni.$http.post('/small/project/text/listAll',{type:1})
if (!res.success) return uni.$showMsg()
res.data.forEach(item=>{
this.content = item.content
})
uni.$showMsg('数据请求成功!')
},
}
}
</script>
<style lang="scss">
</style>

37
subpkg/privacy/privacy.vue

@ -0,0 +1,37 @@
<template>
<view>
<view v-html="content"></view>
</view>
</template>
<script>
export default {
data() {
return {
content:""
};
},
onLoad() {
this.getAboutContent();
},
methods:{
async getAboutContent() {
const {
data: res
} = await uni.$http.post('/small/project/text/listAll',{type:0})
if (!res.success) return uni.$showMsg()
res.data.forEach(item=>{
this.content = item.content
})
uni.$showMsg('数据请求成功!')
},
}
}
</script>
<style lang="scss">
</style>
Loading…
Cancel
Save