|
|
|
@@ -23,15 +23,36 @@ Page({ |
|
|
|
dataFontWeight: fontWeight |
|
|
|
}); |
|
|
|
}, |
|
|
|
onLoad: function(options) { |
|
|
|
onShow: function(options) { |
|
|
|
var that = this; |
|
|
|
Http.post({ |
|
|
|
url: config.api.checkPhoneStatus, |
|
|
|
data: {} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log(err); |
|
|
|
console.log("我即将要跳转到用户手机号授权的页面"); |
|
|
|
if (err.code == 11005) { |
|
|
|
// 用户手机未授权 |
|
|
|
/** |
|
|
|
* 将值传到用户手机号授权的页面 |
|
|
|
* |
|
|
|
*/ |
|
|
|
wx.navigateTo({ |
|
|
|
url: "/pages/getphoneInfo/index"}); |
|
|
|
} |
|
|
|
if (err.code == 11006) { |
|
|
|
// 用户手机已加密 |
|
|
|
wx.navigateTo({ |
|
|
|
url: "/pages/phoneinput/phoneinput"}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
that.init(); |
|
|
|
that.getList(); |
|
|
|
}, |
|
|
|
|
|
|
|
onShow: function(options) { |
|
|
|
var that = this; |
|
|
|
console.log("车牌号"); |
|
|
|
if (that.data.addCar) { |
|
|
|
// 绑车牌 |
|
|
|
if (app.globalData.carLogin) { |
|
|
|
@@ -84,9 +105,9 @@ Page({ |
|
|
|
} |
|
|
|
var etcpData = { |
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
carNumber: that.data.payList[0].carNumber |
|
|
|
? that.data.payList[0].carNumber |
|
|
|
: "", |
|
|
|
carNumber: that.data.payList[0].carNumber ? |
|
|
|
that.data.payList[0].carNumber : |
|
|
|
"", |
|
|
|
couponOrderId: that.data.couponList[0].id |
|
|
|
}; |
|
|
|
console.log(etcpData); |
|
|
|
@@ -97,9 +118,9 @@ Page({ |
|
|
|
var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData; |
|
|
|
|
|
|
|
Http.post({ |
|
|
|
url: config.api.getCarCoupon, |
|
|
|
data: postCouponData |
|
|
|
}) |
|
|
|
url: config.api.getCarCoupon, |
|
|
|
data: postCouponData |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
that.setData({ |
|
|
|
flag: "1" |
|
|
|
@@ -161,9 +182,9 @@ Page({ |
|
|
|
}; |
|
|
|
var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData; |
|
|
|
Http.post({ |
|
|
|
url: config.api.bindCar, |
|
|
|
data: postData |
|
|
|
}) |
|
|
|
url: config.api.bindCar, |
|
|
|
data: postData |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res); |
|
|
|
that.setData({ |
|
|
|
@@ -190,18 +211,18 @@ Page({ |
|
|
|
unbindCar: function(carNum) { |
|
|
|
var that = this; |
|
|
|
var postData = |
|
|
|
app.globalData.parkVendor == 1 |
|
|
|
? { |
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
carNumber: carNum |
|
|
|
} |
|
|
|
: { |
|
|
|
carNumber: carNum |
|
|
|
}; |
|
|
|
app.globalData.parkVendor == 1 ? |
|
|
|
{ |
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
carNumber: carNum |
|
|
|
} : |
|
|
|
{ |
|
|
|
carNumber: carNum |
|
|
|
}; |
|
|
|
Http.post({ |
|
|
|
url: config.api.unbindCar, |
|
|
|
data: postData |
|
|
|
}) |
|
|
|
url: config.api.unbindCar, |
|
|
|
data: postData |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res); |
|
|
|
that.initUsrCarList(); |
|
|
|
@@ -230,35 +251,39 @@ Page({ |
|
|
|
getStopFeeItem: function(carItem, i) { |
|
|
|
var that = this; |
|
|
|
var postData = |
|
|
|
app.globalData.parkVendor == 1 |
|
|
|
? { |
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
carNumber: carItem.carNumber |
|
|
|
} |
|
|
|
: { |
|
|
|
carNumber: carItem.carNumber, |
|
|
|
outCarId: carItem.outCarId |
|
|
|
}; |
|
|
|
app.globalData.parkVendor == 1 ? |
|
|
|
{ |
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
carNumber: carItem.carNumber |
|
|
|
} : |
|
|
|
{ |
|
|
|
carNumber: carItem.carNumber, |
|
|
|
outCarId: carItem.outCarId |
|
|
|
}; |
|
|
|
var stopFee = "carList[" + i + "].stopFee"; |
|
|
|
var extraData = "carList[" + i + "].extraData"; |
|
|
|
console.log(extraData); |
|
|
|
var extraDataStr = { params: { CarNumber: carItem.carNumber } }; |
|
|
|
var extraDataStr = { |
|
|
|
params: { |
|
|
|
CarNumber: carItem.carNumber |
|
|
|
} |
|
|
|
}; |
|
|
|
that.setData({ |
|
|
|
extraData: extraDataStr |
|
|
|
}); |
|
|
|
Http.post({ |
|
|
|
url: config.api.getCarStopFee, |
|
|
|
data: postData |
|
|
|
}) |
|
|
|
url: config.api.getCarStopFee, |
|
|
|
data: postData |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
/** |
|
|
|
* 停车费用 |
|
|
|
*/ |
|
|
|
that.setData({ |
|
|
|
[stopFee]: res.data, |
|
|
|
[extraData]: extraDataStr, |
|
|
|
buttonBox: res.data.parkingFee |
|
|
|
}), |
|
|
|
[stopFee]: res.data, |
|
|
|
[extraData]: extraDataStr, |
|
|
|
buttonBox: res.data.parkingFee |
|
|
|
}), |
|
|
|
console.log("res>>>" + JSON.stringify(that.data.buttonBox)); |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
@@ -328,4 +353,4 @@ Page({ |
|
|
|
app.parkInitCallback(app.globalData.token); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |