jufubao-movie 1.0.40 → 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.40",
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
  },