瀏覽代碼

feat:提交代码,对接完电影模块

longzhicheng 1 年之前
父節點
當前提交
c61a233283

File diff suppressed because it is too large
+ 1 - 1
src/pages.json


+ 14 - 10
src/pages/payment/index.vue

@@ -26,8 +26,8 @@ onLoad((options) => {
26 26
     state.payPrice = options.pay_price
27 27
     state.orderId = options.order_id
28 28
 	state.initType =options.initType //3 电影购票 1充值话费
29
-	state.orderSn = options.orderSn
30
-	console.log("===options.pay_price",options.pay_price);
29
+	state.orderSn = options.order_sn
30
+	console.log("===options.pay_price",options);
31 31
 
32 32
     if (options.tabIndex)
33 33
       state.tabIndex = options.tabIndex
@@ -51,7 +51,14 @@ function handleConfirm() {
51 51
     duration: 3000,
52 52
   })
53 53
   console.log("====state.orderId",state.orderId);
54
-   console.log("====state.orderId",state.orderList);
54
+   
55
+   let params =  {
56
+      oid: state.orderId,
57
+      OrderLists: state.orderList?state.orderList:[],
58
+      type: state.initType==1?'xfbspzfHF':(state.initType==3?'dyxfbzh':'xfbspzf'),// 商品--xfbspzf  话费--xfbspzfHF
59
+    }
60
+	
61
+	console.log("====state.params",params);
55 62
   uni.navigateToMiniProgram({
56 63
     // appid  写你要跳转的小程序的 appid
57 64
     // appId: 'wxfb755febdb800f23',
@@ -59,14 +66,11 @@ function handleConfirm() {
59 66
     // 路径写  src下的路径,假如你跳转的是pages下的页面,就可以写pages/index
60 67
     // path: 'pagesA/oderPay/oder_nian',
61 68
     path: 'pages/payment/payment',
62
-    extraData: {
63
-      oid: state.orderId,
64
-      OrderLists: state.orderList?state.orderList:[],
65
-      type: state.initType==1?'xfbspzfHF':(state.initType==3?'dyxfbzh':'xfbspzf'),// 商品--xfbspzf  话费--xfbspzfHF
66
-    },
69
+    extraData: params,
67 70
     envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
68 71
     // envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
69 72
     success(res) {
73
+		console.log("res===",res);
70 74
       // 打开成功
71 75
       uni.showToast({
72 76
         title: '跳转成功',
@@ -91,8 +95,8 @@ function onClickLeft() {
91 95
 	}
92 96
 	
93 97
 	if(state.initType==3){
94
-		uni.navigateBack({
95
-		  delta: 1,
98
+		uni.redirectTo({
99
+			url:`/subPages/pages/movies/orderDetail?orderSn=${state.orderSn}`
96 100
 		})
97 101
 		return
98 102
 	}

+ 0 - 619
src/subPages/pages/movies/chooseSeat - 副本.vue

@@ -1,619 +0,0 @@
1
-<template>
2
-	<view class="w-100">
3
-		<view class="bg-f1 h-100vh">
4
-			<view class="pt-f left-0 w-100 p-0-32 bg-white z1000" :style="'height: 132rpx;top:0'">
5
-				<view>
6
-					<view class="fz-34 fw-b pt-20">
7
-						{{initInfo.film_name}}
8
-					</view>
9
-					<view class="mt-10 fz-28 color-666">
10
-						{{initInfo.show_des}}
11
-					</view>
12
-				</view>
13
-			</view>
14
-			<movable-area :style="'height:'+(seatRow*40+350)+'rpx;width: 100vw;top:'+(rpxNum*132)+'px'" class="pt-f left-0">
15
-				<movable-view :style="'width: 100vw;height:'+(seatRow*40+350)+'rpx;'" :inertia="true" :scale="true" :scale-min="0.95"
16
-				 :scale-max="2" direction="all" @change="onMove" @scale="onScale">
17
-					<view class="Stage dp-f jc-c ai-c fz-22 color-333">
18
-						{{initInfo.hall_name}}
19
-					</view>
20
-					<view style="width: 100rpx;height: 30rpx;" class="m-0-a mt-48 dp-f jc-c ai-c fz-20 color-999 b-1 br-5">银幕中央</view>
21
-					
22
-					<view class="pt-f pa-v-2 b-d-1" :style="'height:'+seatRow*(20+seatSize*pxNum)+'rpx;top:165rpx;width:0'"></view>
23
-					
24
-					<view v-for="(item,index) in seatArray" :key="index" class="dp-f jc-c mt-20" :style="'width:'+boxWidth+'px;height:'+seatSize+'px'">
25
-						<view v-for="(seat,col) in item" :key="col" class="dp-ib" :style="'width:'+seatSize+'px;height:'+seatSize+'px'"
26
-						 @click="handleChooseSeat(index,col)">
27
-							<image v-if="seat.status===1" class="w-100 h-100" src="../../static/unselected.png" mode="aspectFit"></image>
28
-							<image v-else-if="seat.status===2" class="w-100 h-100" src="../../static/selected.png" mode="aspectFit"></image>
29
-							<image v-else-if="seat.status===0" class="w-100 h-100" src="../../static/bought.png" mode="aspectFit"></image>
30
-						</view>
31
-					</view>
32
-					
33
-					<view class="pt-f bg-line br-15 over-h" :style="'left: '+(10-moveX/scale)+'px;top:109rpx;width:30rpx;'">
34
-						<view class="w-100 dp-f ai-c jc-c fz-22 color-fff" :style="'height:'+seatSize+'px;margin-top:20rpx;'" v-for="(m,mindex) in mArr"
35
-						 :key="mindex">{{m}}</view>
36
-						<view :style="'height: 20rpx;'"></view>
37
-					</view>
38
-
39
-				</movable-view>
40
-			</movable-area>
41
-			<view class="pt-f bottom-bar left-0 dp-f fd-cr z1000">
42
-				<view class="bg-white p-all-32">
43
-					<!-- <view class="dp-f ai-c jc-c fz-28 color-333 mb-20" v-if="SelectNum===0">
44
-						推荐选座
45
-						<view style="width: 106rpx;height: 60rpx;" class="b-1 br-5 dp-f ai-c jc-c fz-28 ml-20" v-for="(n,numindex) in 4"
46
-						 :key="n" @click="smartChoose(numindex+1)">
47
-							{{numindex+1}}人
48
-						</view>
49
-					</view> -->
50
-					<view class="dp-f ai-c fw-w fz-28 color-333 mb-20" v-if="SelectNum>0">
51
-						<text>已选</text>
52
-						<view class="p-all-10 b-1 br-5 dp-f ai-c jc-c fz-28 ml-20" v-for="(optItem,optindex) in optArr" :key="optindex">
53
-							{{optItem.seatNo}}
54
-						</view>
55
-					</view>
56
-					<view style="width: 686rpx;height: 90rpx;" class="dp-f jc-c ai-c br-10 fz-34 color-fff" :class="SelectNum>0?'bg-red-1':'bg-unbtn'"
57
-					 @click="buySeat">
58
-						{{SelectNum>0?('¥ '+totalPrice+' 确认座位'):'请选座位'}}
59
-					</view>
60
-				</view>
61
-				<view class="dp-f jc-c ai-c mb-20 fz-28" v-if="showTis && seatSize!=0">
62
-					<view class="dp-f jc-c ai-c m-0-10">
63
-						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/unselected.png" mode="aspectFit"></image><span
64
-						 class="ml-10">可选</span>
65
-					</view>
66
-					<view class="dp-f jc-c ai-c m-0-10">
67
-						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/bought.png" mode="aspectFit"></image><span
68
-						 class="ml-10">不可选</span>
69
-					</view>
70
-					<view class="dp-f jc-c ai-c m-0-10">
71
-						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/selected.png" mode="aspectFit"></image><span
72
-						 class="ml-10">选中</span>
73
-					</view>
74
-				</view>
75
-			</view>
76
-		</view>
77
-	</view>
78
-</template>
79
-<script>
80
-	
81
-	import {
82
-		seatData
83
-	} from '@/utils/seat-data.js'
84
-	
85
-	import {
86
-		apiGetSchedSeatList,
87
-		apiSubmitOrder
88
-	} from '~/apis/movies'
89
-	export default {
90
-		data() {
91
-			return {
92
-				scaleMin:1,//h5端为解决1无法缩小问题,设为0.95
93
-				boxWidth: 400, //屏幕宽度px
94
-				space: ' ', //空格
95
-				seatArray: [], //影院座位的二维数组,-1为非座位,0为未购座位,1为已选座位(绿色),2为已购座位(红色),一维行,二维列
96
-				seatRow: 0, //影院座位行数
97
-				seatCol: 0, //影院座位列数
98
-				seatSize: 0, //座位尺寸
99
-				SelectNum: 0, //选择座位数
100
-				moveX: 0, //水平移动偏移量
101
-				scale: 1, //放大倍数
102
-				minRow: 0, //从第几行开始排座位
103
-				minCol: 0, //从第几列开始排座位
104
-				showTis: true, //显示选座提示
105
-				seatList: [], //接口获取的原始位置
106
-				mArr: [], //排数提示
107
-				optArr: [], //选中的座位数组。
108
-				isWXAPP:false,
109
-				relation_id:'',
110
-				sched_sign:'',
111
-				initInfo:'',
112
-				orgSeatList:[],
113
-				siginPrice:'',
114
-				channelSn:'',
115
-				totalPrice:0,
116
-				isFirstInit:true,
117
-				isCanClick:true
118
-			};
119
-		},
120
-		computed: {
121
-			// aPrice() {
122
-			// 	return (this.SelectNum * (this.siginPrice*100))/100
123
-			// },
124
-			rpxNum() {
125
-				return this.boxWidth / 750
126
-			},
127
-			pxNum() {
128
-				return 750 / this.boxWidth
129
-			},
130
-		},
131
-		
132
-		onLoad(e) {
133
-			this.initWidth()
134
-			if(e.info){
135
-				this.initInfo  = JSON.parse(decodeURIComponent(e.info))
136
-				this.getSeatList()
137
-			}
138
-		},
139
-		
140
-		onShow() {
141
-			if(!this.isFirstInit){
142
-				this.resetSeat()
143
-				this.getSeatList()
144
-			}
145
-			this.isFirstInit =false
146
-		},
147
-	
148
-		
149
-		methods: {
150
-			
151
-			initWidth(){
152
-				//获取宽度
153
-				let _this =this
154
-				uni.getSystemInfo({
155
-					success: function(e) {
156
-						_this.boxWidth = e.screenWidth
157
-						//#ifdef H5
158
-						_this.scaleMin = 0.95
159
-						//#endif
160
-					}
161
-				})
162
-			},
163
-			
164
-			 completeSeats(originalData) {
165
-			  // 1. 确定最大行号和列号
166
-			  let maxRow = 0, maxColumn = 0;
167
-			  originalData.forEach(rowArray => {
168
-			    rowArray.forEach(seat => {
169
-			      maxRow = Math.max(maxRow, parseInt(seat.rowNo));
170
-			      maxColumn = Math.max(maxColumn, parseInt(seat.columnNo));
171
-			    });
172
-			  });
173
-			   this.seatRow  = maxRow//数组长度
174
-			   this.seatCol  = maxColumn//子数组中长度最大的
175
-			  // 2. 按行号整理原始数据
176
-			  const rowMap = new Map();
177
-			  originalData.forEach(rowArray => {
178
-			    if (rowArray.length === 0) return;
179
-			    const rowNo = rowArray[0].rowNo;
180
-			    rowMap.set(rowNo, rowArray);
181
-			  });
182
-			
183
-			  // 3. 生成完整的行和列
184
-			  const result = [];
185
-			  for (let row = 1; row <= maxRow; row++) {
186
-			    const rowNo = row.toString();
187
-			    const currentRow = rowMap.get(rowNo) || [];
188
-			    const columnMap = new Map(currentRow.map(seat => [seat.columnNo, seat]));
189
-			
190
-			    // 生成当前排的完整列数据
191
-			    const completedColumns = Array.from({ length: maxColumn }, (_, colIdx) => {
192
-			      const columnNo = (colIdx + 1).toString();
193
-			      return columnMap.has(columnNo) 
194
-			        ? columnMap.get(columnNo) 
195
-			        : { 
196
-			            supplier_id: null, 
197
-			            seatNo: `${rowNo}排${columnNo.padStart(2, '0')}座`, 
198
-			            rowNo, 
199
-			            columnNo ,
200
-						status:-1
201
-			          };
202
-			    });
203
-				
204
-			    result.push(completedColumns);
205
-			  }
206
-			
207
-			  return result;
208
-			},
209
-		
210
-			getSeatList(){
211
-				uni.showLoading()
212
-				let params = `relation_id=${this.initInfo.relation_id}&sched_sign=${this.initInfo.sched_sign}`
213
-				apiGetSchedSeatList(params).then(res => {
214
-					this.orgSeatList = res
215
-					if(res.length!=0){
216
-						this.seatArray = this.completeSeats(this.orgSeatList)
217
-						this.initSeatArray()
218
-						uni.hideLoading()
219
-					}else{
220
-						uni.showToast({
221
-							title:'未获取到座位数据',
222
-							icon:'none'
223
-						})
224
-					}
225
-			     
226
-				})
227
-			},
228
-			
229
-			submitOrder(){
230
-				if(!this.isCanClick){
231
-					return
232
-				}
233
-				this.isCanClick=false
234
-				uni.showLoading({
235
-					title:'处理中...',
236
-					mask:true
237
-				})
238
-			let _newArr=this.optArr.map((res)=>{
239
-					return {seat_no:res.seatNo,seat_sign:res.seatSign,channel_sn:res.channel_sn}
240
-				})
241
-				
242
-				let params ={
243
-					sched_sign:this.initInfo.sched_sign,
244
-					channel_sn:_newArr[0].channel_sn,
245
-					sched_seat:JSON.stringify(_newArr),
246
-					hall_sign:this.initInfo.hall_sign,
247
-					hall_name:this.initInfo.hall_name,
248
-					show_date:this.initInfo.show_date,
249
-					show_time:this.initInfo.show_time,
250
-					cinema_sign:this.initInfo.cinema_sign,
251
-					phone:uni.getStorageSync('USER_INFO_PHONE'),
252
-					
253
-					film_sign:this.initInfo.film_sign,
254
-					relation_id:this.initInfo.relation_id,
255
-				}
256
-				apiSubmitOrder(params).then(res => {
257
-					uni.hideLoading()
258
-					uni.navigateTo({
259
-						url:`/subPages/pages/movies/moviesOrder?order_sn=${res.order_sn}&oid=${res.oid}&code=${res.code}&type=${res.type}`
260
-					})
261
-				}).catch((e)=>{
262
-					console.log("===e",e);
263
-					this.isCanClick=true
264
-			    uni.showToast({
265
-				title:e ||'接口异常!',
266
-				icon:'none'
267
-			})
268
-		})
269
-			},
270
-			
271
-			//初始座位数组
272
-			initSeatArray() {
273
-				this.seatSize = this.boxWidth > 0 ?
274
-					parseInt(parseInt(this.boxWidth, 10) / (this.seatCol + 3), 10) :
275
-					parseInt(parseInt(414, 10) / (this.seatCol + 3), 10)
276
-				   this.initNonSeatPlace();
277
-			},
278
-			
279
-			//初始化是座位的地方
280
-			initNonSeatPlace() {
281
-				let mArr = []
282
-				for (var i = 0; i <this.seatArray.length; i++) {
283
-					let _item = this.seatArray[i]
284
-					let _name =''
285
-					for (var j = 0; j < _item.length; j++) {
286
-						let childItem = _item[j]
287
-						if (childItem.status!=-1 ) {
288
-							//this.siginPrice = childItem.price
289
-							this.channelSn =childItem.channel_sn
290
-							if(childItem.seatNo.indexOf('排')!= -1){
291
-								_name= childItem.seatNo.split('排')[0]
292
-							}else{
293
-								_name= childItem.rowNo
294
-							}
295
-							break
296
-						} 
297
-					}
298
-					mArr.push(_name)
299
-				}
300
-				this.mArr = mArr
301
-			},
302
-			//放大缩小事件
303
-			onScale(e) {
304
-				this.showTis = false
305
-				// this.moveX=-e.detail.x
306
-				let w = this.boxWidth * 0.5
307
-				let s = 1 - e.detail.scale
308
-				this.moveX = w * s
309
-				this.scale = e.detail.scale
310
-				if (s > 0 || s === 0) {
311
-					this.showTis = true
312
-				}
313
-			},
314
-			//移动事件
315
-			onMove(e) {
316
-				this.showTis = false
317
-				this.moveX = e.detail.x
318
-			},
319
-			//重置座位
320
-			resetSeat() {
321
-				this.totalPrice=0
322
-				this.SelectNum = 0
323
-				this.optArr = []
324
-				//将所有已选座位的值变为0
325
-				let oldArray = this.seatArray.slice();
326
-				for (let i = 0; i < this.seatRow; i++) {
327
-					for (let j = 0; j < this.seatCol; j++) {
328
-						if (oldArray[i][j].status === 2) {
329
-							oldArray[i][j].status = 1
330
-						}
331
-					}
332
-				}
333
-				this.seatArray = oldArray;
334
-			},
335
-			//选定且购买座位
336
-			buySeat() {
337
-				if (this.SelectNum === 0) {
338
-					return
339
-				}
340
-				let _this =this
341
-				for (let i = 0; i < this.optArr.length; i++) {
342
-					let _price = this.optArr[0].price
343
-					if(_price != this.optArr[i].price){
344
-						uni.showModal({
345
-							title:'温馨提示',
346
-							content:'请选择相同价格的座位,暂不支持不同价格的座位同时下单,如有需要请单独选择座位下单~',
347
-							complete: (res) => {
348
-								_this.resetSeat()
349
-							}
350
-						})
351
-						return
352
-					}
353
-				}
354
-				this.submitOrder()
355
-			},
356
-			
357
-			
358
-			//处理座位选择逻辑
359
-			handleChooseSeat(row, col) {
360
-				let seatValue = this.seatArray[row][col].status;
361
-				let newArray = this.seatArray;
362
-				//情侣座处理,基数加1 偶数减1
363
-				//如果是已购座位,直接返回
364
-				if (seatValue === 0 || seatValue === -1) return
365
-				//如果是已选座位点击后变未选
366
-				if (seatValue === 2) {
367
-					newArray[row][col].status = 1
368
-					this.SelectNum--
369
-					this.getOptArr(newArray[row][col], 0)
370
-					this.totalPrice = (parseFloat(this.totalPrice )*100- parseFloat(newArray[row][col].price)*100)/100
371
-				} else if (seatValue === 1) {
372
-					if(this.SelectNum==4){
373
-						uni.showToast({
374
-							title:'每次最多只能选择4个座位',
375
-							icon:'none'
376
-						})
377
-						return
378
-					}
379
-					newArray[row][col].status =2
380
-					this.totalPrice = ( parseFloat(this.totalPrice )*100 +  parseFloat(newArray[row][col].price)*100)/100
381
-					this.SelectNum++
382
-					this.getOptArr(newArray[row][col], 1)
383
-				}
384
-				//必须整体更新二维数组,Vue无法检测到数组某一项更新,必须slice复制一个数组才行
385
-				this.seatArray = newArray.slice();
386
-			
387
-			},
388
-			//处理已选座位数组
389
-			getOptArr(item, type) {
390
-				let optArr = this.optArr
391
-				if (type === 1) {
392
-					optArr.push(item)
393
-				} else if (type === 0) {
394
-					let arr = []
395
-					optArr.forEach(v => {
396
-						if (v.seatSign !== item.seatSign) {
397
-							arr.push(v)
398
-						}
399
-					})
400
-					optArr = arr
401
-				}
402
-				this.optArr = optArr.slice()
403
-			},
404
-			
405
-		}
406
-	}
407
-</script>
408
-
409
-<style lang="scss" scoped>
410
-	.p-all-10{
411
-		padding: 10rpx;
412
-	}
413
-	.ml-10 {
414
-		margin-left: 10rpx;
415
-	}
416
-
417
-	.m-0-10 {
418
-		margin: 0 10rpx;
419
-	}
420
-
421
-	.bg-unbtn {
422
-		background-color: #f9abb3;
423
-	}
424
-
425
-	.bg-red-1 {
426
-		background-color: #F45664;
427
-	}
428
-
429
-	.br-10 {
430
-		border-radius: 10rpx;
431
-	}
432
-
433
-	.ml-20 {
434
-		margin-left: 20rpx;
435
-	}
436
-
437
-	.mb-20 {
438
-		margin-bottom: 20rpx;
439
-	}
440
-
441
-	.p-all-32 {
442
-		padding: 32rpx;
443
-	}
444
-
445
-	.fd-cr {
446
-		flex-direction: column-reverse;
447
-		/* 主轴方向从下到上,默认从左到右 */
448
-	}
449
-
450
-	.bottom-bar {
451
-		bottom: var(--window-bottom);
452
-	}
453
-
454
-	.color-fff {
455
-		color: #fff
456
-	}
457
-
458
-	.br-15 {
459
-		border-radius: 15rpx;
460
-	}
461
-
462
-	.over-h {
463
-		overflow: hidden;
464
-	}
465
-
466
-	.dp-ib {
467
-		display: inline-block;
468
-	}
469
-
470
-	.mt-20 {
471
-		margin-top: 20rpx;
472
-	}
473
-
474
-	.pa-v-2 {
475
-		/* 定位垂直对齐 */
476
-		left: 50%;
477
-		transform: translateX(-50%)
478
-	}
479
-
480
-	.b-d-1 {
481
-		border: 1px dashed #e5e5e5;
482
-	}
483
-
484
-	.w-100 {
485
-		width: 100%;
486
-	}
487
-
488
-	.h-100 {
489
-		height: 100%;
490
-	}
491
-
492
-	.bg-f1 {
493
-		background-color: #f1f1f1;
494
-	}
495
-
496
-	.h-100vh {
497
-		height: 100vh;
498
-	}
499
-
500
-	.pt-f {
501
-		position: fixed;
502
-	}
503
-
504
-	.left-0 {
505
-		left: 0;
506
-	}
507
-
508
-	.p-0-32 {
509
-		padding: 0 32rpx;
510
-	}
511
-
512
-	.pt-20 {
513
-		padding-top: 20rpx;
514
-	}
515
-
516
-	.bg-white {
517
-		background-color: #fff;
518
-	}
519
-
520
-	.z1000 {
521
-		z-index: 1000;
522
-	}
523
-
524
-	.fz-34 {
525
-		font-size: 34rpx;
526
-	}
527
-
528
-	.fw-b {
529
-		font-weight: bold;
530
-	}
531
-
532
-	.mt-10 {
533
-		margin-top: 10rpx;
534
-	}
535
-
536
-	.fz-28 {
537
-		font-size: 28rpx;
538
-	}
539
-
540
-	.color-666 {
541
-		color: #666666
542
-	}
543
-
544
-	.dp-f {
545
-		display: flex;
546
-	}
547
-
548
-	.jc-c {
549
-		justify-content: center;
550
-	}
551
-
552
-	.ai-c {
553
-		align-items: center;
554
-	}
555
-
556
-	.fz-22 {
557
-		font-size: 22rpx;
558
-	}
559
-
560
-	.color-333 {
561
-		color: #333333
562
-	}
563
-
564
-	.m-0-a {
565
-		margin: 0 auto;
566
-	}
567
-
568
-	.mt-48 {
569
-		margin-top: 48rpx;
570
-	}
571
-
572
-	.fz-20 {
573
-		font-size: 20rpx;
574
-	}
575
-
576
-	.color-999 {
577
-		color: #999999
578
-	}
579
-
580
-	.b-1 {
581
-		border: 1px solid #CCCCCC;
582
-	}
583
-
584
-	.br-5 {
585
-		border-radius: 5rpx;
586
-	}
587
-
588
-	.Stage {
589
-		background-color: #dddddd;
590
-		width: 380rpx;
591
-		height: 50rpx;
592
-		transform: perspective(50rpx) rotateX(-10deg);
593
-		margin: 0 auto;
594
-	}
595
-
596
-	.bg-line {
597
-		background-color: rgba(0, 0, 0, 0.3);
598
-	}
599
-
600
-	.sel-seat {
601
-		background: url('/static/selected.png') center center no-repeat;
602
-		background-size: 100% 100%;
603
-	}
604
-	
605
-	.unsel-seat {
606
-		background: url('/static/unselected.png') center center no-repeat;
607
-		background-size: 100% 100%;
608
-	}
609
-	
610
-	.bought-seat {
611
-		background: url('/static/bought.png') center center no-repeat;
612
-		background-size: 100% 100%;
613
-	}
614
-</style>
615
-<route lang="yaml">
616
-style:
617
-  navigationBarTitleText: 选择座位
618
-  enablePullDownRefresh: true
619
-</route>

+ 166 - 172
src/subPages/pages/movies/chooseSeat.vue

@@ -11,28 +11,37 @@
11 11
 					</view>
12 12
 				</view>
13 13
 			</view>
14
-			<movable-area :style="'height:'+(seatRow*40+350)+'rpx;width: 100vw;top:'+(rpxNum*132)+'px'" class="pt-f left-0">
15
-				<movable-view :style="'width: 100vw;height:'+(seatRow*40+350)+'rpx;'" :inertia="true" :scale="true" :scale-min="0.95"
16
-				 :scale-max="2" direction="all" @change="onMove" @scale="onScale">
14
+			<movable-area :style="'height:'+(seatRow*40+350)+'rpx;width: 100vw;top:'+(rpxNum*132)+'px'"
15
+				class="pt-f left-0">
16
+				<movable-view :style="'width: 100vw;height:'+(seatRow*40+350)+'rpx;'" :inertia="true" :scale="true"
17
+					:scale-min="0.95" :scale-max="2" direction="all" @change="onMove" @scale="onScale">
17 18
 					<view class="Stage dp-f jc-c ai-c fz-22 color-333">
18 19
 						{{initInfo.hall_name}}
19 20
 					</view>
20
-					<view style="width: 100rpx;height: 30rpx;" class="m-0-a mt-48 dp-f jc-c ai-c fz-20 color-999 b-1 br-5">银幕中央</view>
21
-					
22
-					<view class="pt-f pa-v-2 b-d-1" :style="'height:'+seatRow*(20+seatSize*pxNum)+'rpx;top:165rpx;width:0'"></view>
23
-					
24
-					<view v-for="(item,index) in seatArray" :key="index" class="dp-f jc-c mt-20" :style="'width:'+boxWidth+'px;height:'+seatSize+'px'">
25
-						<view v-for="(seat,col) in item" :key="col" class="dp-ib" :style="'width:'+seatSize+'px;height:'+seatSize+'px'"
26
-						 @click="handleChooseSeat(index,col)">
27
-							<image v-if="seat.status===1" class="w-100 h-100" src="../../static/unselected.png" mode="aspectFit"></image>
28
-							<image v-else-if="seat.status===2" class="w-100 h-100" src="../../static/selected.png" mode="aspectFit"></image>
29
-							<image v-else-if="seat.status===0" class="w-100 h-100" src="../../static/bought.png" mode="aspectFit"></image>
21
+					<view style="width: 100rpx;height: 30rpx;"
22
+						class="m-0-a mt-48 dp-f jc-c ai-c fz-20 color-999 b-1 br-5">银幕中央</view>
23
+
24
+					<view class="pt-f pa-v-2 b-d-1"
25
+						:style="'height:'+seatRow*(20+seatSize*pxNum)+'rpx;top:165rpx;width:0'"></view>
26
+
27
+					<view v-for="(item,index) in seatArray" :key="index" class="dp-f jc-c mt-20"
28
+						:style="'width:'+boxWidth+'px;height:'+seatSize+'px'">
29
+						<view v-for="(seat,col) in item" :key="col" class="dp-ib"
30
+							:style="'width:'+seatSize+'px;height:'+seatSize+'px'" @click="handleChooseSeat(index,col)">
31
+							<image v-if="seat.status===1" class="w-100 h-100" src="../../static/unselected.png"
32
+								mode="aspectFit"></image>
33
+							<image v-else-if="seat.status===2" class="w-100 h-100" src="../../static/selected.png"
34
+								mode="aspectFit"></image>
35
+							<image v-else-if="seat.status===0" class="w-100 h-100" src="../../static/bought.png"
36
+								mode="aspectFit"></image>
30 37
 						</view>
31 38
 					</view>
32
-					
33
-					<view class="pt-f bg-line br-15 over-h" :style="'left: '+(10-moveX/scale)+'px;top:109rpx;width:30rpx;'">
34
-						<view class="w-100 dp-f ai-c jc-c fz-22 color-fff" :style="'height:'+seatSize+'px;margin-top:20rpx;'" v-for="(m,mindex) in mArr"
35
-						 :key="mindex">{{m}}</view>
39
+
40
+					<view class="pt-f bg-line br-15 over-h"
41
+						:style="'left: '+(10-moveX/scale)+'px;top:109rpx;width:30rpx;'">
42
+						<view class="w-100 dp-f ai-c jc-c fz-22 color-fff"
43
+							:style="'height:'+seatSize+'px;margin-top:20rpx;'" v-for="(m,mindex) in mArr" :key="mindex">
44
+							{{m}}</view>
36 45
 						<view :style="'height: 20rpx;'"></view>
37 46
 					</view>
38 47
 
@@ -49,27 +58,28 @@
49 58
 					</view> -->
50 59
 					<view class="dp-f ai-c fw-w fz-28 color-333 mb-20" v-if="SelectNum>0">
51 60
 						<text>已选</text>
52
-						<view class="p-all-10 b-1 br-5 dp-f ai-c jc-c fz-28 ml-20" v-for="(optItem,optindex) in optArr" :key="optindex">
61
+						<view class="p-all-10 b-1 br-5 dp-f ai-c jc-c fz-28 ml-20" v-for="(optItem,optindex) in optArr"
62
+							:key="optindex">
53 63
 							{{optItem.seatNo}}
54 64
 						</view>
55 65
 					</view>
56
-					<view style="width: 686rpx;height: 90rpx;" class="dp-f jc-c ai-c br-10 fz-34 color-fff" :class="SelectNum>0?'bg-red-1':'bg-unbtn'"
57
-					 @click="buySeat">
66
+					<view style="width: 686rpx;height: 90rpx;" class="dp-f jc-c ai-c br-10 fz-34 color-fff"
67
+						:class="SelectNum>0?'bg-red-1':'bg-unbtn'" @click="buySeat">
58 68
 						{{SelectNum>0?('¥ '+totalPrice+' 确认座位'):'请选座位'}}
59 69
 					</view>
60 70
 				</view>
61 71
 				<view class="dp-f jc-c ai-c mb-20 fz-28" v-if="showTis && seatSize!=0">
62 72
 					<view class="dp-f jc-c ai-c m-0-10">
63
-						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/unselected.png" mode="aspectFit"></image><span
64
-						 class="ml-10">可选</span>
73
+						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/unselected.png"
74
+							mode="aspectFit"></image><span class="ml-10">可选</span>
65 75
 					</view>
66 76
 					<view class="dp-f jc-c ai-c m-0-10">
67
-						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/bought.png" mode="aspectFit"></image><span
68
-						 class="ml-10">不可选</span>
77
+						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/bought.png"
78
+							mode="aspectFit"></image><span class="ml-10">不可选</span>
69 79
 					</view>
70 80
 					<view class="dp-f jc-c ai-c m-0-10">
71
-						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/selected.png" mode="aspectFit"></image><span
72
-						 class="ml-10">选中</span>
81
+						<image :style="'width:'+seatSize+'px;height:'+seatSize+'px'" src="/static/selected.png"
82
+							mode="aspectFit"></image><span class="ml-10">选中</span>
73 83
 					</view>
74 84
 				</view>
75 85
 			</view>
@@ -77,19 +87,17 @@
77 87
 	</view>
78 88
 </template>
79 89
 <script>
80
-	
81 90
 	import {
82 91
 		seatData
83 92
 	} from '@/utils/seat-data.js'
84
-	
93
+
85 94
 	import {
86 95
 		apiGetSchedSeatList,
87
-		apiSubmitOrder
88 96
 	} from '~/apis/movies'
89 97
 	export default {
90 98
 		data() {
91 99
 			return {
92
-				scaleMin:1,//h5端为解决1无法缩小问题,设为0.95
100
+				scaleMin: 1, //h5端为解决1无法缩小问题,设为0.95
93 101
 				boxWidth: 400, //屏幕宽度px
94 102
 				space: ' ', //空格
95 103
 				seatArray: [], //影院座位的二维数组,-1为非座位,0为未购座位,1为已选座位(绿色),2为已购座位(红色),一维行,二维列
@@ -105,16 +113,16 @@
105 113
 				seatList: [], //接口获取的原始位置
106 114
 				mArr: [], //排数提示
107 115
 				optArr: [], //选中的座位数组。
108
-				isWXAPP:false,
109
-				relation_id:'',
110
-				sched_sign:'',
111
-				initInfo:'',
112
-				orgSeatList:[],
113
-				siginPrice:'',
114
-				channelSn:'',
115
-				totalPrice:0,
116
-				isFirstInit:true,
117
-				isCanClick:true
116
+				isWXAPP: false,
117
+				relation_id: '',
118
+				sched_sign: '',
119
+				initInfo: '',
120
+				orgSeatList: [],
121
+				siginPrice: '',
122
+				channelSn: '',
123
+				totalPrice: 0,
124
+				isFirstInit: true,
125
+				isCanClick: true
118 126
 			};
119 127
 		},
120 128
 		computed: {
@@ -128,29 +136,29 @@
128 136
 				return 750 / this.boxWidth
129 137
 			},
130 138
 		},
131
-		
139
+
132 140
 		onLoad(e) {
133 141
 			this.initWidth()
134
-			if(e.info){
135
-				this.initInfo  = JSON.parse(decodeURIComponent(e.info))
142
+			if (e.info) {
143
+				this.initInfo = JSON.parse(decodeURIComponent(e.info))
136 144
 				this.getSeatList()
137 145
 			}
138 146
 		},
139
-		
147
+
140 148
 		onShow() {
141
-			if(!this.isFirstInit){
149
+			if (!this.isFirstInit) {
142 150
 				this.resetSeat()
143 151
 				this.getSeatList()
144 152
 			}
145
-			this.isFirstInit =false
153
+			this.isFirstInit = false
146 154
 		},
147
-	
148
-		
155
+
156
+
149 157
 		methods: {
150
-			
151
-			initWidth(){
158
+
159
+			initWidth() {
152 160
 				//获取宽度
153
-				let _this =this
161
+				let _this = this
154 162
 				uni.getSystemInfo({
155 163
 					success: function(e) {
156 164
 						_this.boxWidth = e.screenWidth
@@ -160,140 +168,123 @@
160 168
 					}
161 169
 				})
162 170
 			},
163
-			
164
-			 completeSeats(originalData) {
165
-			  // 1. 确定最大行号和列号
166
-			  let maxRow = 0, maxColumn = 0;
167
-			  originalData.forEach(rowArray => {
168
-			    rowArray.forEach(seat => {
169
-			      maxRow = Math.max(maxRow, parseInt(seat.rowNo));
170
-			      maxColumn = Math.max(maxColumn, parseInt(seat.columnNo));
171
-			    });
172
-			  });
173
-			   this.seatRow  = maxRow//数组长度
174
-			   this.seatCol  = maxColumn//子数组中长度最大的
175
-			  // 2. 按行号整理原始数据
176
-			  const rowMap = new Map();
177
-			  originalData.forEach(rowArray => {
178
-			    if (rowArray.length === 0) return;
179
-			    const rowNo = rowArray[0].rowNo;
180
-			    rowMap.set(rowNo, rowArray);
181
-			  });
182
-			
183
-			  // 3. 生成完整的行和列
184
-			  const result = [];
185
-			  for (let row = 1; row <= maxRow; row++) {
186
-			    const rowNo = row.toString();
187
-			    const currentRow = rowMap.get(rowNo) || [];
188
-			    const columnMap = new Map(currentRow.map(seat => [seat.columnNo, seat]));
189
-			
190
-			    // 生成当前排的完整列数据
191
-			    const completedColumns = Array.from({ length: maxColumn }, (_, colIdx) => {
192
-			      const columnNo = (colIdx + 1).toString();
193
-			      return columnMap.has(columnNo) 
194
-			        ? columnMap.get(columnNo) 
195
-			        : { 
196
-			            supplier_id: null, 
197
-			            seatNo: `${rowNo}排${columnNo.padStart(2, '0')}座`, 
198
-			            rowNo, 
199
-			            columnNo ,
200
-						status:-1
201
-			          };
202
-			    });
203
-				
204
-			    result.push(completedColumns);
205
-			  }
206
-			
207
-			  return result;
171
+
172
+			completeSeats(originalData) {
173
+				// 1. 确定最大行号和列号
174
+				let maxRow = 0,
175
+					maxColumn = 0;
176
+				originalData.forEach(rowArray => {
177
+					rowArray.forEach(seat => {
178
+						maxRow = Math.max(maxRow, parseInt(seat.rowNo));
179
+						maxColumn = Math.max(maxColumn, parseInt(seat.columnNo));
180
+					});
181
+				});
182
+				this.seatRow = maxRow //数组长度
183
+				this.seatCol = maxColumn //子数组中长度最大的
184
+				// 2. 按行号整理原始数据
185
+				const rowMap = new Map();
186
+				originalData.forEach(rowArray => {
187
+					if (rowArray.length === 0) return;
188
+					const rowNo = rowArray[0].rowNo;
189
+					rowMap.set(rowNo, rowArray);
190
+				});
191
+
192
+				// 3. 生成完整的行和列
193
+				const result = [];
194
+				for (let row = 1; row <= maxRow; row++) {
195
+					const rowNo = row.toString();
196
+					const currentRow = rowMap.get(rowNo) || [];
197
+					const columnMap = new Map(currentRow.map(seat => [seat.columnNo, seat]));
198
+
199
+					// 生成当前排的完整列数据
200
+					const completedColumns = Array.from({
201
+						length: maxColumn
202
+					}, (_, colIdx) => {
203
+						const columnNo = (colIdx + 1).toString();
204
+						return columnMap.has(columnNo) ?
205
+							columnMap.get(columnNo) :
206
+							{
207
+								supplier_id: null,
208
+								seatNo: `${rowNo}排${columnNo.padStart(2, '0')}座`,
209
+								rowNo,
210
+								columnNo,
211
+								status: -1
212
+							};
213
+					});
214
+
215
+					result.push(completedColumns);
216
+				}
217
+
218
+				return result;
208 219
 			},
209
-		
210
-			getSeatList(){
211
-				uni.showLoading()
220
+
221
+			getSeatList() {
222
+				uni.showLoading({title:'加载中...',mask:true})
212 223
 				let params = `relation_id=${this.initInfo.relation_id}&sched_sign=${this.initInfo.sched_sign}`
213 224
 				apiGetSchedSeatList(params).then(res => {
214 225
 					this.orgSeatList = res
215
-					if(res.length!=0){
226
+					if (res.length != 0) {
216 227
 						this.seatArray = this.completeSeats(this.orgSeatList)
217 228
 						this.initSeatArray()
218 229
 						uni.hideLoading()
219
-					}else{
230
+					} else {
220 231
 						uni.showToast({
221
-							title:'未获取到座位数据',
222
-							icon:'none'
232
+							title: '未获取到座位数据',
233
+							icon: 'none'
223 234
 						})
224 235
 					}
225
-			     
236
+
226 237
 				})
227 238
 			},
228
-			
229
-			submitOrder(){
230
-				if(!this.isCanClick){
231
-					return
232
-				}
233
-				this.isCanClick=false
234
-				uni.showLoading({
235
-					title:'处理中...',
236
-					mask:true
237
-				})
238
-			let _newArr=this.optArr.map((res)=>{
239
-					return {seat_no:res.seatNo,seat_sign:res.seatSign,channel_sn:res.channel_sn}
239
+
240
+			submitOrder() {
241
+				
242
+				let _newArr = this.optArr.map((res) => {
243
+					return {
244
+						seat_no: res.seatNo,
245
+						seat_sign: res.seatSign,
246
+					}
240 247
 				})
241 248
 				
242
-				let params ={
243
-					sched_sign:this.initInfo.sched_sign,
244
-					channel_sn:_newArr[0].channel_sn,
245
-					sched_seat:JSON.stringify(_newArr),
246
-					hall_sign:this.initInfo.hall_sign,
247
-					hall_name:this.initInfo.hall_name,
248
-					show_date:this.initInfo.show_date,
249
-					show_time:this.initInfo.show_time,
250
-					cinema_sign:this.initInfo.cinema_sign,
251
-					phone:uni.getStorageSync('USER_INFO_PHONE'),
252
-					
253
-					film_sign:this.initInfo.film_sign,
254
-					relation_id:this.initInfo.relation_id,
249
+				let params = {
250
+					channel_sn: this.optArr[0].channel_sn,
251
+					sched_seat: _newArr,
252
+					detailInfo:this.initInfo ,
253
+					totalPrice:this.totalPrice
255 254
 				}
256
-				apiSubmitOrder(params).then(res => {
257
-					uni.hideLoading()
258
-					uni.navigateTo({
259
-						url:`/subPages/pages/movies/moviesOrder?order_sn=${res.order_sn}&oid=${res.oid}&code=${res.code}&type=${res.type}`
260
-					})
261
-				}).catch((e)=>{
262
-					console.log("===e",e);
263
-					this.isCanClick=true
264
-			    uni.showToast({
265
-				title:e ||'接口异常!',
266
-				icon:'none'
267
-			})
268
-		})
255
+				
256
+				uni.navigateTo({
257
+					url: `/subPages/pages/movies/moviesOrder?params=${encodeURIComponent(JSON.stringify(params))}`
258
+				})
259
+
269 260
 			},
270
-			
261
+
271 262
 			//初始座位数组
272 263
 			initSeatArray() {
273 264
 				this.seatSize = this.boxWidth > 0 ?
274 265
 					parseInt(parseInt(this.boxWidth, 10) / (this.seatCol + 3), 10) :
275 266
 					parseInt(parseInt(414, 10) / (this.seatCol + 3), 10)
276
-				   this.initNonSeatPlace();
267
+				this.initNonSeatPlace();
277 268
 			},
278
-			
269
+
279 270
 			//初始化是座位的地方
280 271
 			initNonSeatPlace() {
281 272
 				let mArr = []
282
-				for (var i = 0; i <this.seatArray.length; i++) {
273
+				for (var i = 0; i < this.seatArray.length; i++) {
283 274
 					let _item = this.seatArray[i]
284
-					let _name =''
275
+					let _name = ''
285 276
 					for (var j = 0; j < _item.length; j++) {
286 277
 						let childItem = _item[j]
287
-						if (childItem.status!=-1 ) {
278
+						if (childItem.status != -1) {
288 279
 							//this.siginPrice = childItem.price
289
-							this.channelSn =childItem.channel_sn
290
-							if(childItem.seatNo.indexOf('排')!= -1){
291
-								_name= childItem.seatNo.split('排')[0]
292
-							}else{
293
-								_name= childItem.rowNo
280
+							this.channelSn = childItem.channel_sn
281
+							if (childItem.seatNo.indexOf('排') != -1) {
282
+								_name = childItem.seatNo.split('排')[0]
283
+							} else {
284
+								_name = childItem.rowNo
294 285
 							}
295 286
 							break
296
-						} 
287
+						}
297 288
 					}
298 289
 					mArr.push(_name)
299 290
 				}
@@ -318,7 +309,7 @@
318 309
 			},
319 310
 			//重置座位
320 311
 			resetSeat() {
321
-				this.totalPrice=0
312
+				this.totalPrice = 0
322 313
 				this.SelectNum = 0
323 314
 				this.optArr = []
324 315
 				//将所有已选座位的值变为0
@@ -337,13 +328,13 @@
337 328
 				if (this.SelectNum === 0) {
338 329
 					return
339 330
 				}
340
-				let _this =this
331
+				let _this = this
341 332
 				for (let i = 0; i < this.optArr.length; i++) {
342 333
 					let _price = this.optArr[0].price
343
-					if(_price != this.optArr[i].price){
334
+					if (_price != this.optArr[i].price) {
344 335
 						uni.showModal({
345
-							title:'温馨提示',
346
-							content:'请选择相同价格的座位,暂不支持不同价格的座位同时下单,如有需要请单独选择座位下单~',
336
+							title: '温馨提示',
337
+							content: '请选择相同价格的座位,暂不支持不同价格的座位同时下单,如有需要请单独选择座位下单~',
347 338
 							complete: (res) => {
348 339
 								_this.resetSeat()
349 340
 							}
@@ -353,8 +344,8 @@
353 344
 				}
354 345
 				this.submitOrder()
355 346
 			},
356
-			
357
-			
347
+
348
+
358 349
 			//处理座位选择逻辑
359 350
 			handleChooseSeat(row, col) {
360 351
 				let seatValue = this.seatArray[row][col].status;
@@ -367,23 +358,25 @@
367 358
 					newArray[row][col].status = 1
368 359
 					this.SelectNum--
369 360
 					this.getOptArr(newArray[row][col], 0)
370
-					this.totalPrice = (parseFloat(this.totalPrice )*100- parseFloat(newArray[row][col].price)*100)/100
361
+					this.totalPrice = (parseFloat(this.totalPrice) * 100 - parseFloat(newArray[row][col].price) * 100) /
362
+						100
371 363
 				} else if (seatValue === 1) {
372
-					if(this.SelectNum==4){
364
+					if (this.SelectNum == 4) {
373 365
 						uni.showToast({
374
-							title:'每次最多只能选择4个座位',
375
-							icon:'none'
366
+							title: '每次最多只能选择4个座位',
367
+							icon: 'none'
376 368
 						})
377 369
 						return
378 370
 					}
379
-					newArray[row][col].status =2
380
-					this.totalPrice = ( parseFloat(this.totalPrice )*100 +  parseFloat(newArray[row][col].price)*100)/100
371
+					newArray[row][col].status = 2
372
+					this.totalPrice = (parseFloat(this.totalPrice) * 100 + parseFloat(newArray[row][col].price) * 100) /
373
+						100
381 374
 					this.SelectNum++
382 375
 					this.getOptArr(newArray[row][col], 1)
383 376
 				}
384 377
 				//必须整体更新二维数组,Vue无法检测到数组某一项更新,必须slice复制一个数组才行
385 378
 				this.seatArray = newArray.slice();
386
-			
379
+
387 380
 			},
388 381
 			//处理已选座位数组
389 382
 			getOptArr(item, type) {
@@ -401,15 +394,16 @@
401 394
 				}
402 395
 				this.optArr = optArr.slice()
403 396
 			},
404
-			
397
+
405 398
 		}
406 399
 	}
407 400
 </script>
408 401
 
409 402
 <style lang="scss" scoped>
410
-	.p-all-10{
403
+	.p-all-10 {
411 404
 		padding: 10rpx;
412 405
 	}
406
+
413 407
 	.ml-10 {
414 408
 		margin-left: 10rpx;
415 409
 	}
@@ -601,12 +595,12 @@
601 595
 		background: url('/static/selected.png') center center no-repeat;
602 596
 		background-size: 100% 100%;
603 597
 	}
604
-	
598
+
605 599
 	.unsel-seat {
606 600
 		background: url('/static/unselected.png') center center no-repeat;
607 601
 		background-size: 100% 100%;
608 602
 	}
609
-	
603
+
610 604
 	.bought-seat {
611 605
 		background: url('/static/bought.png') center center no-repeat;
612 606
 		background-size: 100% 100%;

+ 52 - 32
src/subPages/pages/movies/moviesOrder.vue

@@ -2,16 +2,17 @@
2 2
 	<view class="movies-oder-container" v-if="orderDetail">
3 3
 		<view class="card-content">
4 4
 			<view class="list-item">
5
-				<image class="item-img" :src="orderDetail.film.cover_img" mode="aspectFill"></image>
5
+				<image class="item-img" :src="orderDetail.cover_img" mode="aspectFill"></image>
6 6
 				<view class="info-item">
7 7
 					<text class="item-title">{{orderDetail.film_name}}</text>
8
-					<text class="file-des mb-24-x">{{orderDetail.sched_time}} </text>
8
+					<text class="file-des mb-24-x">{{orderDetail.show_des}} </text>
9 9
 					<text class="file-des mb-24-x">{{orderDetail.cinema_name}}</text>
10 10
 					<view class="title-content ">
11 11
 						<text class="file-des">{{orderDetail.hall_name}}</text>
12 12
 						<text class="file-des-x" :key="'seat-item-'+index"
13
-							v-for="(item,index) in orderDetail.sched_seat">{{item.seat_no}}</text>
13
+							v-for="(item,index) in schedSeat">{{item.seat_no}}</text>
14 14
 					</view>
15
+					
15 16
 				</view>
16 17
 				<view class="timer-content">
17 18
 					<image class="timer-icon" src="/static/icon/timer_icon.png" mode="widthFix"></image>
@@ -24,7 +25,7 @@
24 25
 				<text class="hint-tx">不支持退票</text>
25 26
 				<image class="close-icon" src="/static/icon/red_close.png" mode="widthFix"></image>
26 27
 				<text class="hint-tx-1">不支持改签</text>
27
-				<text class="hint-tx">共{{orderDetail.sched_seat.length}}张</text>
28
+				<text class="hint-tx">共{{schedSeat.length}}张</text>
28 29
 				<!-- <text class="hint-tx">原价¥60</text> -->
29 30
 			</view>
30 31
 
@@ -38,14 +39,14 @@
38 39
 			<view class="discount-info">
39 40
 				<text class="fare-tx">票价合计</text>
40 41
 				<text class="fare-price-unit">¥</text>
41
-				<text class="fare-price">{{orderDetail.order_price}}</text>
42
+				<text class="fare-price">{{totalPrice}}</text>
42 43
 			</view>
43 44
 		</view>
44 45
 
45 46
 		<view class="card-content">
46 47
 			<view class="discount-info">
47 48
 				<text class="discount-tx">手机号码</text>
48
-				<input class="phone-value" type="text" v-model="userPhone" placeholder="请先填写手机号码" />
49
+				<input  class="phone-value" type="text" v-model="userPhone" placeholder="请先填写手机号码" />
49 50
 			</view>
50 51
 			<view class="card-line"></view>
51 52
 			<text class="discount-tx-hine">仅用于出票异常时联系,取票码不会通过短信发送</text>
@@ -90,9 +91,8 @@
90 91
 			<view class="left-content">
91 92
 				<view class="left-top-info">
92 93
 					<text class="pay-price-title">应付:</text>
93
-					<text class="pay-price">¥{{orderDetail.order_price}}</text>
94
+					<text class="pay-price">¥{{totalPrice}}</text>
94 95
 				</view>
95
-				<!-- <text class="price-hint">总计优惠:2.7元</text> -->
96 96
 			</view>
97 97
 			<view class="right-btn" @click="onPayClick">立即付款</view>
98 98
 		</view>
@@ -114,13 +114,14 @@
114 114
 	} from '~/config/app'
115 115
 	import {
116 116
 		apiGetOrderInfo,
117
-		apiConfirmOrder
117
+		apiConfirmOrder,
118
+		apiSubmitOrder
118 119
 	} from '~/apis/movies'
119 120
 	import {
120 121
 		useUserStore
121 122
 	} from '~/stores/userStore'
122 123
 
123
-	const totalTime = 600 // 5分钟=300秒
124
+	const totalTime = 300 // 5分钟=300秒
124 125
 	const count = ref(totalTime)
125 126
 	const minutes = ref(0)
126 127
 	const seconds = ref(0)
@@ -129,24 +130,28 @@
129 130
 	const isCheck = ref(false)
130 131
 	let timer = null
131 132
 	let order_sn = ''
132
-	let oid =''
133
-	let type =''
134
-	let code =''
133
+	let oid = ''
134
+	let type = ''
135
+	let code = ''
135 136
 	const orderDetail = ref()
136 137
 	const userPhone = ref('')
138
+	const schedSeat=ref([])
139
+	const totalPrice=ref(0)
140
+	let channel_sn=''
137 141
 
138 142
 	// 格式化时间补零
139 143
 	const formatTime = (num) => num < 10 ? `0${num}` : num
140 144
 	onLoad((option) => {
141
-		console.log("===option.order_sn",option.oid);
142
-		if (option.order_sn) {
143
-			order_sn = option.order_sn
144
-			oid = option.oid
145
-			type = option.type
146
-			code = option.code
145
+		if(option.params){
146
+			orderDetail.value = JSON.parse(decodeURIComponent(option.params)).detailInfo
147
+			schedSeat.value =  JSON.parse(decodeURIComponent(option.params)).sched_seat
148
+			channel_sn=  JSON.parse(decodeURIComponent(option.params)).channel_sn
149
+			totalPrice.value = JSON.parse(decodeURIComponent(option.params)).totalPrice
150
+			console.log("===orderDetail.value",schedSeat.value);
151
+			console.log("===orderDetail.value",schedSeat.value.length);
147 152
 			initTimer()
148
-			getDetailInfo()
149 153
 		}
154
+		
150 155
 		userPhone.value = uni.getStorageSync('USER_INFO_PHONE')
151 156
 	})
152 157
 
@@ -217,30 +222,43 @@
217 222
 			})
218 223
 			return
219 224
 		}
220
-
221 225
 		uni.showLoading({
222
-			title: '请求中...'
226
+			title:'处理中...',
227
+			mask:true
223 228
 		})
224
-
225
-
226
-
227 229
 		let params = {
230
+			sched_sign: orderDetail.value.sched_sign,
231
+			channel_sn:channel_sn,
232
+			sched_seat: JSON.stringify(schedSeat.value ),
233
+			hall_sign: orderDetail.value.hall_sign,
234
+			hall_name: orderDetail.value.hall_name,
235
+			show_date: orderDetail.value.show_date,
236
+			show_time: orderDetail.value.show_time,
237
+			cinema_sign: orderDetail.value.cinema_sign,
228 238
 			phone: userPhone.value,
229
-			oid : oid,
230
-			type :type,
231
-			code :code,
239
+			film_sign: orderDetail.value.film_sign,
240
+			relation_id: orderDetail.value.relation_id,
232 241
 		}
233
-		apiConfirmOrder(params).then(res => {
242
+		console.log("===params",params);
243
+		
244
+		apiSubmitOrder(params).then(res => {
245
+			uni.hideLoading()
234 246
 			uni.redirectTo({
235
-				url: `/pages/payment/index?pay_price=${orderDetail.value.order_price}&order_id=${oid}&initType=3&order_sn=${order_sn}&type=${res.pay_channel}`
247
+				url: `/pages/payment/index?pay_price=${totalPrice.value}&order_id=${res.oid}&initType=3&order_sn=${res.order_sn}&type=${res.type}`
236 248
 			})
237
-			uni.hideLoading()
238 249
 		}).catch((e) => {
239 250
 			uni.showToast({
240 251
 				title: e || '接口异常!',
241 252
 				icon: 'none'
242 253
 			})
243 254
 		})
255
+		
256
+		
257
+		
258
+		
259
+
260
+	
261
+		
244 262
 	}
245 263
 </script>
246 264
 
@@ -481,6 +499,7 @@
481 499
 				.title-content {
482 500
 					display: flex;
483 501
 					flex-direction: row;
502
+					flex-wrap: wrap;
484 503
 					align-items: center;
485 504
 					width: 100%;
486 505
 				}
@@ -503,11 +522,12 @@
503 522
 				.file-des {
504 523
 					font-size: 24rpx;
505 524
 					color: #999;
525
+					margin-right: 10rpx;
506 526
 				}
507 527
 
508 528
 				.file-des-x {
509 529
 					font-size: 26rpx;
510
-					margin-left: 10rpx;
530
+					margin-right: 10rpx;
511 531
 					color: #000;
512 532
 					font-weight: bolder;
513 533
 				}

+ 3 - 1
src/subPages/pages/movies/moviesTicketList.vue

@@ -145,16 +145,18 @@
145 145
 	
146 146
 	function onChooseSeatClick(item){
147 147
 		let params ={
148
+			cover_img:moviesList.value[currentMoviesIndex.value].cover_img,
148 149
 			relation_id:item.relation_id,
149 150
 			sched_sign:item.sched_sign,
150 151
 			show_date:item.show_date,
151 152
 			show_time:item.show_time,
153
+			cinema_name:item.cinema_name,
152 154
 			film_name:moviesList.value[currentMoviesIndex.value].film_name,
153 155
 			hall_name:item.hall_name,
154 156
 			hall_sign:item.hall_sign,
155 157
 			film_sign:moviesList.value[currentMoviesIndex.value].film_sign,
156 158
 			cinema_sign:initInfo.value.cinema_sign,
157
-			show_des:`${formatDate(item.show_date,7,'-')} ${item.show_time}-${item.end_time} (${item.film.language=='汉语普通话'?'国语':item.film.language} ${item.film.version})`
159
+			show_des:`${formatDate(dateList.value[currentIndex.value].date_timestamp,7,'-')} ${item.show_time}-${item.end_time} (${item.film.language=='汉语普通话'?'国语':item.film.language} ${item.film.version})`
158 160
 		}
159 161
 		uni.navigateTo({
160 162
 			url:`/subPages/pages/movies/chooseSeat?info=${encodeURIComponent(JSON.stringify(params))}`

+ 27 - 18
src/subPages/pages/movies/orderDetail.vue

@@ -5,27 +5,28 @@
5 5
 			<view class="top-info-content">
6 6
 				<view class="info-content">
7 7
 					<text class="info-title">{{detailInfo.film_name}}</text>
8
-					<text class="info-des" v-if="detailInfo&&detailInfo.film">{{detailInfo.sched_time}} ~ {{detailInfo.schedend_time}}({{detailInfo.film.language=='汉语普通话'?'国语':detailInfo.film.language}}{{detailInfo.film.version}})</text>
8
+					<text class="info-des" v-if="detailInfo&&detailInfo.film">{{detailInfo.sched_time}} ~
9
+						{{detailInfo.schedend_time}}({{detailInfo.film.language=='汉语普通话'?'国语':detailInfo.film.language}}{{detailInfo.film.version}})</text>
9 10
 					<text class="info-des">{{detailInfo.cinema_name}}{{detailInfo.hall_name}}</text>
10
-					
11
+
11 12
 					<view class="seat-content">
12 13
 						<text :key="'info-seat-'+index" class="info-seat"
13 14
 							v-for="(item,index) in detailInfo.sched_seat">{{item.seat_no}}</text>
14 15
 					</view>
15
-				
16
-						
16
+
17
+
17 18
 				</view>
18 19
 				<image v-if="detailInfo && detailInfo.film" class="info-img" :src="detailInfo.film.cover_img"
19 20
 					mode="aspectFill"></image>
20 21
 			</view>
21 22
 			<view class="order-line"></view>
22 23
 
23
-			<view class="order-status-content" v-if="detailInfo.status==0">
24
+			<view class="order-status-content" v-if="detailInfo.status==0 && isShowTimer">
24 25
 				<text class="status-title">支付剩余 {{ formatTime(minutes) }}:{{ formatTime(seconds) }}</text>
25 26
 				<text class="status-hint"> 请尽快支付,否则订单将在10分钟后失效</text>
26 27
 			</view>
27 28
 			<view class="order-status-content"
28
-				v-if="detailInfo.status==3 || detailInfo.status==2|| detailInfo.status==5">
29
+				v-if="detailInfo.status==3 || detailInfo.status==2|| detailInfo.status==5 ||(detailInfo.status==0 && !isShowTimer)">
29 30
 				<text class="status-title"> 订单已取消</text>
30 31
 				<text class="status-hint"> 订单超时未支付,系统已自动关闭!</text>
31 32
 			</view>
@@ -104,13 +105,16 @@
104 105
 	let orderSn = ''
105 106
 	const formatTime = (num) => num < 10 ? `0${num}` : num
106 107
 	const detailInfo = ref({})
107
-	let totalTime = 600 // 5分钟=300秒
108
+	let totalTime = 300 // 5分钟=300秒
108 109
 	const count = ref(0)
109 110
 	const minutes = ref(0)
110 111
 	const seconds = ref(0)
112
+	const isShowTimer = ref(false)
111 113
 	let timer = null
114
+	let initType = 0
112 115
 	onLoad((option) => {
113 116
 		orderSn = option.orderSn
117
+		initType = option.initType
114 118
 		if (orderSn != 'undefined') {
115 119
 			getorderDetailInfo()
116 120
 		}
@@ -118,7 +122,7 @@
118 122
 
119 123
 	function onAddressClick() {
120 124
 		uni.navigateTo({
121
-			url:`/subPages/pages/movies/moviesTicketList?info=${encodeURIComponent(JSON.stringify(detailInfo.value.cinema))}&film_sign=${detailInfo.value.film.film_sign}`
125
+			url: `/subPages/pages/movies/moviesTicketList?info=${encodeURIComponent(JSON.stringify(detailInfo.value.cinema))}&film_sign=${detailInfo.value.film.film_sign}`
122 126
 		})
123 127
 	}
124 128
 
@@ -130,7 +134,7 @@
130 134
 	}
131 135
 
132 136
 	function onPayClick() {
133
-		console.log("===detailInfo",detailInfo.value.oid);
137
+		console.log("===detailInfo", detailInfo.value.oid);
134 138
 		uni.redirectTo({
135 139
 			url: `/pages/payment/index?pay_price=${detailInfo.value.order_price}&order_id=${detailInfo.value.oid}&initType=3&order_sn=${detailInfo.value.order_sn}`
136 140
 		})
@@ -192,15 +196,20 @@
192 196
 		apiGetOrderInfo(orderSn).then(res => {
193 197
 			detailInfo.value = res
194 198
 			if (detailInfo.value.status == 0) {
195
-	     	totalTime = parseInt((detailInfo.value.create_time*1000+600000 -	new Date().getTime())/1000)
196
-			count.value = totalTime+2
197
-				initTimer()
199
+				totalTime = parseInt((detailInfo.value.create_time * 1000 + 300000 - new Date().getTime()) / 1000)
200
+				count.value = totalTime + 2
201
+				if (count.value > 0) {
202
+					initTimer()
203
+					isShowTimer.value = true
204
+				} else {
205
+					isShowTimer.value = false
206
+				}
198 207
 			}
199 208
 			uni.hideLoading()
200
-		}).catch((e)=>{
209
+		}).catch((e) => {
201 210
 			uni.showToast({
202
-				title:e.message ||'接口异常!',
203
-				icon:'none'
211
+				title: e.message || '接口异常!',
212
+				icon: 'none'
204 213
 			})
205 214
 		})
206 215
 	}
@@ -209,15 +218,15 @@
209 218
 <style lang="scss" scoped>
210 219
 	.order-detail-container {
211 220
 		display: flex;
212
-		padding-bottom: 60rpx;
221
+		padding-bottom: 100rpx;
213 222
 		flex-direction: column;
214 223
 		min-height: 100VH;
215 224
 		background-color: #f8f8f8;
216 225
 		box-sizing: border-box;
217 226
 		position: relative;
218 227
 		padding-top: 24rpx;
219
-		
220
-		.seat-content{
228
+
229
+		.seat-content {
221 230
 			display: flex;
222 231
 			flex-direction: row;
223 232
 			align-items: center;

+ 21 - 8
src/subPages/pages/movies/orderList.vue

@@ -53,7 +53,7 @@
53 53
 				
54 54
 				<view class="card-bottom-content">
55 55
 					<text class="card-date">{{item.create_time}}</text>
56
-					<text class="card-status">{{dealStatus(item.status)}}</text>
56
+					<text class="card-status">{{dealStatus(item)}}</text>
57 57
 				</view>
58 58
 			</view>
59 59
 		</view>
@@ -95,6 +95,10 @@
95 95
 
96 96
 	onLoad((option) => {
97 97
 		currentIndex.value = option.type
98
+		
99
+	})
100
+	
101
+	onShow(()=>{
98 102
 		getmoviesOrderList()
99 103
 	})
100 104
 
@@ -104,15 +108,24 @@
104 108
 		})
105 109
 	}
106 110
 	
107
-	function dealStatus(status){
111
+	function dealStatus(item){
108 112
 		let name 
109
-		if(status==0){
113
+		let status =item.status
114
+		let isShowTimer=true
115
+	    let totalTime = parseInt((item.create_time * 1000 + 300000 - new Date().getTime()) / 1000)
116
+		if (totalTime > 0) {
117
+			isShowTimer = true
118
+		} else {
119
+			isShowTimer = false
120
+		}
121
+		
122
+		if(status==0 && isShowTimer){
110 123
 			name='待支付'
124
+		}else if(status==0 && !isShowTimer){
125
+			name='未支付'
111 126
 		}else if(status==1){
112
-			name='已支付'
113
-		}else if(status==2){
114
-			name='已超时'
115
-		}else if(status==3 || status==5){
127
+			name='已出票'
128
+		}else if(status==2 ||status==3 || status==5){
116 129
 			name='已取消'
117 130
 		}else if(status==4){
118 131
 			name='已成功'
@@ -124,7 +137,7 @@
124 137
 	function getmoviesOrderList() {
125 138
 		uni.showLoading()
126 139
 		let params =
127
-			`page=${state.page}&limit=${state.limit}&type=${currentIndex.value==0?-1:(currentIndex.value==2?5:1)}`
140
+			`page=${state.page}&limit=${state.limit}&type=${currentIndex.value==0?-1:(currentIndex.value==2?3:1)}`
128 141
 		apiGetOrderList(params).then(res => {
129 142
 			state.count = res.count
130 143
 			if (state.page === 1) {

+ 0 - 1
uni-pages.d.ts

@@ -104,7 +104,6 @@ interface NavigateToOptions {
104 104
        "/subPages/pages/mine-top/qianbao" |
105 105
        "/subPages/pages/mine-top/repurchase" |
106 106
        "/subPages/pages/mine-top/vr" |
107
-       "/subPages/pages/movies/chooseSeat - 副本" |
108 107
        "/subPages/pages/movies/chooseSeat" |
109 108
        "/subPages/pages/movies/chooseSeat1" |
110 109
        "/subPages/pages/movies/cityList" |