Commit ed34839c109558778885bdfdc491fbcfaeb13743

Authored by chenbiao
1 parent e5b0f026

add 停车缴费 支付页面 接口联调

common/common.js
@@ -53,7 +53,7 @@ const publicUnifiedOrder = serverUrl + "/business/h5/pay/weixinpay/publicUnified @@ -53,7 +53,7 @@ const publicUnifiedOrder = serverUrl + "/business/h5/pay/weixinpay/publicUnified
53 // 钱包-根据订单ID获取购买优惠券信息 53 // 钱包-根据订单ID获取购买优惠券信息
54 const couponInfo = serverUrl + "/business/h5/wallet/detail/couponInfo"; 54 const couponInfo = serverUrl + "/business/h5/wallet/detail/couponInfo";
55 // const couponInfo = "http://127.0.0.1:8075/business/h5/wallet/detail/couponInfo"; 55 // const couponInfo = "http://127.0.0.1:8075/business/h5/wallet/detail/couponInfo";
56 - 56 +const queryParkingRecordByCarNumbers ="https://pay.jycrtc.com/queryParkOrder/queryParkingRecordPageByCarNumbersForBusiness";
57 57
58 58
59 59
@@ -226,5 +226,5 @@ export default { @@ -226,5 +226,5 @@ export default {
226 walletDetailsPage, 226 walletDetailsPage,
227 publicUnifiedOrder, 227 publicUnifiedOrder,
228 couponInfo, 228 couponInfo,
229 - 229 + queryParkingRecordByCarNumbers,
230 } 230 }
common/filters.js
@@ -68,14 +68,35 @@ const toThousands = (num) => { @@ -68,14 +68,35 @@ const toThousands = (num) => {
68 return result.join(''); 68 return result.join('');
69 } 69 }
70 70
71 -// 根据身份证号码判断男女  
72 -const sexFilter = value => {  
73 - if (!value) {  
74 - return ''  
75 - } else {  
76 - let data = value.substr(16, 1) % 2 === 1 ? '男' : '女'  
77 - return data 71 +// 1天1小时1分钟1秒
  72 +const timeFormatter = value => {
  73 + let time = '';
  74 + if (null != value && "" != value) {
  75 + let timer = parseInt(value);
  76 + if (timer == 0) {
  77 + return '0秒';
  78 + }
  79 + let days = parseInt(timer / (60 * 60 * 24));
  80 + let hours = parseInt((timer % (60 * 60 * 24)) / (60 * 60));
  81 + let minutes = parseInt((timer % (60 * 60)) / (60))
  82 + let seconds = parseInt(timer % (60));
  83 + if (days > 0) {
  84 + time = time + days +'天';
  85 + }
  86 + if (hours > 0) {
  87 + time = time + hours +'小时';
  88 + }
  89 + if (minutes > 0) {
  90 + time = time + minutes +'分钟';
  91 + }
  92 + if (seconds > 0) {
  93 + time = time + seconds +'秒';
  94 + }
  95 + return time;
  96 + }else{
  97 + return '-'
78 } 98 }
  99 +
79 } 100 }
80 101
81 // 商户卡券类型 102 // 商户卡券类型
@@ -111,6 +132,6 @@ export default { @@ -111,6 +132,6 @@ export default {
111 toFixed2, 132 toFixed2,
112 ortherToFixed, 133 ortherToFixed,
113 toThousands, 134 toThousands,
114 - sexFilter, 135 + timeFormatter,
115 cardTypeFormate 136 cardTypeFormate
116 } 137 }
pages.json
@@ -13,6 +13,13 @@ @@ -13,6 +13,13 @@
13 }, 13 },
14 "pages": [ 14 "pages": [
15 // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages 15 // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
  16 +
  17 + {
  18 + "path": "pages/index/index",
  19 + "style": {
  20 + "navigationBarTitleText": "商户管理"
  21 + }
  22 + },
16 { 23 {
17 "path": "pages/businessCard/provideCard", 24 "path": "pages/businessCard/provideCard",
18 "style": { 25 "style": {
@@ -43,12 +50,6 @@ @@ -43,12 +50,6 @@
43 }, 50 },
44 51
45 { 52 {
46 - "path": "pages/index/index",  
47 - "style": {  
48 - "navigationBarTitleText": "商户管理"  
49 - }  
50 - },  
51 - {  
52 "path": "pages/parkRecordList/parkRecordList", 53 "path": "pages/parkRecordList/parkRecordList",
53 "style": { 54 "style": {
54 "navigationBarTitleText": "停车记录" 55 "navigationBarTitleText": "停车记录"
@@ -265,7 +266,8 @@ @@ -265,7 +266,8 @@
265 } 266 }
266 267
267 } 268 }
268 - ], 269 +
  270 + ],
269 "globalStyle": { 271 "globalStyle": {
270 "navigationBarTextStyle": "black", 272 "navigationBarTextStyle": "black",
271 "navigationBarTitleText": "江阴慧停车", 273 "navigationBarTitleText": "江阴慧停车",
pages/index/index.vue
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 <view class="uni-padding-wrap uni-common-mt"> 42 <view class="uni-padding-wrap uni-common-mt">
43 43
44 <view class="uni-flex uni-row"> 44 <view class="uni-flex uni-row">
45 - <view class="flex-item"> 45 + <view class="flex-item" @click="toCarNumberPage">
46 <view class=""> 46 <view class="">
47 <image src="../../static/me/me-parkrecord.png" class="index-icon"></image> 47 <image src="../../static/me/me-parkrecord.png" class="index-icon"></image>
48 </view> 48 </view>
@@ -199,8 +199,12 @@ @@ -199,8 +199,12 @@
199 199
200 }); 200 });
201 }, 201 },
202 -  
203 - 202 + toCarNumberPage() {
  203 + uni.navigateTo({
  204 + url: '../inputCarNumber/inputCarNumber'
  205 +
  206 + });
  207 + },
204 208
205 } 209 }
206 } 210 }
pages/inputCarNumber/inputCarNumber.vue
@@ -242,13 +242,13 @@ export default { @@ -242,13 +242,13 @@ export default {
242 } 242 }
243 if(err) return uni.showToast({ 243 if(err) return uni.showToast({
244 title:'请输入完整的车牌号码', 244 title:'请输入完整的车牌号码',
245 - icon:'none' 245 + icon:'error'
246 }) 246 })
247 247
248 console.log(plate) 248 console.log(plate)
249 249
250 uni.navigateTo({ 250 uni.navigateTo({
251 - url: '../parkRecord/parkRecord?carNumber='+plate 251 + url: '../parkPay/parkPay?carNumber='+plate
252 }) 252 })
253 }, 253 },
254 changeKeyboardHeight(){ 254 changeKeyboardHeight(){
pages/parkPay/parkPay.vue
1 <template> 1 <template>
2 - <view>  
3 -  
4 - <view class="order-time">  
5 - 剩余支付时间: 00:02:35  
6 - </view>  
7 -  
8 - <view class="order-title">  
9 - 订单详情  
10 - </view>  
11 - <view class="order-info">  
12 - 车牌号:{{mycarNumber}}  
13 - </view>  
14 - <view class="order-line"></view>  
15 - <view class="order-info">  
16 - 停车场:{{myorderinfo.parkName}}  
17 - </view>  
18 - <view class="order-line"></view>  
19 - <view class="order-info">  
20 - 进场时间:{{myorderinfo.inparktime}}  
21 - </view>  
22 - <view class="order-line"></view>  
23 - <view class="order-info">  
24 - 停车时间:{{myorderinfo.staytime|timeFormat()}}  
25 - </view>  
26 - <view class="order-line"></view>  
27 - <view class="order-info">  
28 - 总计费用:{{myorderinfo.due|priceFormat()}}元  
29 - </view>  
30 - <!--<view class="order-line"></view>-->  
31 - <!--<view class="order-info">-->  
32 - <!--已付费用:{{myorderinfo.paid|priceFormat()}}元-->  
33 - <!--</view>-->  
34 - <!--<view class="order-line"></view>-->  
35 - <!--<view class="order-info">-->  
36 - <!--优惠费用:{{myorderinfo.discountFee}}-->  
37 - <!--</view>-->  
38 -  
39 - <view class="order-line-bold" v-show="true"></view>  
40 - <view class="flex-row-justify-between" @click="DiscountClick" v-show="true">  
41 - <view class="order-info">  
42 - 优惠  
43 - </view>  
44 - <view class="flex-row-justify-end">  
45 - <view v-if="selCoupon.couponType== undefined" class="order-info"  
46 - style="color: red;margin-right: 10upx;">  
47 - 未选择优惠  
48 - </view>  
49 - <view v-else-if="selCoupon.couponType == 1 && selCoupon.couponsType != 3" class="order-info"  
50 - style="color: red;margin-right: 10upx;">  
51 - -{{selCoupon.discValueAllName}}  
52 - </view>  
53 - <view v-else class="order-info" style="color: red;margin-right: 10upx;">  
54 - {{selCoupon.fullCutValueAllName}}  
55 - </view>  
56 - <view class="order-discount">  
57 - >  
58 - </view>  
59 - </view>  
60 -  
61 - </view>  
62 -  
63 - <view class="order-line"></view>  
64 - <view class="flex-row-justify-between">  
65 - <view class="order-info">  
66 - 支付金额  
67 - </view>  
68 - <view class="flex-row-justify-end">  
69 - <view class="order-info" style="font-weight:bold;font-size:17px ;">  
70 - {{myorderinfo.orderFee|priceFormat()}}  
71 - </view>  
72 - <view class="order-info" style="margin-right: 50upx;margin-left: 0px;">  
73 - 元  
74 - </view>  
75 - </view>  
76 - </view>  
77 -  
78 - <view class="order-line-bold"></view>  
79 -  
80 -  
81 - <view class="order-title">  
82 - 支付方法  
83 - </view>  
84 - <view class="order-line"></view>  
85 -  
86 - <view class="orderwaysview" @click="selPaywaysClick(0)">  
87 - <image src="../../static/orderInfo/orderinfo-wechat.png" class="orderways"></image>  
88 - <view class="order-info" style="margin-left: 8px;">  
89 - 商户余额  
90 - </view>  
91 -  
92 - <image v-show="payWaysSel != 0" src="../../static/orderInfo/orderinfo-unsel.png"  
93 - class="orderwaysSel"></image>  
94 - <image v-show="payWaysSel == 0" src="../../static/orderInfo/orderinfo-sel.png" class="orderwaysSel"></image>  
95 -  
96 -  
97 - </view>  
98 -  
99 - <!-- <uni-list>  
100 - <uni-list-item title="列表文字" />  
101 - <uni-list-item title="列表文字" rightText="右侧文字" />  
102 - <uni-list-item title="列表文字" note="列表描述信息" rightText="右侧文字" />  
103 - </uni-list> -->  
104 -  
105 -  
106 -  
107 -  
108 -  
109 - <!--<view class="order-title">-->  
110 - <!--选择支付方法-->  
111 - <!--</view>-->  
112 - <!--<view class="order-line"></view>-->  
113 -  
114 - <!--<view class="orderwaysview" @click="selPaywaysClick(0)">-->  
115 - <!--<image src="../../static/orderInfo/orderinfo-wechat.png" class="orderways"></image>-->  
116 - <!--<view class="order-info" style="margin-left: 8px;">-->  
117 - <!--微信支付-->  
118 - <!--</view>-->  
119 -  
120 - <!--<image v-show="payWaysSel != 0" src="../../static/orderInfo/orderinfo-unsel.png"-->  
121 - <!--class="orderwaysSel"></image>-->  
122 - <!--<image v-show="payWaysSel == 0" src="../../static/orderInfo/orderinfo-sel.png" class="orderwaysSel"></image>-->  
123 -  
124 -  
125 - <!--</view>-->  
126 -  
127 - <!--<view class="order-line"></view>-->  
128 -  
129 - <!--<view class="orderwaysview" @click="selPaywaysClick(1)">-->  
130 - <!--<image src="../../static/orderInfo/orderinfo-money.png" class="orderways"></image>-->  
131 - <!--<view class="order-info" style="margin-left: 8px;">-->  
132 - <!--余额支付-->  
133 - <!--</view>-->  
134 - <!--<image v-show="payWaysSel != 1" src="../../static/orderInfo/orderinfo-unsel.png"-->  
135 - <!--class="orderwaysSel"></image>-->  
136 - <!--<image v-show="payWaysSel == 1" src="../../static/orderInfo/orderinfo-sel.png" class="orderwaysSel"></image>-->  
137 -  
138 - <!--</view>-->  
139 -  
140 - <view class="order-line"></view>  
141 - <button @click="payClick" class="button-sp-area" type="primary" plain="true">确认支付</button>  
142 - <view v-show="alertFlag">  
143 - <div class="alertFlag">请先登录</div>  
144 - </view>  
145 - </view> 2 + <view>
  3 +
  4 + <view class="order-time">
  5 + 剩余支付时间: {{appOrderTimeout}}
  6 + </view>
  7 +
  8 + <view class="order-title">
  9 + 订单详情
  10 + </view>
  11 + <view class="order-info">
  12 + 车牌号:{{mycarNumber | tranNull}}
  13 + </view>
  14 + <view class="order-line"></view>
  15 + <view class="order-info">
  16 + 停车场:{{myorderinfo.parkName | tranNull}}
  17 + </view>
  18 + <view class="order-line"></view>
  19 + <view class="order-info">
  20 + 进场时间:{{myorderinfo.inparktime | tranNull}}
  21 + </view>
  22 + <view class="order-line"></view>
  23 + <view class="order-info">
  24 + 停车时间:{{myorderinfo.staytime | timeFormatter}}
  25 + </view>
  26 + <view class="order-line"></view>
  27 + <view class="order-info">
  28 + 总计费用:{{myorderinfo.due |toFixed2}}元
  29 + </view>
  30 + <view class="order-line"></view>
  31 +
  32 + <view class="flex-row-justify-between">
  33 + <view class="order-info">
  34 + 支付金额
  35 + </view>
  36 + <view class="flex-row-justify-end">
  37 + <view class="order-info" style="font-weight:bold;font-size:17px ;">
  38 + {{myorderinfo.orderFee | toFixed2}}
  39 + </view>
  40 + <view class="order-info" style="margin-right: 50upx;margin-left: 0px;">
  41 + 元
  42 + </view>
  43 + </view>
  44 + </view>
  45 +
  46 + <view class="order-line-bold"></view>
  47 +
  48 + <view class="order-title">
  49 + 支付方法
  50 + </view>
  51 + <view class="order-line"></view>
  52 +
  53 + <view class="orderwaysview">
  54 + <image src="../../static/orderInfo/orderinfo-wechat.png" class="orderways"></image>
  55 + <view class="order-info" style="margin-left: 8px;">
  56 + 商户余额
  57 + </view>
  58 + <image src="../../static/orderInfo/orderinfo-sel.png" class="orderwaysSel"></image>
  59 +
  60 + </view>
  61 +
  62 + <view class="order-line"></view>
  63 + <button @click="payClick" class="button-sp-area" type="primary" plain="true">确认支付</button>
  64 +
  65 + </view>
146 </template> 66 </template>
147 67
148 <script> 68 <script>
149 -import common from "../../common/common.js";  
150 -  
151 -export default {  
152 - data() {  
153 - return {  
154 - mycarNumber: '',  
155 - myorderId: '',  
156 - myparkCode: '',  
157 - myorderinfo1: {},  
158 - myorderinfo: {},  
159 - payWaysSel: 0,  
160 - myorderState: 0,  
161 - mypaySrcType: '',  
162 - selCoupon: {},  
163 - appOrderTimeout: '',  
164 - loginflag: 0,  
165 - phoneNumb: '',  
166 - totalFee: '', //应收  
167 - alertFlag: false,  
168 - unPayFee: '' //实收  
169 - }  
170 - },  
171 - onLoad(params) {  
172 - wx.showShareMenu({  
173 - withShareTicket: true  
174 - })  
175 - this.mycarNumber = params.carNumber;  
176 - this.myorderId = params.orderId;  
177 - this.myparkCode = params.parkCode;  
178 - this.myorderState = params.orderState;  
179 - this.totalFee = params.totalFee  
180 - this.unPayFee = params.unPayFee  
181 - if (params.orderState == 5) {  
182 - //停车补缴单 103  
183 - this.mypaySrcType = '103'  
184 - } else {  
185 - this.mypaySrcType = '101'  
186 - }  
187 -  
188 - // this.GetbillQueryInfo(this.mycarNumber, this.myorderId, this.myparkCode);  
189 - this.getWxCode();  
190 - this.PDlogin();  
191 - //console.log("xxxmake = "+this.makedateFormat());  
192 - },  
193 - onShow() {  
194 - var me = this;  
195 - var userInfo = me.getGlobalUser("globalUser");  
196 - if (userInfo != null) {  
197 - me.phoneNumb = userInfo.userPhone;  
198 - }  
199 -  
200 - var pages = getCurrentPages();  
201 - var currPage = pages[pages.length - 1]; //当前页面  
202 - console.log('currPage.data.selCoupon = ' + currPage.data.selCoupon);  
203 - me.selCoupon = currPage.data.selCoupon;  
204 - console.log(JSON.stringify(me.selCoupon));  
205 -  
206 - me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType, me.selCoupon  
207 - .discValue);  
208 - // GetbillQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) {  
209 -  
210 - },  
211 - methods: {  
212 -  
213 - PDlogin() {  
214 - var me = this;  
215 - // var loginflag = 0;  
216 - var globalUser = me.getGlobalUser("globalUser");  
217 - if (globalUser == undefined || globalUser == null || globalUser.token == null || globalUser.token == undefined ||  
218 - globalUser.token.length == 0) {  
219 - me.loginflag = 0;  
220 - } else {  
221 - me.loginflag = 1;  
222 - }  
223 - },  
224 - //选择优惠券  
225 - DiscountClick() {  
226 - console.log("gotoDiscountView");  
227 - var me = this;  
228 - if (me.loginflag == 0) {  
229 - uni.showToast({  
230 - title: '请先登录',  
231 - icon: 'none',  
232 - duration: 4000  
233 - })  
234 - return;  
235 - }  
236 - var myurl = 'use_couponList/use_couponList?plNo=' + me.myparkCode + '&parkingDura=' + me.myorderinfo.staytime +  
237 - '&parkingFee=' + me.myorderinfo.orderTotalFee + '&carNumber=' + me.mycarNumber + '&carType=' + me.myorderinfo.carType;  
238 - uni.navigateTo({  
239 - url: myurl  
240 - });  
241 -  
242 - },  
243 - //选择支付方式  
244 - selPaywaysClick(selNumb) {  
245 - let me = this  
246 - this.payWaysSel = selNumb;  
247 - console.log("this.payWaysSel: " + this.payWaysSel);  
248 - console.log(me.loginflag)  
249 - if (this.payWaysSel == 1) {  
250 - if (me.loginflag == 0) {  
251 - uni.showToast({  
252 - title: '请先登录',  
253 - icon: 'none',  
254 - duration: 2000  
255 - })  
256 - return;  
257 - }  
258 - }  
259 - },  
260 - payClick() {  
261 - var me = this;  
262 - me.goPay_billQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType,  
263 - me.selCoupon.discValue);  
264 -  
265 - // if(me.myorderinfo.orderFee == 0){  
266 - // uni.showModal({  
267 - // title: '提示',  
268 - // content: '0元无需支付',  
269 - // showCancel: false,  
270 - // success: function(res) {  
271 - // if (res.confirm) {  
272 - // console.log('0元无需支付');  
273 - // me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode ,me.selCoupon.cardNo ,me.selCoupon.couponType ,me.selCoupon.discValue);  
274 - // }  
275 - // }  
276 - // });  
277 - // return;  
278 - // }  
279 - // //用户选择微信支付  
280 - // if (me.payWaysSel == 0) {  
281 - // me.getWxPayinfo();  
282 - // } else {  
283 - // me.UseAccountPay();  
284 - // }  
285 -  
286 - },  
287 - getWxPayinfo() {  
288 - var me = this;  
289 - uni.showLoading({  
290 - mask: true,  
291 - title: "请稍后..."  
292 - });  
293 - uni.showNavigationBarLoading();  
294 - var getwxpayinfoUrl = common.getwxpayinfoUrl;  
295 -  
296 - if (me.mypaySrcType == 101) {  
297 - me.payQuery(100)  
298 - } else {  
299 - me.rltOrderId()  
300 - }  
301 -  
302 - },  
303 -  
304 - rltOrderId() {  
305 - var me = this;  
306 - console.log(me.totalFee)  
307 - console.log(me.unPayFee)  
308 - var jsondata = {  
309 -  
310 - parkOrderIds: [me.myorderId],  
311 - orderBigType: 100,  
312 - payOrderType: 103,  
313 - terminalSource: 11,  
314 - operCode: me.phoneNumb,//订单生成操作人 如果是车主 传 custId  
315 - operName: me.phoneNumb,//订单生成操作人名称 如果是车主 传车主名称或手机号  
316 - orgId: common.public_orgId,  
317 - orderActFee: me.myorderinfo.orderFee,  
318 - orderTotalFee: me.unPayFee,  
319 -  
320 - };  
321 -  
322 - uni.request({  
323 - url: common.doOrderCreate,  
324 - data: JSON.stringify(jsondata),  
325 - // url: getwxPayUnifiedorderUrl,  
326 - // data: JSON.stringify(common.requestSign(jsondata)),  
327 - dataType: "json",  
328 - method: "POST",  
329 - success: (res) => {  
330 - if (res.data.code == 0) {  
331 -  
332 - console.log(res.data.data.rltOrderId);  
333 - me.myorderId = res.data.data.rltOrderId  
334 - console.log(me.myorderId)  
335 - me.payQuery(100)  
336 -  
337 - // uni.hideNavigationBarLoading();  
338 - // uni.hideLoading();  
339 - } else {  
340 -  
341 - uni.showModal({  
342 - title: '提示',  
343 - content: res.data.message,  
344 - showCancel: false,  
345 - success: function (res) {  
346 -  
347 - }  
348 - });  
349 - // uni.showToast({  
350 - // title: res.data.message,  
351 - // // icon: none;  
352 - // duration: 2000  
353 - // })  
354 - }  
355 -  
356 - },  
357 - complete: () => {  
358 - // uni.hideNavigationBarLoading();  
359 - // uni.hideLoading();  
360 - }  
361 - });  
362 - },  
363 - payQuery(_orderBigType) {  
364 -  
365 - var me = this;  
366 - console.log(me.totalFee)  
367 - console.log(me.unPayFee)  
368 - console.log(me.mypaySrcType)  
369 - var jsondata = {  
370 -  
371 - orderBigType: _orderBigType,  
372 - payOrderType: me.mypaySrcType,  
373 - rltOrderId: me.myorderId,  
374 - payType: 2,  
375 - terminalSource: 11,  
376 - orderActFee: me.myorderinfo.orderFee,  
377 - orderTotalFee: me.unPayFee,  
378 - // totalFee: '', //应收  
379 - // unPayFee: '' //实收  
380 - payUserId: me.getWxOpenid("WxOpenid"),  
381 - terminalOS: uni.getSystemInfoSync().platform == 'android' ? 'AND' : 'IOS',  
382 -  
383 - //terminalOS:isAndroid?'AND':'IOS',  
384 - //uni.getSystemInfoSync().platform  
385 -  
386 - };  
387 -  
388 - uni.request({  
389 - //url: getwxpayinfoUrl,  
390 - url: common.doPayUrl,  
391 - data: JSON.stringify(jsondata),  
392 - //data: JSON.stringify(common.requestSign(jsondata)),  
393 - header: {  
394 - 'content-type': 'application/json'  
395 - },  
396 - dataType: "json",  
397 - method: "POST",  
398 - success: (res) => {  
399 - console.log(res)  
400 - if (res.statusCode == 200) {  
401 -  
402 - me.myorderinfo1 = res.data;  
403 - // var code = res.data.code;  
404 - console.log(JSON.stringify(res.data));  
405 - // var mydata = res.data;  
406 - var mydata = JSON.parse(res.data.data.jsPayRequest);  
407 - me.MakeWxPay(mydata);  
408 - uni.hideNavigationBarLoading();  
409 - uni.hideLoading();  
410 - }  
411 - },  
412 - complete: () => {  
413 - uni.hideNavigationBarLoading();  
414 - uni.hideLoading();  
415 - }  
416 - });  
417 - },  
418 - // 调用微信支付  
419 - MakeWxPay(mydata) {  
420 - console.log('3')  
421 - var me = this;  
422 - uni.requestPayment({  
423 - provider: 'wxpay',  
424 - timeStamp: mydata.timeStamp,  
425 - //随机字符串,长度为32个字符以下  
426 - nonceStr: mydata.nonceStr,  
427 - //统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=xx。  
428 - package: mydata.package,  
429 - signType: mydata.signType,  
430 - paySign: mydata.paySign,  
431 - success: function (res) {  
432 - console.log('success:' + JSON.stringify(res));  
433 - var myurl = '../wxPaySuccess/wxPaySuccess?carNumber=' + me.mycarNumber + '&payWays=微信&payMoney=' + me.myorderinfo  
434 - .orderFee + '&appOrderTimeout=' + me.appOrderTimeout;  
435 - uni.reLaunch({  
436 - url: myurl  
437 - });  
438 - },  
439 - fail: function (err) {  
440 - console.log('fail:' + JSON.stringify(err));  
441 - uni.showModal({  
442 - title: '提示',  
443 - content: '支付失败/取消',  
444 - showCancel: false,  
445 - success: function (res) {  
446 - if (res.confirm) {  
447 - console.log('支付失败');  
448 - }  
449 - }  
450 - });  
451 - }  
452 - });  
453 - },  
454 - goPay_billQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) {  
455 - var me = this;  
456 - // uni.showLoading({  
457 - // mask: true,  
458 - // title: "请稍后..."  
459 - // });  
460 - uni.showNavigationBarLoading();  
461 - var billQueryUrl = common.billQueryUrl;  
462 -  
463 - var jsondata = {  
464 - carNumber: carnum,  
465 - orderId: orderId,  
466 - terminalSource: '11',  
467 - parkCode: parkCode,  
468 - cardNo: cardNo,  
469 - couponType: couponType,  
470 - disValue: disValue  
471 - }  
472 - uni.request({  
473 - url: billQueryUrl,  
474 - // data: JSON.stringify(jsondata),  
475 - data: JSON.stringify(common.requestSign(jsondata)),  
476 - header: {  
477 - 'content-type': 'application/json'  
478 - },  
479 - dataType: "json",  
480 - method: "POST",  
481 - success: (res) => {  
482 - console.log(JSON.stringify(res.data));  
483 -  
484 - uni.hideNavigationBarLoading();  
485 - uni.hideLoading();  
486 - if (res.data.code == 0) {  
487 -  
488 - me.myorderinfo = res.data.data;  
489 - me.appOrderTimeout = res.data.data.appOrderTimeout;  
490 -  
491 - if (me.myorderinfo.orderFee == 0) {  
492 -  
493 -  
494 - // 101:停车付款单,102:停车预付单,103:停车补缴单,201:余额充值单,202:押金充值;301:会员卡购买单,302:会员卡续费  
495 - //个人使用的卡券cardId  
496 - // couponPersonId:  
497 -  
498 - // paySrcType: me.mypaySrcType,  
499 - me.zeroPayUrl(me.mypaySrcType, res.data.data.orderId, me.selCoupon.custCardId);  
500 -  
501 - } else {  
502 - //用户选择微信支付  
503 - if (me.payWaysSel == 0) {  
504 - me.getWxPayinfo();  
505 - } else {  
506 - me.UseAccountPay();  
507 - }  
508 - }  
509 -  
510 - // me.myorderinfo1 = res.data.data ;  
511 - //  
512 -  
513 - // var code = res.data.code;  
514 - //console.log(JSON.stringify(res.data));  
515 -  
516 - } else if (res.data.code == -10000) {  
517 - uni.showModal({  
518 - title: '提示',  
519 - content: res.data.message,  
520 - showCancel: false,  
521 - success: function (res) {  
522 - if (res.confirm) {  
523 - console.log('登录失效');  
524 - uni.clearStorageSync();  
525 - }  
526 - }  
527 - });  
528 - }  
529 - },  
530 - complete: () => {  
531 - uni.hideNavigationBarLoading();  
532 - uni.hideLoading();  
533 - }  
534 - });  
535 - },  
536 - // 0元支付  
537 - zeroPayUrl(payOrderType, orderId, couponPersonId) {  
538 -  
539 - var me = this;  
540 - uni.showLoading({  
541 - mask: true,  
542 - title: "请稍后..."  
543 - });  
544 - uni.showNavigationBarLoading();  
545 - var zeroPayUrl = common.zeroPayUrl;  
546 -  
547 - var jsondata = {  
548 - payOrderType: payOrderType,  
549 - orderId: orderId,  
550 - terminalSource: '11',  
551 - couponPersonId: couponPersonId  
552 - }  
553 - uni.request({  
554 - url: zeroPayUrl,  
555 - // data: JSON.stringify(jsondata),  
556 - data: JSON.stringify(common.requestSign(jsondata)),  
557 - header: {  
558 - 'content-type': 'application/json'  
559 - },  
560 - dataType: "json",  
561 - method: "POST",  
562 - success: (res) => {  
563 - console.log(JSON.stringify(res.data));  
564 - uni.hideNavigationBarLoading();  
565 - uni.hideLoading();  
566 - if (res.data.code == 0) {  
567 - uni.showModal({  
568 - title: '提示',  
569 - content: '支付成功!',  
570 - showCancel: false,  
571 - success: function (res) {  
572 - me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType,  
573 - me.selCoupon  
574 - .discValue);  
575 - }  
576 - });  
577 -  
578 - // me.myorderinfo = res.data.data;  
579 - // me.appOrderTimeout = res.data.data.appOrderTimeout;  
580 - // // me.myorderinfo1 = res.data.data ;  
581 - //  
582 -  
583 - // var code = res.data.code;  
584 - //console.log(JSON.stringify(res.data));  
585 -  
586 - } else if (res.data.code == -10000) {  
587 - uni.showModal({  
588 - title: '提示',  
589 - content: res.data.message,  
590 - showCancel: false,  
591 - success: function (res) {  
592 - if (res.confirm) {  
593 - console.log('登录失效');  
594 - uni.clearStorageSync();  
595 - }  
596 - }  
597 - });  
598 - } else {  
599 - uni.showModal({  
600 - title: '提示',  
601 - content: res.data.message,  
602 - showCancel: false,  
603 - success: function (res) {  
604 - me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType,  
605 - me.selCoupon  
606 - .discValue);  
607 - }  
608 - });  
609 - }  
610 - },  
611 - complete: () => {  
612 - uni.hideNavigationBarLoading();  
613 - uni.hideLoading();  
614 - }  
615 - });  
616 - },  
617 - //初始化订单信息  
618 - GetbillQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) {  
619 - var me = this;  
620 - uni.showLoading({  
621 - mask: true,  
622 - title: "请稍后..."  
623 - });  
624 - uni.showNavigationBarLoading();  
625 - var billQueryUrl = common.billQueryUrl;  
626 -  
627 - var jsondata = {  
628 - carNumber: carnum,  
629 - orderId: orderId,  
630 - terminalSource: '11',  
631 - parkCode: parkCode,  
632 - cardNo: cardNo,  
633 - couponType: couponType,  
634 - disValue: disValue  
635 - }  
636 - uni.request({  
637 - url: billQueryUrl,  
638 - // data: JSON.stringify(jsondata),  
639 - data: JSON.stringify(common.requestSign(jsondata)),  
640 - header: {  
641 - 'content-type': 'application/json'  
642 - },  
643 - dataType: "json",  
644 - method: "POST",  
645 - success: (res) => {  
646 - console.log(JSON.stringify(res.data));  
647 - uni.hideNavigationBarLoading();  
648 - uni.hideLoading();  
649 - if (res.data.code == 0) {  
650 -  
651 - me.myorderinfo = res.data.data;  
652 - me.appOrderTimeout = res.data.data.appOrderTimeout;  
653 - // me.myorderinfo1 = res.data.data ;  
654 - //  
655 -  
656 - // var code = res.data.code;  
657 - //console.log(JSON.stringify(res.data));  
658 -  
659 - } else if (res.data.code == -10000) {  
660 - uni.showModal({  
661 - title: '提示',  
662 - content: res.data.message,  
663 - showCancel: false,  
664 - success: function (res) {  
665 - if (res.confirm) {  
666 - console.log('登录失效');  
667 - uni.clearStorageSync();  
668 - }  
669 - }  
670 - });  
671 - }  
672 - },  
673 - complete: () => {  
674 - uni.hideNavigationBarLoading();  
675 - uni.hideLoading();  
676 - }  
677 - });  
678 - },  
679 - // 获取openid  
680 - getWxCode() {  
681 - var that = this;  
682 - uni.login({  
683 - provider: 'weixin',  
684 - success: function (loginRes) {  
685 -  
686 - console.log(JSON.stringify(loginRes));  
687 - console.log(loginRes.code);  
688 - that.get_WxOpenid(loginRes.code);  
689 - }  
690 - });  
691 - },  
692 - get_WxOpenid(code) {  
693 - var me = this;  
694 - console.log('123456');  
695 - uni.showLoading({  
696 - mask: true,  
697 - title: "请稍后..."  
698 - });  
699 - uni.showNavigationBarLoading();  
700 - var getOpenidUrl = common.getOpenidUrl;  
701 -  
702 - uni.request({  
703 - url: getOpenidUrl,  
704 - data: {  
705 - appId: common.hs_wxPay_appId,  
706 - code: code  
707 - },  
708 - header: {  
709 - 'content-type': 'application/json'  
710 - },  
711 - dataType: "json",  
712 - method: "POST",  
713 - success: (res) => {  
714 - console.log(res)  
715 - if (res.data.code == 0) {  
716 - console.log('id')  
717 - // me.myorderinfo = res.data.data;  
718 - // // var code = res.data.code;  
719 - uni.setStorageSync("WxOpenid", res.data.data.openid);  
720 - console.log(JSON.stringify(res.data));  
721 - console.log("wxopenid = " + res.data.data.openid);  
722 -  
723 - uni.hideNavigationBarLoading();  
724 - uni.hideLoading();  
725 - }  
726 - },  
727 - complete: () => {  
728 - uni.hideNavigationBarLoading();  
729 - uni.hideLoading();  
730 - }  
731 - });  
732 - },  
733 - // 使用余额支付  
734 - UseAccountPay() {  
735 - var me = this;  
736 - console.log(me.loginflag + 'aaaaa')  
737 - if (me.loginflag == 0) {  
738 - console.log('123123')  
739 - // this.alertFlag = true  
740 - // uni.showToast({  
741 - // title: '请先登录',  
742 - // icon: 'none',  
743 - // duration: 4000  
744 - // })  
745 -  
746 - uni.showModal({  
747 - title: '提示',  
748 - showCancel: false,  
749 - content: '未登录状态,请先登录!',  
750 - success: function (res) {  
751 - if (res.confirm) {  
752 - console.log('用户点击确定');  
753 - }  
754 - }  
755 - });  
756 -  
757 - } else {  
758 - console.log('bbbb')  
759 - uni.showLoading({  
760 - mask: true,  
761 - title: "请稍后...",  
762 - duration: 4000  
763 - });  
764 - uni.showNavigationBarLoading();  
765 - var accountPayUrl = common.accountPayUrl;  
766 -  
767 - var jsondata = {  
768 - payType: '5', //支付方式-- 1:支付宝 2:微信 3:银联 4:微信公众号 5 个人账户  
769 - orderId: me.myorderId,  
770 - payFee: me.myorderinfo.orderFee,  
771 - //支付单来源 101:停车付款单 102:停车预付单 103:停车补缴单 104 共享车位 201 余额充值单 202 押金充值单 301 会员卡购买单 302 会员卡续费  
772 - paySrcType: me.mypaySrcType,  
773 - terminalSource: '11', //小程序  
774 - //个人使用的卡券cardId  
775 - couponPersonId: me.selCoupon.custCardId,  
776 - carNumber: me.mycarNumber,  
777 - orderId: me.myorderId,  
778 - paySource: '3',  
779 - sourceType: '3',  
780 - terminalSource: '11', //小程序  
781 - recordArreaInfos: JSON.stringify([{  
782 - "orderId": me.myorderId,  
783 - "orderNotPayFee": me.myorderinfo.orderFee,  
784 - "parkId": me.myparkCode  
785 - }])  
786 -  
787 - };  
788 - uni.request({  
789 - url: accountPayUrl,  
790 - data: JSON.stringify(common.requestSign(jsondata)),  
791 - header: {  
792 - 'content-type': 'application/json'  
793 - },  
794 - dataType: "json",  
795 - method: "POST",  
796 - success: (res) => {  
797 - uni.hideNavigationBarLoading();  
798 - uni.hideLoading();  
799 - console.log('余额支付 = ' + JSON.stringify(res.data));  
800 - if (res.data.code == 0) {  
801 -  
802 - var myurl = '../wxPaySuccess/wxPaySuccess?carNumber=' + me.mycarNumber + '&payWays=余额&payMoney=' + me.myorderinfo  
803 - .orderFee + '&appOrderTimeout=' + me.appOrderTimeout;  
804 - uni.reLaunch({  
805 - url: myurl  
806 - });  
807 -  
808 - } else {  
809 - uni.showToast({  
810 - title: res.data.message,  
811 - icon: 'none',  
812 - duration: 4000  
813 - })  
814 - }  
815 - },  
816 - complete: () => {  
817 - // uni.hideNavigationBarLoading();  
818 - // uni.hideLoading();  
819 - }  
820 - });  
821 - }  
822 -  
823 - }  
824 -  
825 - }  
826 -} 69 + export default {
  70 + data() {
  71 + return {
  72 + businessId: '',
  73 + mycarNumber: '',
  74 + myorderinfo: {
  75 + parkName:'',
  76 + inparktime:'',
  77 + staytime:'',
  78 + due:'',
  79 + orderFee:'',
  80 + },
  81 + appOrderTimeout:'0',
  82 + totalFee: '', //应收
  83 + unPayFee: '' //实收
  84 + }
  85 + },
  86 + onLoad(params) {
  87 + wx.showShareMenu({
  88 + withShareTicket: true
  89 + })
  90 + this.mycarNumber = params.carNumber;
  91 + let indexInfo = uni.getStorageSync("indexInfo");
  92 + this.businessId = indexInfo.businessId;
  93 + console.log(this.mycarNumber,this.businessId)
  94 + this.getbBillQueryInfo();
  95 + },
  96 + onShow() {
  97 +
  98 + },
  99 + methods: {
  100 +
  101 + payClick() {
  102 + var that = this;
  103 + that.goPay_billQueryInfo();
  104 + },
  105 +
  106 + getbBillQueryInfo() {
  107 + let that = this
  108 + let paramsData = {
  109 + carNumber: that.mycarNumber,
  110 + pageNum:'1',
  111 + pageSize:'10',
  112 + businessId: that.businessId,
  113 + terminalSource: '11',
  114 + parkState: '10',
  115 +
  116 + }
  117 + // 获取 接口
  118 + that.$myRequest({
  119 + url: that.$common.queryParkingRecordByCarNumbers,
  120 + method: 'POST',
  121 + data: that.$common.requestSign(paramsData)
  122 + }).then(res => {
  123 + console.log(res)
  124 + that.myorderinfo = res.data.dataList[0];
  125 + that.appOrderTimeout = res.data.dataList[0].appOrderTimeout;
  126 +
  127 + })
  128 +
  129 + },
  130 + }
  131 +
  132 + }
827 </script> 133 </script>
828 134
829 <style scoped lang="scss"> 135 <style scoped lang="scss">
830 - .order-time{  
831 - padding: 5px 0;  
832 - background: #f0ad4e;  
833 - text-align: center;  
834 - color: #fff;  
835 - }  
836 -  
837 - .order-title {  
838 - font-size: 18px;  
839 - margin-left: 16px;  
840 - margin-top: 15px;  
841 - font-weight: bold;  
842 - color: #404040;  
843 - }  
844 -  
845 - .order-info {  
846 - font-size: 14px;  
847 - margin-left: 15px;  
848 - margin-top: 12px;  
849 - color: #404040;  
850 - }  
851 -  
852 - .order-line {  
853 - background: #D9D9D9;  
854 - height: 1px;  
855 - margin-top: 12px;  
856 - margin-left: 15px;  
857 - padding: 0px;  
858 - overflow: hidden;  
859 - /* 透明度 */  
860 - opacity: 0.5;  
861 - }  
862 -  
863 - .order-line-bold {  
864 - background: #FAFAFA;  
865 - height: 12px;  
866 - margin-top: 12px;  
867 - padding: 0px;  
868 - overflow: hidden;  
869 - }  
870 -  
871 - .flex-row-justify-between {  
872 - display: flex;  
873 - flex-direction: row;  
874 - justify-content: space-between;  
875 - }  
876 -  
877 - .flex-row-justify-end {  
878 - display: flex;  
879 - flex-direction: row;  
880 - /* 水平对齐*/  
881 - align-items: baseline;  
882 -  
883 - }  
884 -  
885 - .order-discount {  
886 - color: #C8C7CC;  
887 - margin-right: 20 upx;  
888 - /* margin-right: 12px ; */  
889 - /* margin-top:12px ; */  
890 -  
891 - }  
892 -  
893 - .orderwaysview {  
894 - display: flex;  
895 - flex-direction: row;  
896 - }  
897 -  
898 - .orderways {  
899 - width: 18px;  
900 - height: 18px;  
901 - margin-left: 15px;  
902 - margin-top: 14px;  
903 - }  
904 -  
905 - .orderwaysSel {  
906 - width: 16px;  
907 - height: 16px;  
908 - margin-left: auto;  
909 - margin-right: 14px;  
910 - margin-top: 14px;  
911 - /* justify-content:flex-end; */  
912 - }  
913 -  
914 - .button-sp-area {  
915 - margin: 0 auto;  
916 - width: 60%;  
917 - margin-top: 40px;  
918 -  
919 - } 136 + .order-time {
  137 + padding: 5px 0;
  138 + background: #f0ad4e;
  139 + text-align: center;
  140 + color: #fff;
  141 + }
  142 +
  143 + .order-title {
  144 + font-size: 18px;
  145 + margin-left: 16px;
  146 + margin-top: 15px;
  147 + font-weight: bold;
  148 + color: #404040;
  149 + }
  150 +
  151 + .order-info {
  152 + font-size: 14px;
  153 + margin-left: 15px;
  154 + margin-top: 12px;
  155 + color: #404040;
  156 + }
  157 +
  158 + .order-line {
  159 + background: #D9D9D9;
  160 + height: 1px;
  161 + margin-top: 12px;
  162 + margin-left: 15px;
  163 + padding: 0px;
  164 + overflow: hidden;
  165 + /* 透明度 */
  166 + opacity: 0.5;
  167 + }
  168 +
  169 + .order-line-bold {
  170 + background: #FAFAFA;
  171 + height: 12px;
  172 + margin-top: 12px;
  173 + padding: 0px;
  174 + overflow: hidden;
  175 + }
  176 +
  177 + .flex-row-justify-between {
  178 + display: flex;
  179 + flex-direction: row;
  180 + justify-content: space-between;
  181 + }
  182 +
  183 + .flex-row-justify-end {
  184 + display: flex;
  185 + flex-direction: row;
  186 + /* 水平对齐*/
  187 + align-items: baseline;
  188 +
  189 + }
  190 +
  191 + .order-discount {
  192 + color: #C8C7CC;
  193 + margin-right: 20 upx;
  194 + /* margin-right: 12px ; */
  195 + /* margin-top:12px ; */
  196 +
  197 + }
  198 +
  199 + .orderwaysview {
  200 + display: flex;
  201 + flex-direction: row;
  202 + }
  203 +
  204 + .orderways {
  205 + width: 18px;
  206 + height: 18px;
  207 + margin-left: 15px;
  208 + margin-top: 14px;
  209 + }
  210 +
  211 + .orderwaysSel {
  212 + width: 16px;
  213 + height: 16px;
  214 + margin-left: auto;
  215 + margin-right: 14px;
  216 + margin-top: 14px;
  217 + /* justify-content:flex-end; */
  218 + }
  219 +
  220 + .button-sp-area {
  221 + margin: 0 auto;
  222 + width: 60%;
  223 + margin-top: 40px;
  224 +
  225 + }
920 </style> 226 </style>