Commit caee095e authored by 肖健's avatar 肖健

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

parents e350fc79 f695305c
......@@ -107,7 +107,8 @@
getPrice() {
if(this.clickState == false){
uni.showLoading({
title:"加载中"
title:"加载中",
mask:true
})
this.clickState = true
let that = this
......@@ -136,9 +137,9 @@
}
that.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
uni.hideLoading()
let freeMoveFlag = res.data.data.freeMoveFlag
if (freeMoveFlag) {
uni.hideLoading()
// uni.showToast({
// title: "您的免费领取次数已用完",
// icon: 'none',
......@@ -176,7 +177,7 @@
// uni.showLoading({
// title: '加载中'
// });
this.timer = setTimeout(()=>{
setTimeout(()=>{
this.getCarList()
},500)
}
......@@ -264,14 +265,15 @@
getCarList(){
let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
clearInterval(this.timer)
uni.hideLoading()
if (res.statusCode == 200) {
this.carList = res.data
this.clickState = false
if(res.data.length == 0){
uni.navigateTo({
url: '/pages/transitionPage'
url: '/pages/transitionPage',
success:()=>{
this.clickState = false
}
});
uni.setStorageSync('firstCoupon',true)
// let url = "car.m.jd.com/h5/list.html?final-action=closewebview&source=licenseprocedure"
......@@ -281,9 +283,14 @@
// url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
// });
uni.navigateTo({
url: '/pagesA/pages/index/getCoupon'
url: '/pagesA/pages/index/getCoupon',
success:()=>{
this.clickState = false
}
});
}
}else{
this.clickState = false
}
})
},
......
......@@ -37,6 +37,7 @@
tab: "index",
page: 1,
scene: null ,// 二维码携带参数
scanClick:true, //扫一扫节流
}
},
computed: {
......@@ -78,8 +79,12 @@
case 2:
let token = uni.getStorageSync('userToken');
if (token) {
if(this.scanClick){
this.scanClick = false
setTimeout(()=>{
uni.scanCode({
success: function(res) {
success: (res)=> {
this.scanClick = true
let path = res.path
let opts = {
......@@ -136,8 +141,13 @@
});
}
})
},
fail: () => {
this.scanClick = true
}
});
},300)
}
} else {
let returnPage= '/pages/main';
let pageType = "reLaunch"
......@@ -235,7 +245,6 @@
}
},
onLoad(option) {
console.log(option,888888888)
// 静默授权获取openid
let openid = uni.getStorageSync('openid');
if (!openid) {
......@@ -261,7 +270,8 @@
let ptKey = plugin.getPtKey();
if (ptKey) {
uni.showLoading({
title: '登录中'
title: '登录中',
mask:true
});
plugin.isvObfuscator({
url: 'https://wxapplogin2.m.jd.com/cgi-bin/login/isv/isvObfuscator'
......
......@@ -53,7 +53,8 @@ export default {
url: "/pagesB/pages/move-car/myRecord",
title: "我的挪车记录"
},
]
],
scanClick:true, //扫一扫节流
}
},
methods: {
......@@ -79,15 +80,17 @@ export default {
// url: vo.url
// })
//扫码
if(this.scanClick){
this.scanClick = false;
setTimeout(()=>{
uni.scanCode({
success: function (res) {
success:(res)=> {
this.scanClick = true
let path = res.path
if (path) {
let xcxIndexPath = uni.getStorageSync('xcxIndexPath')
if (xcxIndexPath) {
xcxIndexPath = path.replace(xcxIndexPath, '').replace("?", '')
if (xcxIndexPath.indexOf('scene') >= 0) {
let scene = xcxIndexPath.replace('scene=', '')
let paths = path.split('?')[1]
let scene = paths.split("=")[1]
let param = {
code: scene
}
......@@ -97,25 +100,34 @@ export default {
}
that.http.httpTokenRequest(opts, param).then(res => {
console.info(res)
console.log(res,"扫码通知车主")
if (res.data.code == 200) {
if (res.data.data.bindFlag) {
that.gotoMoveCar(scene)
} else {
that.gotoBindMoveCar(scene)
}
}
}else{
uni.showToast({
title: res.data.msg,
icon: 'none',
icon: 'error',
})
}
}
})
} else {
uni.showToast({
title: '扫码失败',
icon: 'none',
title: "扫码失败!",
icon: 'error',
})
}
},
fail: () => {
this.scanClick = true
}
});
},300)
}
}
},
//跳转到挪车页面
......
......@@ -23,6 +23,9 @@
<view class="pooup-success" v-if="pooupSuccess">
<view class="success-box">
<image src="../../../static/index/coupon2.png"></image>
<view class="close" @click="closeCoupon">
X
</view>
<view class="title">
<view style="margin-bottom:10rpx;font-weight: bold;">
优惠券领取成功
......@@ -48,7 +51,7 @@
pooupSuccess: false,
timerNum: 3,
timer:null,
clickState:false
clickState:false, //节流
}
},
methods: {
......@@ -63,13 +66,13 @@
url: '/app/user/send/coupon',
method: 'post'
};
setTimeout(()=>{
this.http.httpTokenRequest(opts, {}).then(res => {
console.log(res.data, 1111111)
uni.hideLoading()
if (res.data.code == 200) {
uni.showToast({
title: "领取成功!",
icon: 'none',
icon: 'success',
});
this.pooupSuccess = true
this.timer = setInterval(() => {
......@@ -78,13 +81,16 @@
} else {
this.pooupSuccess = false
this.timerNum = 3
this.clickState = false
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success(res) {// 打开成功
success:(res)=> {// 打开成功
this.clickState = false
},
fail:()=>{
this.clickState = false
}
})
clearInterval(this.timer)
......@@ -93,24 +99,23 @@
}else if(res.data.code == 1000000001){
uni.showToast({
title: "您已领取优惠券!",
icon: 'none',
icon: 'error',
duration:1500,
success:()=> {
this.timer = setTimeout(()=>{
this.clickState = false
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success(res) {// 打开成功
success:()=> {// 打开成功
this.clickState = false
},
fail:()=>{
this.clickState = false
}
})
clearTimeout(this.timer)
},500)
}
});
}else{
this.clickState = false
uni.showToast({
......@@ -119,6 +124,8 @@
});
}
})
},500)
}
// uni.showToast({
// title: "领取成功!",
......@@ -147,6 +154,7 @@
},
goUseCoupon() {
this.timerNum = 3;
this.clickState = false
clearInterval(this.timer);
uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
......@@ -163,7 +171,13 @@
}
})
}
},
closeCoupon(){
this.pooupSuccess = false
this.timerNum = 3
this.clickState = false
clearInterval(this.timer)
},
}
}
</script>
......@@ -249,6 +263,14 @@
z-index: -11;
}
.close{
padding:20rpx 30rpx;
font-size:32rpx;
position: absolute;
top:0;right:0;
color: #fff;
}
.title {
width: 100%;
color: #fff;
......
......@@ -15,7 +15,7 @@
</div>
<div class="item__title" @click="goGetPrice(vo.id)">
<view class="title">
{{vo.brand}}
{{vo.brand + "-" + item.seriesName}}
</view>
<view class="type">
{{vo.carModel}}
......@@ -107,7 +107,8 @@ export default {
},
getCarList(){
uni.showLoading({
title: '加载中'
title: '加载中',
mask:true
});
let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
......
......@@ -270,7 +270,8 @@ export default {
// 获取爱车列表
getCarList(){
uni.showLoading({
title: '加载中'
title: '加载中',
mask:true
});
let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
......@@ -298,7 +299,8 @@ export default {
return;
}
uni.showLoading({
title: '加载中'
title: '加载中',
mask:true
});
let opts = { url: '/app/smsCode/binding/', method: 'post' };
this.http.httpTokenRequest(opts,{phone: this.model1.userMobile}).then(res => {
......@@ -344,7 +346,8 @@ export default {
return;
}
uni.showLoading({
title: '加载中'
title: '加载中',
mask:true
});
let opts = {
url: '/app/moveCode/binding/',
......@@ -374,7 +377,8 @@ export default {
getCarInfo() {
if (this.carId) {
uni.showLoading({
title:"加载中"
title:"加载中",
mask:true
})
let opts = {
url: '/app/vehicleAdmin/' + this.carId,
......@@ -638,7 +642,7 @@ export default {
width:100%;
background-color: #fff;
text-align: center;
padding:30rpx;
padding:30rpx 0;
.title{
font-size:28rpx;
color: #666;
......
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