|
@@ -23,7 +23,7 @@ Page({ |
|
|
} else { |
|
|
} else { |
|
|
app.userCarLogin() |
|
|
app.userCarLogin() |
|
|
that.bindCar(that.data.addCar) |
|
|
that.bindCar(that.data.addCar) |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
jumpToAdd: function() { |
|
|
jumpToAdd: function() { |
|
@@ -32,9 +32,10 @@ Page({ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
jumpToPay: function() { |
|
|
jumpToPay: function() { |
|
|
wx.redirectTo({ |
|
|
|
|
|
url: '/pages/pay/pay', |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
console.log("停车支付去") |
|
|
|
|
|
//wx.redirectTo({ |
|
|
|
|
|
// url: '/pages/pay/pay', |
|
|
|
|
|
//}) |
|
|
}, |
|
|
}, |
|
|
passb: function() { |
|
|
passb: function() { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
@@ -69,6 +70,9 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
addCar: null |
|
|
|
|
|
}) |
|
|
that.initUsrCarList() |
|
|
that.initUsrCarList() |
|
|
wx.showModal({ |
|
|
wx.showModal({ |
|
|
title: '提示', |
|
|
title: '提示', |
|
@@ -87,10 +91,8 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
unbindCar: function(e) { |
|
|
|
|
|
console.log(e) |
|
|
|
|
|
|
|
|
unbindCar: function(carNum) { |
|
|
var that = this |
|
|
var that = this |
|
|
var carNum = e.currentTarget.dataset.car |
|
|
|
|
|
// carLogin |
|
|
// carLogin |
|
|
app.userCarLogin() |
|
|
app.userCarLogin() |
|
|
var postData = |
|
|
var postData = |
|
@@ -123,13 +125,44 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
unbindCarBtn: function(e) { |
|
|
|
|
|
console.log(e) |
|
|
|
|
|
var that = this |
|
|
|
|
|
var carNum = e.currentTarget.dataset.car |
|
|
|
|
|
that.unbindCar(carNum) |
|
|
|
|
|
}, |
|
|
|
|
|
getStopFee: function() { |
|
|
|
|
|
var that = this |
|
|
|
|
|
for (var i = 0; i < that.data.carList.length; i++) { |
|
|
|
|
|
var carItem = that.data.carList[i] |
|
|
|
|
|
var postData = |
|
|
|
|
|
(app.globalData.parkVendor == 1) ? { |
|
|
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
|
|
carNumber: carItem.carNumber, |
|
|
|
|
|
} : { |
|
|
|
|
|
carNumber: carItem.carNumber, |
|
|
|
|
|
outCarId: carItem.outCarId, |
|
|
|
|
|
} |
|
|
|
|
|
var stopFee = 'carList[' + i + '].stopFee' |
|
|
|
|
|
Http.post({ |
|
|
|
|
|
url: config.api.getCarStopFee, |
|
|
|
|
|
data: postData |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
[stopFee]: res.data |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
initPark: function() { |
|
|
initPark: function() { |
|
|
var that = this |
|
|
var that = this |
|
|
// 车场信息获取 |
|
|
// 车场信息获取 |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: config.api.getParkInfo, |
|
|
|
|
|
data: {} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
url: config.api.getParkInfo, |
|
|
|
|
|
data: {} |
|
|
|
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
that.setData({ |
|
|
that.setData({ |
|
@@ -137,7 +170,7 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
initUsrCarList: function () { |
|
|
|
|
|
|
|
|
initUsrCarList: function() { |
|
|
var that = this |
|
|
var that = this |
|
|
// 绑定车获取 |
|
|
// 绑定车获取 |
|
|
Http.get({ |
|
|
Http.get({ |
|
@@ -148,6 +181,8 @@ Page({ |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
carList: res.data |
|
|
carList: res.data |
|
|
}) |
|
|
}) |
|
|
|
|
|
// 获取 停车费 |
|
|
|
|
|
that.getStopFee() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
init: function() { |
|
|
init: function() { |
|
|