|
|
@@ -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%;
|