agreement.vue
757 字节
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
<template>
<view class="">
<rich-text :nodes="text"></rich-text>
</view>
</template>
<script>
import { getAgreement } from '@/api/login.js'
export default {
data() {
return {
text: '',
type:''
}
},
onLoad(e) {
this.type = e.type
wx.setNavigationBarTitle({ title: e.type==1?'用户协议':e.type==2?'隐私政策':'' })
this.getAgreement()
},
methods: {
async getAgreement(){
try {
const res = await getAgreement(this.type)
this.text = res.agreement
console.log('getAgreement', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getAgreement', err)
}
},
},
}
</script>
<style>
</style>