Commit caee095e authored by 肖健's avatar 肖健

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

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