ソースを参照

edit

tags/2.2.4
shark 6年前
コミット
0377983403
3個のファイルの変更194行の追加85行の削除
  1. +72
    -42
      pages/passCar/passCar.js
  2. +39
    -19
      pages/passCar/passCar.wxml
  3. +83
    -24
      pages/passCar/passCar.wxss

+ 72
- 42
pages/passCar/passCar.js ファイルの表示

@@ -7,13 +7,42 @@ Page({
park: null, park: null,
carList: [], carList: [],
addCar: null, 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 var that = this
that.init(); that.init();
}, },
onShow: function(options) {
onShow: function (options) {
var that = this var that = this
if (options) if (options)
console.log(options) console.log(options)
@@ -30,11 +59,11 @@ Page({
} }
}, },
//我的停车券的显示与消失 //我的停车券的显示与消失
showquan:function(){
showquan: function () {
let that = this; let that = this;
if(that.data.tcq==1){
if (that.data.tcq == 1) {
that.setData({ that.setData({
tcq:2
tcq: 2
}) })
} }
else if (that.data.tcq == 2) { else if (that.data.tcq == 2) {
@@ -43,33 +72,33 @@ Page({
}) })
} }
}, },
jumpToAdd: function() {
jumpToAdd: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/addPark/addPark', url: '/pages/addPark/addPark',
}); });
}, },
jumpToPay: function() {
jumpToPay: function () {
console.log("停车支付去") console.log("停车支付去")
//wx.redirectTo({ //wx.redirectTo({
// url: '/pages/pay/pay', // url: '/pages/pay/pay',
//}) //})
}, },
passb: function() {
passb: function () {
wx.showToast({ wx.showToast({
title: '货物在路上~', title: '货物在路上~',
}) })
}, },
passc: function() {
passc: function () {
wx.showToast({ wx.showToast({
title: '宝宝最可爱~', title: '宝宝最可爱~',
}) })
}, },
orderPay: function() {
orderPay: function () {
wx.redirectTo({ wx.redirectTo({
url: '/pages/pay/pay' url: '/pages/pay/pay'
}); });
}, },
bindCar: function(carNum) {
bindCar: function (carNum) {
var that = this var that = this
// ETCP // ETCP
var etcpData = { var etcpData = {
@@ -82,9 +111,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({
@@ -95,7 +124,7 @@ Page({
title: '提示', title: '提示',
showCancel: false, showCancel: false,
content: "绑车牌成功!", content: "绑车牌成功!",
success: function() {}
success: function () { }
}) })
}) })
.catch(error => { .catch(error => {
@@ -104,23 +133,23 @@ Page({
title: '提示', title: '提示',
showCancel: false, showCancel: false,
content: error.data.message, content: error.data.message,
success: function() {}
success: function () { }
}) })
}) })
}, },
unbindCar: function(carNum) {
unbindCar: function (carNum) {
var that = this var that = this
var postData = var postData =
(app.globalData.parkVendor == 1) ? { (app.globalData.parkVendor == 1) ? {
etcpToken: app.globalData.etcpToken, etcpToken: app.globalData.etcpToken,
carNumber: carNum, carNumber: carNum,
} : { } : {
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()
@@ -128,7 +157,7 @@ Page({
title: '提示', title: '提示',
showCancel: false, showCancel: false,
content: "解绑车牌成功!", content: "解绑车牌成功!",
success: function() {}
success: function () { }
}) })
}) })
.catch(error => { .catch(error => {
@@ -136,32 +165,32 @@ Page({
title: '提示', title: '提示',
showCancel: false, showCancel: false,
content: "解绑车牌失败!", content: "解绑车牌失败!",
success: function() {}
success: function () { }
}) })
}) })
}, },
unbindCarBtn: function(e) {
unbindCarBtn: function (e) {
console.log(e) console.log(e)
var that = this var that = this
var carNum = e.currentTarget.dataset.car var carNum = e.currentTarget.dataset.car
that.unbindCar(carNum) that.unbindCar(carNum)
}, },
getStopFeeItem: function(carItem, i) {
getStopFeeItem: function (carItem, i) {
var that = this var that = this
var postData = var postData =
(app.globalData.parkVendor == 1) ? { (app.globalData.parkVendor == 1) ? {
etcpToken: app.globalData.etcpToken, etcpToken: app.globalData.etcpToken,
carNumber: carItem.carNumber, carNumber: carItem.carNumber,
} : { } : {
carNumber: carItem.carNumber,
outCarId: carItem.outCarId,
}
carNumber: carItem.carNumber,
outCarId: carItem.outCarId,
}
var stopFee = 'carList[' + i + '].stopFee' var stopFee = 'carList[' + i + '].stopFee'
console.log(postData) console.log(postData)
Http.post({ Http.post({
url: config.api.getCarStopFee,
data: postData
})
url: config.api.getCarStopFee,
data: postData
})
.then(res => { .then(res => {
console.log(res) console.log(res)
console.log(stopFee) console.log(stopFee)
@@ -169,24 +198,25 @@ Page({
[stopFee]: res.data [stopFee]: res.data
}) })
}) })
.catch(error =>{
.catch(error => {
console.log(error) console.log(error)
}) })
}, },
getStopFee: function() {
getStopFee: function () {
var that = this var that = this
// carLogin // carLogin
for (var i = 0; i < that.data.carList.length; i++) { for (var i = 0; i < that.data.carList.length; i++) {
that.getStopFeeItem(that.data.carList[i], i) that.getStopFeeItem(that.data.carList[i], i)
} }
// console.log(JSON.stringify(getStopFeeItem))
}, },
initPark: function() {
initPark: function () {
var that = this var that = this
// 车场信息获取 // 车场信息获取
Http.get({ Http.get({
url: config.api.getParkInfo,
data: {}
})
url: config.api.getParkInfo,
data: {}
})
.then(res => { .then(res => {
console.log(res) console.log(res)
that.setData({ that.setData({
@@ -194,7 +224,7 @@ Page({
}) })
}) })
}, },
initUsrCarList: function() {
initUsrCarList: function () {
var that = this var that = this
// 绑定车获取 // 绑定车获取
Http.get({ Http.get({
@@ -207,9 +237,9 @@ Page({
}) })
}) })
}, },
init: function() {
init: function () {
var that = this var that = this
app.parkInitCallback = token => { app.parkInitCallback = token => {
that.initPark() that.initPark()
that.initUsrCarList() that.initUsrCarList()


+ 39
- 19
pages/passCar/passCar.wxml ファイルの表示

@@ -3,29 +3,45 @@
<image src='../../assets/img/timg.jpg'></image> <image src='../../assets/img/timg.jpg'></image>
<view class='numberBox'> <view class='numberBox'>
<view class='titleName'>{{park.addr}}</view> <view class='titleName'>{{park.addr}}</view>
<view class='carLocation price'>停车费:
<label class='locationNumber'>{{park.stopFee}}</label>
</view>
<view class='carLocation'>总车位: <view class='carLocation'>总车位:
<label class='locationNumber'> {{park.number}}个</label> <label class='locationNumber'> {{park.number}}个</label>
</view> </view>
<view class='carLocation'>停车费:
<label class='locationNumber'>{{park.stopFee}}</label>
</view>

</view> </view>
</view> </view>
<view class='borderBox'> <view class='borderBox'>
<view class='borderUp'>我的爱车 <view class='borderUp'>我的爱车
<label class='carNumber'>最多可添加3辆,点选车牌号完成付款</label>
<label class='carNumber'></label>
</view> </view>
<view class='passNumberBox' wx:for='{{carList}}' wx:key='{{index}}'> <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> </view>
<button class='deleteButton' bindtap='unbindCarBtn' data-car='{{item.carNumber}}'>解绑</button> <button class='deleteButton' bindtap='unbindCarBtn' data-car='{{item.carNumber}}'>解绑</button>
</view> </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> </view>
<view class='bottonBox'> <view class='bottonBox'>
@@ -33,24 +49,25 @@
<image src='../../assets/img/quan.png'></image> <image src='../../assets/img/quan.png'></image>
我的停车券 我的停车券
<view class='detail'> <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> </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'> <view class='choice'>
<image src='../../assets/img/choiced.png'></image> <image src='../../assets/img/choiced.png'></image>
</view> </view>
</view>
<view class='textStyle' bindtap='passb'>
</view> -->
<!-- <view class='textStyle' bindtap='passb'>
<image src='../../assets/img/jilu.png'></image> <image src='../../assets/img/jilu.png'></image>
停车记录 停车记录
<view class='detail'> <view class='detail'>
<image src='../../assets/img/right.png'></image> <image src='../../assets/img/right.png'></image>
</view> </view>
</view>
</view> -->
<view class='textStyle' bindtap='passc'> <view class='textStyle' bindtap='passc'>
<image src='../../assets/img/wenti.png'></image> <image src='../../assets/img/wenti.png'></image>
常见问题 常见问题
@@ -59,4 +76,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="buy-view app-border-top">
<button bindtap='orderFunc' class='buy'>立即支付</button>
</view>
</view> </view>

+ 83
- 24
pages/passCar/passCar.wxss ファイルの表示

@@ -14,7 +14,7 @@ page{
.headBox image{ .headBox image{
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
margin-right: 30rpx;
margin:10rpx 30rpx 0 0;
border-radius:16rpx; border-radius:16rpx;
} }
.numberBox{ .numberBox{
@@ -29,6 +29,7 @@ page{
width: 400rpx; width: 400rpx;
word-break:break-all; word-break:break-all;
text-align: justify; text-align: justify;
margin-bottom: 10rpx;
} }
::-webkit-scrollbar{ ::-webkit-scrollbar{
width: 0; width: 0;
@@ -42,6 +43,9 @@ color: transparent;
font-size: 24rpx; font-size: 24rpx;
line-height: 30rpx; line-height: 30rpx;
} }
.price{
font-size: 28rpx;
}
.borderBox{ .borderBox{
width: 750rpx; width: 750rpx;
margin-top: 26rpx; margin-top: 26rpx;
@@ -49,7 +53,7 @@ color: transparent;
} }
.borderUp{ .borderUp{
padding: 50rpx; padding: 50rpx;
width: 750rpx;
width: 650rpx;
height: 50rpx; height: 50rpx;
line-height: 50rpx; line-height: 50rpx;
font-size: 36rpx; font-size: 36rpx;
@@ -89,16 +93,15 @@ color: transparent;
.bottonBox{ .bottonBox{
width: 750rpx; width: 750rpx;
margin-top: 75rpx; margin-top: 75rpx;
background-color: white;
} }
.textStyle{ .textStyle{
background-color: white;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
padding-left: 130rpx; padding-left: 130rpx;
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
letter-spacing: 1rpx; letter-spacing: 1rpx;
margin-top: 30rpx;
border-bottom: 1rpx #f8f8f8 solid; border-bottom: 1rpx #f8f8f8 solid;
position: relative; position: relative;
} }
@@ -112,27 +115,43 @@ color: transparent;
} }
.passNumberBox{ .passNumberBox{
width: 750rpx; width: 750rpx;
height: 150rpx;
position: relative; position: relative;
background-color: white; background-color: white;
border-bottom: 1rpx #f8f8f8 solid; border-bottom: 1rpx #f8f8f8 solid;
display: flex;
justify-content: space-between;
} }
.passNumber{ .passNumber{
width: 400rpx;
width: 450rpx;
height: 150rpx; height: 150rpx;

font-size: 32rpx;
font-weight: 600;
margin-left: 55rpx;
position: relative;
display: flex;
justify-content: space-between;
line-height: 150rpx; 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{ .deleteButton{
font-size: 28rpx; font-size: 28rpx;
line-height: 50rpx; line-height: 50rpx;
top: 50rpx;
height: 50rpx;
top: 50%;
right: 30rpx; right: 30rpx;
position: absolute; position: absolute;
transform: translate(0,-50%);
} }
.detail{ .detail{
width: 32rpx; width: 32rpx;
@@ -149,33 +168,53 @@ color: transparent;
top: 0; top: 0;
} }
.voucher{ .voucher{
width: 88%;
margin-left: 6%;
width: 90%;
padding: 0 5%;
background-color: rgb(255, 178, 50);
/* background-color: #cbcbcb; */
height: 80rpx; height: 80rpx;
background-color: #cbcbcb;
position: relative; position: relative;
margin: 24rpx 0;
border-bottom: 2rpx #fff solid;
display: flex;
justify-content: space-between;
} }
.textV1,.textV2{ .textV1,.textV2{
height: 58rpx;
width: 225rpx;
padding-top: 22rpx;
text-align: center;
line-height: 80rxp; line-height: 80rxp;
font-size: 28rpx; 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; position: absolute;
left: 10rpx; left: 10rpx;
top: 22rpx; top: 22rpx;
}
.textV2{
} */
/* .textV2{
position: absolute; position: absolute;
top: 22rpx; top: 22rpx;
right: 80rpx; right: 80rpx;
}
} */
.choice{ .choice{
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
position: absolute;
top: 0;
right: 0;
position: relative;
} }
.choice image{ .choice image{
position: absolute; position: absolute;
@@ -184,4 +223,24 @@ color: transparent;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
width: 30rpx; width: 30rpx;
height: 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;
}

読み込み中…
キャンセル
保存