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