|
|
@@ -69,6 +69,7 @@ Page({ |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res) |
|
|
|
that.initUsrCarList() |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
showCancel: false, |
|
|
@@ -86,13 +87,15 @@ Page({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
unbindCar: function(carNum) { |
|
|
|
unbindCar: function(e) { |
|
|
|
console.log(e) |
|
|
|
var that = this |
|
|
|
var carNum = e.currentTarget.dataset.car |
|
|
|
// carLogin |
|
|
|
app.userCarLogin() |
|
|
|
var postData = |
|
|
|
(parkVendor == 1) ? { |
|
|
|
etcpToken: that.data.etcpToken, |
|
|
|
(app.globalData.parkVendor == 1) ? { |
|
|
|
etcpToken: app.globalData.etcpToken, |
|
|
|
carNumber: carNum, |
|
|
|
} : { |
|
|
|
carNumber: carNum, |
|
|
@@ -103,6 +106,7 @@ Page({ |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res) |
|
|
|
that.initUsrCarList() |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
showCancel: false, |
|
|
@@ -119,30 +123,38 @@ Page({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
init: function() { |
|
|
|
initPark: function() { |
|
|
|
var that = this |
|
|
|
app.parkInitCallback = token => { |
|
|
|
// 车场信息获取 |
|
|
|
Http.get({ |
|
|
|
url: config.api.getParkInfo, |
|
|
|
data: {} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res) |
|
|
|
that.setData({ |
|
|
|
park: res.data, |
|
|
|
}) |
|
|
|
}) |
|
|
|
//绑定车获取 |
|
|
|
Http.get({ |
|
|
|
url: config.api.getUserCarList, |
|
|
|
data: {} |
|
|
|
}).then(res => { |
|
|
|
console.log(res); |
|
|
|
// 车场信息获取 |
|
|
|
Http.get({ |
|
|
|
url: config.api.getParkInfo, |
|
|
|
data: {} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log(res) |
|
|
|
that.setData({ |
|
|
|
carList: res.data |
|
|
|
park: res.data, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
initUsrCarList: function () { |
|
|
|
var that = this |
|
|
|
// 绑定车获取 |
|
|
|
Http.get({ |
|
|
|
url: config.api.getUserCarList, |
|
|
|
data: {} |
|
|
|
}).then(res => { |
|
|
|
console.log(res); |
|
|
|
that.setData({ |
|
|
|
carList: res.data |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
init: function() { |
|
|
|
var that = this |
|
|
|
app.parkInitCallback = token => { |
|
|
|
that.initPark() |
|
|
|
that.initUsrCarList() |
|
|
|
} |
|
|
|
if (app.globalData.token && app.globalData.token != null) { |
|
|
|
app.parkInitCallback(app.globalData.token) |
|
|
|