소스 검색

停车费支持

tags/2.2.4
Stormeye.Wu 6 년 전
부모
커밋
5d09e5c777
2개의 변경된 파일50개의 추가작업 그리고 12개의 파일을 삭제
  1. +46
    -11
      pages/passCar/passCar.js
  2. +4
    -1
      pages/passCar/passCar.wxml

+ 46
- 11
pages/passCar/passCar.js 파일 보기

@@ -23,7 +23,7 @@ Page({
} else {
app.userCarLogin()
that.bindCar(that.data.addCar)
}
}
}
},
jumpToAdd: function() {
@@ -32,9 +32,10 @@ Page({
});
},
jumpToPay: function() {
wx.redirectTo({
url: '/pages/pay/pay',
})
console.log("停车支付去")
//wx.redirectTo({
// url: '/pages/pay/pay',
//})
},
passb: function() {
wx.showToast({
@@ -69,6 +70,9 @@ Page({
})
.then(res => {
console.log(res)
that.setData({
addCar: null
})
that.initUsrCarList()
wx.showModal({
title: '提示',
@@ -87,10 +91,8 @@ Page({
})
})
},
unbindCar: function(e) {
console.log(e)
unbindCar: function(carNum) {
var that = this
var carNum = e.currentTarget.dataset.car
// carLogin
app.userCarLogin()
var postData =
@@ -123,13 +125,44 @@ Page({
})
})
},
unbindCarBtn: function(e) {
console.log(e)
var that = this
var carNum = e.currentTarget.dataset.car
that.unbindCar(carNum)
},
getStopFee: function() {
var that = this
for (var i = 0; i < that.data.carList.length; i++) {
var carItem = that.data.carList[i]
var postData =
(app.globalData.parkVendor == 1) ? {
etcpToken: app.globalData.etcpToken,
carNumber: carItem.carNumber,
} : {
carNumber: carItem.carNumber,
outCarId: carItem.outCarId,
}
var stopFee = 'carList[' + i + '].stopFee'
Http.post({
url: config.api.getCarStopFee,
data: postData
})
.then(res => {
console.log(res)
that.setData({
[stopFee]: res.data
})
})
}
},
initPark: function() {
var that = this
// 车场信息获取
Http.get({
url: config.api.getParkInfo,
data: {}
})
url: config.api.getParkInfo,
data: {}
})
.then(res => {
console.log(res)
that.setData({
@@ -137,7 +170,7 @@ Page({
})
})
},
initUsrCarList: function () {
initUsrCarList: function() {
var that = this
// 绑定车获取
Http.get({
@@ -148,6 +181,8 @@ Page({
that.setData({
carList: res.data
})
// 获取 停车费
that.getStopFee()
})
},
init: function() {


+ 4
- 1
pages/passCar/passCar.wxml 파일 보기

@@ -18,8 +18,11 @@
<view class='passNumberBox' wx:for='{{carList}}' wx:key='{{index}}'>
<view class='passNumber' bindtap='orderPay'>
<text>{{item.carNumber}}</text>
<text>总费用:{{item.stopFee.parkingFee}}</text>
<text>已缴:{{item.stopFee.paidFee}}</text>
<text>优免金额{{item.stopFee.discountAmount}}</text>
</view>
<button class='deleteButton' bindtap='unbindCar' data-car='{{item.carNumber}}'>解绑</button>
<button class='deleteButton' bindtap='unbindCarBtn' data-car='{{item.carNumber}}'>解绑</button>
</view>
<view class='addBox'>
<view class='add' bindtap="jumpToAdd">点击添加我的爱车</view>


불러오는 중...
취소
저장