@@ -7,13 +7,42 @@ Page({ | |||
park: null, | |||
carList: [], | |||
addCar: null, | |||
tcq:2 | |||
tcq: 2 | |||
}, | |||
onLoad: function(options) { | |||
// ready() { | |||
// app.couponChannelListCallback = token => { | |||
// Http.setToken(token); | |||
// Http.get({ | |||
// url: config.api.couponChannelList, | |||
// data: { | |||
// pageNum: 1, | |||
// pageSize: 2, | |||
// targetAd: 2 | |||
// } | |||
// }).then(res => { | |||
// console.log(res); | |||
// this.setData({ | |||
// list: res.data.list | |||
// }); | |||
// }); | |||
// }; | |||
// }, | |||
/*车牌动态样式 */ | |||
changeStyle: function () { | |||
var height = this.data.dataHeight == '150rpx' ? '80rpx' : '150rpx'; | |||
var lineHeight = this.data.dataHeight == '150rpx' ? '80rpx' : '150rpx'; | |||
var fontWeight = this.data.fontWeight == '600' ? '500' : '600'; | |||
this.setData({ | |||
dataHeight: height, | |||
dataLineHeight: lineHeight, | |||
dataFontWeight: fontWeight | |||
}); | |||
}, | |||
onLoad: function (options) { | |||
var that = this | |||
that.init(); | |||
}, | |||
onShow: function(options) { | |||
onShow: function (options) { | |||
var that = this | |||
if (options) | |||
console.log(options) | |||
@@ -30,11 +59,11 @@ Page({ | |||
} | |||
}, | |||
//我的停车券的显示与消失 | |||
showquan:function(){ | |||
showquan: function () { | |||
let that = this; | |||
if(that.data.tcq==1){ | |||
if (that.data.tcq == 1) { | |||
that.setData({ | |||
tcq:2 | |||
tcq: 2 | |||
}) | |||
} | |||
else if (that.data.tcq == 2) { | |||
@@ -43,33 +72,33 @@ Page({ | |||
}) | |||
} | |||
}, | |||
jumpToAdd: function() { | |||
jumpToAdd: function () { | |||
wx.navigateTo({ | |||
url: '/pages/addPark/addPark', | |||
}); | |||
}, | |||
jumpToPay: function() { | |||
jumpToPay: function () { | |||
console.log("停车支付去") | |||
//wx.redirectTo({ | |||
// url: '/pages/pay/pay', | |||
//}) | |||
}, | |||
passb: function() { | |||
passb: function () { | |||
wx.showToast({ | |||
title: '货物在路上~', | |||
}) | |||
}, | |||
passc: function() { | |||
passc: function () { | |||
wx.showToast({ | |||
title: '宝宝最可爱~', | |||
}) | |||
}, | |||
orderPay: function() { | |||
orderPay: function () { | |||
wx.redirectTo({ | |||
url: '/pages/pay/pay' | |||
}); | |||
}, | |||
bindCar: function(carNum) { | |||
bindCar: function (carNum) { | |||
var that = this | |||
// ETCP | |||
var etcpData = { | |||
@@ -82,9 +111,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({ | |||
@@ -95,7 +124,7 @@ Page({ | |||
title: '提示', | |||
showCancel: false, | |||
content: "绑车牌成功!", | |||
success: function() {} | |||
success: function () { } | |||
}) | |||
}) | |||
.catch(error => { | |||
@@ -104,23 +133,23 @@ Page({ | |||
title: '提示', | |||
showCancel: false, | |||
content: error.data.message, | |||
success: function() {} | |||
success: function () { } | |||
}) | |||
}) | |||
}, | |||
unbindCar: function(carNum) { | |||
unbindCar: function (carNum) { | |||
var that = this | |||
var postData = | |||
(app.globalData.parkVendor == 1) ? { | |||
etcpToken: app.globalData.etcpToken, | |||
carNumber: carNum, | |||
} : { | |||
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() | |||
@@ -128,7 +157,7 @@ Page({ | |||
title: '提示', | |||
showCancel: false, | |||
content: "解绑车牌成功!", | |||
success: function() {} | |||
success: function () { } | |||
}) | |||
}) | |||
.catch(error => { | |||
@@ -136,32 +165,32 @@ Page({ | |||
title: '提示', | |||
showCancel: false, | |||
content: "解绑车牌失败!", | |||
success: function() {} | |||
success: function () { } | |||
}) | |||
}) | |||
}, | |||
unbindCarBtn: function(e) { | |||
unbindCarBtn: function (e) { | |||
console.log(e) | |||
var that = this | |||
var carNum = e.currentTarget.dataset.car | |||
that.unbindCar(carNum) | |||
}, | |||
getStopFeeItem: function(carItem, i) { | |||
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, | |||
} | |||
carNumber: carItem.carNumber, | |||
outCarId: carItem.outCarId, | |||
} | |||
var stopFee = 'carList[' + i + '].stopFee' | |||
console.log(postData) | |||
Http.post({ | |||
url: config.api.getCarStopFee, | |||
data: postData | |||
}) | |||
url: config.api.getCarStopFee, | |||
data: postData | |||
}) | |||
.then(res => { | |||
console.log(res) | |||
console.log(stopFee) | |||
@@ -169,24 +198,25 @@ Page({ | |||
[stopFee]: res.data | |||
}) | |||
}) | |||
.catch(error =>{ | |||
.catch(error => { | |||
console.log(error) | |||
}) | |||
}, | |||
getStopFee: function() { | |||
getStopFee: function () { | |||
var that = this | |||
// carLogin | |||
for (var i = 0; i < that.data.carList.length; i++) { | |||
that.getStopFeeItem(that.data.carList[i], i) | |||
} | |||
// console.log(JSON.stringify(getStopFeeItem)) | |||
}, | |||
initPark: function() { | |||
initPark: function () { | |||
var that = this | |||
// 车场信息获取 | |||
Http.get({ | |||
url: config.api.getParkInfo, | |||
data: {} | |||
}) | |||
url: config.api.getParkInfo, | |||
data: {} | |||
}) | |||
.then(res => { | |||
console.log(res) | |||
that.setData({ | |||
@@ -194,7 +224,7 @@ Page({ | |||
}) | |||
}) | |||
}, | |||
initUsrCarList: function() { | |||
initUsrCarList: function () { | |||
var that = this | |||
// 绑定车获取 | |||
Http.get({ | |||
@@ -207,9 +237,9 @@ Page({ | |||
}) | |||
}) | |||
}, | |||
init: function() { | |||
init: function () { | |||
var that = this | |||
app.parkInitCallback = token => { | |||
that.initPark() | |||
that.initUsrCarList() | |||
@@ -3,29 +3,45 @@ | |||
<image src='../../assets/img/timg.jpg'></image> | |||
<view class='numberBox'> | |||
<view class='titleName'>{{park.addr}}</view> | |||
<view class='carLocation price'>停车费: | |||
<label class='locationNumber'>{{park.stopFee}}</label> | |||
</view> | |||
<view class='carLocation'>总车位: | |||
<label class='locationNumber'> {{park.number}}个</label> | |||
</view> | |||
<view class='carLocation'>停车费: | |||
<label class='locationNumber'>{{park.stopFee}}</label> | |||
</view> | |||
</view> | |||
</view> | |||
<view class='borderBox'> | |||
<view class='borderUp'>我的爱车 | |||
<label class='carNumber'>最多可添加3辆,点选车牌号完成付款</label> | |||
<label class='carNumber'></label> | |||
</view> | |||
<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 class='passNumber' bindtap='orderPay' style='height:{{dataHeight}};font-weight:{{dataWeight}};line-height:{{dataLineHeight}}'> | |||
<text class='number'>{{item.carNumber}}</text> | |||
<!-- <text class='price'>待缴金额:¥{{item.remainingParkFee?item.remainingParkFee:'0'}}</text> --> | |||
<text class='parkPrice'>待缴金额:¥500</text> | |||
<!-- <text>已缴:{{item.stopFee.paidFee}}</text> | |||
<text>优免金额{{item.stopFee.discountAmount}}</text> --> | |||
</view> | |||
<button class='deleteButton' bindtap='unbindCarBtn' data-car='{{item.carNumber}}'>解绑</button> | |||
</view> | |||
<view class='passNumberBox'> | |||
<view class='passNumber nopay' bindtap='orderPay'> | |||
<text class='number'>蒙B35412</text> | |||
</view> | |||
<button class='deleteButton' bindtap='unbindCarBtn' data-car='{{item.carNumber}}'>解绑</button> | |||
</view> | |||
<view class='addBox'> | |||
<view class='add' bindtap="jumpToAdd"><text>+</text>添加爱车</view> | |||
<view class='passNumberBox'> | |||
<view class='passNumber nopay' bindtap='orderPay'> | |||
<text class='number'>沪B88888</text> | |||
</view> | |||
<button class='deleteButton' bindtap='unbindCarBtn' data-car='{{item.carNumber}}'>解绑</button> | |||
</view> | |||
<view class='addBox' wx:if='{{carList.length==3}}'> | |||
<view class='add' bindtap="jumpToAdd"> | |||
<text>+</text>添加爱车</view> | |||
</view> | |||
</view> | |||
<view class='bottonBox'> | |||
@@ -33,24 +49,25 @@ | |||
<image src='../../assets/img/quan.png'></image> | |||
我的停车券 | |||
<view class='detail'> | |||
<image wx:if="{{tcq==1}}" src='../../assets/img/down.png'></image> | |||
<image wx:elif="{{tcq!=1}}" src='../../assets/img/right.png'></image> | |||
<!-- <image wx:if="{{tcq==1}}" src='../../assets/img/down.png'></image> --> | |||
<image src='../../assets/img/right.png'></image> | |||
</view> | |||
</view> | |||
<view class='voucher' wx:if="{{tcq==1}}"> | |||
<text class='textV1'>2小时免费停车券</text> | |||
<text class='textV2'>¥10.00元</text> | |||
<!-- <view class='voucher' wx:if="{{tcq==1}}"> | |||
<text class='textV1'>2小时免费</text> | |||
<text class='textV2'>蒙B35412</text> | |||
<text class='textV1'>¥10.00元</text> | |||
<view class='choice'> | |||
<image src='../../assets/img/choiced.png'></image> | |||
</view> | |||
</view> | |||
<view class='textStyle' bindtap='passb'> | |||
</view> --> | |||
<!-- <view class='textStyle' bindtap='passb'> | |||
<image src='../../assets/img/jilu.png'></image> | |||
停车记录 | |||
<view class='detail'> | |||
<image src='../../assets/img/right.png'></image> | |||
</view> | |||
</view> | |||
</view> --> | |||
<view class='textStyle' bindtap='passc'> | |||
<image src='../../assets/img/wenti.png'></image> | |||
常见问题 | |||
@@ -59,4 +76,7 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view class="buy-view app-border-top"> | |||
<button bindtap='orderFunc' class='buy'>立即支付</button> | |||
</view> | |||
</view> |
@@ -14,7 +14,7 @@ page{ | |||
.headBox image{ | |||
width: 150rpx; | |||
height: 150rpx; | |||
margin-right: 30rpx; | |||
margin:10rpx 30rpx 0 0; | |||
border-radius:16rpx; | |||
} | |||
.numberBox{ | |||
@@ -29,6 +29,7 @@ page{ | |||
width: 400rpx; | |||
word-break:break-all; | |||
text-align: justify; | |||
margin-bottom: 10rpx; | |||
} | |||
::-webkit-scrollbar{ | |||
width: 0; | |||
@@ -42,6 +43,9 @@ color: transparent; | |||
font-size: 24rpx; | |||
line-height: 30rpx; | |||
} | |||
.price{ | |||
font-size: 28rpx; | |||
} | |||
.borderBox{ | |||
width: 750rpx; | |||
margin-top: 26rpx; | |||
@@ -49,7 +53,7 @@ color: transparent; | |||
} | |||
.borderUp{ | |||
padding: 50rpx; | |||
width: 750rpx; | |||
width: 650rpx; | |||
height: 50rpx; | |||
line-height: 50rpx; | |||
font-size: 36rpx; | |||
@@ -89,16 +93,15 @@ color: transparent; | |||
.bottonBox{ | |||
width: 750rpx; | |||
margin-top: 75rpx; | |||
background-color: white; | |||
} | |||
.textStyle{ | |||
background-color: white; | |||
height: 90rpx; | |||
line-height: 90rpx; | |||
padding-left: 130rpx; | |||
color: #333; | |||
font-size: 28rpx; | |||
letter-spacing: 1rpx; | |||
margin-top: 30rpx; | |||
border-bottom: 1rpx #f8f8f8 solid; | |||
position: relative; | |||
} | |||
@@ -112,27 +115,43 @@ color: transparent; | |||
} | |||
.passNumberBox{ | |||
width: 750rpx; | |||
height: 150rpx; | |||
position: relative; | |||
background-color: white; | |||
border-bottom: 1rpx #f8f8f8 solid; | |||
display: flex; | |||
justify-content: space-between; | |||
} | |||
.passNumber{ | |||
width: 400rpx; | |||
width: 450rpx; | |||
height: 150rpx; | |||
font-size: 32rpx; | |||
font-weight: 600; | |||
margin-left: 55rpx; | |||
position: relative; | |||
display: flex; | |||
justify-content: space-between; | |||
line-height: 150rpx; | |||
left: 55rpx; | |||
position: absolute; | |||
font-weight: 600; | |||
color: #333; | |||
} | |||
.nopay{ | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
font-weight: 400; | |||
} | |||
.number{ | |||
font-size: 32rpx; | |||
} | |||
.parkPrice{ | |||
font-size: 30rpx; | |||
font-weight: 500; | |||
} | |||
.deleteButton{ | |||
font-size: 28rpx; | |||
line-height: 50rpx; | |||
top: 50rpx; | |||
height: 50rpx; | |||
top: 50%; | |||
right: 30rpx; | |||
position: absolute; | |||
transform: translate(0,-50%); | |||
} | |||
.detail{ | |||
width: 32rpx; | |||
@@ -149,33 +168,53 @@ color: transparent; | |||
top: 0; | |||
} | |||
.voucher{ | |||
width: 88%; | |||
margin-left: 6%; | |||
width: 90%; | |||
padding: 0 5%; | |||
background-color: rgb(255, 178, 50); | |||
/* background-color: #cbcbcb; */ | |||
height: 80rpx; | |||
background-color: #cbcbcb; | |||
position: relative; | |||
margin: 24rpx 0; | |||
border-bottom: 2rpx #fff solid; | |||
display: flex; | |||
justify-content: space-between; | |||
} | |||
.textV1,.textV2{ | |||
height: 58rpx; | |||
width: 225rpx; | |||
padding-top: 22rpx; | |||
text-align: center; | |||
line-height: 80rxp; | |||
font-size: 28rpx; | |||
color: white; | |||
color: #fff; | |||
} | |||
.textV1{ | |||
.textV2{ | |||
margin-top: -1rpx; | |||
padding: 0; | |||
/* background-color: rgb(0, 192, 255); */ | |||
border-radius: 10rpx; | |||
width: 221rpx; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
font-size: 36rpx; | |||
border: 4rpx #fff solid; | |||
margin-bottom: 22rpx; | |||
} | |||
/* .textV1{ | |||
position: absolute; | |||
left: 10rpx; | |||
top: 22rpx; | |||
} | |||
.textV2{ | |||
} */ | |||
/* .textV2{ | |||
position: absolute; | |||
top: 22rpx; | |||
right: 80rpx; | |||
} | |||
} */ | |||
.choice{ | |||
width: 80rpx; | |||
height: 80rpx; | |||
position: absolute; | |||
top: 0; | |||
right: 0; | |||
position: relative; | |||
} | |||
.choice image{ | |||
position: absolute; | |||
@@ -184,4 +223,24 @@ color: transparent; | |||
transform: translate(-50%,-50%); | |||
width: 30rpx; | |||
height: 30rpx; | |||
} | |||
} | |||
.buy-view { | |||
background: #fff; | |||
position: relative; | |||
padding-top: 10rpx; | |||
height:98rpx; | |||
bottom: 0rpx; | |||
margin-top: 50rpx; | |||
/* left: 0; | |||
right: 0; */ | |||
} | |||
.buy { | |||
background: #00c0ff; | |||
height: 88rpx; | |||
width: 98%; | |||
margin: 30rpx auto; | |||
color: #fff; | |||
font-size: 36rpx; | |||
line-height: 88rpx; | |||
border-radius: 6rpx; | |||
} |