Commit e939e66a authored by lijiongliang's avatar lijiongliang

优惠券逻辑修改

parent f0fe0ab6
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
return { return {
tab: "index", tab: "index",
page: 1, page: 1,
scene: null // 二维码携带参数 scene: null ,// 二维码携带参数
} }
}, },
computed: { computed: {
...@@ -65,15 +65,16 @@ ...@@ -65,15 +65,16 @@
title: "领取成功!", title: "领取成功!",
icon: 'none', icon: 'none',
}); });
setTimeout(()=>{ let timer = setTimeout(()=>{
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径 path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数 extraData: { // 需要携带的参数
}, },
success(res) { success:(res)=> {
// 打开成功 // 打开成功
clearTimeout(timer)
} }
}) })
},600) },600)
......
...@@ -56,14 +56,14 @@ ...@@ -56,14 +56,14 @@
url: '/app/user/send/coupon', url: '/app/user/send/coupon',
method: 'post' method: 'post'
}; };
this.http.httpTokenRequest(opts, {}).then(res => { // this.http.httpTokenRequest(opts, {}).then(res => {
console.log(res.data, 1111111) // console.log(res.data, 1111111)
if (res.data.code == 200) { // if (res.data.code == 200) {
uni.showToast({ // uni.showToast({
title: "领取成功!", // title: "领取成功!",
icon: 'none', // icon: 'none',
}); // });
this.pooupSuccess = true // this.pooupSuccess = true
// let timer = setInterval(() => { // let timer = setInterval(() => {
// if (this.timerNum > 0) { // if (this.timerNum > 0) {
// this.timerNum-- // this.timerNum--
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
// clearInterval(timer) // clearInterval(timer)
// } // }
// }, 1000) // }, 1000)
}else{ // }else if(res.data.code == 1000000001){
// uni.showToast({ // uni.showToast({
// title: "您已领取优惠券!", // title: "您已领取优惠券!",
// icon: 'none', // icon: 'none',
...@@ -101,32 +101,32 @@ ...@@ -101,32 +101,32 @@
// }) // })
// } // }
// }); // });
}
})
// uni.showToast({
// title: "领取成功!",
// icon: 'none',
// });
// this.pooupSuccess = true
// let timer = setInterval(()=>{
// if(this.timerNum > 0){
// this.timerNum --
// }else{
// this.pooupSuccess = false
// this.timerNum = 3
// uni.navigateToMiniProgram({
// appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
// path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
// extraData: { // 需要携带的参数
// },
// success(res) {
// // 打开成功
// } // }
// }) // })
// clearInterval(timer) uni.showToast({
// } title: "领取成功!",
// },1000) icon: 'none',
});
this.pooupSuccess = true
let timer = setInterval(()=>{
if(this.timerNum > 0){
this.timerNum --
}else{
this.pooupSuccess = false
this.timerNum = 3
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success(res) {
// 打开成功
}
})
clearInterval(timer)
}
},1000)
}, },
goUseCoupon() { goUseCoupon() {
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment