import common from '../../utils/util'; import main from '../../utils/main'; const app = getApp(); var id=0; var idchild=0; Page({ data: { List: [], ImagePath: app.globalData.uploadImageUrl, }, onLoad: function (options) { var that = this; id=options.id; idchild=options.idchild; that.init(options,function(list){ that.setData({ Containnerheight: main.getWindowHeight(), Item: list[options.id].List[options.idchild], IsShare: options.IsShare, }); wx.setNavigationBarColor({ frontColor: "#000000", backgroundColor: "#ffffff", }); }); }, init: function (options,callback) { var that = this; var list = wx.getStorageSync("MiaoguoTipsList"); if (!list[options.id] || !list[options.id].List[options.idchild]) list=undefined; if (!list){ main.getData("GetMiaoguoTipsList", function (data) { callback(data); wx.setStorageSync("MiaoguoTipsList", data); }); } else callback(list); }, goto: function (e) { if (this.data.IsShare==1){ var url = e.currentTarget.dataset.url; wx.redirectTo({ url: url, }); } else{ wx.navigateBack({ delta: 1, }); } }, onShareAppMessage: function () { return { title: "小贴士", path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID + '&type=help&ID=' + id + '&IDChild=' + idchild, imageUrl: app.globalData.uploadImageUrl+'web/'+this.data.Item.Cover, } }, })