From 58f065d023c4159472b4a15af30e134f60cb6d9a Mon Sep 17 00:00:00 2001 From: shark <717155252@qq.com> Date: Fri, 31 Aug 2018 15:14:07 +0800 Subject: [PATCH] edit --- app.json | 6 +- assets/img/parkCoupon.png | Bin 0 -> 8968 bytes pages/coupon/detail/index.js | 74 +++++- pages/passCar/choiceCar/choiceCar.js | 273 +++++++++++++++++++++ pages/passCar/choiceCar/choiceCar.json | 3 + pages/passCar/choiceCar/choiceCar.wxml | 29 +++ pages/passCar/choiceCar/choiceCar.wxss | 291 +++++++++++++++++++++++ pages/passCar/couponList/couponList.js | 129 ++++++++++ pages/passCar/couponList/couponList.json | 7 + pages/passCar/couponList/couponList.wxml | 43 ++++ pages/passCar/couponList/couponList.wxss | 165 +++++++++++++ pages/passCar/passCar.js | 1 + pages/passCar/passCar.wxml | 3 +- 13 files changed, 1020 insertions(+), 4 deletions(-) create mode 100644 assets/img/parkCoupon.png create mode 100644 pages/passCar/choiceCar/choiceCar.js create mode 100644 pages/passCar/choiceCar/choiceCar.json create mode 100644 pages/passCar/choiceCar/choiceCar.wxml create mode 100644 pages/passCar/choiceCar/choiceCar.wxss create mode 100644 pages/passCar/couponList/couponList.js create mode 100644 pages/passCar/couponList/couponList.json create mode 100644 pages/passCar/couponList/couponList.wxml create mode 100644 pages/passCar/couponList/couponList.wxss diff --git a/app.json b/app.json index 2fdf307..5f383e0 100644 --- a/app.json +++ b/app.json @@ -1,6 +1,7 @@ { "pages": [ "pages/index/index", + "pages/passCar/choiceCar/choiceCar", "pages/bannerdetail/index", "pages/getuserinfo/index", "pages/getphoneInfo/index", @@ -20,7 +21,8 @@ "pages/park/park", "pages/passCar/passCar", "pages/addPark/addPark", - "pages/youhuiquanma/index" + "pages/youhuiquanma/index", + "pages/passCar/couponList/couponList" ], "tabBar": { "color": "#9F9F9F", @@ -57,4 +59,4 @@ "downloadFile": 10000 }, "debug": false -} +} \ No newline at end of file diff --git a/assets/img/parkCoupon.png b/assets/img/parkCoupon.png new file mode 100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Cjr9gO8@mcau-=o>{V*P|IN|0v(4AdyXe>IWEs_kAkte4sIOWCSOGk z86JG^*rp8dEP|3|nyrd%^@p4oPPHMM{BhyG_$GmTdi#JYJmn2Ga*R-9iUNcasU_Y? zd9yMtfkaPG0D9~uZTPq89_anS`+BZf)E=l;U{;!OZ;FDficE!+ap3<0Q>nb1 literal 0 HcmV?d00001 diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 29fd101..01005c3 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -5,6 +5,7 @@ const util = require("../../../utils/util"); Page({ data: { data: {}, + carList: [], couponChannelId: null, couponId: null, orderId: "", @@ -16,6 +17,7 @@ Page({ let that = this; console.log(options.couponChannelId); console.log(options.couponId); + that.init(); /** * 首页banner detail couponlist传过来的值 * iambannercoupon @@ -31,6 +33,7 @@ Page({ }); if (options.flag) { + console.log('111111111111111'+JSON.stringify(options)) this.orderFunc(); } else { @@ -111,6 +114,73 @@ Page({ console.log("payOrderUpdate catch", err); }); }, + /** + * 拉取车牌列表 + */ + init: function () { + var that = this + + app.parkInitCallback = token => { + that.initPark() + that.initUsrCarList() + if (!app.globalData.carLogin) { + // 共同登录 + Http.post({ + url: config.api.carInit, + data: { + phone: app.globalData.phone + } + }).then(res => { + app.globalData.carLogin = true + app.globalData.parkVendor = res.data.vendor + if (res.data.token != "undefined") { + app.globalData.etcpToken = res.data.token + console.log("etcpToken", app.globalData.etcpToken) + } + // 获取 停车费 + that.getStopFee() + }) + } + } + if (app.globalData.token && app.globalData.token != null) { + app.parkInitCallback(app.globalData.token) + } + }, + 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 () { + var that = this + // 车场信息获取 + Http.get({ + url: config.api.getParkInfo, + data: {} + }) + .then(res => { + console.log(res) + that.setData({ + park: res.data, + }) + }) + }, + initUsrCarList: function () { + var that = this + // 绑定车获取 + Http.get({ + url: config.api.getUserCarList, + data: {} + }).then(res => { + console.log('>>>>>>>>>>>>>>>>>1' + JSON.stringify(res)); + that.setData({ + carList: res.data + }) + }) + }, /** * 发起支付 */ @@ -119,9 +189,11 @@ Page({ wx.showLoading({ title: "加载中..." }); - if (that.data.type == 5) { + if (that.data.data.type == 5) { + this.initUsrCarList() // 领取 5.停车券 // TODO 选取用户下的车牌 + console.log(11111111111111111111111111111111) } else { Http.post({ url: config.api.checkPhoneStatus, diff --git a/pages/passCar/choiceCar/choiceCar.js b/pages/passCar/choiceCar/choiceCar.js new file mode 100644 index 0000000..925e5fa --- /dev/null +++ b/pages/passCar/choiceCar/choiceCar.js @@ -0,0 +1,273 @@ +// pages/passCar/passCar.js +let config = require('../../../config/config.js') +let Http = require('../../../utils/HttpBasics') +const app = getApp(); +Page({ + data: { + park: null, + carList: [], + addCar: null, + tcq: 2 + }, + // 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) { + var that = this + if (options) + console.log(options) + if (that.data.addCar) { + console.log(JSON.stringify(that.data.addCar)) + // 绑车牌 + if (app.globalData.carLogin) { + that.bindCar(that.data.addCar) + } else { + that.bindCar(that.data.addCar) + } + that.setData({ + addCar: null + }) + } + }, + //我的停车券的显示与消失 + showquan: function () { + let that = this; + if (that.data.tcq == 1) { + that.setData({ + tcq: 2 + }) + } + else if (that.data.tcq == 2) { + that.setData({ + tcq: 1 + }) + } + }, + jumpToAdd: function () { + wx.navigateTo({ + url: '/pages/addPark/addPark', + }); + }, + jumpToPay: function () { + console.log("停车支付去") + //wx.redirectTo({ + // url: '/pages/pay/pay', + //}) + }, + passb: function () { + wx.showToast({ + title: '货物在路上~', + }) + }, + passc: function () { + wx.showToast({ + title: '宝宝最可爱~', + }) + }, + orderPay: function () { + wx.redirectTo({ + url: '/pages/pay/pay' + }); + }, + bindCar: function (carNum) { + var that = this + // ETCP + var etcpData = { + etcpToken: app.globalData.etcpToken, + carNumber: carNum, + } + // 停简单 + var tjdData = { + carNumber: carNum, + } + var postData = (app.globalData.parkVendor == 1) ? etcpData : tjdData + Http.post({ + url: config.api.bindCar, + data: postData, + }) + .then(res => { + console.log(res) + that.setData({ + addCar: null + }) + that.initUsrCarList() + wx.showModal({ + title: '提示', + showCancel: false, + content: "绑车牌成功!", + success: function () { } + }) + }) + .catch(error => { + console.log(error) + wx.showModal({ + title: '提示', + showCancel: false, + content: error.data.message, + success: function () { } + }) + }) + }, + unbindCar: function (carNum) { + var that = this + var postData = + (app.globalData.parkVendor == 1) ? { + etcpToken: app.globalData.etcpToken, + carNumber: carNum, + } : { + carNumber: carNum, + } + Http.post({ + url: config.api.unbindCar, + data: postData, + }) + .then(res => { + console.log(res) + that.initUsrCarList() + wx.showModal({ + title: '提示', + showCancel: false, + content: "解绑车牌成功!", + success: function () { } + }) + }) + .catch(error => { + wx.showModal({ + title: '提示', + showCancel: false, + content: "解绑车牌失败!", + success: function () { } + }) + }) + }, + unbindCarBtn: function (e) { + console.log(e) + var that = this + var carNum = e.currentTarget.dataset.car + that.unbindCar(carNum) + }, + 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, + } + var stopFee = 'carList[' + i + '].stopFee' + var extraData = 'carList[' + i + '].extraData' + var extraDataStr = { params: { CarNumber: carItem.carNumber } } + console.log(postData) + Http.post({ + url: config.api.getCarStopFee, + data: postData + }) + .then(res => { + console.log(res) + console.log(stopFee) + that.setData({ + [stopFee]: res.data, + [extraData]: extraDataStr + }) + }) + .catch(error => { + console.log(error) + }) + }, + 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 () { + var that = this + // 车场信息获取 + Http.get({ + url: config.api.getParkInfo, + data: {} + }) + .then(res => { + console.log(res) + that.setData({ + park: res.data, + }) + }) + }, + initUsrCarList: function () { + var that = this + // 绑定车获取 + Http.get({ + url: config.api.getUserCarList, + data: {} + }).then(res => { + console.log(res); + that.setData({ + carList: res.data + }) + }) + }, + init: function () { + var that = this + + app.parkInitCallback = token => { + that.initPark() + that.initUsrCarList() + if (!app.globalData.carLogin) { + // 共同登录 + Http.post({ + url: config.api.carInit, + data: { + phone: app.globalData.phone + } + }).then(res => { + app.globalData.carLogin = true + app.globalData.parkVendor = res.data.vendor + if (res.data.token != "undefined") { + app.globalData.etcpToken = res.data.token + console.log("etcpToken", app.globalData.etcpToken) + } + // 获取 停车费 + that.getStopFee() + }) + } + } + if (app.globalData.token && app.globalData.token != null) { + app.parkInitCallback(app.globalData.token) + } + } +}) \ No newline at end of file diff --git a/pages/passCar/choiceCar/choiceCar.json b/pages/passCar/choiceCar/choiceCar.json new file mode 100644 index 0000000..be67e26 --- /dev/null +++ b/pages/passCar/choiceCar/choiceCar.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "券绑车牌" +} \ No newline at end of file diff --git a/pages/passCar/choiceCar/choiceCar.wxml b/pages/passCar/choiceCar/choiceCar.wxml new file mode 100644 index 0000000..390c226 --- /dev/null +++ b/pages/passCar/choiceCar/choiceCar.wxml @@ -0,0 +1,29 @@ + + + 我的爱车 + + + + + + {{item.carNumber}} + + + + + + {{'待支付金额:¥'+item.remainingFee}} + + + + + + + + + + + +添加爱车 + + + \ No newline at end of file diff --git a/pages/passCar/choiceCar/choiceCar.wxss b/pages/passCar/choiceCar/choiceCar.wxss new file mode 100644 index 0000000..bfb628f --- /dev/null +++ b/pages/passCar/choiceCar/choiceCar.wxss @@ -0,0 +1,291 @@ +/**passCar.wxss**/ +page{ + background-color: #f8f8f8; +} +.headBox{ + margin-top: 13rpx; + width: 750rpx; + height: 210rpx; + box-sizing: border-box; + padding: 30rpx 40rpx; + display: flex; + background-color: white +} +.headBox image{ + width: 150rpx; + height: 150rpx; + margin:10rpx 30rpx 0 0; + border-radius:16rpx; +} +.numberBox{ + width: 400rpx; + height: 150rpx +} +.titleName{ + line-height: 60rpx; + height:60rpx; + color: #666; + font-size: 32rpx; + width: 400rpx; + word-break:break-all; + text-align: justify; + margin-bottom: 10rpx; +} +::-webkit-scrollbar{ +width: 0; +height: 0; +color: transparent; +} +.carLocation,.locationNumber{ + width: 400rpx; + height: 40rpx; + color: #666; + font-size: 24rpx; + line-height: 30rpx; +} +.price{ + font-size: 28rpx; +} +.borderBox{ + width: 750rpx; + margin-top: 26rpx; + +} +.borderUp{ + padding: 50rpx; + width: 650rpx; + height: 50rpx; + line-height: 50rpx; + font-size: 36rpx; + color: #333; + border-bottom: 1rpx #f8f8f8 solid; + background-color: white; + +} +.carNumber{ + padding: 50rpx; + height: 50rpx; + line-height: 50rpx; + font-size: 28rpx; + color: #cbcbcb; + background-color: white; +} +.addBox{ + width: 750rpx; + height: 220rpx; + position: relative; + background-color: white; +} +.add{ + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%); + font-size: 34rpx; + color: #666; + border:2px dashed #eee; + padding: 30rpx 50rpx; + border-radius:16rpx; +} +.add text{ + font-size: 40rpx; +} +.bottonBox{ + width: 750rpx; + margin-top: 75rpx; +} +.textStyle{ + background-color: white; + height: 90rpx; + line-height: 90rpx; + padding-left: 130rpx; + color: #333; + font-size: 28rpx; + letter-spacing: 1rpx; + border-bottom: 1rpx #f8f8f8 solid; + position: relative; +} +.textStyle image{ + width: 50rpx; + height: 50rpx; + top: 20rpx; + left: 50rpx; + position: absolute; + +} +.passNumberBox{ + width: 750rpx; + position: relative; + background-color: white; + border-bottom: 1rpx #f8f8f8 solid ; +} +.passNumber{ + width: 400rpx; + height: 150rpx; + + font-size: 32rpx; + font-weight: 600; + line-height: 150rpx; + left: 55rpx; + position: absolute; +} +.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; + height: 50rpx; + top: 50%; + right: 30rpx; + position: absolute; + transform: translate(0,-50%); +} +.detail{ + width: 32rpx; + height: 32rpx; + right: 50rpx; + top: 32rpx; + position: absolute; +} +.detail image{ + width: 32rpx; + height: 32rpx; + position: absolute; + left: 0; + top: 0; +} +.voucher{ + width: 90%; + padding: 0 5%; + background-color: rgb(255, 178, 50); + /* background-color: #cbcbcb; */ + height: 80rpx; + 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: #fff; +} +.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{ + position: absolute; + top: 22rpx; + right: 80rpx; +} */ +.choice{ + width: 80rpx; + height: 80rpx; + position: relative; +} +.choice image{ + position: absolute; + left: 50%; + top: 50%; + 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; +} +.borderBox{ + width: 750rpx; + margin-top: 26rpx; + +} +.orderBox { + width: 100%; + height: 100rpx; + border-top: 1rpx #f8f8f8 solid; + position: relative; + display: flex; +} + +.passUp { + width: 100%; + height: 150rpx; + position: relative; +} +.priceBox{ + width: 500rpx; +} +.priceBox text{ + margin-top: 35rpx; + color: #333; + font-size: 24rpx; + margin-left: 50rpx; + display: block; +} +.payBox{ + width: 250rpxpx; +} +.payBox button{ + width: 230rpx; + border:0; + font-size: 32rpx; + margin-top: 13rpx; + margin-right: 20rpx; + background-color: lightgreen; + color: white; +} +input{ + outline:none; + border:none; + list-style: none; +} +button::after{ +border:none; +} diff --git a/pages/passCar/couponList/couponList.js b/pages/passCar/couponList/couponList.js new file mode 100644 index 0000000..f08075e --- /dev/null +++ b/pages/passCar/couponList/couponList.js @@ -0,0 +1,129 @@ +const format = require("../../../utils/util.js"); +const config = require("../../../config/config.js"); +const app = getApp(); +const Http = require("../../../utils/HttpBasics"); +Page({ + data: { + tabs: [ + { + key: 0, + name: "未使用" + }, + { + key: 1, + name: "已使用" + }, + { + key: 2, + name: "已过期" + }, + { + key: 3, + name: "已退款" + } + ], + list: [], + current: "0", + current_scroll: "0", + page: 1, + allow_load: true + }, + onLoad() { + this.getList(0, 0); + }, + + //点击跳转到券详情页面 + gotouse: function (e) { + console.log(e.currentTarget.dataset.quancode); + console.log("点击跳转到券详情"); + wx.navigateTo({ + url: `/pages/couponorder/detail/index?quancode=${ + e.currentTarget.dataset.quancode + }`, + success: function (res) { + // success + console.log("点击跳转到券详情页面"); + }, + fail: function () { + // fail + }, + complete: function () { + // complete + } + }); + }, + getList(key, pageNum) { + var that = this; + console.log(key); + console.log(pageNum); + if (that.data.allow_load) { + wx.showLoading({ + title: "加载中" + }); + Http.get({ + url: config.api.couponOrderList + "?type=5", + data: { + pageNum: pageNum, + pageSize: 8, + couponOrderStatus: key + } + }).then(res => { + console.log(res); + res.data.list.map(file => { + file.expiredTime = format.formatTime( + file.expiredTime, + "yyyy-MM-dddd hh:mm:ss" + ); + }); + console.log("姐姐的订单列表"); + setTimeout(function () { + wx.hideLoading(); + }, 1200); + if (pageNum >= res.data.pages) { + that.setData({ + allow_load: false + }); + } + /** + * 先赋值后渲染页面 + * concat 不会改变原数组值 + * push 会改变原数组值,但不会一条一条插入,而是整个数组插入 + */ + that.data.list = that.data.list.concat(res.data.list); + that.setData({ + list: that.data.list + }); + }); + } else { + console.log("加载完成allow_load设置成false"); + } + }, + handleChange({ detail }) { + console.log(detail); + this.setData({ + current: detail.key + }); + }, + handleChangeScroll({ detail }) { + this.setData({ + list: [], + allow_load: true, + current_scroll: detail.key + }); + this.getList(detail.key, 1); + this.setData({ + current_scroll: detail.key + }); + }, + onReachBottom: function () { + var that = this; + console.log(that.data.page); + that.data.page++; + console.log(that.data.page); + that.setData({ + page: that.data.page + }); + console.info("after++ " + that.data.page); + that.getList(that.data.current_scroll, that.data.page); + } +}); diff --git a/pages/passCar/couponList/couponList.json b/pages/passCar/couponList/couponList.json new file mode 100644 index 0000000..276ffad --- /dev/null +++ b/pages/passCar/couponList/couponList.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "i-tab": "../../../dist/tab/index", + "i-tabs": "../../../dist/tabs/index" + }, + "navigationBarTitleText": "我的优惠劵" +} \ No newline at end of file diff --git a/pages/passCar/couponList/couponList.wxml b/pages/passCar/couponList/couponList.wxml new file mode 100644 index 0000000..9990206 --- /dev/null +++ b/pages/passCar/couponList/couponList.wxml @@ -0,0 +1,43 @@ + + + + + + + + + 暂无优惠券可用 + + + + + + + + + + + {{item.title}} + + + 有效期至: + {{item.expiredTime}} + + 立即使用 + 查看 + + + + + + 2小时免费停车券 + 京A88888 + 2018-08-30 + + 2018-09-30 + 朝阳大悦城 + + + \ No newline at end of file diff --git a/pages/passCar/couponList/couponList.wxss b/pages/passCar/couponList/couponList.wxss new file mode 100644 index 0000000..6ff18eb --- /dev/null +++ b/pages/passCar/couponList/couponList.wxss @@ -0,0 +1,165 @@ +.market { + width: 100%; + height: 100%; +} + +.tabs { + width: 100% !important; + height: 88rpx; + text-align: center; +} + +.i-tab { + width: 25% !important; + display: inline-block; +} + +.section { + margin-top: 2%; +} +.section:nth-of-type(1) { + margin-top: 30rpx; +} + +.detail_msg { + width: 92%; + height: 202rpx !important; + background: #fff; + display: flex; + padding: 0 4%; + margin-top: 2%; + border-bottom: 1px solid #ededed; +} + +.logo { + width: 348rpx; + height: 184rpx; +} + +.logo image { + width: 100%; + height: 100%; + border-radius: 15rpx; +} + +.info view:nth-child(1) { + display: flex; + justify-content: space-between; + padding: 0 4%; +} + +.info { + width: 100%; +} + +.info view:nth-child(1) text { + font-size: 30rpx; + margin-top: 10rpx; + color: #666; +} + +.info view:nth-child(2) { + color: #ff3434; + font-size: 24rpx; + padding-left: 4%; + margin-top: 1%; +} + +.info view:nth-child(3) { + margin-left: 20rpx; +} + +.btns { + width: 200rpx; + height: 60rpx; + line-height: 60rpx; + text-align: center; + background: #00c0ff; + color: #fff; + float: right; + border-radius: 15rpx; + font-size: 28rpx; + margin-top: 20rpx; +} + +.txt1 { + font-size: 22rpx; + color: #999; +} + +.txt2 { + font-size: 22rpx; + color: #f96563; +} + +.nocoupon image{ + width: 203rpx; + display: block; + margin: 200rpx auto 0; +} +.nocoupon text{ + display: block; + text-align: center; + font-size:30rpx; + color: #00C0FF; +} +.nocoupon button{ + background: #00C0FF; + color: #fff; + font-style: 30rpx; + width: 70%; + margin: 30rpx auto 0; +} +.imageBox,imageBox image{ + width: 100%; + height: 250rpx; + margin-top: 30rpx; + position: relative; +} +image{ + width: 100%; + height: 100%; +} +.text1{ + color: white; + font-size: 28rpx; + position: absolute; + top: 32rpx; + left: 50rpx; +} +.text2{ + color: white; + font-size: 40rpx; + position: absolute; + top: 90rpx; + left: 50rpx; +} +.text3{ + color: white; + font-size: 32rpx; + position: absolute; + top: 60rpx; + right: 50rpx; +} +.text4{ + color: white; + font-size: 32rpx; + position: absolute; + top: 150rpx; + right: 50rpx; +} +.text5{ + color: white; + font-size: 28rpx; + position: absolute; + bottom: 32rpx; + left: 50rpx; +} +.text6{ + color: white; + font-size: 24rpx; + position: absolute; + top: 110rpx; + right: 120rpx; + font-weight: 600; +} \ No newline at end of file diff --git a/pages/passCar/passCar.js b/pages/passCar/passCar.js index 1b87fd0..ceee941 100644 --- a/pages/passCar/passCar.js +++ b/pages/passCar/passCar.js @@ -47,6 +47,7 @@ Page({ if (options) console.log(options) if (that.data.addCar) { + console.log(JSON.stringify(that.data.addCar)) // 绑车牌 if (app.globalData.carLogin) { that.bindCar(that.data.addCar) diff --git a/pages/passCar/passCar.wxml b/pages/passCar/passCar.wxml index 6bca2a0..a039011 100644 --- a/pages/passCar/passCar.wxml +++ b/pages/passCar/passCar.wxml @@ -9,7 +9,6 @@ 总车位: - @@ -60,6 +59,7 @@ + 我的停车券 @@ -68,6 +68,7 @@ +