Blame view

src/pages/myOrderPaying/myOrderPaying.vue 12.2 KB
9a8f39ae3   BigBoss   订单
1
  <!-- 订单待付款  待收货 -->
4de4be344   喻鹏   客服在线和我的订单-待付款
2
  <template>
9a8f39ae3   BigBoss   订单
3
4
5
  	<view class="content">		
  		<!-- 待付款 -->
  		<view class="order-time" v-if="status == '0'">
ab4209caf   喻鹏   update
6
  			<text>请在</text>
ab4209caf   喻鹏   update
7
  			<uni-countdown color="#EC5D3B" splitor-color="#EC5D3B" :show-day="false" 
9a8f39ae3   BigBoss   订单
8
  			:hour="0" :second="getTime" @timeup=timeup ></uni-countdown> 
ab4209caf   喻鹏   update
9
  			<text>内完成付款</text>
9a8f39ae3   BigBoss   订单
10
11
12
13
14
15
16
17
  		</view>
  		<!-- 待收货 -->
  		<view class="headerBanner" v-if="status == '1'">
  			<view class="bannerLeft">
  				<view class="T1">卖家已发货</view>
  				<view class="T2">还剩   确认收货</view>
  			</view>
  			<image src="../../static/car.png" mode="aspectFill"></image>
4de4be344   喻鹏   客服在线和我的订单-待付款
18
  		</view>
ab4209caf   喻鹏   update
19
  		<view class="order">
4de4be344   喻鹏   客服在线和我的订单-待付款
20
21
  			<view class="order-user">
  				<view class="order-user-head">
9a8f39ae3   BigBoss   订单
22
23
  					<text class="p1">{{orderAddressInfo.userName}}</text>
  					<text class="p2">{{orderAddressInfo.telNumber}}</text>
4de4be344   喻鹏   客服在线和我的订单-待付款
24
25
26
  				</view>
  				<view class="order-user-body">	
  					<image src="../../static/myorder-paying-location.png"></image>
9a8f39ae3   BigBoss   订单
27
28
  					<text class="p3">{{orderAddressInfo.provinceName}} {{orderAddressInfo.cityName}} {{orderAddressInfo.countyName}}
  {{orderAddressInfo.detailInfo}}</text>
4de4be344   喻鹏   客服在线和我的订单-待付款
29
30
31
  				</view>
  			</view>
  			<view class="order-info">
9a8f39ae3   BigBoss   订单
32
33
  				<view class="order-info-head"   v-for="(orderInfoListItem,index) in orderInfoList" :key="index"  >
  					<image :src="orderInfoListItem.imgUrl" mode="aspectFill"></image>
4de4be344   喻鹏   客服在线和我的订单-待付款
34
  					<view class="order-info-head-r">
9a8f39ae3   BigBoss   订单
35
  						<text class="p1">{{orderInfoListItem.p_name}}</text>
ab4209caf   喻鹏   update
36
37
38
  						<view class="p2" style="margin: 0;">
  							规格:玫瑰金 / 钛合金 / 防日光防紫外线 / 超薄超轻
  							<!-- <view class="arrow"></view> -->
9a8f39ae3   BigBoss   订单
39
40
41
42
  						</view>
  						<view class="infoText-bottom">
  							<view class="markPrice">{{orderInfoListItem.nowPrice}}</view>
  							<view class="buy-num">X {{orderInfoListItem.num}}</view>
ab4209caf   喻鹏   update
43
  						</view>
4de4be344   喻鹏   客服在线和我的订单-待付款
44
45
  					</view>
  				</view>
ab4209caf   喻鹏   update
46
  <!-- 				<view class="order-info-goodsnum">
4de4be344   喻鹏   客服在线和我的订单-待付款
47
  					<text>X1</text>
ab4209caf   喻鹏   update
48
  				</view> -->
4de4be344   喻鹏   客服在线和我的订单-待付款
49
50
  				<text class="order-info-freight">
  					<text class="p1">运费</text>
9a8f39ae3   BigBoss   订单
51
  					<text class="p2">{{orderInfo.trans_price}}</text>
4de4be344   喻鹏   客服在线和我的订单-待付款
52
53
54
  				</text>
  				<text class="order-info-discount">
  					<text class="p1">优惠</text>
9a8f39ae3   BigBoss   订单
55
  					<text class="p2">-¥{{totalDiscount}}</text>
4de4be344   喻鹏   客服在线和我的订单-待付款
56
57
58
  				</text>
  				<text class="order-info-price">
  					<text class="p1">实付</text>
9a8f39ae3   BigBoss   订单
59
  					<text class="p2">¥{{orderInfo.order_info.total_fee}}</text>
4de4be344   喻鹏   客服在线和我的订单-待付款
60
61
  				</text>
  				<text class="order-info-num">
9a8f39ae3   BigBoss   订单
62
  					<text>订单号:{{orderInfo.prepay_id}}</text>
4de4be344   喻鹏   客服在线和我的订单-待付款
63
64
  				</text>
  				<text class="order-info-time">
9a8f39ae3   BigBoss   订单
65
  					<text>下单时间:{{orderInfo.pay_time}}</text>
4de4be344   喻鹏   客服在线和我的订单-待付款
66
67
68
69
70
71
72
  				</text>
  				<view class="order-info-hr"></view>
  				<view class="order-info-contact">
  					<image src="../../static/myorder-paying-contact.png"></image>
  					<text>联系客服</text>
  				</view>
  			</view>
ab4209caf   喻鹏   update
73
  		</view>
9a8f39ae3   BigBoss   订单
74
75
76
77
78
79
80
81
  		<view class="order-confim" v-if="status == '0'">
  			<button class="b1" @click="cancleOrder">取消订单</button>
  			<button class="b2" @click="paylog">立即支付</button>
  		</view>
  		
  		<view class="order-confim" v-if="status == '1'">
  			<!-- <button class="b1">取消订单</button> -->
  			<button class="b2" @click="confirmOrder">确认收货</button>
4de4be344   喻鹏   客服在线和我的订单-待付款
82
83
84
  		</view>
  	</view>
  </template>
9a8f39ae3   BigBoss   订单
85
86
  <script>
  	import store from '@/store';
ab4209caf   喻鹏   update
87
  	import UniCountdown from '../../components/UniCountdown/UniCountdown.vue'
4de4be344   喻鹏   客服在线和我的订单-待付款
88
  	export default {
ab4209caf   喻鹏   update
89
90
91
  		components: {
  			UniCountdown
  		},
4de4be344   喻鹏   客服在线和我的订单-待付款
92
  		data() {
9a8f39ae3   BigBoss   订单
93
94
95
96
97
98
99
100
  			return {
  				// orderInfo:{},
  				payId:'',
  				status:'',
  				uid:'',
  				openid:'',
  				lefttime:0,
  				
4de4be344   喻鹏   客服在线和我的订单-待付款
101
  			}
9a8f39ae3   BigBoss   订单
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  		},
  		onLoad: function(option) {
  			console.log(option);
  			this.payId = option.payId;
  			this.status = option.status
  			const openid = uni.getStorageSync('openid');
  			const uid = this.$store.state.user.uid
  			this.uid = uid
  			this.openid = openid
  			store.dispatch('orderRead/getOrderInfo',{
  				pay_id:this.payId,
  				uid:'1',
  				openid:openid
  			})
  			
  			
  			
  			// this.orderInfo = this.$store.state.orderRead.orderInfo
  		},
  		computed: {
  			//获取订单详细信息
  			orderInfo() {
  				console.log(this.$store.state.orderRead.orderInfo)
  				return this.$store.state.orderRead.orderInfo || {}
  			},
  		    orderInfoList(){
  				const orderInfoList =this.orderInfo.order_info[0].list
  				return orderInfoList
  			},
  			//获取订单地址信息
  			orderAddressInfo(){
  					return this.orderInfo.order_info[0].address
  			},
  			//订单付款时间
  			getTime(){
  				return this.orderInfo.order_info[0].lefttime
  			},
  			// 计算总优惠额
  			totalDiscount(){
  				const discountInfoList = this.orderInfo.discount_info
  				let totalDiscount = 0;
  				if(discountInfoList){
  					discountInfoList.map((discountItem,index)=>{
  						totalDiscount += Number(discountItem.value)
  					})
  				}
  				// console.log(totalDiscount)
  				return totalDiscount
  			},
4de4be344   喻鹏   客服在线和我的订单-待付款
151
  		},
9a8f39ae3   BigBoss   订单
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
  		methods: {
  			//取消订单
  			timeup(){
  				this.cancleOrder()
  			},
  			cancleOrder(){
  				const uid = this.uid
  				const openid = this.openid
  				uni.showModal({
  					title: '提示',
  					content: '现在取消,订单不可恢复哦,确认取消吗?',
  					success: function (res) {
  						if (res.confirm) {
  							store.dispatch('cancelOrder/cancel',{
  								keyname:'1',
  								uid:uid,
  								openid:openid
  							})
  						} else if (res.cancel) {
  							console.log('用户点击取消');
  						}
  					}
  				})
  			},
  			paylog(){
  				
  			},
  			confirmOrder(){
  				store.dispatch('statusConfirm/confirm',{
  					uid:this.uid,
  					openid:this.openid,
  					oldway:'1',
  					way:'2',
  					pay_id:this.payId,
  					judgeContent:'',
  					orderInfo:this.orderInfo.order_info,
d1ce60f3d   BigBoss   合并冲突
188
189
190
191
192
  				}).then(
  				setTimeout(()=>{
  					uni.navigateBack()
  				},1500)
  				)
9a8f39ae3   BigBoss   订单
193
  			}
4de4be344   喻鹏   客服在线和我的订单-待付款
194
195
196
197
198
  		}
  	}
  </script>
  
  <style lang="scss" scoped>
9a8f39ae3   BigBoss   订单
199
200
  	.content{
  		min-height: 100vh;
4de4be344   喻鹏   客服在线和我的订单-待付款
201
202
  		display: flex;
  		flex-direction: column;
9a8f39ae3   BigBoss   订单
203
  		justify-content: flex-start;
4de4be344   喻鹏   客服在线和我的订单-待付款
204
  		align-items: center;
ab4209caf   喻鹏   update
205
  		background-color: #f2f2f2;
4de4be344   喻鹏   客服在线和我的订单-待付款
206
207
  	}
  	
4de4be344   喻鹏   客服在线和我的订单-待付款
208
  	
ab4209caf   喻鹏   update
209
  	.order {
ab4209caf   喻鹏   update
210
  		margin-bottom: 112rpx;
9a8f39ae3   BigBoss   订单
211
212
213
  		background: #F2F2F2;
  		margin-top: 140rpx;
  		width: 670rpx;
4de4be344   喻鹏   客服在线和我的订单-待付款
214
  	}
9a8f39ae3   BigBoss   订单
215

4de4be344   喻鹏   客服在线和我的订单-待付款
216
217
218
219
220
  	.order-time {
  		width: 100%;
  		height: 140rpx;
  		background-color: #fff;
  		display: flex;
9a8f39ae3   BigBoss   订单
221
222
223
224
225
  		justify-content: center;
  		align-items: center;
  		position: fixed;
  		top: 0 ;
  		left: 0;
4de4be344   喻鹏   客服在线和我的订单-待付款
226
227
  		text {
  			// font-family: PingFangSC-Regular;
9a8f39ae3   BigBoss   订单
228
  			// margin-top: 48rpx;
4de4be344   喻鹏   客服在线和我的订单-待付款
229
230
231
232
233
234
235
236
237
238
239
240
  			font-size: 14px;
  			color: #333333;
  			letter-spacing: -0.26px;
  		}
  		.p2 {
  			// font-family: DINAlternate-Bold;
  			margin: 42rpx 20rpx 0 20rpx;
  			font-size: 18px;
  			color: #EC5D3B;
  			letter-spacing: -0.34px;
  		}
  	}
9a8f39ae3   BigBoss   订单
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
  	.headerBanner{
  		width: 100%;
  		height: 140rpx;
  		background: #4A90E2;
  		padding: 26rpx 60rpx 24rpx 60rpx;
  		box-sizing: border-box;
  		color: #FFFFFF;
  		display: flex;
  		justify-content: space-between;
  		align-items: center;
  		position: fixed;
  		top: 0 ;
  		left: 0;
  		.bannerLeft{
  			font-size: 36rpx;
  			display: flex;
  			flex-direction: column;
  			justify-content: center;
  			align-items: center;
  			.T2{
  				font-size: 24rpx;
  			}
  		}
  		image{
  			height: 56rpx;
  			width: 72rpx;
  		}
  	}
  		
4de4be344   喻鹏   客服在线和我的订单-待付款
270
  	.order-user {
4de4be344   喻鹏   客服在线和我的订单-待付款
271
272
273
274
275
276
277
278
279
  		height: 228rpx;
  		background: #FFFFFF;
  		border-radius: 14rpx;
  		margin: 0 auto;
  		margin-top: 20rpx;
  		margin-bottom: 20rpx;
  		.order-user-head {
  			display: flex;
  			height: 108rpx;
4de4be344   喻鹏   客服在线和我的订单-待付款
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
  			align-items: center;
  			margin-left: 126rpx;
  			.p1 {
  				// font-family: PingFangSC-Regular;
  				font-size: 14px;
  				color: #333333;
  				letter-spacing: -0.26px;
  				margin-right: 20rpx;
  			}
  			.p2 {
  				// font-family: PingFangSC-Regular;
  				font-size: 14px;
  				color: #999999;
  				letter-spacing: -0.26px;
  			}
  		}
  		.order-user-body {
  			display: flex;
  			width: 100%;
  			image{
  				width: 24px;
  				height: 26px;
  				margin: 12rpx 32rpx 0 40rpx;
  			}
  			.p3 {
  				// font-family: PingFangSC-Semibold;
  				font-size: 14px;
  				color: #333333;
  				letter-spacing: -0.26px;
  			}
  		}
  	}
  	
  	.order-info {
4de4be344   喻鹏   客服在线和我的订单-待付款
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
  		background-color: #fff;
  		box-shadow: 0 0 20rpx 0 rgba(177,128,128,0.06);
  		border-radius: 16rpx;
  		margin: 0 auto;
  		view{
  			margin-left: 40rpx;
  		}
  		text{
  			font-size: 14px;
  		}
  		.order-info-head {
  			display: flex;
  			padding-top: 40rpx;
  			image{
  				height: 188rpx;
  				width: 188rpx;
  			}
  			.order-info-head-r{
  				margin: 0;
  				width: 368rpx;
  				margin-left: 24rpx;
  				// margin-top: 40rpx;
  				text{
  					display: block;
  				}
ab4209caf   喻鹏   update
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
  				// .arrow{
  				// width: 0;
  				// height: 0;
  				// border-left: 5px transparent;
  				// border-right: 5px transparent;
  				// border-top: 5px #979797;
  				// border-bottom: 0 transparent;
  				// border-style: solid;
  				// position: relative;
  				// // transform: scaleY(-1);
  				// }
  				// .arrow::after{
  				//     content: '';
  				//     position: absolute;
  				//     top: -6.5px;
  				//     left: -5px;
  				// 	border-left: 5px transparent;
  				// 	border-right: 5px transparent;
  				// 	border-top: 5px #FFFFFF;
  				// 	border-bottom: 0 transparent;
  				// 	border-style: solid;
  				// }
4de4be344   喻鹏   客服在线和我的订单-待付款
361
  				.p1 {
ab4209caf   喻鹏   update
362
  					min-height: 40px;
4de4be344   喻鹏   客服在线和我的订单-待付款
363
364
365
366
367
368
369
370
371
372
373
374
375
376
  					// font-family: PingFangSC-Regular;
  					font-size: 14px;
  					color: #333333;
  					letter-spacing: -0.26px;
  					line-height: 18px;
  					// line-height: 20px;
  				}
  				.p2 {
  					height: 34px;
  					padding: 1px 0 3px 0;
  					// font-family: PingFangSC-Regular;
  					font-size: 12px;
  					color: #999999;
  					letter-spacing: -0.23px;
9a8f39ae3   BigBoss   订单
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
  				}
  				.infoText-bottom{
  					display: flex;
  					flex-direction: row;
  					justify-content: flex-start;
  					align-items: center;
  					width: 100%;
  					margin-left: 0;
  					.markPrice{
  						font-size: 14px;
  						color: #FF6B4A;
  						margin-right: 20rpx;
  						margin-left: 0rpx;
  					}
  					.buy-num{
  						font-size: 12px;
  						color: #999999;
  					}
ab4209caf   喻鹏   update
395
  				}
4de4be344   喻鹏   客服在线和我的订单-待付款
396
397
398
  			}
  
  		}
ab4209caf   喻鹏   update
399
400
401
402
403
404
405
406
407
408
409
410
  		// .order-info-goodsnum {
  		// 	display: flex;
  		// 	align-items: center;
  		// 	justify-content: flex-end;
  		// 	text {
  		// 		margin-right: 44rpx;
  		// 		// ont-family: PingFangSC-Regular;
  		// 		font-size: 12px;
  		// 		color: #999999;
  		// 		letter-spacing: -0.23px;
  		// 	}
  		// }
4de4be344   喻鹏   客服在线和我的订单-待付款
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
  		.order-info-freight {
  			display: block;
  			margin-left: 40rpx;
  			margin-top: 22rpx;
  			.p1{
  				// font-family: PingFangSC-Regular;
  				font-size: 14px;
  				color: #333333;
  				letter-spacing: -0.26px;
  				line-height: 18px;
  				margin-right: 24px;
  			}
  			.p2 {
  				// font-family: PingFangSC-Regular;
  				font-size: 14px;
  				color: #FF6B4A;
  				letter-spacing: -0.26px;
  			}
  		}
  		.order-info-discount {
  			display: block;
  			margin-left: 40rpx;
  			margin-top: 24rpx;
  			.p1 {
  				// font-family: PingFangSC-Regular;
  				font-size: 14px;
  				color: #333333;
  				letter-spacing: -0.26px;
  				line-height: 18px;
  				margin-right: 24px;
  			}
  			.p2 {
  				// font-family: PingFangSC-Regular;
  				font-size: 14px;
  				color: #FF6B4A;
  				letter-spacing: -0.26px;
  			}
  		}
  		.order-info-price {
  			display: block;
  			margin-left: 40rpx;
  			margin-top: 24rpx;
  			.p1 {
  				// font-family: PingFangSC-Semibold;
  				font-size: 14px;
  				color: #333333;
  				letter-spacing: -0.26px;
  				line-height: 18px;
  				margin-right: 24px;
  			}
  			.p2 {
  				// font-family: PingFangSC-Semibold;
  				font-size: 14px;
  				color: #FF6B4A;
  				letter-spacing: -0.26px;
  			}
  		}
  		.order-info-num{
  			display: block;
  			margin-left: 40rpx;
  			margin-top: 44rpx;
  			text{
  				// font-family: PingFangSC-Regular;
  				font-size: 12px;
  				color: #999999;
  				letter-spacing: -0.23px;
  			}
  		}
  		.order-info-time {
  			display: block;
  			margin: 8rpx 0 48rpx 40rpx;
  			text{
  				// font-family: PingFangSC-Regular;
  				font-size: 12px;
  				color: #999999;
  				letter-spacing: -0.23px;
  			}
  		}
  		.order-info-hr{
  			width: 520rpx;
  			height: 1px;
  			background-color: #E9E9E9;
  			margin-bottom: 20rpx;
  		}
  		.order-info-contact {
  			display: flex;
  			padding-bottom: 28rpx;
  			image{
  				width: 19px;
  				height: 16px;
  			}
  			text {
  				// font-family: PingFangSC-Regular;
  				margin-left: 20rpx;
  				font-size: 14px;
  				color: #333333;
  				letter-spacing: -0.26px;
  				line-height: 18px;
  			}
  		}
  	}
  	
  	.order-confim {
  		display: flex;
9a8f39ae3   BigBoss   订单
515
516
517
  		align-items: center;
  		justify-content: flex-end;
  		// z-index: 999;
4de4be344   喻鹏   客服在线和我的订单-待付款
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
  		width: 100%;
  		height: 112rpx;
  		position: fixed;
  		bottom: 0;
  		background: #FFFFFF;
  		button {
  			width: 204rpx;
  			height: 80rpx;
  			border: 1px solid #FF6B4A;
  			border-radius: 40rpx;
  			font-size: 32rpx;
  			letter-spacing: -0.3px;
  			margin-right: 0;
  		}
  		.b1 {
  			// font-family: PingFangSC-Regular;
  			color: #FF6B4A;
9a8f39ae3   BigBoss   订单
535
  			background-color: #FFFFFF;
4de4be344   喻鹏   客服在线和我的订单-待付款
536
537
538
539
540
541
542
543
544
545
  		}
  		.b2 {
  			// font-family: PingFangSC-Regular;
  			background-color: #FF6B4A;
  			color: #FFFFFF;
  			margin: 0 26rpx 0 20rpx;
  		}
  	}
  	
  </style>