liukangdong
2024-07-19 1b897c74e44d185669d87abd4c3a29c90d6fe225
wechat_staff/pages/sets/protocol.js
@@ -1,20 +1,36 @@
// pages/sets/protocol.js
import { getDictData } from '../../api/index'
Page({
  /**
   * 页面的初始数据
   */
  data: {
    content:''
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    console.log(options.type)
    if(options.type == 1){
      wx.setNavigationBarTitle({title:'隐私协议'})
    }else{
      wx.setNavigationBarTitle({title:'用户协议'})
    }
    this.loadDict(options.type);
  },
  loadDict(type){
    //type ==0 用户协议,否则隐私协议
    const label = type == 1?'PRIVACY_AGREEMENT':'SERVER_AGREEMENT'
    getDictData({
      code: 'ZBOM_CUSTOMIZED',
      label: label
    }).then(res => {
      this.setData({ content: res.data.code })
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */