|
@@ -72,58 +72,73 @@ Page({ |
|
|
// url: '/pages/pay/pay' |
|
|
// url: '/pages/pay/pay' |
|
|
// }); |
|
|
// }); |
|
|
// }, |
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
// payButton:function(){ |
|
|
|
|
|
// if (that.data.couponList.length>0){ |
|
|
|
|
|
// console.log('>>>'+that.data.couponList.length) |
|
|
|
|
|
// that.bindCoupon(e); |
|
|
|
|
|
// } |
|
|
|
|
|
// }, |
|
|
//券绑定车牌 |
|
|
//券绑定车牌 |
|
|
bindCoupon: function (e) { |
|
|
bindCoupon: function (e) { |
|
|
var that = this; |
|
|
var that = this; |
|
|
console.log(e.currentTarget.dataset.checkbind); |
|
|
|
|
|
/** |
|
|
|
|
|
* 如果1 已经绑定 |
|
|
|
|
|
* 0 没有绑定 |
|
|
|
|
|
*/ |
|
|
|
|
|
for (let car of that.data.carList) { |
|
|
|
|
|
if (car.stopFee.parkingFee) { |
|
|
|
|
|
that.data.payList.push(car) |
|
|
|
|
|
|
|
|
if (that.data.couponList.length>0){ |
|
|
|
|
|
console.log('00000000000000') |
|
|
|
|
|
console.log(e.currentTarget.dataset.checkbind); |
|
|
|
|
|
/** |
|
|
|
|
|
* 如果1 已经绑定 |
|
|
|
|
|
* 0 没有绑定 |
|
|
|
|
|
*/ |
|
|
|
|
|
for (let car of that.data.carList) { |
|
|
|
|
|
if (car.stopFee.parkingFee) { |
|
|
|
|
|
that.data.payList.push(car) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
var etcpData = { |
|
|
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
|
|
carNumber: that.data.payList[0].carNumber ? that.data.payList[0].carNumber : '', |
|
|
|
|
|
couponFreeId: that.data.couponList[0].couponFreeId ? that.data.couponList[0].couponFreeId:'', |
|
|
|
|
|
merchantId: that.data.couponList[0].merchantId ? that.data.couponList[0].merchantId:'', |
|
|
|
|
|
} |
|
|
|
|
|
console.log(etcpData) |
|
|
|
|
|
// 停简单 |
|
|
|
|
|
var tjdData = { |
|
|
|
|
|
carNumber: that.data.payList[0].carNumber, |
|
|
|
|
|
} |
|
|
|
|
|
var postCouponData = (app.globalData.parkVendor == 1) ? etcpData : tjdData; |
|
|
|
|
|
|
|
|
|
|
|
Http.post({ |
|
|
|
|
|
url: config.api.getCarCoupon, |
|
|
|
|
|
data: postCouponData, |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
flag: '1' |
|
|
|
|
|
}); |
|
|
|
|
|
// that.initUsrCarList() |
|
|
|
|
|
wx.showModal({ |
|
|
|
|
|
title: '提示', |
|
|
|
|
|
showCancel: false, |
|
|
|
|
|
content: "车牌绑定优免券成功!", |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
var etcpData = { |
|
|
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
|
|
carNumber: that.data.payList[0].carNumber ? that.data.payList[0].carNumber : '', |
|
|
|
|
|
couponFreeId: that.data.couponList[0].couponFreeId ? that.data.couponList[0].couponFreeId : '', |
|
|
|
|
|
merchantId: that.data.couponList[0].merchantId ? that.data.couponList[0].merchantId : '', |
|
|
|
|
|
} |
|
|
|
|
|
console.log(etcpData) |
|
|
|
|
|
// 停简单 |
|
|
|
|
|
var tjdData = { |
|
|
|
|
|
carNumber: that.data.payList[0].carNumber, |
|
|
|
|
|
} |
|
|
|
|
|
var postCouponData = (app.globalData.parkVendor == 1) ? etcpData : tjdData; |
|
|
|
|
|
|
|
|
|
|
|
Http.post({ |
|
|
|
|
|
url: config.api.getCarCoupon, |
|
|
|
|
|
data: postCouponData, |
|
|
}) |
|
|
}) |
|
|
.catch(error => { |
|
|
|
|
|
console.log(error); |
|
|
|
|
|
if (error.code==2056){ |
|
|
|
|
|
|
|
|
.then(res => { |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
flags:'alreadybind' |
|
|
|
|
|
|
|
|
flag: '1' |
|
|
|
|
|
}); |
|
|
|
|
|
// that.initUsrCarList() |
|
|
|
|
|
wx.showModal({ |
|
|
|
|
|
title: '提示', |
|
|
|
|
|
showCancel: false, |
|
|
|
|
|
content: "车牌绑定优免券成功!", |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.catch(error => { |
|
|
|
|
|
console.log(error); |
|
|
|
|
|
if (error.code == 2056) { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
flags: 'alreadybind' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
console.log('1111111111111111111') |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
flags: 'alreadybind' |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(that.data.flags) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//获取名下停车券列表 |
|
|
//获取名下停车券列表 |
|
|