@@ -20,30 +20,20 @@ Page({ | |||||
}); | }); | ||||
let that = this | let that = this | ||||
if (app.globalData.token){ | if (app.globalData.token){ | ||||
if (options && (options.couponChannelId || options.couponIds)) { | |||||
if (options.couponIds) { | |||||
this.setData({ | |||||
couponIds: options.couponIds | |||||
if (options && options.couponChannelId ) { | |||||
that.setData({ | |||||
couponChannelId:options.couponChannelId | |||||
}) | }) | ||||
that.getDetail(options.couponIds, 'notendclock'); | |||||
} else { | |||||
that.getDetail(options.couponChannelId, 'notendclock'); | |||||
that.getSupId(options.couponChannelId) | |||||
} | |||||
that.getDetail(options.couponChannelId, 'notendclock'); | |||||
} | } | ||||
}else{ | }else{ | ||||
app.tokenCallback = token => { | app.tokenCallback = token => { | ||||
if (options && (options.couponChannelId || options.couponIds)) { | |||||
if (options.couponIds) { | |||||
this.setData({ | |||||
couponIds: options.couponIds | |||||
}) | |||||
that.getDetail(options.couponIds, 'notendclock'); | |||||
} else { | |||||
that.setData({ | |||||
couponChannelId:options.couponChannelId | |||||
}) | |||||
if (options && options.couponChannelId ) { | |||||
that.getDetail(options.couponChannelId, 'notendclock'); | that.getDetail(options.couponChannelId, 'notendclock'); | ||||
// that.getSupId(options.couponChannelId) | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -568,6 +558,7 @@ Page({ | |||||
} | } | ||||
}).catch(err => { | }).catch(err => { | ||||
tt.hideLoading() | tt.hideLoading() | ||||
that.setData({ | that.setData({ | ||||
showbutton: false, | showbutton: false, | ||||
@@ -634,16 +625,14 @@ Page({ | |||||
/** | /** | ||||
* 将值传到用户手机号授权的页面 | * 将值传到用户手机号授权的页面 | ||||
* | * | ||||
*/ | |||||
tt.redirectTo({ | |||||
url: "/pages/getphoneInfo/index?couponChannelId=" + | |||||
that.data.couponChannelId | |||||
*/ | |||||
tt.navigateTo({ | |||||
url: `/pages/getPhone/getPhone?couponChannelId=${that.data.couponChannelId}&path=qr` | |||||
}); | }); | ||||
} else if (err.code == 11006) { | } else if (err.code == 11006) { | ||||
// 用户手机已加密 | // 用户手机已加密 | ||||
tt.redirectTo({ | |||||
url: "/pages/phoneinput/phoneinput?couponChannelId=" + | |||||
that.data.couponChannelId | |||||
tt.navigateTo({ | |||||
url: `/pages/getPhone/getPhone?couponChannelId=${that.data.couponChannelId}&path=qr` | |||||
}); | }); | ||||
} else { | } else { | ||||
tt.showToast({ | tt.showToast({ | ||||
@@ -655,12 +644,17 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
}).catch(err => { | }).catch(err => { | ||||
console.log(err) | |||||
tt.hideLoading() | |||||
that.setData({ | |||||
showbutton: false, | |||||
}) | |||||
console.log(err) | |||||
if (err.code == 11004) { | if (err.code == 11004) { | ||||
tt.redirectTo({ | |||||
url: `/pages/getuserinfo/index?fromflag=coupondetail&couponChannelIdflag=${that.data.couponChannelId}`, | |||||
tt.navigateTo({ | |||||
url: `/pages/getuserinfo/getuserinfo?fromflag=confirmation&confirmationFlag=${that.data.couponChannelId}`, | |||||
}) | }) | ||||
} else { | } else { | ||||
tt.showToast({ | tt.showToast({ | ||||
title: err.message, | title: err.message, | ||||
icon: "none", | icon: "none", | ||||
@@ -226,7 +226,7 @@ Page({ | |||||
if (err.code == 11004) { | if (err.code == 11004) { | ||||
// 用户昵称未授权 | // 用户昵称未授权 | ||||
tt.redirectTo({ | tt.redirectTo({ | ||||
url: `/pages/getuserinfo/index?couponChannelId=${that.data.data.id}&fromflag=poster` | |||||
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${that.data.data.id}&fromflag=poster` | |||||
}) | }) | ||||
} | } | ||||
}) | }) | ||||
@@ -416,6 +416,10 @@ Page({ | |||||
}, | }, | ||||
gotopay: function (e) { | gotopay: function (e) { | ||||
tt.navigateTo({ | |||||
url: `/pages/coupon/confirmation/confirmation?couponChannelId=${this.data.couponChannelId}`, | |||||
}) | |||||
return | |||||
let that = this; | let that = this; | ||||
app.globalData.previewFlag = true | app.globalData.previewFlag = true | ||||
/* 判断是否授权*/ | /* 判断是否授权*/ | ||||
@@ -1378,7 +1382,7 @@ Page({ | |||||
console.log(err) | console.log(err) | ||||
if (err.code == 11004) { | if (err.code == 11004) { | ||||
tt.redirectTo({ | tt.redirectTo({ | ||||
url: `/pages/getuserinfo/index?fromflag=coupondetail&couponChannelIdflag=${that.data.couponChannelId}`, | |||||
url: `/pages/getuserinfo/getuserinfo?fromflag=coupondetail&couponChannelIdflag=${that.data.couponChannelId}`, | |||||
}) | }) | ||||
} else { | } else { | ||||
tt.showToast({ | tt.showToast({ | ||||
@@ -106,6 +106,7 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
backHome(){ | backHome(){ | ||||
console.log("我调用的返回"); | |||||
tt.navigateBack({ | tt.navigateBack({ | ||||
delta: 1, | delta: 1, | ||||
success: (res) => { | success: (res) => { | ||||
@@ -136,6 +137,7 @@ Page({ | |||||
iv: iv | iv: iv | ||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
app.globalData.phone = res.data.phone; | app.globalData.phone = res.data.phone; | ||||
if (that.data.skipUrl == '1') { | if (that.data.skipUrl == '1') { | ||||
console.log(app.globalData.skip, app.globalData.skipUrl, "跳转地址") | console.log(app.globalData.skip, app.globalData.skipUrl, "跳转地址") | ||||
@@ -166,6 +168,12 @@ Page({ | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
//确认订单 | |||||
if (that.data.path == "qr") { | |||||
tt.redirectTo({ | |||||
url: `/pages/coupon/confirmation/confirmation?couponChannelId=${that.data.couponChannelId}` | |||||
}) | |||||
} | |||||
//线上配送 | //线上配送 | ||||
if (that.data.path == "fi") { | if (that.data.path == "fi") { | ||||
tt.redirectTo({ | tt.redirectTo({ | ||||
@@ -13,6 +13,7 @@ Page({ | |||||
optionData: null, | optionData: null, | ||||
fromflag: '', | fromflag: '', | ||||
couponChannelIdflag: '', | couponChannelIdflag: '', | ||||
confirmationFlag:'', | |||||
wjId: "", | wjId: "", | ||||
composeOrderType: "", | composeOrderType: "", | ||||
fillIndentId: "", | fillIndentId: "", | ||||
@@ -87,7 +88,7 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
console.log(app.globalData.skip, app.globalData.skipUrl, app.globalData.type, "跳转地址") | console.log(app.globalData.skip, app.globalData.skipUrl, app.globalData.type, "跳转地址") | ||||
var that = this; | var that = this; | ||||
// options.fromflag == 'coupondetail'; | // options.fromflag == 'coupondetail'; | ||||
@@ -117,12 +118,18 @@ Page({ | |||||
couponId: options.couponId | couponId: options.couponId | ||||
}) | }) | ||||
} | } | ||||
// 来自优惠券列表券详情页面的 couponChannelId | |||||
// 来自优惠券列表券详情页面的 couponChannelId | |||||
if (options && options.couponChannelIdflag) { | if (options && options.couponChannelIdflag) { | ||||
that.setData({ | that.setData({ | ||||
couponChannelIdflag: options.couponChannelIdflag | couponChannelIdflag: options.couponChannelIdflag | ||||
}) | }) | ||||
} | } | ||||
//确定订单 | |||||
if (options && options.confirmationFlag) { | |||||
that.setData({ | |||||
confirmationFlag: options.confirmationFlag | |||||
}) | |||||
} | |||||
//调查问卷 | //调查问卷 | ||||
if (options && !options.wjId || options.wjId) { | if (options && !options.wjId || options.wjId) { | ||||
this.setData({ | this.setData({ | ||||
@@ -228,14 +235,16 @@ Page({ | |||||
}, | }, | ||||
bindGetUserInfo(e) { | bindGetUserInfo(e) { | ||||
//session_key 未过期,并且在本生命周期一直有效 | //session_key 未过期,并且在本生命周期一直有效 | ||||
tt.getUserProfile({ | |||||
title: '温馨提示', | |||||
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 | |||||
tt.getUserInfo({ | |||||
withCredentials: true, | |||||
// title: '温馨提示', | |||||
// desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 | |||||
success: (res) => { | success: (res) => { | ||||
let that = this; | let that = this; | ||||
var iv = res.iv; | var iv = res.iv; | ||||
var encryptedData = res.encryptedData; | var encryptedData = res.encryptedData; | ||||
// console.log(res,"数据"); | |||||
// return | |||||
Http.post({ | Http.post({ | ||||
url: config.api.getUserInfo, | url: config.api.getUserInfo, | ||||
data: { | data: { | ||||
@@ -243,7 +252,6 @@ Page({ | |||||
iv: iv | iv: iv | ||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
if (app.globalData.type == 'gm' && that.data.id && that.data.gameId && that.data.url) {//游戏页面 | if (app.globalData.type == 'gm' && that.data.id && that.data.gameId && that.data.url) {//游戏页面 | ||||
app.globalData.skipUrl = '/pages/game/index?url=' + that.data.url + "&id=" + that.data.id + "&gameId=" + that.data.gameId, | app.globalData.skipUrl = '/pages/game/index?url=' + that.data.url + "&id=" + that.data.id + "&gameId=" + that.data.gameId, | ||||
app.globalData.skip = 'redirectTo' | app.globalData.skip = 'redirectTo' | ||||
@@ -433,7 +441,13 @@ Page({ | |||||
app.globalData.skipUrl = '/index/searchbar', | app.globalData.skipUrl = '/index/searchbar', | ||||
app.globalData.skip = 'redirectTo' | app.globalData.skip = 'redirectTo' | ||||
that.judgePhonelngo() | that.judgePhonelngo() | ||||
} else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) { | |||||
} else if (that.data.fromflag == 'confirmation' && that.data.confirmationFlag) { | |||||
//订单确认 confirmation | |||||
app.globalData.skipUrl = `/pages/coupon/confirmation/confirmation?couponChannelId=${that.data.confirmationFlag}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) { | |||||
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`, | app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`, | ||||
app.globalData.skip = 'redirectTo' | app.globalData.skip = 'redirectTo' | ||||
that.judgePhonelngo() | that.judgePhonelngo() | ||||
@@ -4,17 +4,19 @@ | |||||
"es6": true, | "es6": true, | ||||
"newFeature": false, | "newFeature": false, | ||||
"postcss": false, | "postcss": false, | ||||
"mockUpdate": false, | |||||
"mockUpdate": true, | |||||
"minified": false, | "minified": false, | ||||
"autoPush": false, | "autoPush": false, | ||||
"scripts": false, | "scripts": false, | ||||
"mockLogin": false | |||||
"mockLogin": false, | |||||
"autoCompile": true, | |||||
"localPlugins": false | |||||
}, | }, | ||||
"appid": "ttde7ca8c141425a2301", | "appid": "ttde7ca8c141425a2301", | ||||
"projectname": "tt富茂C", | "projectname": "tt富茂C", | ||||
"condition": { | "condition": { | ||||
"miniprogram": { | "miniprogram": { | ||||
"current": 1649905362371, | |||||
"current": -1, | |||||
"list": [ | "list": [ | ||||
{ | { | ||||
"id": 1650610427387, | "id": 1650610427387, | ||||