// pages/index/periodicReviews/periodicReviews.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { KeyWord: '', vip_state:false }, //设置搜索关键词 setkeyword(e) { this.setData({ KeyWord: e.detail.value }) }, // goData() { this.getInfo() }, //家庭保单汇总表 summaryList(e) { var num = e.currentTarget.dataset.num var index = e.currentTarget.dataset.index var allinfo = JSON.stringify(e.currentTarget.dataset.allinfo) this.setData({ allinfo: allinfo }) var mid = e.currentTarget.dataset.mid if (mid == 1) { this.setData({ mainid: mid }) } if (num == 0) { wx.showToast({ title: '您还没有保单,请添加!', icon: 'none', }) } else { wx.navigateTo({ url: '../summaryList/summaryList?allinfo=' + allinfo, }) } }, //保单列表 policyList(e) { wx.navigateTo({ url: '/pages/index/personalPolicyList/personalPolicyList?DefId=' + e.currentTarget.id, }) }, //保单管理 PolicyManage(e) { wx.navigateTo({ url: '../policyManage/policyManage?FamilyId=' + e.currentTarget.dataset.familyid }) }, //报告列表 reportList(e) { var allinfo = JSON.stringify(e.currentTarget.dataset.allinfo) wx.navigateTo({ url: '../reportList/reportList?FamilyId=' + e.currentTarget.dataset.familyid+'&allinfo='+allinfo, }) }, // getInfo() { let that = this; let url = 'counselor/familylist'; let param = { UserId: app.globalData.UserId, Status: '', //固定传1 KeyWord: that.data.KeyWord } app.post(url, param).then((res) => { console.log(res) if (res.data.code == 200) { that.setData({ list: res.data.data.list, KeyWord: '', // vip_state: true }) // if (res.data.data.type == '-13') { // wx.showToast({ // title: '会员到期,请充值', // icon: 'none', // duration: 2000, // success: function() {} // }, 2000) // that.setData({ // vip_state: false // }) // } else if (res.data.data.type == '-12') { // wx.showToast({ // title: '您已经被禁用,请联系管理员', // icon: 'none', // success: function() { // setTimeout(function() { // wx.navigateTo({ // url: '/pages/index/index', // }) // }, 2000) // } // }, 2000) // that.setData({ // vip_state: false // }) // } else if (res.data.data.type == '-11') { // wx.showToast({ // title: '您的权限不足', // icon: 'none', // success: function() { // setTimeout(function() { // wx.navigateTo({ // url: '/pages/index/index', // }) // }) // } // }, 2000) // that.setData({ // vip_state: false // }) // } else { // that.setData({ // list: res.data.data.list, // KeyWord: '', // vip_state: true // }) // } } }).catch((errMsg) => { console.log(errMsg) }) }, //获取客户管理页面信息 getData() { let that = this; let url = 'pubilc/UserType'; let param = { UserId: app.globalData.UserId, } app.post(url, param).then((res) => { console.log(res) if (res.data.code == 200) { if (res.data.data.type == '5') { wx.showToast({ title: '会员到期,请充值', icon: 'none' }, 2000) that.setData({ vip_state: false }) } else if (res.data.data.type == '2') { wx.showToast({ title: '您的权限不足', icon: 'none' }, 2000) that.setData({ vip_state: false }) } else { that.setData({ vip_state: true }) // if (res.data.data.list[0].users[0].cid != '') { // that.setData({ // cid: res.data.data.list[0].users[0].cid, // }) // } } } }).catch((errMsg) => { // console.log(errMsg) }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { this.getData() this.getInfo() }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() { }, /** * 生命周期函数--监听页面显示 */ onShow: function() { this.getData() }, /** * 生命周期函数--监听页面隐藏 */ onHide: function() { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function() { }, /** * 用户点击右上角分享 */ onShareAppMessage: function() { } })