| 
							- const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
 - var config = require("../../config/config.js");
 - var app = getApp();
 - const Http = require("../../utils/HttpBasics");
 - Page({
 -   data: {
 -     navigationBarHeight,
 -     canIUse: wx.canIUse("button.open-type.getUserInfo"),
 -     path:null,
 -     couponChannelId: null,
 -     cuserId:null,
 -     coverImg:null,
 -     couponOrderId:null,
 -     optionData:null
 -   },
 -   onLoad: function(options) {
 -     var that = this;
 -     if (options && options.spellGroup){
 -       that.setData({
 -         spellGroup: options.spellGroup
 -       })
 -     }else{
 -       that.setData({
 -         spellGroup: null
 -       }) 
 -     }
 -     if (options.couponChannelId && !options.cuserId||options.orderId) {
 -       that.setData({
 -         couponChannelId: options.couponChannelId,
 -         orderId:options.orderId
 -       })
 -     }
 -     if (options && options.frommd && options.id){
 -       that.setData({
 -         id: options.id,
 -         frommd: options.frommd
 -       })
 -     }
 -     // that.setData({
 -     //   optionData: null
 -     // })
 -     console.log(wx.getStorageSync('options'),6666)
 -     that.setData({
 -       optionData: wx.getStorageSync('options') ? JSON.parse(wx.getStorageSync('options')):null
 -     })
 -     if (options&&options.path == 'index') {
 -       that.setData({
 -         path: options.path
 -       })
 -     }
 -     /**
 -      * 来自转赠
 -      */
 -     if (options.couponChannelId && options.cuserId){
 -       that.setData({
 -         couponChannelId: options.couponChannelId,
 -         cuserId: options.cuserId,
 -         updateDate: options.updateDate,
 -         coverImg: options.coverImg,
 -         userName: options.userName,
 -         avatarUrl: options.avatarUrl,
 -         couponOrderId: options.couponOrderId
 -       })
 -     }
 -     Http.get({
 -         url: config.api.marketicon,
 -         data: {
 -           appId: config.weapp.AppId
 -         }
 -       }).then(res => {
 -         that.setData({
 -           mallImgUrl: res.data.mallImgUrl
 -         });
 -         wx.setNavigationBarTitle({
 -           title: res.data.mallName
 -         })
 -       })
 -       .catch(err => {
 -         wx.showToast({
 -           title: err.errMsg,
 -           icon: 'none',
 -           duration: 2000,
 -           mask: false
 -         });
 -       })
 -   },
 - 
 -   bindGetUserInfo: function (e) {
 -     let that = this;
 -     var iv = e.detail.iv;
 -     var encryptedData = e.detail.encryptedData;
 -     Http.post({
 -         url: config.api.getUserInfo,
 -         data: {
 -           encryptedData: encryptedData,
 -           iv: iv
 -         }
 -       })
 -       .then(
 -         function (res) {
 -           if (that.data.optionData.orderGroupId){
 -             wx.reLaunch({
 -               url: `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}`
 -             });
 -             return;
 -           }
 -           if (that.data.path == 'index') {
 -             wx.reLaunch({
 -               url: "/pages/game/index"
 -             });
 -           } else {
 -             //返回主页
 -             if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') {
 -               // 跳转普通券/消费卡/限时秒杀/砍价详情
 -               wx.navigateTo({
 -                 url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}`
 -               });
 -             } else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') {
 -               // 来自转赠
 -               wx.reLaunch({
 -                 url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}`
 -               });
 -             } else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) {
 -               // 拼团详情页
 -               wx.redirectTo({
 -                 url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}`,
 -               })
 -             } else if (that.data.optionData.id && app.globalData.type == 'gm') {
 -               // 游戏页面
 -               that.getGameOne(app.globalData.token, that.data.optionData.id)
 -             } else if (that.data.optionData.id && app.globalData.type == 'td') {
 -               wx.redirectTo({
 -                 url: `/pages/topicDetail/index?id=${that.data.optionData.id}`
 -               });
 -             } 
 -             // 报名活动
 -             else if (that.data.optionData.id && app.globalData.type == 'ra') {
 -               wx.redirectTo({
 -                 url: `/pages/radetail/index?id=${that.data.optionData.id}`,
 -               })
 -             } 
 -             // 报名签到
 -             else if (that.data.optionData.id && app.globalData.type == 'si') {
 -               wx.redirectTo({
 -                 url: `/pages/acSignIn/index?id=${that.data.optionData.id}`,
 -               })
 -             } 
 -             // 门店详情
 -             else if (that.data.optionData.id && app.globalData.type == 'md') {
 -               wx.redirectTo({
 -                 url: `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`
 -               });
 -             } 
 -             // 通过分享进入的门店详情页面
 -             else if (that.data.id && that.data.frommd == 'md') {
 -               wx.redirectTo({
 -                 url: `/pages/index/searchbar/detail/index?id=${that.data.id}`
 -               });
 -             } else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') {
 -               // 宣传页详情
 -               if (that.data.optionData.bt == '2') {
 -                 // 自由图文
 -                 wx.redirectTo({
 -                   url: `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`,
 -                 })
 -               } else {
 -                 // 标准格式
 -                 wx.redirectTo({
 -                   url: `/pages/bannerdetail/index?id=${that.data.optionData.id}`,
 -                 })
 -               }
 -             } else if (that.data.orderId||that.data.orderId&&app.globalData.type=='bg') {
 -               // 参与砍价
 -               wx.navigateTo({
 -                 url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}`
 -               });
 -             } else if (app.globalData.type == 'uc') {
 -               // 我的
 -               wx.switchTab({
 -                 url: '/index/user'
 -               });
 -             } else if (app.globalData.type == 'in') {
 -               // 首页
 -               wx.switchTab({
 -                 url: '/index/index'
 -               });
 -             } 
 -             // 积分
 -             else if (app.globalData.type == 'jf') {
 -               wx.redirectTo({
 -                 url: '/pages/integralmall/index'
 -               });
 -             }else if (app.globalData.type == 'pc') {
 -               // 停车
 -               wx.switchTab({
 -                 url: '/index/passCar'
 -               });
 -             } else if (app.globalData.type == 'mc') {
 -               // 我的券包
 -               wx.redirectTo({
 -                 url: '/pages/couponorder/index/index'
 -               });
 -             } else if (app.globalData.type == 'mo') {
 -               // 我的订单
 -               wx.redirectTo({
 -                 url: '/pages/order/index/index?id=all'
 -               });
 -             } else if (app.globalData.type == 'ca') {
 -               // 我的卡包
 -               wx.redirectTo({
 -                 url: '/pages/cardorder/index/index'
 -               });
 -             } else if (app.globalData.type == 'sc') {
 -               // 特享礼遇
 -               wx.redirectTo({
 -                 url: '/pages/specialcourtesy/specialcourtesy'
 -               });
 -             } else if (app.globalData.type == 'rb') {
 -               // 限时秒杀
 -               wx.redirectTo({
 -                 url: '/pages/rushToBuy/index'
 -               });
 -             } else if (app.globalData.type == 'bl') {
 -               // 砍价专场
 -               wx.redirectTo({
 -                 url: '/pages/bargain/bargain'
 -               });
 -             } else if (app.globalData.type == 'mb') {
 -               // 我的砍价
 -               wx.redirectTo({
 -                 url: '/pages/bargain/bargain?from=myhtml'
 -               });
 -             } else if (app.globalData.type == 'sl') {
 -               // 拼团专场
 -               wx.redirectTo({
 -                 url: '/pages/spellGroup/spellGroup'
 -               });
 -             } else if (app.globalData.type == 'ms') {
 -               // 我的拼团
 -               wx.redirectTo({
 -                 url: '/pages/spellGroup/spellGroup?from=myhtml'
 -               });
 -             } else if (app.globalData.type == 'dc') {
 -               // 消费卡
 -               wx.redirectTo({
 -                 url: '/pages/discountCardList/discountCardList'
 -               });
 -             } else if (app.globalData.type == 'td') {
 -               // 专题活动页
 -               wx.redirectTo({
 -                 url: '/pages/topicDetail/index'
 -               });
 -             }
 -              else if (app.globalData.type == 'ml') {
 -               // 门店
 -               wx.switchTab({
 -                 url: '/index/searchbar'
 -               });
 -             } else {
 -               wx.switchTab({
 -                 url: "/index/index"
 -               });
 -             }
 -           }
 -         },
 -         function (error) {
 -           console.log(error)
 -           wx.showToast({
 -             title: "请授权个人信息",
 -             icon: "none"
 -           });
 -         }
 -       )
 -       .catch(err => {
 -         wx.showToast({
 -           title: err.errMsg,
 -           icon: 'none',
 -           duration: 2000,
 -           mask: false
 -         });
 -       })
 -   },
 -   getGameOne: function (token, id) {
 -     let _this = this;
 -     Http.get({
 -       url: config.api.getOneGame,
 -       data: {
 -         token: token,
 -         id: id
 -       }
 -     }).then(res => {
 -       wx.redirectTo({
 -         url: '/pages/game/index?url=' + res.data.url + "&id=" + res.data.id + "&gameId=" + res.data.gameId,
 -       })
 -     })
 -     .catch(err => {
 -       wx.showModal({
 -         title: '提示',
 -         content: err.message,
 -         showCancel: false,
 -         success: function (res) {
 -           // 如果游戏下架或者找不到,重启首页
 -           if (res.confirm) {
 -             wx.reLaunch({
 -               url: '/pages/index/index',
 -             })
 -           }
 -         }
 -       })
 -       this.alphaClick();
 -     })
 -   },
 - });
 
 
  |