|
|
@@ -301,68 +301,75 @@ Page({ |
|
|
|
showCancel: false, |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onShow: function (options) { |
|
|
|
this.setData({ |
|
|
|
goHomeUrl: app.globalData.goHomeUrl |
|
|
|
}) |
|
|
|
if (typeof this.getTabBar === 'function' && |
|
|
|
this.getTabBar()) { |
|
|
|
this.getTabBar().setData({ |
|
|
|
selected: 2 |
|
|
|
}) |
|
|
|
} |
|
|
|
var that = this; |
|
|
|
that.setData({ |
|
|
|
etcpAppId: extConfig.attr.car.etcp.etcpAppId, |
|
|
|
carMiniVersion: extConfig.attr.car.version, |
|
|
|
etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl, |
|
|
|
payPath: extConfig.attr.car.etcp.payPath, |
|
|
|
ifHaveCarModular: extConfig.attr.ifHaveCarModular |
|
|
|
}) |
|
|
|
console.log(this.data.ifHaveCarModular, 'ifHaveCarModular'); |
|
|
|
if (app.globalData.token) { |
|
|
|
that.getList(); |
|
|
|
that.init(); |
|
|
|
} else { |
|
|
|
that.init(); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 只有用户选择了优惠券 |
|
|
|
* 才会进行券和车牌的绑定 |
|
|
|
*/ |
|
|
|
/* if (wx.getStorageSync("chosed") && that.data.quanid) { |
|
|
|
that.getStopFee(that.data.listCardNum); |
|
|
|
that.bindCoupon(that.data.quanid); |
|
|
|
wx.setStorage({ |
|
|
|
key: 'chosed', |
|
|
|
data: '', |
|
|
|
Http.get({ |
|
|
|
url: config.api.checkPhoneStatus, |
|
|
|
data: {} |
|
|
|
}).then(res => { |
|
|
|
this.setData({ |
|
|
|
goHomeUrl: app.globalData.goHomeUrl |
|
|
|
}) |
|
|
|
}; */ |
|
|
|
if (app.globalData.token) { |
|
|
|
// that.initUsrCarList(); |
|
|
|
that.initUsrCarList("flags"); |
|
|
|
if (typeof this.getTabBar === 'function' && |
|
|
|
this.getTabBar()) { |
|
|
|
this.getTabBar().setData({ |
|
|
|
selected: 2 |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
that.setData({ |
|
|
|
current: 0 |
|
|
|
etcpAppId: extConfig.attr.car.etcp.etcpAppId, |
|
|
|
carMiniVersion: extConfig.attr.car.version, |
|
|
|
etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl, |
|
|
|
payPath: extConfig.attr.car.etcp.payPath, |
|
|
|
ifHaveCarModular: extConfig.attr.ifHaveCarModular |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if (that.data.addCar) { |
|
|
|
// 绑车牌 |
|
|
|
if (app.globalData.carLogin) { |
|
|
|
that.bindCar(that.data.addCar); |
|
|
|
console.log(this.data.ifHaveCarModular, 'ifHaveCarModular'); |
|
|
|
if (app.globalData.token) { |
|
|
|
that.getList(); |
|
|
|
that.init(); |
|
|
|
} else { |
|
|
|
that.bindCar(that.data.addCar); |
|
|
|
that.init(); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 只有用户选择了优惠券 |
|
|
|
* 才会进行券和车牌的绑定 |
|
|
|
*/ |
|
|
|
/* if (wx.getStorageSync("chosed") && that.data.quanid) { |
|
|
|
that.getStopFee(that.data.listCardNum); |
|
|
|
that.bindCoupon(that.data.quanid); |
|
|
|
wx.setStorage({ |
|
|
|
key: 'chosed', |
|
|
|
data: '', |
|
|
|
}) |
|
|
|
}; */ |
|
|
|
if (app.globalData.token) { |
|
|
|
// that.initUsrCarList(); |
|
|
|
that.initUsrCarList("flags"); |
|
|
|
that.setData({ |
|
|
|
current: 0 |
|
|
|
}) |
|
|
|
} |
|
|
|
that.setData({ |
|
|
|
addCar: null |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
this.getTicketList(0, 1); |
|
|
|
|
|
|
|
|
|
|
|
if (that.data.addCar) { |
|
|
|
// 绑车牌 |
|
|
|
if (app.globalData.carLogin) { |
|
|
|
that.bindCar(that.data.addCar); |
|
|
|
} else { |
|
|
|
that.bindCar(that.data.addCar); |
|
|
|
} |
|
|
|
that.setData({ |
|
|
|
addCar: null |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
this.getTicketList(0, 1); |
|
|
|
}).catch(err => { |
|
|
|
that.init(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
cancelMove: function () { |
|
|
|
console.log(111) |
|
|
|
return false; |
|
|
@@ -376,39 +383,45 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
onLoad: function (options) { |
|
|
|
|
|
|
|
var that = this; |
|
|
|
/** |
|
|
|
* 获得分享小程序的 |
|
|
|
* title |
|
|
|
* desc |
|
|
|
*/ |
|
|
|
|
|
|
|
Http.get({ |
|
|
|
url: config.api.getWeapNote, |
|
|
|
data: { |
|
|
|
appId: config.weapp.AppId, |
|
|
|
url: config.api.checkPhoneStatus, |
|
|
|
data: {} |
|
|
|
}).then(res => { |
|
|
|
/** |
|
|
|
* 获得分享小程序的 |
|
|
|
* title |
|
|
|
* desc |
|
|
|
*/ |
|
|
|
Http.get({ |
|
|
|
url: config.api.getWeapNote, |
|
|
|
data: { |
|
|
|
appId: config.weapp.AppId, |
|
|
|
} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
let weapNote = JSON.parse(res.data.weapNote); |
|
|
|
that.setData({ |
|
|
|
desc: weapNote.carpage.desc, |
|
|
|
title: weapNote.carpage.title |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
// 登录 |
|
|
|
var scene = decodeURIComponent(options.scene); |
|
|
|
that.setData({ |
|
|
|
scene: scene |
|
|
|
}); |
|
|
|
if (app.globalData.token) { } else { |
|
|
|
// app.getLocation(); |
|
|
|
that.userLogin() |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
return |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
let weapNote = JSON.parse(res.data.weapNote); |
|
|
|
that.setData({ |
|
|
|
desc: weapNote.carpage.desc, |
|
|
|
title: weapNote.carpage.title |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
// 登录 |
|
|
|
var scene = decodeURIComponent(options.scene); |
|
|
|
that.setData({ |
|
|
|
scene: scene |
|
|
|
}); |
|
|
|
if (app.globalData.token) { } else { |
|
|
|
// app.getLocation(); |
|
|
|
that.userLogin() |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
/** |
|
|
|
* 用户登录 |
|
|
@@ -499,9 +512,18 @@ Page({ |
|
|
|
.catch(err => { }) |
|
|
|
}, |
|
|
|
jumpToAdd: function () { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/addPark/addPark?flags=managepalte` |
|
|
|
}); |
|
|
|
Http.get({ |
|
|
|
url: config.api.checkPhoneStatus, |
|
|
|
data: {} |
|
|
|
}).then(res => { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/addPark/addPark?flags=managepalte` |
|
|
|
}); |
|
|
|
}).catch(err => { |
|
|
|
wx.navigateTo({ |
|
|
|
url: `/pages/getphoneInfo/index?mineFlag=passCar`, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
passc: function () { |
|
|
|
wx.navigateTo({ |
|
|
|