import common from '../../utils/util'; import server from '../../utils/main'; const app = getApp(); Page({ data: { IsAccredit: false, }, onLoad: function (options) { var member = "非会员"; if (app.globalData.userInfo.IsMember == 1) member = "付费会员"; this.setData({ Height: common.getSystemHeight(), Member: member, }); this.init(); }, init: function () { var that = this; server.getData('GetWXUsersAllTime?ProductID=' + app.globalData.ProgramID + '&UserID=' + app.globalData.userInfo.UserID, function (data) { if (data) { for (var i = 0; i < data.length; i++) { if (data[i].ID == app.globalData.ProgramID) { if (that.data.Member == "非会员") { data[i].Time = common.formatDateCHS(app.globalData.userInfo.CreateTime); } } } that.setData({ ProductList: data, }); } }); wx.getSetting({ success(res) { if (res.authSetting['scope.userInfo']) { that.setData({ IsAccredit: true, }); } } }); }, gotoPaylist: function () { var that = this; wx.getSetting({ success(res) { if (res.authSetting['scope.userInfo']) { wx.navigateTo({ url: '../about/paylist', }); } else { that.getAccredit(); } } }); }, gotoPayFinished: function () { wx.navigateTo({ url: '../about/payfinished?type=accredit', }); }, })