import common from '../../utils/util'; import server from '../../utils/main'; const app = getApp(); Page({ data: { PayList: [], IsActive: false, }, onLoad: function (options) { //测试***************** if (!app.globalData.userInfo) app.globalData.userInfo = { UserID: 4 }; this.setData({ Height: common.getSystemHeight(), }); this.init(); }, init: function () { var that = this; server.getLocalHost(function () { server.getData('GetWXUsersAllPayInfo?UserID=' + app.globalData.userInfo.UserID, function (data) { if (data) { for (var i = 0; i < data.length; i++) { for (var j = 0; j < data[i].List.length; j++) { data[i].List[j].isShowActivty = false; if (data[i].List[j].Status == 0) { data[i].List[j].isShowActivty = true; } } } that.setData({ PayList: data, }); } }); }); }, gotoActive: function (e) { var that = this; var productid = e.currentTarget.dataset.productid; var list = server.getProgramList(); for (var i = 0; i < list.length; i++) { if (productid == list[i].ID) { var path = list[i].path; path += "&ProductBuyInfoID=" + e.currentTarget.dataset.id; path += "&ProductID=" + app.globalData.ProgramID; path += "&ProductUserID=" + app.globalData.userInfo.UserID; path += "&BuyType=" + e.currentTarget.dataset.buytype; wx.navigateToMiniProgram({ appId: list[i].appId, path: path, success(res) { } }); var data = this.data.PayList; for (var i = 0; i < data.length; i++) { for (var j = 0; j < data[i].List.length; j++) { if (data[i].List[j].ProductID == productid) { data[i].List[j].isShowActivty = false; } } } that.setData({ PayList: data, }); break; } } }, refresh: function () { var that = this; wx.showLoading({ title: '加载中', }); setTimeout(function () { wx.hideLoading(); that.init(); }, 1000); }, onShareAppMessage: function () { return { title: app.globalData.ShareTitle, path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID, imageUrl: '../../images/07001.png', } }, })