Commit e350fc79 authored by 肖健's avatar 肖健

Merge remote-tracking branch 'origin/dev_cd' into dev_jd

parents 3eb4cd32 8d45765f
...@@ -93,8 +93,7 @@ ...@@ -93,8 +93,7 @@
pooupCoupon:false, pooupCoupon:false,
timerNum:3, timerNum:3,
timer:null, timer:null,
clickState:false clickState:false, // 立即领取 防抖
}; };
}, },
methods: { methods: {
...@@ -177,7 +176,9 @@ ...@@ -177,7 +176,9 @@
// uni.showLoading({ // uni.showLoading({
// title: '加载中' // title: '加载中'
// }); // });
this.timer = setTimeout(()=>{
this.getCarList() this.getCarList()
},500)
} }
}else{ }else{
uni.hideLoading() uni.hideLoading()
...@@ -263,9 +264,11 @@ ...@@ -263,9 +264,11 @@
getCarList(){ getCarList(){
let opts = { url: '/app/vehicleAdmin/list', method: 'get' }; let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
clearInterval(this.timer)
uni.hideLoading()
if (res.statusCode == 200) { if (res.statusCode == 200) {
this.carList = res.data this.carList = res.data
uni.hideLoading() this.clickState = false
if(res.data.length == 0){ if(res.data.length == 0){
uni.navigateTo({ uni.navigateTo({
url: '/pages/transitionPage' url: '/pages/transitionPage'
...@@ -501,9 +504,10 @@ ...@@ -501,9 +504,10 @@
z-index:-11; z-index:-11;
} }
.close{ .close{
padding:20rpx 30rpx;
font-size:32rpx; font-size:32rpx;
position: absolute; position: absolute;
top:20rpx;right:30rpx; top:0;right:0;
} }
.title{ .title{
width:100%; width:100%;
......
...@@ -270,8 +270,8 @@ ...@@ -270,8 +270,8 @@
token, token,
message message
} = res; } = res;
console.log(res,"pin_key失效")
if (!token) { if (!token) {
console.log(res,"pin_key失效")
uni.navigateTo({ uni.navigateTo({
url:"/pages/login/index/index" url:"/pages/login/index/index"
}) })
......
...@@ -47,29 +47,38 @@ ...@@ -47,29 +47,38 @@
return { return {
pooupSuccess: false, pooupSuccess: false,
timerNum: 3, timerNum: 3,
timer:null timer:null,
clickState:false
} }
}, },
methods: { methods: {
getCoupon() { getCoupon() {
if(!this.clickState){
uni.showLoading({
title:"加载中",
mask:true
})
this.clickState = true
let opts = { let opts = {
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)
uni.hideLoading()
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(() => { this.timer = setInterval(() => {
if (this.timerNum > 0) { if (this.timerNum > 0) {
this.timerNum-- this.timerNum--
} else { } else {
this.pooupSuccess = false this.pooupSuccess = false
this.timerNum = 3 this.timerNum = 3
this.clickState = false
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径 path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
...@@ -78,7 +87,7 @@ ...@@ -78,7 +87,7 @@
success(res) {// 打开成功 success(res) {// 打开成功
} }
}) })
clearInterval(timer) clearInterval(this.timer)
} }
}, 1000) }, 1000)
}else if(res.data.code == 1000000001){ }else if(res.data.code == 1000000001){
...@@ -86,7 +95,9 @@ ...@@ -86,7 +95,9 @@
title: "您已领取优惠券!", title: "您已领取优惠券!",
icon: 'none', icon: 'none',
duration:1500, duration:1500,
success() { success:()=> {
this.timer = setTimeout(()=>{
this.clickState = false
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径 path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
...@@ -95,15 +106,20 @@ ...@@ -95,15 +106,20 @@
success(res) {// 打开成功 success(res) {// 打开成功
} }
}) })
clearTimeout(this.timer)
},500)
} }
}); });
}else{ }else{
this.clickState = false
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
icon: 'none', icon: 'none',
}); });
} }
}) })
}
// uni.showToast({ // uni.showToast({
// title: "领取成功!", // title: "领取成功!",
// icon: 'none', // icon: 'none',
......
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