|
@@ -105,8 +105,9 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 前往支付
|
|
// 前往支付
|
|
async toPay() {
|
|
async toPay() {
|
|
- const { parkingRecord, discountInfo = {} } = this.orderDetail;
|
|
|
|
|
|
+ const { parkingRecord, discountInfo = {}, parkingRule } = this.orderDetail;
|
|
const { coupons, points } = discountInfo
|
|
const { coupons, points } = discountInfo
|
|
|
|
+ const { hourPrice } = parkingRule
|
|
try {
|
|
try {
|
|
const params = {
|
|
const params = {
|
|
// vehicleNo: '', // 车牌号
|
|
// vehicleNo: '', // 车牌号
|
|
@@ -129,9 +130,9 @@ export default {
|
|
// 15 兑换 5元
|
|
// 15 兑换 5元
|
|
const { pointsPerUnit, unitAmount, discountFee, available } = points[0]
|
|
const { pointsPerUnit, unitAmount, discountFee, available } = points[0]
|
|
params.discountInfo.points = {
|
|
params.discountInfo.points = {
|
|
- "discountTime": discountFee / pointsPerUnit,
|
|
|
|
|
|
+ "discountTime": discountFee / hourPrice * 60,
|
|
"discountFee": discountFee,
|
|
"discountFee": discountFee,
|
|
- "discountPoints": discountFee * (unitAmount / pointsPerUnit)
|
|
|
|
|
|
+ "discountPoints": discountFee / hourPrice * pointsPerUnit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 优惠券
|
|
// 优惠券
|
|
@@ -139,6 +140,9 @@ export default {
|
|
const selectedCoupons = coupons.filter(elm => {
|
|
const selectedCoupons = coupons.filter(elm => {
|
|
const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
|
|
const selected = elm.hasOwnProperty('selected') ? elm.selected : elm.defaultSelected;
|
|
return selected
|
|
return selected
|
|
|
|
+ }).map(elm => {
|
|
|
|
+ elm.discountTime = elm.discountFee / hourPrice * 60
|
|
|
|
+ return elm
|
|
})
|
|
})
|
|
if (selectedCoupons.length) {
|
|
if (selectedCoupons.length) {
|
|
params.discountInfo.coupons = selectedCoupons
|
|
params.discountInfo.coupons = selectedCoupons
|