Commit 07fee088810805991ecf5c7cef7a157d78b29397
1 parent
44d935db
add 停车缴费支付订单页面 接口联调
Showing
5 changed files
with
213 additions
and
31 deletions
common/common.js
@@ -65,7 +65,7 @@ const publicUnifiedOrder = serverUrl + "/business/h5/pay/weixinpay/publicUnified | @@ -65,7 +65,7 @@ const publicUnifiedOrder = serverUrl + "/business/h5/pay/weixinpay/publicUnified | ||
65 | 65 | ||
66 | // 钱包-根据订单ID获取购买优惠券信息 | 66 | // 钱包-根据订单ID获取购买优惠券信息 |
67 | const couponInfo = serverUrl + "/business/h5/wallet/detail/couponInfo"; | 67 | const couponInfo = serverUrl + "/business/h5/wallet/detail/couponInfo"; |
68 | -// const couponInfo = "http://127.0.0.1:8075/business/h5/wallet/detail/couponInfo"; | 68 | +// 根据车牌号查询车牌号订单支付详情 |
69 | const queryParkingRecordByCarNumbers ="https://pay.jycrtc.com/queryParkOrder/queryParkingRecordPageByCarNumbersForBusiness"; | 69 | const queryParkingRecordByCarNumbers ="https://pay.jycrtc.com/queryParkOrder/queryParkingRecordPageByCarNumbersForBusiness"; |
70 | 70 | ||
71 | 71 |
common/requestServer.js
@@ -52,7 +52,7 @@ export const myRequest = (options) => { | @@ -52,7 +52,7 @@ export const myRequest = (options) => { | ||
52 | uni.hideLoading(); | 52 | uni.hideLoading(); |
53 | uni.showToast({ | 53 | uni.showToast({ |
54 | title: result.message, | 54 | title: result.message, |
55 | - icon: 'none', | 55 | + icon: 'error', |
56 | duration: 2000 | 56 | duration: 2000 |
57 | }); | 57 | }); |
58 | } | 58 | } |
@@ -65,7 +65,7 @@ export const myRequest = (options) => { | @@ -65,7 +65,7 @@ export const myRequest = (options) => { | ||
65 | console.log("请求失败", error); | 65 | console.log("请求失败", error); |
66 | uni.showToast({ | 66 | uni.showToast({ |
67 | title: error.message, | 67 | title: error.message, |
68 | - icon: 'none', | 68 | + icon: 'error', |
69 | duration: 2000 | 69 | duration: 2000 |
70 | }) | 70 | }) |
71 | // 失败数据 | 71 | // 失败数据 |
pages.json
@@ -278,6 +278,15 @@ | @@ -278,6 +278,15 @@ | ||
278 | 278 | ||
279 | } | 279 | } |
280 | 280 | ||
281 | + ,{ | ||
282 | + "path" : "pages/wxpaySuccess/wxpaySuccess", | ||
283 | + "style" : | ||
284 | + { | ||
285 | + "navigationBarTitleText": "", | ||
286 | + "enablePullDownRefresh": false | ||
287 | + } | ||
288 | + | ||
289 | + } | ||
281 | ], | 290 | ], |
282 | "globalStyle": { | 291 | "globalStyle": { |
283 | "navigationBarTextStyle": "black", | 292 | "navigationBarTextStyle": "black", |
pages/parkPay/parkPay.vue
1 | <template> | 1 | <template> |
2 | <view> | 2 | <view> |
3 | 3 | ||
4 | - <view class="order-time"> | 4 | + <!-- <view class="order-time"> |
5 | 剩余支付时间: {{appOrderTimeout}} | 5 | 剩余支付时间: {{appOrderTimeout}} |
6 | - </view> | 6 | + </view> --> |
7 | 7 | ||
8 | <view class="order-title"> | 8 | <view class="order-title"> |
9 | 订单详情 | 9 | 订单详情 |
@@ -13,19 +13,19 @@ | @@ -13,19 +13,19 @@ | ||
13 | </view> | 13 | </view> |
14 | <view class="order-line"></view> | 14 | <view class="order-line"></view> |
15 | <view class="order-info"> | 15 | <view class="order-info"> |
16 | - 停车场:{{myorderinfo.parkName | tranNull}} | 16 | + 停车场:{{parkName | tranNull}} |
17 | </view> | 17 | </view> |
18 | <view class="order-line"></view> | 18 | <view class="order-line"></view> |
19 | <view class="order-info"> | 19 | <view class="order-info"> |
20 | - 进场时间:{{myorderinfo.inparktime | tranNull}} | 20 | + 进场时间:{{parkInTime | tranNull}} |
21 | </view> | 21 | </view> |
22 | <view class="order-line"></view> | 22 | <view class="order-line"></view> |
23 | <view class="order-info"> | 23 | <view class="order-info"> |
24 | - 停车时间:{{myorderinfo.staytime | timeFormatter}} | 24 | + 停车时间:{{staytime | timeFormatter}} |
25 | </view> | 25 | </view> |
26 | <view class="order-line"></view> | 26 | <view class="order-line"></view> |
27 | <view class="order-info"> | 27 | <view class="order-info"> |
28 | - 总计费用:{{myorderinfo.due |toFixed2}}元 | 28 | + 总计费用:{{due |toFixed2}}元 |
29 | </view> | 29 | </view> |
30 | <view class="order-line"></view> | 30 | <view class="order-line"></view> |
31 | 31 | ||
@@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
35 | </view> | 35 | </view> |
36 | <view class="flex-row-justify-end"> | 36 | <view class="flex-row-justify-end"> |
37 | <view class="order-info" style="font-weight:bold;font-size:17px ;"> | 37 | <view class="order-info" style="font-weight:bold;font-size:17px ;"> |
38 | - {{myorderinfo.orderFee | toFixed2}} | 38 | + {{orderFee | toFixed2}} |
39 | </view> | 39 | </view> |
40 | <view class="order-info" style="margin-right: 50upx;margin-left: 0px;"> | 40 | <view class="order-info" style="margin-right: 50upx;margin-left: 0px;"> |
41 | 元 | 41 | 元 |
@@ -70,17 +70,15 @@ | @@ -70,17 +70,15 @@ | ||
70 | data() { | 70 | data() { |
71 | return { | 71 | return { |
72 | businessId: '', | 72 | businessId: '', |
73 | - mycarNumber: '', | ||
74 | - myorderinfo: { | ||
75 | - parkName:'', | ||
76 | - inparktime:'', | ||
77 | - staytime:'', | ||
78 | - due:'', | ||
79 | - orderFee:'', | ||
80 | - }, | ||
81 | - appOrderTimeout:'0', | 73 | + orderId: '', |
74 | + mycarNumber: '', | ||
75 | + parkName: '', | ||
76 | + parkInTime: '', | ||
77 | + staytime: '', | ||
78 | + due: '', | ||
79 | + orderFee: '', | ||
80 | + // appOrderTimeout:'0', | ||
82 | totalFee: '', //应收 | 81 | totalFee: '', //应收 |
83 | - unPayFee: '' //实收 | ||
84 | } | 82 | } |
85 | }, | 83 | }, |
86 | onLoad(params) { | 84 | onLoad(params) { |
@@ -90,7 +88,7 @@ | @@ -90,7 +88,7 @@ | ||
90 | this.mycarNumber = params.carNumber; | 88 | this.mycarNumber = params.carNumber; |
91 | let indexInfo = uni.getStorageSync("indexInfo"); | 89 | let indexInfo = uni.getStorageSync("indexInfo"); |
92 | this.businessId = indexInfo.businessId; | 90 | this.businessId = indexInfo.businessId; |
93 | - console.log(this.mycarNumber,this.businessId) | 91 | + console.log(this.mycarNumber, this.businessId) |
94 | this.getbBillQueryInfo(); | 92 | this.getbBillQueryInfo(); |
95 | }, | 93 | }, |
96 | onShow() { | 94 | onShow() { |
@@ -99,20 +97,44 @@ | @@ -99,20 +97,44 @@ | ||
99 | methods: { | 97 | methods: { |
100 | 98 | ||
101 | payClick() { | 99 | payClick() { |
102 | - var that = this; | ||
103 | - that.goPay_billQueryInfo(); | 100 | + let that = this; |
101 | + let paramsData = { | ||
102 | + payType: '35', | ||
103 | + paySrcType: '101', | ||
104 | + orderId: that.orderId, | ||
105 | + payFee: that.orderFee, | ||
106 | + | ||
107 | + } | ||
108 | + // 获取 接口 | ||
109 | + that.$myRequest({ | ||
110 | + url: that.$common.accountPay, | ||
111 | + method: 'POST', | ||
112 | + data: that.$common.requestSign(paramsData) | ||
113 | + }).then(res => { | ||
114 | + console.log('余额支付:' + res) | ||
115 | + uni.showToast({ | ||
116 | + title: "支付成功", | ||
117 | + icon: 'success', | ||
118 | + duration: 2000 | ||
119 | + }); | ||
120 | + setTimeout(function() { | ||
121 | + uni.navigateTo({ | ||
122 | + url: '../inputCarNumber/inputCarNumber' | ||
123 | + }) | ||
124 | + }, 2000); | ||
125 | + | ||
126 | + }) | ||
104 | }, | 127 | }, |
105 | 128 | ||
106 | getbBillQueryInfo() { | 129 | getbBillQueryInfo() { |
107 | let that = this | 130 | let that = this |
108 | let paramsData = { | 131 | let paramsData = { |
109 | carNumber: that.mycarNumber, | 132 | carNumber: that.mycarNumber, |
110 | - pageNum:'1', | ||
111 | - pageSize:'10', | 133 | + pageNum: '1', |
134 | + pageSize: '10', | ||
112 | businessId: that.businessId, | 135 | businessId: that.businessId, |
113 | - terminalSource: '11', | ||
114 | parkState: '10', | 136 | parkState: '10', |
115 | - | 137 | + |
116 | } | 138 | } |
117 | // 获取 接口 | 139 | // 获取 接口 |
118 | that.$myRequest({ | 140 | that.$myRequest({ |
@@ -120,10 +142,16 @@ | @@ -120,10 +142,16 @@ | ||
120 | method: 'POST', | 142 | method: 'POST', |
121 | data: that.$common.requestSign(paramsData) | 143 | data: that.$common.requestSign(paramsData) |
122 | }).then(res => { | 144 | }).then(res => { |
123 | - console.log(res) | ||
124 | - that.myorderinfo = res.data.dataList[0]; | ||
125 | - that.appOrderTimeout = res.data.dataList[0].appOrderTimeout; | ||
126 | - | 145 | + console.log(res.data.dataList[0]) |
146 | + let data = res.data.dataList[0] | ||
147 | + | ||
148 | + that.parkName = data.parkName; | ||
149 | + that.parkInTime = data.parkInTime; | ||
150 | + that.staytime = data.parkDuration; | ||
151 | + that.due = data.totalFee; | ||
152 | + that.orderFee = data.payFee; | ||
153 | + that.orderId = data.orderId; | ||
154 | + | ||
127 | }) | 155 | }) |
128 | 156 | ||
129 | }, | 157 | }, |
pages/wxpaySuccess/wxpaySuccess.vue
0 → 100644
1 | +<template> | ||
2 | + <view class="page-fill"> | ||
3 | + <view class="successicon"> | ||
4 | + <image class="imageIcon" src="../../static/orderInfo/orderinfo-success.png" mode=""></image> | ||
5 | + </view> | ||
6 | + <text class="paystatus">支付成功</text> | ||
7 | + <text class="payinfo"> | ||
8 | + {{mycarNumber}} ¥{{payMoney|priceFormat()}} | ||
9 | + </text> | ||
10 | + <text class="paytime"> | ||
11 | + 支付时间:{{dateStr}} | ||
12 | + </text> | ||
13 | + <view style="background: #d9d9d9;height:1px;margin-top:7px ;margin-left:15px ;opacity: 0.5; padding:0px;overflow:hidden;"></view> | ||
14 | + | ||
15 | + <text class="payways"> | ||
16 | + 支付方式:{{payWays}} | ||
17 | + </text> | ||
18 | + <view style="background: #d9d9d9;height:1px;margin-top:7px;margin-left:15px ;opacity: 0.5;padding:0px;overflow:hidden;"></view> | ||
19 | + | ||
20 | + <text v-if="appOrderTimeout !=''" class="payways"> | ||
21 | + 温馨提示:{{appOrderTimeout}} | ||
22 | + </text> | ||
23 | + <view v-if="appOrderTimeout !=''" style="background: #d9d9d9;height:1px;margin-top:7px;margin-left:15px ;opacity: 0.5;padding:0px;overflow:hidden;"></view> | ||
24 | + | ||
25 | + <button @click="Click" class="button-sp-area" type="primary" plain="true">完成</button> | ||
26 | + </view> | ||
27 | +</template> | ||
28 | + | ||
29 | +<script> | ||
30 | + export default { | ||
31 | + data() { | ||
32 | + return { | ||
33 | + mycarNumber:'', | ||
34 | + payWays:'', | ||
35 | + payMoney:0, | ||
36 | + appOrderTimeout:'', | ||
37 | + dateStr:'' | ||
38 | + } | ||
39 | + }, | ||
40 | + | ||
41 | + onLoad(params) { | ||
42 | + wx.showShareMenu({ | ||
43 | + withShareTicket: true | ||
44 | + }) | ||
45 | + this.mycarNumber = params.carNumber; | ||
46 | + | ||
47 | + this.payWays = params.payWays; | ||
48 | + this.payMoney = params.payMoney; | ||
49 | + this.appOrderTimeout = params.appOrderTimeout; | ||
50 | + this.getNowDate(); | ||
51 | + }, | ||
52 | + methods: { | ||
53 | + Click() { | ||
54 | + uni.navigateTo({ | ||
55 | + url: '../index/idnex' | ||
56 | + | ||
57 | + }); | ||
58 | + }, | ||
59 | + getNowDate(){ | ||
60 | + var dateTime = new Date(); | ||
61 | + this.dateStr = this.getDateWeek(dateTime); | ||
62 | + | ||
63 | + }, | ||
64 | + | ||
65 | + getDateWeek(now) { | ||
66 | + // var now=new Date(); | ||
67 | + var year = now.getFullYear(); //获取四位数年数 | ||
68 | + var month = now.getMonth() + 1; | ||
69 | + var date = now.getDate(); | ||
70 | + var weeknum = now.getDay(); | ||
71 | + | ||
72 | + var s = year + '-' + this.Appendzero(month) + '-' + this.Appendzero(date); | ||
73 | + return s; | ||
74 | + }, | ||
75 | + Appendzero(obj) { | ||
76 | + if (obj < 10) return '0' + '' + obj; | ||
77 | + else return obj; | ||
78 | + } | ||
79 | + } | ||
80 | + } | ||
81 | +</script> | ||
82 | + | ||
83 | +<style> | ||
84 | + .page-fill { | ||
85 | + width: 100%; | ||
86 | + height: 100%; | ||
87 | + display: flex; | ||
88 | + flex-direction: column; | ||
89 | + } | ||
90 | + | ||
91 | + .imageIcon { | ||
92 | + width: 96px; | ||
93 | + height: 95px; | ||
94 | + margin-top: 42px; | ||
95 | + margin-left: auto; | ||
96 | + margin-right: auto; | ||
97 | + /* margin: 42px auto; */ | ||
98 | + display: flex; | ||
99 | + justify-content: center; | ||
100 | + | ||
101 | + | ||
102 | + } | ||
103 | + | ||
104 | + .paystatus { | ||
105 | + margin-top: 20px; | ||
106 | + font-weight: bold; | ||
107 | + font-size: 18px; | ||
108 | + color: #404040; | ||
109 | + display: flex; | ||
110 | + justify-content: center; | ||
111 | + } | ||
112 | + | ||
113 | + .payinfo { | ||
114 | + margin-top: 3px; | ||
115 | + font-size: 16px; | ||
116 | + color: #404040; | ||
117 | + display: flex; | ||
118 | + justify-content: center; | ||
119 | + } | ||
120 | + | ||
121 | + .paytime { | ||
122 | + margin-top: 51px; | ||
123 | + margin-left: 15px; | ||
124 | + font-size: 14px; | ||
125 | + color: #404040; | ||
126 | + display: flex; | ||
127 | + justify-content: flex-start; | ||
128 | + } | ||
129 | + | ||
130 | + .payways { | ||
131 | + margin-top: 17px; | ||
132 | + margin-left: 15px; | ||
133 | + font-size: 14px; | ||
134 | + color: #404040; | ||
135 | + display: flex; | ||
136 | + justify-content: flex-start; | ||
137 | + } | ||
138 | + | ||
139 | + .button-sp-area { | ||
140 | + margin: 0 auto; | ||
141 | + width: 60%; | ||
142 | + margin-top: 114px; | ||
143 | + | ||
144 | + } | ||
145 | +</style> |