|
@@ -1,4 +1,3 @@ |
|
|
|
|
|
|
|
|
const Http = require("../../utils/HttpBasics"); |
|
|
const Http = require("../../utils/HttpBasics"); |
|
|
const imgurl = require("../../utils/imgurl"); |
|
|
const imgurl = require("../../utils/imgurl"); |
|
|
const config = require("../../config/config"); |
|
|
const config = require("../../config/config"); |
|
@@ -12,19 +11,19 @@ Page({ |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
getCongig(){//获取小程序是否开通授权手机号 |
|
|
|
|
|
|
|
|
getCongig() { //获取小程序是否开通授权手机号 |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url:config.api.getConfig, |
|
|
|
|
|
data:{ |
|
|
|
|
|
key:"douyinPhoneStatus" |
|
|
|
|
|
|
|
|
url: config.api.getConfig, |
|
|
|
|
|
data: { |
|
|
|
|
|
key: "douyinPhoneStatus" |
|
|
} |
|
|
} |
|
|
}).then(res=>{ |
|
|
|
|
|
app.globalData.ifCongPh = res.data?res.data:1 |
|
|
|
|
|
}).catch(err=>{ |
|
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
app.globalData.ifCongPh = res.data ? res.data : 1 |
|
|
|
|
|
}).catch(err => { |
|
|
app.globalData.ifCongPh = 1 |
|
|
app.globalData.ifCongPh = 1 |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onLoad: function(options) { |
|
|
|
|
|
|
|
|
onLoad: function (options) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
console.log(options, "跳转地址栏"); |
|
|
console.log(options, "跳转地址栏"); |
|
|
tt.showToast({ |
|
|
tt.showToast({ |
|
@@ -86,9 +85,9 @@ Page({ |
|
|
//活动签到 |
|
|
//活动签到 |
|
|
options.id = this.data.newArr[2]; |
|
|
options.id = this.data.newArr[2]; |
|
|
} else if (options.type == 'wj') { |
|
|
} else if (options.type == 'wj') { |
|
|
options.id = this.data.newArr[2]; |
|
|
|
|
|
|
|
|
options.id = this.data.newArr[2]; |
|
|
} else if (options.type == 'wjLsit') { |
|
|
} else if (options.type == 'wjLsit') { |
|
|
options.id = this.data.newArr[2]; |
|
|
|
|
|
|
|
|
options.id = this.data.newArr[2]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -122,7 +121,7 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 检查用户的状态 |
|
|
* 检查用户的状态 |
|
|
*/ |
|
|
*/ |
|
|
userStatus: function(options) { |
|
|
|
|
|
|
|
|
userStatus: function (options) { |
|
|
var that = this; |
|
|
var that = this; |
|
|
if (options && (options.couponChannelId || options.orderId || options.id)) { |
|
|
if (options && (options.couponChannelId || options.orderId || options.id)) { |
|
|
that.checkuserstatus(options); |
|
|
that.checkuserstatus(options); |
|
@@ -150,316 +149,137 @@ Page({ |
|
|
|
|
|
|
|
|
checkuserstatus(options) { |
|
|
checkuserstatus(options) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
if(options && options.couponChannelId&&options.type=='orderAffirm'){ |
|
|
|
|
|
|
|
|
if (options && options.couponChannelId && options.type == 'orderAffirm') { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url:`/pages/coupon/confirmation/confirmation?couponChannelId=${options.couponChannelId}` |
|
|
|
|
|
|
|
|
url: `/pages/coupon/confirmation/confirmation?couponChannelId=${options.couponChannelId}` |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
if(options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd'){ |
|
|
|
|
|
|
|
|
if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') { |
|
|
if (options.cuserId) { |
|
|
if (options.cuserId) { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`, |
|
|
|
|
|
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}&mallTenantId=${options.tenantId}`, |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 跳转普通券/消费卡/限时秒杀/砍价详情 |
|
|
// 跳转普通券/消费卡/限时秒杀/砍价详情 |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`, |
|
|
|
|
|
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&mallTenantId=${options.tenantId}`, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.checkUserStatus, |
|
|
|
|
|
data: { |
|
|
|
|
|
token: app.globalData.token |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
// res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}') |
|
|
|
|
|
//参与拼团 |
|
|
|
|
|
if(options && options.orderId && app.globalData.type == 'dt'){ |
|
|
|
|
|
//订单详情 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/order/detail/index?orderId=${options.orderId}` |
|
|
|
|
|
}) |
|
|
|
|
|
}else if (options && options.orderGroupId) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/joinFrDpell/index?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}` |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
//来自大屏的跳转拼团券详情 |
|
|
|
|
|
else if (options && options.couponChannelId && options.path == 'daping') { |
|
|
|
|
|
/** |
|
|
|
|
|
* 主要是为了拿couponId |
|
|
|
|
|
*/ |
|
|
|
|
|
Http.get({ |
|
|
|
|
|
url: config.api.couponDetail, |
|
|
|
|
|
data: { |
|
|
|
|
|
couponChannelId: options.couponChannelId |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
let data = res.data; |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}&couponId=${data.couponId}` |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') { |
|
|
|
|
|
// 转赠判断 |
|
|
|
|
|
if (options.cuserId) { |
|
|
|
|
|
|
|
|
url: config.api.checkUserStatus, |
|
|
|
|
|
data: { |
|
|
|
|
|
token: app.globalData.token |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
// res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}') |
|
|
|
|
|
//参与拼团 |
|
|
|
|
|
if (options && options.orderId && app.globalData.type == 'dt') { |
|
|
|
|
|
//订单详情 |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`, |
|
|
|
|
|
|
|
|
url: `/pages/order/detail/index?orderId=${options.orderId}` |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
|
|
|
// 跳转普通券/消费卡/限时秒杀/砍价详情 |
|
|
|
|
|
|
|
|
} else if (options && options.orderGroupId) { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`, |
|
|
|
|
|
|
|
|
url: `/pages/joinFrDpell/index?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}` |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 拼团详情页(只有通过扫码进入才可能进入拼团详情页面,只有这一个入口) |
|
|
|
|
|
else if ((options && options.couponChannelId && app.globalData.type == 'sd') || (options && options.couponChannelId && options.spellGroup)) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 游戏页面 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'gm') { |
|
|
|
|
|
that.getGameOne(app.globalData.token, options.id) |
|
|
|
|
|
} |
|
|
|
|
|
// 报名活动页面 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'ra') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/radetail/index?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
//活动签到 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'si') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/acSignIn/index?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
}else if(app.globalData.type == 'wjLsit'){//问卷调查 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
//问卷答题 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'wj') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/questionnaire/questionnaire?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 宣传页详情 |
|
|
|
|
|
else if (options && options.bt && options.id && app.globalData.type == 'bd') { |
|
|
|
|
|
if (options.bt == '2') { |
|
|
|
|
|
// 自由图文 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/freeBannerDetail/index?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 标准格式 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/bannerdetail/index?id=${options.id}`, |
|
|
|
|
|
|
|
|
//来自大屏的跳转拼团券详情 |
|
|
|
|
|
else if (options && options.couponChannelId && options.path == 'daping') { |
|
|
|
|
|
/** |
|
|
|
|
|
* 主要是为了拿couponId |
|
|
|
|
|
*/ |
|
|
|
|
|
Http.get({ |
|
|
|
|
|
url: config.api.couponDetail, |
|
|
|
|
|
data: { |
|
|
|
|
|
couponChannelId: options.couponChannelId |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
let data = res.data; |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}&couponId=${data.couponId}` |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
} else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') { |
|
|
|
|
|
// 转赠判断 |
|
|
|
|
|
if (options.cuserId) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 跳转普通券/消费卡/限时秒杀/砍价详情 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 专题 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'td') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/topicDetail/index?id=${options.id}` |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 门店详情 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'md') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/index/searchbar/detail/index?id=${options.id}` |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 参与砍价 |
|
|
|
|
|
else if (options && options.orderId) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 我的 |
|
|
|
|
|
else if (app.globalData.type == 'uc') { |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/user' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 积分 |
|
|
|
|
|
else if (app.globalData.type == 'jf') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/integralmall/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 首页 |
|
|
|
|
|
else if (app.globalData.type == 'in') { |
|
|
|
|
|
tt.reLaunch({ |
|
|
|
|
|
url: '/index/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 停车 |
|
|
|
|
|
else if (app.globalData.type == 'pc') { |
|
|
|
|
|
// 停车 |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/passCar' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 我的券包 |
|
|
|
|
|
else if (app.globalData.type == 'mc') { |
|
|
|
|
|
// 我的券包 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/couponorder/index/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 我的订单 |
|
|
|
|
|
else if (app.globalData.type == 'mo') { |
|
|
|
|
|
// 我的订单 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/order/index/index?id=all' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 我的卡包 |
|
|
|
|
|
else if (app.globalData.type == 'ca') { |
|
|
|
|
|
// 我的卡包 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/cardorder/index/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 特享礼遇 |
|
|
|
|
|
else if (app.globalData.type == 'sc') { |
|
|
|
|
|
// 特享礼遇 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/specialcourtesy/specialcourtesy' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 限时秒杀 |
|
|
|
|
|
else if (app.globalData.type == 'rb') { |
|
|
|
|
|
// 限时秒杀 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/rushToBuy/index' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 砍价专场 |
|
|
|
|
|
else if (app.globalData.type == 'bl') { |
|
|
|
|
|
// 砍价专场 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/bargain/bargain' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 我的砍价 |
|
|
|
|
|
else if (app.globalData.type == 'mb') { |
|
|
|
|
|
// 我的砍价 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/bargain/bargain?from=myhtml' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 拼团专场 |
|
|
|
|
|
else if (app.globalData.type == 'sl') { |
|
|
|
|
|
// 拼团专场 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/spellGroup/spellGroup' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 我的拼团 |
|
|
|
|
|
else if (app.globalData.type == 'ms') { |
|
|
|
|
|
// 我的拼团 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/spellGroup/spellGroup?from=myhtml' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 消费卡 |
|
|
|
|
|
else if (app.globalData.type == 'dc') { |
|
|
|
|
|
// 消费卡 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/discountCardList/discountCardList' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 门店 |
|
|
|
|
|
else if (app.globalData.type == 'ml') { |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/searchbar' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 兑换 |
|
|
|
|
|
else if (app.globalData.type == 'ec') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/exchange/exchange' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 通过分享进入的门店详情 |
|
|
|
|
|
else if (options && options.id && options.frommd == 'md') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/index/searchbar/detail/index?id=${options.id}` |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 主页 |
|
|
|
|
|
tt.reLaunch({ |
|
|
|
|
|
url: '/index/index' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
if (err.code == 11004) { |
|
|
|
|
|
// 用户昵称未授权 |
|
|
|
|
|
if (options && options.orderGroupId) { |
|
|
|
|
|
|
|
|
// 拼团详情页(只有通过扫码进入才可能进入拼团详情页面,只有这一个入口) |
|
|
|
|
|
else if ((options && options.couponChannelId && app.globalData.type == 'sd') || (options && options.couponChannelId && options.spellGroup)) { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/getuserinfo/getuserinfo?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}` |
|
|
|
|
|
|
|
|
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}`, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
/** |
|
|
|
|
|
* spellGroup |
|
|
|
|
|
* 区分是通过拼团详情分享过来的还是从普通券分享过来的 |
|
|
|
|
|
* 注意:拼团券和普通券是两个页面 |
|
|
|
|
|
*/ |
|
|
|
|
|
if (options && options.couponChannelId && !options.cuserId && !options.spellGroup) { |
|
|
|
|
|
|
|
|
// 游戏页面 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'gm') { |
|
|
|
|
|
that.getGameOne(app.globalData.token, options.id) |
|
|
|
|
|
} |
|
|
|
|
|
// 报名活动页面 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'ra') { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}` |
|
|
|
|
|
|
|
|
url: `/pages/radetail/index?id=${options.id}`, |
|
|
}) |
|
|
}) |
|
|
} else if (options && options.couponChannelId && !options.cuserId && options.spellGroup) { |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
//活动签到 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'si') { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&spellGroup=${options.spellGroup}` |
|
|
|
|
|
|
|
|
url: `/pages/acSignIn/index?id=${options.id}`, |
|
|
}) |
|
|
}) |
|
|
} else if (options && options.couponChannelId && options.cuserId) { |
|
|
|
|
|
/** |
|
|
|
|
|
* 转赠判断 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
} else if (app.globalData.type == 'wjLsit') { //问卷调查 |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}` |
|
|
|
|
|
|
|
|
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`, |
|
|
}) |
|
|
}) |
|
|
} else if (options && options.orderId) { |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
//问卷答题 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'wj') { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/getuserinfo/getuserinfo?orderId=${options.orderId}&from='${"discount"}` |
|
|
|
|
|
|
|
|
url: `/pages/questionnaire/questionnaire?id=${options.id}`, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 通过分享进入的门店详情 |
|
|
|
|
|
else if (options && options.id && options.frommd == 'md') { |
|
|
|
|
|
|
|
|
// 宣传页详情 |
|
|
|
|
|
else if (options && options.bt && options.id && app.globalData.type == 'bd') { |
|
|
|
|
|
if (options.bt == '2') { |
|
|
|
|
|
// 自由图文 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/freeBannerDetail/index?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 标准格式 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/bannerdetail/index?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 专题 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'td') { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/getuserinfo/getuserinfo?id=${options.id}&frommd=md` |
|
|
|
|
|
|
|
|
url: `/pages/topicDetail/index?id=${options.id}` |
|
|
}); |
|
|
}); |
|
|
} // 门店详情 |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
// 门店详情 |
|
|
else if (options && options.id && app.globalData.type == 'md') { |
|
|
else if (options && options.id && app.globalData.type == 'md') { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/index/searchbar/detail/index?id=${options.id}` |
|
|
url: `/pages/index/searchbar/detail/index?id=${options.id}` |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
else if(app.globalData.type == 'wjLsit'){//问卷调查 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 答题问卷 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'wj') { |
|
|
|
|
|
|
|
|
// 参与砍价 |
|
|
|
|
|
else if (options && options.orderId) { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: `/pages/questionnaire/questionnaire?id=${options.id}`, |
|
|
|
|
|
|
|
|
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 报名活动页面 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'ra') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/radetail/index?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (app.globalData.type == 'uc') { |
|
|
|
|
|
|
|
|
// 我的 |
|
|
|
|
|
else if (app.globalData.type == 'uc') { |
|
|
tt.navigateTo({ |
|
|
tt.navigateTo({ |
|
|
url: '/index/user' |
|
|
url: '/index/user' |
|
|
}); |
|
|
}); |
|
@@ -470,12 +290,6 @@ Page({ |
|
|
url: '/pages/integralmall/index' |
|
|
url: '/pages/integralmall/index' |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
// 专题 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'td') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/topicDetail/index?id=${options.id}` |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 首页 |
|
|
// 首页 |
|
|
else if (app.globalData.type == 'in') { |
|
|
else if (app.globalData.type == 'in') { |
|
|
tt.reLaunch({ |
|
|
tt.reLaunch({ |
|
@@ -547,6 +361,7 @@ Page({ |
|
|
} |
|
|
} |
|
|
// 我的拼团 |
|
|
// 我的拼团 |
|
|
else if (app.globalData.type == 'ms') { |
|
|
else if (app.globalData.type == 'ms') { |
|
|
|
|
|
// 我的拼团 |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: '/pages/spellGroup/spellGroup?from=myhtml' |
|
|
url: '/pages/spellGroup/spellGroup?from=myhtml' |
|
|
}) |
|
|
}) |
|
@@ -558,29 +373,212 @@ Page({ |
|
|
url: '/pages/discountCardList/discountCardList' |
|
|
url: '/pages/discountCardList/discountCardList' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
// 门店 |
|
|
|
|
|
else if (app.globalData.type == 'ml') { |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/searchbar' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
// 兑换 |
|
|
// 兑换 |
|
|
else if (app.globalData.type == 'ec') { |
|
|
else if (app.globalData.type == 'ec') { |
|
|
tt.redirectTo({ |
|
|
tt.redirectTo({ |
|
|
url: '/pages/exchange/exchange' |
|
|
url: '/pages/exchange/exchange' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 门店 |
|
|
|
|
|
else if (app.globalData.type == 'ml') { |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/searchbar' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// 通过分享进入的门店详情 |
|
|
|
|
|
else if (options && options.id && options.frommd == 'md') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/index/searchbar/detail/index?id=${options.id}` |
|
|
|
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
// 主页 |
|
|
tt.reLaunch({ |
|
|
tt.reLaunch({ |
|
|
url: '/index/index', |
|
|
|
|
|
|
|
|
url: '/index/index' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
if (err.code == 11004) { |
|
|
|
|
|
// 用户昵称未授权 |
|
|
|
|
|
if (options && options.orderGroupId) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/getuserinfo/getuserinfo?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}` |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* spellGroup |
|
|
|
|
|
* 区分是通过拼团详情分享过来的还是从普通券分享过来的 |
|
|
|
|
|
* 注意:拼团券和普通券是两个页面 |
|
|
|
|
|
*/ |
|
|
|
|
|
if (options && options.couponChannelId && !options.cuserId && !options.spellGroup) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}` |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (options && options.couponChannelId && !options.cuserId && options.spellGroup) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&spellGroup=${options.spellGroup}` |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (options && options.couponChannelId && options.cuserId) { |
|
|
|
|
|
/** |
|
|
|
|
|
* 转赠判断 |
|
|
|
|
|
*/ |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}` |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (options && options.orderId) { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/getuserinfo/getuserinfo?orderId=${options.orderId}&from='${"discount"}` |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 通过分享进入的门店详情 |
|
|
|
|
|
else if (options && options.id && options.frommd == 'md') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/getuserinfo/getuserinfo?id=${options.id}&frommd=md` |
|
|
|
|
|
}); |
|
|
|
|
|
} // 门店详情 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'md') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/index/searchbar/detail/index?id=${options.id}` |
|
|
|
|
|
}); |
|
|
|
|
|
} else if (app.globalData.type == 'wjLsit') { //问卷调查 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 答题问卷 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'wj') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/questionnaire/questionnaire?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 报名活动页面 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'ra') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/radetail/index?id=${options.id}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (app.globalData.type == 'uc') { |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/user' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 积分 |
|
|
|
|
|
else if (app.globalData.type == 'jf') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/integralmall/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 专题 |
|
|
|
|
|
else if (options && options.id && app.globalData.type == 'td') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: `/pages/topicDetail/index?id=${options.id}` |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 首页 |
|
|
|
|
|
else if (app.globalData.type == 'in') { |
|
|
|
|
|
tt.reLaunch({ |
|
|
|
|
|
url: '/index/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 停车 |
|
|
|
|
|
else if (app.globalData.type == 'pc') { |
|
|
|
|
|
// 停车 |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/passCar' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 我的券包 |
|
|
|
|
|
else if (app.globalData.type == 'mc') { |
|
|
|
|
|
// 我的券包 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/couponorder/index/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 我的订单 |
|
|
|
|
|
else if (app.globalData.type == 'mo') { |
|
|
|
|
|
// 我的订单 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/order/index/index?id=all' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 我的卡包 |
|
|
|
|
|
else if (app.globalData.type == 'ca') { |
|
|
|
|
|
// 我的卡包 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/cardorder/index/index' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 特享礼遇 |
|
|
|
|
|
else if (app.globalData.type == 'sc') { |
|
|
|
|
|
// 特享礼遇 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/specialcourtesy/specialcourtesy' |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 限时秒杀 |
|
|
|
|
|
else if (app.globalData.type == 'rb') { |
|
|
|
|
|
// 限时秒杀 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/rushToBuy/index' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 砍价专场 |
|
|
|
|
|
else if (app.globalData.type == 'bl') { |
|
|
|
|
|
// 砍价专场 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/bargain/bargain' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 我的砍价 |
|
|
|
|
|
else if (app.globalData.type == 'mb') { |
|
|
|
|
|
// 我的砍价 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/bargain/bargain?from=myhtml' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 拼团专场 |
|
|
|
|
|
else if (app.globalData.type == 'sl') { |
|
|
|
|
|
// 拼团专场 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/spellGroup/spellGroup' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 我的拼团 |
|
|
|
|
|
else if (app.globalData.type == 'ms') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/spellGroup/spellGroup?from=myhtml' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 消费卡 |
|
|
|
|
|
else if (app.globalData.type == 'dc') { |
|
|
|
|
|
// 消费卡 |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/discountCardList/discountCardList' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 兑换 |
|
|
|
|
|
else if (app.globalData.type == 'ec') { |
|
|
|
|
|
tt.redirectTo({ |
|
|
|
|
|
url: '/pages/exchange/exchange' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 门店 |
|
|
|
|
|
else if (app.globalData.type == 'ml') { |
|
|
|
|
|
tt.navigateTo({ |
|
|
|
|
|
url: '/index/searchbar' |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
tt.reLaunch({ |
|
|
|
|
|
url: '/index/index', |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getGameOne: function(token, id) { |
|
|
|
|
|
|
|
|
getGameOne: function (token, id) { |
|
|
let _this = this; |
|
|
let _this = this; |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.getOneGame, |
|
|
url: config.api.getOneGame, |
|
@@ -598,7 +596,7 @@ Page({ |
|
|
title: '提示', |
|
|
title: '提示', |
|
|
content: err.message, |
|
|
content: err.message, |
|
|
showCancel: false, |
|
|
showCancel: false, |
|
|
success: function(res) { |
|
|
|
|
|
|
|
|
success: function (res) { |
|
|
// 如果游戏下架或者找不到,重启首页 |
|
|
// 如果游戏下架或者找不到,重启首页 |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
tt.reLaunch({ |
|
|
tt.reLaunch({ |
|
|