123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- // pages/cms-web.js
- const api = require('../../utils/o2Api.js');
- const util = require('../../utils/util.js');
- Page({
- /**
- * Page initial data
- */
- data: {
- workUrl: '',
- navTitle: ''
- },
- /**
- * Lifecycle function--Called when page load
- */
- onLoad: function (options) {
- var id = options.id;
- var title = decodeURIComponent(options.title);
- if (id && id != '') {
- var url = api.cmsWebUrl(id);
- var who = wx.getStorageSync('who');
- var tokenName = wx.getStorageSync('tokenName');
- var token = ''
- if (who && who.token) {
- token = who.token;
- url = url + '&'+tokenName+'=' + token;
- }
- url = url + '#wechat_redirect';
- this.setData({
- workUrl: url,
- navTitle: title
- });
- }else {
- util.toast('没有传入信息id!');
- wx.navigateBack({
- delta: 1,
- });
- }
-
- },
- /**
- * Lifecycle function--Called when page is initially rendered
- */
- onReady: function () {
-
- },
- /**
- * Lifecycle function--Called when page show
- */
- onShow: function () {
- },
- /**
- * Lifecycle function--Called when page hide
- */
- onHide: function () {
- },
- /**
- * Lifecycle function--Called when page unload
- */
- onUnload: function () {
- },
- /**
- * Page event handler function--Called when user drop down
- */
- onPullDownRefresh: function () {
- },
- /**
- * Called when page reach bottom
- */
- onReachBottom: function () {
- },
- /**
- * Called when user click on the top right corner to share
- */
- onShareAppMessage: function () {
- }
- })
|