agreement.vue 757 字节
<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>