@@ -36,7 +36,7 @@ | |||||
"text": "首页" | "text": "首页" | ||||
}, | }, | ||||
{ | { | ||||
"pagePath": "pages/cartest/cartest", | |||||
"pagePath": "pages/passCar/passCar", | |||||
"iconPath": "assets/img/pass1.png", | "iconPath": "assets/img/pass1.png", | ||||
"selectedIconPath": "assets/img/pass0.png", | "selectedIconPath": "assets/img/pass0.png", | ||||
"text": "停车" | "text": "停车" | ||||
@@ -313,22 +313,16 @@ Page({ | |||||
wx.showToast({ | wx.showToast({ | ||||
title: "购买成功", | title: "购买成功", | ||||
image: "./../../../assets/img/success.png", | image: "./../../../assets/img/success.png", | ||||
duration: 2000, | |||||
duration: 1000, | |||||
mask: false, | mask: false, | ||||
success: function () { | success: function () { | ||||
wx.showLoading({ | |||||
title: "加载中..." | |||||
}); | |||||
setTimeout(function () { | setTimeout(function () { | ||||
wx.hideLoading(); | |||||
}, 1600); | |||||
setTimeout(() => { | |||||
wx.redirectTo({ | |||||
wx.navigateTo({ | |||||
url: `/pages/order/detail/index?orderId=${ | url: `/pages/order/detail/index?orderId=${ | ||||
that.data.orderId | that.data.orderId | ||||
}` | |||||
}` | |||||
}); | }); | ||||
}, 1600); | |||||
}, 1000) | |||||
} | } | ||||
}); | }); | ||||
@@ -395,9 +389,20 @@ Page({ | |||||
}) | }) | ||||
wx.showToast({ | wx.showToast({ | ||||
title: "领取成功", | title: "领取成功", | ||||
duration: 3000, | |||||
image: "./../../../assets/img/success.png" | |||||
image: "./../../../assets/img/success.png", | |||||
duration: 1000, | |||||
mask: false, | |||||
success:function(){ | |||||
setTimeout(function(){ | |||||
wx.navigateTo({ | |||||
url: `/pages/order/detail/index?orderId=${ | |||||
that.data.orderId | |||||
}` | |||||
}); | |||||
},1000) | |||||
} | |||||
}); | }); | ||||
//////////////////////////停车券 | //////////////////////////停车券 | ||||
console.log(that.data.data.type) | console.log(that.data.data.type) | ||||
if (that.data.data.type == 5) { | if (that.data.data.type == 5) { | ||||
@@ -5,16 +5,26 @@ Page({ | |||||
data: { | data: { | ||||
canIUse: wx.canIUse("button.open-type.getPhoneNumber"), | canIUse: wx.canIUse("button.open-type.getPhoneNumber"), | ||||
couponChannelId: "", | couponChannelId: "", | ||||
couponId: "" | |||||
couponId: "", | |||||
flag:0 | |||||
}, | }, | ||||
onLoad: function(options) { | |||||
onLoad: function (options) { | |||||
var that = this; | var that = this; | ||||
console.log(options); | console.log(options); | ||||
that.setData({ | |||||
couponChannelId: options.couponChannelId, | |||||
couponId: options.couponId | |||||
}); | |||||
if (JSON.stringify(options)=='{}'){ | |||||
console.log("null"), | |||||
that.setData({ | |||||
flag:0 | |||||
}) | |||||
} | |||||
if (JSON.stringify(options)!='{}') { | |||||
console.log("bushi null"); | |||||
that.setData({ | |||||
couponChannelId: options.couponChannelId, | |||||
couponId: options.couponId, | |||||
flag:1 | |||||
}); | |||||
} | |||||
Http.get({ | Http.get({ | ||||
url: config.api.marketicon, | url: config.api.marketicon, | ||||
data: { | data: { | ||||
@@ -27,7 +37,7 @@ Page({ | |||||
}); | }); | ||||
}); | }); | ||||
}, | }, | ||||
getPhoneNumber: function(e) { | |||||
getPhoneNumber: function (e) { | |||||
var that = this; | var that = this; | ||||
var iv = e.detail.iv; | var iv = e.detail.iv; | ||||
var encryptedData = e.detail.encryptedData; | var encryptedData = e.detail.encryptedData; | ||||
@@ -38,29 +48,33 @@ Page({ | |||||
iv: iv | iv: iv | ||||
} | } | ||||
}).then( | }).then( | ||||
function(res) { | |||||
function (res) { | |||||
console.log(res); | console.log(res); | ||||
console.log("这是用户授权手机号的结果"); | console.log("这是用户授权手机号的结果"); | ||||
console.log(that.data.couponChannelId); | |||||
console.log(that.data.couponId); | |||||
console.log("这是从立即支付传回来的值 因为用户没有授权手机号"); | console.log("这是从立即支付传回来的值 因为用户没有授权手机号"); | ||||
app.globalData.phone = res.data.phone; | app.globalData.phone = res.data.phone; | ||||
wx.showToast({ | |||||
title: res.data.msg, | |||||
icon: "success", | |||||
success: function(res) { | |||||
wx.redirectTo({ | |||||
url: | |||||
"/pages/coupon/detail/index?couponChannelId=" + | |||||
that.data.couponChannelId + | |||||
"&couponId=" + | |||||
that.data.couponId + | |||||
"&flag=pay" | |||||
}); | |||||
} | |||||
}); | |||||
if(that.data.flag == 0){ | |||||
wx.switchTab({ | |||||
url: '/pages/passCar/passCar', | |||||
}) | |||||
}else{ | |||||
wx.showToast({ | |||||
title: res.data.msg, | |||||
icon: "success", | |||||
success: function (res) { | |||||
wx.redirectTo({ | |||||
url: | |||||
"/pages/coupon/detail/index?couponChannelId=" + | |||||
that.data.couponChannelId + | |||||
"&couponId=" + | |||||
that.data.couponId + | |||||
"&flag=pay" | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}, | }, | ||||
function(error) { | |||||
function (error) { | |||||
wx.showToast({ | wx.showToast({ | ||||
title: "请重新授权手机号", | title: "请重新授权手机号", | ||||
icon: "none" | icon: "none" | ||||
@@ -23,15 +23,36 @@ Page({ | |||||
dataFontWeight: fontWeight | dataFontWeight: fontWeight | ||||
}); | }); | ||||
}, | }, | ||||
onLoad: function(options) { | |||||
onShow: function(options) { | |||||
var that = this; | 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.init(); | ||||
that.getList(); | that.getList(); | ||||
}, | |||||
onShow: function(options) { | |||||
var that = this; | |||||
console.log("车牌号"); | |||||
if (that.data.addCar) { | if (that.data.addCar) { | ||||
// 绑车牌 | // 绑车牌 | ||||
if (app.globalData.carLogin) { | if (app.globalData.carLogin) { | ||||
@@ -84,9 +105,9 @@ Page({ | |||||
} | } | ||||
var etcpData = { | var etcpData = { | ||||
etcpToken: app.globalData.etcpToken, | 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 | couponOrderId: that.data.couponList[0].id | ||||
}; | }; | ||||
console.log(etcpData); | console.log(etcpData); | ||||
@@ -97,9 +118,9 @@ Page({ | |||||
var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData; | var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData; | ||||
Http.post({ | Http.post({ | ||||
url: config.api.getCarCoupon, | |||||
data: postCouponData | |||||
}) | |||||
url: config.api.getCarCoupon, | |||||
data: postCouponData | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
that.setData({ | that.setData({ | ||||
flag: "1" | flag: "1" | ||||
@@ -161,9 +182,9 @@ Page({ | |||||
}; | }; | ||||
var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData; | var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData; | ||||
Http.post({ | Http.post({ | ||||
url: config.api.bindCar, | |||||
data: postData | |||||
}) | |||||
url: config.api.bindCar, | |||||
data: postData | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
console.log(res); | console.log(res); | ||||
that.setData({ | that.setData({ | ||||
@@ -190,18 +211,18 @@ Page({ | |||||
unbindCar: function(carNum) { | unbindCar: function(carNum) { | ||||
var that = this; | var that = this; | ||||
var postData = | 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({ | Http.post({ | ||||
url: config.api.unbindCar, | |||||
data: postData | |||||
}) | |||||
url: config.api.unbindCar, | |||||
data: postData | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
console.log(res); | console.log(res); | ||||
that.initUsrCarList(); | that.initUsrCarList(); | ||||
@@ -230,35 +251,39 @@ Page({ | |||||
getStopFeeItem: function(carItem, i) { | getStopFeeItem: function(carItem, i) { | ||||
var that = this; | var that = this; | ||||
var postData = | 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 stopFee = "carList[" + i + "].stopFee"; | ||||
var extraData = "carList[" + i + "].extraData"; | var extraData = "carList[" + i + "].extraData"; | ||||
console.log(extraData); | console.log(extraData); | ||||
var extraDataStr = { params: { CarNumber: carItem.carNumber } }; | |||||
var extraDataStr = { | |||||
params: { | |||||
CarNumber: carItem.carNumber | |||||
} | |||||
}; | |||||
that.setData({ | that.setData({ | ||||
extraData: extraDataStr | extraData: extraDataStr | ||||
}); | }); | ||||
Http.post({ | Http.post({ | ||||
url: config.api.getCarStopFee, | |||||
data: postData | |||||
}) | |||||
url: config.api.getCarStopFee, | |||||
data: postData | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
/** | /** | ||||
* 停车费用 | * 停车费用 | ||||
*/ | */ | ||||
that.setData({ | 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)); | console.log("res>>>" + JSON.stringify(that.data.buttonBox)); | ||||
}) | }) | ||||
.catch(error => { | .catch(error => { | ||||
@@ -328,4 +353,4 @@ Page({ | |||||
app.parkInitCallback(app.globalData.token); | app.parkInitCallback(app.globalData.token); | ||||
} | } | ||||
} | } | ||||
}); | |||||
}); |
@@ -1,5 +1,5 @@ | |||||
{ | { | ||||
"component": true, | "component": true, | ||||
"usingComponents": {}, | "usingComponents": {}, | ||||
"navigationBarTitleText": "车辆管理" | |||||
"navigationBarTitleText": "停车" | |||||
} | } |