jufubao-movie 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-movie",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "private": false,
5
5
  "description": "聚福宝在线选座业务组件插件包",
6
6
  "main": "index.js",
@@ -36,6 +36,7 @@
36
36
  </view>
37
37
  <xd-online-seat
38
38
  v-if="filmId"
39
+ ref="xdOnlineSeat"
39
40
  :key="cinemaSeatKey"
40
41
  :is-old="false"
41
42
  :film-id="filmId"
@@ -73,6 +74,10 @@
73
74
  cinemaSeatKey: 'cinemaSeatKey',
74
75
  loadingList: true,
75
76
  request_ident: '',
77
+ seatTimer: null,
78
+ seatTime: 0,
79
+ isPop: false,
80
+ paiQiData: [],
76
81
 
77
82
  //面板
78
83
  payPath: "", //三方支付路径
@@ -121,9 +126,11 @@
121
126
  } else if (res.seat_status === 'N') {
122
127
  clearTimeout(this.timer)
123
128
  this.$xdHideLoading();
124
- uni.showToast({
125
- title: res.seat_message,
126
- icon: "none"
129
+ this.$xdAlert({
130
+ content: res.seat_message,
131
+ time: 2500,
132
+ isClose: false,
133
+ zIndex: 5000
127
134
  })
128
135
  return
129
136
  }else{
@@ -155,20 +162,21 @@
155
162
  ]).then(([res, res1]) => {
156
163
  this.loadingList = false;
157
164
  this.$xdHideLoading();
158
- let paiqi_data = res.schedule_data;
165
+ let paiqi_data = res.schedule_data.map(item => {
166
+ item['name'] = item['date_name'];
167
+ item['paiqi_data'] = item['paiqi'].map(pp => {
168
+ pp['price'] = pp['sale_price'];
169
+ pp['jfb_film_id'] = pp['film_id'];
170
+ pp['jfb_cinema_id'] = pp['cinema_id'];
171
+ pp['data_id'] = pp['schedule_id'];
172
+ return pp;
173
+ });
174
+ return item;
175
+ });
176
+ this.paiQiData = paiqi_data;
159
177
  // const {cinema_data, film_data} = res1;
160
178
  resolve({
161
- paiqi_data: paiqi_data.map(item => {
162
- item['name'] = item['date_name'];
163
- item['paiqi_data'] = item['paiqi'].map(pp => {
164
- pp['price'] = pp['sale_price'];
165
- pp['jfb_film_id'] = pp['film_id'];
166
- pp['jfb_cinema_id'] = pp['cinema_id'];
167
- pp['data_id'] = pp['schedule_id'];
168
- return pp;
169
- });
170
- return item;
171
- }),
179
+ paiqi_data: paiqi_data,
172
180
  film_data: [{
173
181
  ...res1,
174
182
  id: res1.film_id,
@@ -176,12 +184,14 @@
176
184
  cinema_data: res1
177
185
  })
178
186
  if(res1.temp_order_id || res1.oms_order_id){
187
+ this.isPop = true;
179
188
  this.handleToPay(res1);
180
189
  }
181
190
  })
182
191
  },
183
192
 
184
193
  handleGetSeatList(item, resolve) {
194
+ if(this.isPop) return;
185
195
  this.$xdShowLoading({});
186
196
  const {cinemaId} = this;
187
197
  this.scheduleId = item.data_id;
@@ -197,9 +207,10 @@
197
207
  if(res.status === "P"){
198
208
  if(!this.$root.$isShow) return;
199
209
  this.request_ident = res.request_ident;
200
- setTimeout(() => {
210
+ if(this.seatTimer) clearTimeout(this.seatTimer);
211
+ this.seatTimer = setTimeout(() => {
201
212
  this.handleGetSeatList(item, resolve);
202
- }, 2000)
213
+ }, ++this.seatTime > 5 ? (Math.pow(2, (this.seatTime - 4)) * 1000) : 2000)
203
214
  return;
204
215
  }
205
216
  if(res.status === "E"){
@@ -217,7 +228,6 @@
217
228
  })
218
229
  resolve(seatData);
219
230
  this.$xdHideLoading();
220
-
221
231
  })
222
232
  },
223
233
  //去支付未完成订单
@@ -247,7 +257,11 @@
247
257
  data: {
248
258
  order_id: temp_order_id || oms_order_id
249
259
  }
250
- }).then(suc => {})
260
+ }).then(suc => {
261
+ this.isPop = false;
262
+ // this.cinemaSeatKey = Date.now()
263
+ this.$refs.xdOnlineSeat.getScheduleList(this.paiQiData)
264
+ })
251
265
  }
252
266
  }
253
267
  })
@@ -287,6 +301,16 @@
287
301
  console.log('onJfbShow', options)
288
302
  this.onJfbLoad(options);
289
303
  this.cinemaSeatKey = Date.now()
304
+ },
305
+ onJfbUnload(){
306
+ this.unmount();
307
+ },
308
+ onJfbHide(){
309
+ this.unmount();
310
+ },
311
+ unmount(){
312
+ if(this.seatTimer) clearTimeout(this.seatTimer);
313
+ if(this.timer) clearTimeout(this.timer);
290
314
  }
291
315
  }
292
316
  }