jufubao-movie 1.0.39 → 1.0.41-beta2

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.39",
3
+ "version": "1.0.41-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝在线选座业务组件插件包",
6
6
  "main": "index.js",
@@ -252,6 +252,104 @@ export default {
252
252
  }
253
253
  },
254
254
  },
255
+ {
256
+ ele: "title",
257
+ label: "我的优惠券样式配置",
258
+ size: "small",
259
+ groupKey: "style",
260
+ },
261
+ {
262
+ label: "优惠券左侧背景色设置:",
263
+ ele: "xd-gradient-color",
264
+ valueKey: "couponLeftBgColor",
265
+ value: data.couponLeftBgColor || 'linear-gradient(180deg, #FFA852 0%, #FF5733 100%)',
266
+ groupKey:'style',
267
+ },
268
+ {
269
+ label: "圆角设置",
270
+ ele: 'xd-site-select-list',
271
+ valueKey: 'couponRadius',
272
+ value: data['couponRadius'] || 16,
273
+ groupKey:'style',
274
+ placeholder: '请选择内容圆角设置',
275
+ multiple: false,
276
+ className: 'input80',
277
+ handleCustom({ action, data }) {
278
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
279
+ .then(res => {
280
+ data.cb(res.list)
281
+ })
282
+ .catch(error => {
283
+ console.error(error);
284
+ });
285
+ },
286
+ },
287
+ {
288
+ label: "优惠券标题背景颜色设置:",
289
+ ele: "xd-color",
290
+ valueKey: "couponTitleBgColor",
291
+ value: data.couponTitleBgColor || null,
292
+ groupKey:'style',
293
+ setting: {
294
+ showAlpha: true,
295
+ isAlpha: true
296
+ },
297
+ },
298
+ {
299
+ label: "去使用按钮文字背景色设置: ",
300
+ ele: "xd-text-and-bgc",
301
+ groupKey:'style',
302
+ valueKey: "couponBtnTextStyle",
303
+ value: data.couponBtnTextStyle || null,
304
+ setting: {
305
+ fontSize: true, //字体大小选择
306
+ color: true, //文字颜色选项
307
+ bgColor: true, //背景选项
308
+ weight: true, //文字粗细
309
+ },
310
+ handleCustom({action, data}) {
311
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_font_size'})
312
+ .then(res => {
313
+ data.cb(res.list)
314
+ })
315
+ .catch(error => {
316
+ console.error(error);
317
+ data.cb([])
318
+ });
319
+ },
320
+ },
321
+ {
322
+ label: "按钮内边距设置:",
323
+ groupKey:'style',
324
+ ele: 'xd-margin-padding',
325
+ valueKey: 'couponUseBtnPadding',
326
+ value: data.couponUseBtnPadding || null,
327
+ setting: {
328
+ type: 'padding',
329
+ },
330
+ placeholder: '请设置边距',
331
+ inline: false,
332
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
333
+ },
334
+ {
335
+ label: "按钮圆角设置",
336
+ ele: 'xd-site-select-list',
337
+ valueKey: 'couponBtnRadius',
338
+ value: data['couponBtnRadius'] || 16,
339
+ groupKey:'style',
340
+ placeholder: '请选择内容圆角设置',
341
+ multiple: false,
342
+ className: 'input80',
343
+ handleCustom({ action, data }) {
344
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
345
+ .then(res => {
346
+ data.cb(res.list)
347
+ })
348
+ .catch(error => {
349
+ console.error(error);
350
+ });
351
+ },
352
+ },
255
353
  ]
256
354
  }
257
355
  }
@@ -133,19 +133,37 @@
133
133
 
134
134
  <view v-if="otherPayMethod.length" class="jfb-movie-confirm__body-card">
135
135
  <template v-for="item in otherPayMethod">
136
- <xd-list-item v-if="item.method === 'card'" :key="item.method" :label="item.show_name" paddingLR="0rpx" size="small" showRight @click="toChoseCard">
137
- <view v-if="choseCard && choseCard.cardPayPrice" slot="label">{{item.show_name}} <text style="color:red;margin-left: 4px;">(已选{{ choseCard.selectedCardList.length }}张)</text></view>
138
- <template v-if="choseCard && choseCard.cardPayPrice">
136
+ <xd-list-item v-if="item.method === 'card'" :key="item.method" :label="item.show_name" paddingLR="60rpx" size="small" :showRight="!(choseCoupon && choseCoupon.cardPayPrice)" @click="toChoseCard">
137
+ <view v-if="(choseCoupon && choseCoupon.cardPayPrice)">
138
+ <view style="color:#CCCCCC;font-size: 20rpx">已使用其他票券,不可用</view>
139
+ </view>
140
+ <view v-else>
141
+ <view v-if="choseCard && choseCard.cardPayPrice" slot="label">{{item.show_name}} <text style="color:red;margin-left: 4px;">(已选{{ choseCard.selectedCardList.length }}张)</text></view>
142
+ <template v-if="choseCard && choseCard.cardPayPrice">
139
143
  <xd-unit v-if="choseCard.unit == '次'" :price="choseCard.cardPayPoint" :isOld="false" :fontSize="24" :iconSize="0.3" :unit="choseCard.unit"></xd-unit>
140
144
  <xd-unit v-else :price="choseCard.cardPayPrice" :isOld="false" :fontSize="24" :iconSize="0.3" :unit="choseCard.unit || ''"></xd-unit>
141
- </template>
142
-
143
- <view v-else>请选择</view>
144
- </xd-list-item>
145
- <xd-list-item v-if="item.method === 'wallet'" :key="item.method" :label="item.show_name" paddingLR="0rpx" size="small" showRight @click="toChoseWallet">
146
- <xd-unit v-if="choseWallet && choseWallet.walletPayPrice" :price='choseWallet.walletPayPrice' :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
147
- <view v-else>请选择</view>
148
- </xd-list-item>
145
+ </template>
146
+ <view v-else>请选择</view>
147
+ </view>
148
+ </xd-list-item>
149
+ <xd-list-item v-if="item.method === 'wallet'" :key="item.method" :label="item.show_name" paddingLR="60rpx" size="small" :showRight="!(choseCoupon && choseCoupon.cardPayPrice)" @click="toChoseWallet">
150
+ <view v-if="(choseCoupon && choseCoupon.cardPayPrice)">
151
+ <view style="color:#CCCCCC;font-size: 20rpx">已使用其他票券,不可用</view>
152
+ </view>
153
+ <view v-else>
154
+ <xd-unit v-if="choseWallet && choseWallet.walletPayPrice" :price='choseWallet.walletPayPrice' :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
155
+ <view v-else>请选择</view>
156
+ </view>
157
+ </xd-list-item>
158
+ <xd-list-item v-if="item.method === 'coupon'" :key="item.method" :label="item.show_name" paddingLR="60rpx" size="small" :showRight="!(choseCard && choseCard.cardPayPrice)" @click="toChoseCoupon">
159
+ <view v-if="(choseCoupon && choseCoupon.cardPayPrice)||(choseWallet && choseWallet.walletPayPrice)" slot="label">
160
+ {{item.show_name}} <text style="color:red;margin-left: 4px;">(已选{{ choseCoupon.selectedCardList.length }}张)</text>
161
+ </view>
162
+ <view v-else>
163
+ <view style="color:#CCCCCC;font-size: 20rpx" v-if="choseCard && choseCard.cardPayPrice">已使用其他票券,不可用</view>
164
+ <view v-else>请选择</view>
165
+ </view>
166
+ </xd-list-item>
149
167
  </template>
150
168
  </view>
151
169
  <view class="jfb-movie-confirm__body-btn-height" :style="bottomFixedStylePlaceholder"></view>
@@ -222,7 +240,30 @@
222
240
  @onChose="handleWalletChose"
223
241
  @onAlert="() => hasAlertCardChose = true"
224
242
  ></xd-wallet-chose>
225
-
243
+ <xd-coupon-chose
244
+ :couponRadius="couponRadius"
245
+ :couponImageUrl="couponImageUrl"
246
+ :couponTitleBgColor="couponTitleBgColor"
247
+ :couponUseBtnPadding="couponUseBtnPadding"
248
+ :couponBtnRadius="couponBtnRadius"
249
+ :couponBtnTextStyle="couponBtnTextStyle"
250
+ :couponLeftBgColor="couponLeftBgColor"
251
+ :mainColor="mainColor"
252
+ v-if="payCoupon"
253
+ ref="xdCouponChose"
254
+ :hadChoseCoupon="choseCoupon && choseCoupon.selectedCouponList"
255
+ :layoutInfo="layoutInfo"
256
+ :show.sync="showCouponChose"
257
+ :jwxSDK="jwxSDK"
258
+ :validImageAPIUrl="validImageAPIUrl"
259
+ :addSettleCoupon="addSettleCoupon"
260
+ @onChose="handleCouponChose"
261
+ @onAlert="() => hasAlertCardChose = true"
262
+ :orderTotalPrice="order_info.total_price/100"
263
+ :orderNeedPayPrice="orderNeedPayPrice"
264
+ :getSettleListCoupons="getSettleListCoupons"
265
+ :setSettleSelectCoupon="setSettleSelectCoupon"
266
+ ></xd-coupon-chose>
226
267
  </view>
227
268
  </view>
228
269
  </template>
@@ -235,6 +276,7 @@
235
276
  import XdButton from "@/components/XdButton/XdButton";
236
277
  import XdCardPay from "@/components/XdCardPay/XdCardPay";
237
278
  import XdCardPayChose from "@/components/XdCardPayChose/XdCardPayChose"
279
+ import XdCouponChose from '@/components/XdCouponChose/XdCouponChose'
238
280
  import XdWalletChose from "@/components/XdWalletChose/XdWalletChose"
239
281
  import XdContentXss from "@/components/XdContentXss/XdContentXss";
240
282
  import {jfbRootExec} from "@/utils/xd.event";
@@ -255,7 +297,8 @@
255
297
  XdContentXss,
256
298
  XdListItem,
257
299
  XdCardPayChose,
258
- XdWalletChose
300
+ XdWalletChose,
301
+ XdCouponChose
259
302
  },
260
303
  mixins: [componentsMixins,extsMixins,JfbMovieConfirmMixin],
261
304
  data() {
@@ -291,6 +334,10 @@
291
334
  showWalletChose: false,
292
335
  choseWallet: null,
293
336
 
337
+ //优惠券
338
+ choseCoupon: null,
339
+ showCouponChose: false,
340
+
294
341
  xnamespace: "",
295
342
  is_not_show_price: "",
296
343
 
@@ -301,7 +348,13 @@
301
348
  bgColor: '',
302
349
 
303
350
  bindCard: '1',
304
- cardKey: "cardKey"
351
+ cardKey: "cardKey",
352
+ couponBtnRadius: 16,
353
+ couponLeftBgColor: "",
354
+ couponTitleBgColor: "",
355
+ couponBtnTextStyle: {}, //优惠券包登录按钮文字背景色设置
356
+ couponUseBtnPadding: {},
357
+ couponImageUrl: "",
305
358
  }
306
359
  },
307
360
  watch: {
@@ -326,6 +379,9 @@
326
379
  payCard(){
327
380
  return this.otherPayMethod.find(item => item.method === 'card')
328
381
  },
382
+ payCoupon(){
383
+ return this.otherPayMethod.find(item => item.method === 'coupon')
384
+ },
329
385
  //是否支持三方支付、补差
330
386
  payThird(){
331
387
  return true; //都开启补差
@@ -336,7 +392,13 @@
336
392
  if(!this.order_info) return 0;
337
393
  let choseCardPay = this.choseCard ? this.choseCard.cardPayPrice : 0;
338
394
  let choseWalletPay = this.choseWallet ? this.choseWallet.walletPayPrice : 0;
339
- let total = this.$xdUniHelper.addFloatNumber(choseCardPay, choseWalletPay);
395
+ let choseCouponPay = this.choseCoupon ? this.choseCoupon.cardPayPrice : 0
396
+ let total = 0
397
+ if(choseCouponPay) {
398
+ total = choseCouponPay
399
+ } else {
400
+ total = this.$xdUniHelper.addFloatNumber(choseCardPay, choseWalletPay);
401
+ }
340
402
  let total_amount = this.order_info.total_price ? this.order_info.total_price : 0;
341
403
  let result = this.$xdUniHelper.cutFloatNumber(total_amount, total);
342
404
  return result;
@@ -429,6 +491,7 @@
429
491
  //支付方式跟用户相关,与订单无关。
430
492
  //只获取一次。
431
493
  if(!this.otherPayLoaded){
494
+ res.pay_methods.push('coupon')
432
495
  this.p_getPayMethod(res.pay_methods);
433
496
  }
434
497
 
@@ -463,7 +526,17 @@
463
526
  console.log(this.choseWallet)
464
527
  this.showWalletChose = false;
465
528
  },
466
-
529
+ //only选择满减券
530
+ toChoseCoupon(){
531
+ if(this.choseCard && this.choseCard.cardPayPrice) return
532
+ this.showCouponChose = true;
533
+ },
534
+ //only选择满减券结果
535
+ handleCutChose(data){
536
+ console.log(data)
537
+ this.choseCoupon = data;
538
+ this.showCouponChose = false;
539
+ },
467
540
  p_getPayMethod(support_methods){
468
541
  jfbRootExec("getPayMethod", {
469
542
  vm: this,
@@ -507,6 +580,12 @@
507
580
  cb(res);
508
581
  })
509
582
  },
583
+
584
+ handleCouponChose(data) {
585
+ console.log(data)
586
+ this.choseCoupon = data;
587
+ this.showCouponChose = false;
588
+ },
510
589
 
511
590
  addSettleCard(options, successCb, errCb) {
512
591
  console.log(options, 'ioioioioi')
@@ -516,6 +595,7 @@
516
595
  data: {
517
596
  ...options,
518
597
  cart_order_id: this.tempOrderId,
598
+ show_type: 'normal'
519
599
  }
520
600
  }).then(res => {
521
601
  this.$xdHideLoading()
@@ -542,7 +622,9 @@
542
622
  getSettleListCards(cb) {
543
623
  jfbRootExec("movieCardList", {
544
624
  vm: this,
545
- data: {}
625
+ data: {
626
+ show_type: 'normal'
627
+ }
546
628
  }).then(res => {
547
629
  cb(res.list)
548
630
  this.cardList = res.list
@@ -583,8 +665,13 @@
583
665
  /**
584
666
  * 有任一新版支付都用新版支付, 仅卡支付也用新版选卡支付
585
667
  */
586
- if(this.payWallet || this.payCard){ //已选卡
587
- let selected_card_list = this.choseCard ? this.choseCard.selectedCardList : [];
668
+ if(this.payWallet || this.payCard || this.payCoupon){ //已选卡
669
+ let selected_card_list
670
+ if(this.choseCard) {
671
+ selected_card_list = this.choseCard ? this.choseCard.selectedCardList : [];
672
+ } else if(this.choseCoupon) {
673
+ selected_card_list = this.choseCoupon ? this.choseCoupon.selectedCardList : [];
674
+ }
588
675
  let selected_wallet_list = this.choseWallet ? this.choseWallet.selectedWalletList : []
589
676
  //票券跟钱包都未选择,给用户提示
590
677
  if(selected_card_list.length == 0 && selected_wallet_list.length == 0){
@@ -741,6 +828,18 @@
741
828
  this.payPath = getContainerPropsValue(container, 'content.payPath', {value: ''}).value;
742
829
  this.paySuccessPath = getContainerPropsValue(container, 'content.paySuccessPath', {value: "/pages/order/success"}).value;
743
830
  this.bindCard = getContainerPropsValue(container,"content.bindCard","1");
831
+ this.couponBtnRadius = getContainerPropsValue(container, "content.couponBtnRadius", 16);
832
+ this.couponUseBtnPadding = getContainerPropsValue(container, "content.couponUseBtnPadding", {top: 20, left: 20, right: 20, bottom: 20});
833
+ this.couponBtnTextStyle = getContainerPropsValue(container, "content.couponBtnTextStyle", {
834
+ color: '#fff',
835
+ bgColor: '#ff5722',
836
+ fontSize: '30rpx',
837
+ fontWeight: 'normal'
838
+ });
839
+ this.couponTitleBgColor = getContainerPropsValue(container, "content.couponTitleBgColor", 'rgba(255, 87, 51, 0.1)');
840
+ this.couponRadius = getContainerPropsValue(container, "content.couponRadius", 16);
841
+ this.couponLeftBgColor = getContainerPropsValue(container, "content.couponLeftBgColor", "linear-gradient(180deg, #FFA852 0%, #FF5733 100%)");
842
+ this.couponImageUrl = getContainerPropsValue(container, "content.couponImageUrl", "");
744
843
  this.getContent();
745
844
  },
746
845
  handleCreateSuccess(val) {
@@ -766,6 +865,63 @@
766
865
  }
767
866
  },
768
867
 
868
+ addSettleCoupon(options, successCb, errCb) {
869
+
870
+ this.$xdShowLoading({})
871
+ jfbRootExec('movieAddCard', {
872
+ vm: this,
873
+ data: {
874
+ ...options,
875
+ cart_order_id: this.tempOrderId,
876
+ show_type: 'coupon'
877
+ }
878
+ }).then(res => {
879
+ this.$xdHideLoading();
880
+ uni.showToast({
881
+ title: "添加成功",
882
+ icon: "none"
883
+ });
884
+ successCb(res);
885
+ }).catch(err => {
886
+ console.log(err, 'err')
887
+ this.$xdHideLoading();
888
+ if(errCb) errCb();
889
+ this.$xdLog.catch(err);
890
+ })
891
+ },
892
+ getSettleListCoupons(cb) {
893
+
894
+ jfbRootExec('movieCardList', {
895
+ vm: this,
896
+ data: {
897
+ show_type: 'coupon'
898
+ }
899
+ }).then(res => {
900
+ cb(res.list)
901
+ this.cardList = res.list
902
+ }).catch(this.$xdLog.catch)
903
+ },
904
+ setSettleSelectCoupon(options, successCb, errCb) {
905
+
906
+ this.$xdShowLoading({})
907
+ let cart_order_id = this.tempOrderId;
908
+ jfbRootExec('movieSelectCard', {
909
+ vm: this,
910
+ data: {
911
+ cart_order_id: cart_order_id,
912
+ select_content: 1,
913
+ ...options,
914
+ }
915
+ }).then(res => {
916
+ successCb(res)
917
+ this.$xdHideLoading()
918
+ }).catch(err => {
919
+ if(errCb) errCb(err)
920
+ this.$xdHideLoading()
921
+ this.$xdLog.catch(err);
922
+ })
923
+ },
924
+
769
925
  onJfbBack(options) {
770
926
  this.$xdUniHelper.navigateBack()
771
927
  },
@@ -44,10 +44,9 @@
44
44
  <view class="seat_btn"></view>
45
45
  </view>
46
46
  <xd-online-seat
47
- v-if="filmId"
47
+ v-if="isReload && filmId"
48
48
  ref="xdOnlineSeat"
49
49
  :is-show-title="isShowTitle"
50
- :key="cinemaSeatKey"
51
50
  :is-old="false"
52
51
  :film-id="filmId"
53
52
  :cinema-id="cinemaId"
@@ -56,6 +55,7 @@
56
55
  :is_not_show_price="is_not_show_price"
57
56
  @onGetFilm="handleGetFilm"
58
57
  @onGetSeatList="handleGetSeatList"
58
+ @onGetFilmPaiqi="handleGetFilmPaiqi"
59
59
  @onBuy="handleBuy"></xd-online-seat>
60
60
  </view>
61
61
  </view>
@@ -99,6 +99,8 @@
99
99
  time: 0,
100
100
  xItem: 10,
101
101
  yItem: 7,
102
+
103
+ isReload: true,//控制重新加载(onJfbShow)
102
104
  }
103
105
  },
104
106
  watch: {
@@ -125,6 +127,37 @@
125
127
  }
126
128
  },
127
129
 
130
+ /**
131
+ * @description 获取排期数据
132
+ * @param resolve
133
+ */
134
+ handleGetFilmPaiqi(resolve){
135
+ const {filmId, cinemaId} = this;
136
+ this.$xdShowLoading({});
137
+ jfbRootExec("getCinemaSchedule", {
138
+ vm: this,
139
+ data: {cinema_id: cinemaId, film_id: filmId}
140
+ }).then(res=>{
141
+ this.paiQiData = res.schedule_data.map(item => {
142
+ item['name'] = item['date_name'];
143
+ item['paiqi_data'] = item['paiqi'].map(pp => {
144
+ pp['price'] = pp['sale_price'];
145
+ pp['jfb_film_id'] = pp['film_id'];
146
+ pp['jfb_cinema_id'] = pp['cinema_id'];
147
+ pp['data_id'] = pp['schedule_id'];
148
+ return pp;
149
+ });
150
+ return item;
151
+ });
152
+ resolve(this.paiQiData);
153
+ this.$xdHideLoading();
154
+ })
155
+ .catch(err=>{
156
+ console.error(err);
157
+ this.$xdHideLoading();
158
+ })
159
+ },
160
+
128
161
  getSeatStatus(request_seat_id) {
129
162
  this.$xdShowLoading({});
130
163
  jfbRootExec("getCinemaSeatsStatus", {
@@ -133,6 +166,10 @@
133
166
  request_seat_id: request_seat_id
134
167
  }
135
168
  }).then(res => {
169
+ // res['seat_code'] = 'P0007';
170
+ // res['seat_message'] = '当前场次有误,请您重新选择影片';
171
+ // res['seat_status'] = 'N'
172
+
136
173
  if (res.seat_status === 'Y') {
137
174
  this.$xdHideLoading()
138
175
  clearTimeout(this.timer)
@@ -140,17 +177,21 @@
140
177
  url: this.moviePayPath + `?order_id=${res.temp_order_id}`
141
178
  },true);
142
179
  return
143
- } else if (res.seat_status === 'N') {
180
+ }
181
+
182
+ //有错处理res.seat_status
183
+ else if (res.seat_status === 'N') {
144
184
  clearTimeout(this.timer)
145
185
  this.$xdHideLoading();
146
- this.$xdAlert({
147
- content: res.seat_message,
148
- time: 2500,
149
- isClose: false,
150
- zIndex: 5000
151
- })
152
- return
153
- }else{
186
+
187
+ if(res['seat_message']) res['error_msg'] = res['error_msg'] || res['seat_message'];
188
+ if(res['seat_code']) res['error_code'] = res['error_code'] || res['seat_code']
189
+
190
+ //检查是否报错
191
+ this.handleCheckStatusIsError(res);
192
+ return;
193
+ }
194
+ else{
154
195
  this.timer = setTimeout(() => {
155
196
  this.getSeatStatus(request_seat_id);
156
197
  }, ++this.time > 5 ? (Math.pow(2, (this.time - 4)) * 1000) : 3000)
@@ -160,6 +201,7 @@
160
201
  this.$xdHideLoading()
161
202
  })
162
203
  },
204
+
163
205
  /**
164
206
  * @description 监听事件变化
165
207
  * @param container {object} 业务组件对象自己
@@ -171,8 +213,12 @@
171
213
  if(this.isShowTitle === 'Y') this.yItem = 7;
172
214
  else this.yItem = 10;
173
215
  },
216
+
217
+ /**
218
+ * @description 获取排期与影片基础信息数据
219
+ * @param resolve
220
+ */
174
221
  handleGetFilm(resolve) {
175
- // console.log('11111', paiqi.result);
176
222
  const {filmId, cinemaId} = this;
177
223
  this.$xdShowLoading({});
178
224
  Promise.all([
@@ -182,6 +228,15 @@
182
228
  ]).then(([res, res1]) => {
183
229
  this.loadingList = false;
184
230
  this.$xdHideLoading();
231
+
232
+ //错误异常
233
+ if(res1['error_code']) {
234
+ this.handleCheckStatusIsError(res1, ()=>{
235
+ this.handleGetFilm(resolve)
236
+ });
237
+ return
238
+ }
239
+
185
240
  this.is_not_show_price = res.is_not_show_price;
186
241
  let paiqi_data = res.schedule_data.map(item => {
187
242
  item['name'] = item['date_name'];
@@ -195,7 +250,6 @@
195
250
  return item;
196
251
  });
197
252
  this.paiQiData = paiqi_data;
198
- // const {cinema_data, film_data} = res1;
199
253
  resolve({
200
254
  paiqi_data: paiqi_data,
201
255
  film_data: [{
@@ -225,6 +279,10 @@
225
279
  request_ident: this.request_ident
226
280
  }
227
281
  }).then(res => {
282
+ // res['error_code'] = 'P0002';
283
+ // res['error_msg'] = '当前场次有更新 <br/> 请您手动切换或由系统自动切换到下一场次。';
284
+ // res['status'] = 'E'
285
+
228
286
  if(res.status === "P"){
229
287
  if(!this.$root.$isShow) return;
230
288
  this.request_ident = res.request_ident;
@@ -234,32 +292,36 @@
234
292
  }, ++this.seatTime > 5 ? (Math.pow(2, (this.seatTime - 4)) * 1000) : 2000)
235
293
  return;
236
294
  }
295
+
237
296
  if(res.status === "E"){
238
- uni.showToast({
239
- title: res.error_message,
240
- icon: "none"
241
- })
297
+ this.handleCheckStatusIsError(res, ()=>{
298
+ resolve(null);
299
+ });
242
300
  this.$xdHideLoading();
243
301
  return;
244
302
  }
303
+
245
304
  let seatData = Object.assign({}, res, {
246
305
  seat: res.seat_data.map(item => {
247
306
  return item.seat_columns;
248
307
  })
249
- })
308
+ });
309
+
250
310
  resolve(seatData);
251
311
  this.$xdHideLoading();
252
312
  })
253
313
  },
314
+
254
315
  //去支付未完成订单
255
316
  handleToPay(res){
256
317
  const { temp_order_id, oms_order_id, pay_order_id } = res;
257
318
  this.$xdConfirm({
258
319
  styles: this.styles,
259
320
  width: '90%',
260
- content: '有未完成的订单',
261
- confirmText: '去支付',
262
- cancelText: '继续选座',
321
+ content: '您当前有一笔未付款订单,<br/>请先处理!',
322
+ confirmText: '立即付款',
323
+ isHtml: true,
324
+ cancelText: '取消订单',
263
325
  showClose: false,
264
326
  success: (res) => {
265
327
  if (res.confirm) {
@@ -288,6 +350,60 @@
288
350
  })
289
351
  },
290
352
 
353
+ handleCheckStatusIsError({error_msg,error_message,error_code}, cb=null){
354
+ let msg = error_message || error_msg;
355
+ if(!msg) return false;
356
+
357
+ //是否切换场次
358
+ if(error_code === 'P0002') {
359
+ this.$xdConfirm({
360
+ content: msg,
361
+ zIndex: 5000,
362
+ isHtml: true,
363
+ isTitle:false,
364
+ cancelText:'手动切换',
365
+ confirmText:'自动切换',
366
+ msgIcon:'iconinformation',
367
+ success:(res)=>{
368
+ if(res.confirm) {
369
+ if(typeof cb === 'function') cb();
370
+ }
371
+ }
372
+ })
373
+ return true
374
+ }
375
+
376
+ //当前场次有误,请您重新选择影片
377
+ if(error_code === 'P0007') {
378
+ this.$xdConfirm({
379
+ content: msg,
380
+ zIndex: 5000,
381
+ cancel:false,
382
+ isHtml: true,
383
+ isTitle:false,
384
+ confirmText:'返回首页',
385
+ msgIcon:'iconinformation',
386
+ success:(res)=>{
387
+ if(res.confirm) {
388
+ this.$xdUniHelper.redirectTo({
389
+ url: this.$settings.index
390
+ })
391
+ }
392
+ }
393
+ })
394
+ return true
395
+ }
396
+
397
+ this.$xdAlert({
398
+ content: msg,
399
+ type: 'error',
400
+ time: 3000,
401
+ zIndex: 5000
402
+ })
403
+ this.$xdHideLoading({})
404
+ return true;
405
+ },
406
+
291
407
  handleBuy(item) {
292
408
  let postData = {
293
409
  schedule_id: this.scheduleId,
@@ -301,16 +417,28 @@
301
417
  vm: this,
302
418
  data: postData
303
419
  }).then(res => {
304
- console.log("锁座成功", res);
420
+ //检查是否有错误信息并且弹层
421
+ if(this.handleCheckStatusIsError(res)){
422
+ this.$xdHideLoading()
423
+ return;
424
+ }
425
+
426
+ //未获取到锁座ID
427
+ if(!res.request_seat_id) {
428
+ this.$xdHideLoading();
429
+ this.$xdAlert({
430
+ content: '未获取到锁座ID',
431
+ type: 'error',
432
+ time: 3000
433
+ })
434
+ return;
435
+ }
436
+
305
437
  this.timer = setTimeout(() => {
306
438
  this.getSeatStatus(res.request_seat_id);
307
439
  }, 2000)
308
440
  }).catch(error=>{
309
441
  console.error(error);
310
- uni.showToast({
311
- title: '锁座失败!',
312
- icon: "none"
313
- })
314
442
  this.$xdHideLoading()
315
443
  })
316
444
  },
@@ -318,17 +446,23 @@
318
446
  onJfbBack(options){
319
447
  this.$xdUniHelper.navigateBack();
320
448
  },
449
+
321
450
  onJfbShow(options) {
322
- console.log('onJfbShow', options)
323
- this.onJfbLoad(options);
324
- this.cinemaSeatKey = Date.now()
451
+ this.isReload = false;
452
+ setTimeout(()=>{
453
+ this.isReload = true;
454
+ this.onJfbLoad(options);
455
+ },100)
325
456
  },
457
+
326
458
  onJfbUnload(){
327
459
  this.unmount();
328
460
  },
461
+
329
462
  onJfbHide(){
330
463
  this.unmount();
331
464
  },
465
+
332
466
  unmount(){
333
467
  if(this.seatTimer) clearTimeout(this.seatTimer);
334
468
  if(this.timer) clearTimeout(this.timer);
@@ -257,6 +257,7 @@ export default {
257
257
  mainColorToArray: null,
258
258
  paiqiStatus: false, //影院信息与排期信息状态
259
259
  cinemaInfo: null, //影院信息
260
+ paiqiData:null, //排期数据
260
261
  filmInfo: null, //电影信息
261
262
  height: null, //内容区域高度
262
263
  show: false, //是否显示返回
@@ -454,6 +455,21 @@ export default {
454
455
  */
455
456
  getSeat(item) {
456
457
  this.$emit("onGetSeatList", item, (seat) => {
458
+
459
+ //排期有更新自动选中下一场
460
+ if(seat === null) {
461
+ this.$emit('onGetFilmPaiqi',(paiqiData)=>{
462
+ let list = [];
463
+ paiqiData.map(item => {
464
+ list.push(item["paiqi_data"]);
465
+ });
466
+ this.replaceParams(this.getFirst(list));
467
+ });
468
+ return;
469
+ }
470
+
471
+ //正常数据
472
+ this.selectedSeatInfo = seat;
457
473
  this.selectedSeatList = seat["seat"];
458
474
  this.areaPrices = (seat['area_price'] || []).map(item=>{
459
475
  return {
@@ -467,13 +483,13 @@ export default {
467
483
  },
468
484
 
469
485
  /**
470
- * @description 获取排期数据
486
+ * @description 获取排期与影院信息数据
471
487
  */
472
488
  getFilm() {
473
489
  this.$emit("onGetFilm", (film) => {
474
490
  this.cinemaInfo = film["cinema_data"];
491
+ this.paiqiData = film["paiqi_data"];
475
492
  this.filmInfo = this.getFilmInfo(film["film_data"]);
476
- debugger
477
493
  this.getScheduleList(film["paiqi_data"]);
478
494
  console.log("getFilm", film);
479
495
  this.paiqiStatus = true;
@@ -559,9 +575,13 @@ export default {
559
575
  console.warn(`params.seatId:${this.seatId}`);
560
576
  console.warn(`all.seatId:${JSON.stringify(allPaiqiId)}`);
561
577
  this.$xdConfirm({
562
- content:'当前排期已过期,请您手动切换或由系统自动切换到下一排期。',
578
+ content:'当前场次有更新<br/>请您手动切换或由系统自动切换到下一场次。',
563
579
  confirmText:'自动切换',
564
580
  cancelText:'手动切换',
581
+ msgIcon:'iconinformation',
582
+ zIndex:5000,
583
+ isHtml: true,
584
+ isTitle:false,
565
585
  styles: this.$parent.$parent.$parent.styles,
566
586
  success:(status)=>{
567
587
  if(status.confirm) {
@@ -585,9 +605,16 @@ export default {
585
605
  this.scheduleListIndex
586
606
  );
587
607
  },
608
+
588
609
  replaceParams(selectPaiqi) {
589
- let parseUrl = this.$xdUniHelper.parseURL();
590
- let { params, path } = parseUrl;
610
+ let { params, path } = this.$xdUniHelper.parseURL();
611
+
612
+ //#ifdef H5
613
+ let pathArr = path.split("/");
614
+ pathArr.splice(0,2)
615
+ path = `/${pathArr.join('/')}`
616
+ //#endif
617
+
591
618
  params["scheduleId"] = selectPaiqi["data_id"];
592
619
  let searchParams = this.$xdUniHelper.jsonToParams(params);
593
620
  this.$xdUniHelper.redirectTo({