diff --git a/pages/passCar/passCar.js b/pages/passCar/passCar.js index fc196a7..eeaca6f 100644 --- a/pages/passCar/passCar.js +++ b/pages/passCar/passCar.js @@ -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() diff --git a/pages/passCar/passCar.wxml b/pages/passCar/passCar.wxml index b9ca435..abf5105 100644 --- a/pages/passCar/passCar.wxml +++ b/pages/passCar/passCar.wxml @@ -3,29 +3,45 @@ {{park.addr}} + 停车费: + + 总车位: - 停车费: - - + 我的爱车 - + - - {{item.carNumber}} - 总费用:{{item.stopFee.parkingFee}} - 已缴:{{item.stopFee.paidFee}} - 优免金额{{item.stopFee.discountAmount}} + + {{item.carNumber}} + + 待缴金额:¥500 + + + + + + + 蒙B35412 - - +添加爱车 + + + 沪B88888 + + + + + + + +添加爱车 @@ -33,24 +49,25 @@ 我的停车券 - - + + - - 2小时免费停车券 - ¥10.00元 + + 常见问题 @@ -59,4 +76,7 @@ + + + \ No newline at end of file diff --git a/pages/passCar/passCar.wxss b/pages/passCar/passCar.wxss index 09d747d..0261b61 100644 --- a/pages/passCar/passCar.wxss +++ b/pages/passCar/passCar.wxss @@ -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; -} \ No newline at end of file +} +.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; +}