@@ -36,7 +36,7 @@ | |||
"text": "首页" | |||
}, | |||
{ | |||
"pagePath": "pages/cartest/cartest", | |||
"pagePath": "pages/passCar/passCar", | |||
"iconPath": "assets/img/pass1.png", | |||
"selectedIconPath": "assets/img/pass0.png", | |||
"text": "停车" | |||
@@ -313,22 +313,16 @@ Page({ | |||
wx.showToast({ | |||
title: "购买成功", | |||
image: "./../../../assets/img/success.png", | |||
duration: 2000, | |||
duration: 1000, | |||
mask: false, | |||
success: function () { | |||
wx.showLoading({ | |||
title: "加载中..." | |||
}); | |||
setTimeout(function () { | |||
wx.hideLoading(); | |||
}, 1600); | |||
setTimeout(() => { | |||
wx.redirectTo({ | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
that.data.orderId | |||
}` | |||
}` | |||
}); | |||
}, 1600); | |||
}, 1000) | |||
} | |||
}); | |||
@@ -395,9 +389,20 @@ Page({ | |||
}) | |||
wx.showToast({ | |||
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) | |||
if (that.data.data.type == 5) { | |||
@@ -5,16 +5,26 @@ Page({ | |||
data: { | |||
canIUse: wx.canIUse("button.open-type.getPhoneNumber"), | |||
couponChannelId: "", | |||
couponId: "" | |||
couponId: "", | |||
flag:0 | |||
}, | |||
onLoad: function(options) { | |||
onLoad: function (options) { | |||
var that = this; | |||
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({ | |||
url: config.api.marketicon, | |||
data: { | |||
@@ -27,7 +37,7 @@ Page({ | |||
}); | |||
}); | |||
}, | |||
getPhoneNumber: function(e) { | |||
getPhoneNumber: function (e) { | |||
var that = this; | |||
var iv = e.detail.iv; | |||
var encryptedData = e.detail.encryptedData; | |||
@@ -38,29 +48,33 @@ Page({ | |||
iv: iv | |||
} | |||
}).then( | |||
function(res) { | |||
function (res) { | |||
console.log(res); | |||
console.log("这是用户授权手机号的结果"); | |||
console.log(that.data.couponChannelId); | |||
console.log(that.data.couponId); | |||
console.log("这是从立即支付传回来的值 因为用户没有授权手机号"); | |||
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({ | |||
title: "请重新授权手机号", | |||
icon: "none" | |||
@@ -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); | |||
} | |||
} | |||
}); | |||
}); |
@@ -1,5 +1,5 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "车辆管理" | |||
"navigationBarTitleText": "停车" | |||
} |