jufubao-movie 1.0.40 → 1.0.41-beta3

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-beta3",
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.selectedCardList"
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
+ handleCouponChose(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,
@@ -516,6 +589,7 @@
516
589
  data: {
517
590
  ...options,
518
591
  cart_order_id: this.tempOrderId,
592
+ show_type: 'normal'
519
593
  }
520
594
  }).then(res => {
521
595
  this.$xdHideLoading()
@@ -542,7 +616,9 @@
542
616
  getSettleListCards(cb) {
543
617
  jfbRootExec("movieCardList", {
544
618
  vm: this,
545
- data: {}
619
+ data: {
620
+ show_type: 'normal'
621
+ }
546
622
  }).then(res => {
547
623
  cb(res.list)
548
624
  this.cardList = res.list
@@ -583,8 +659,13 @@
583
659
  /**
584
660
  * 有任一新版支付都用新版支付, 仅卡支付也用新版选卡支付
585
661
  */
586
- if(this.payWallet || this.payCard){ //已选卡
587
- let selected_card_list = this.choseCard ? this.choseCard.selectedCardList : [];
662
+ if(this.payWallet || this.payCard || this.payCoupon){ //已选卡
663
+ let selected_card_list
664
+ if(this.choseCard) {
665
+ selected_card_list = this.choseCard ? this.choseCard.selectedCardList : [];
666
+ } else if(this.choseCoupon) {
667
+ selected_card_list = this.choseCoupon ? this.choseCoupon.selectedCardList : [];
668
+ }
588
669
  let selected_wallet_list = this.choseWallet ? this.choseWallet.selectedWalletList : []
589
670
  //票券跟钱包都未选择,给用户提示
590
671
  if(selected_card_list.length == 0 && selected_wallet_list.length == 0){
@@ -741,6 +822,18 @@
741
822
  this.payPath = getContainerPropsValue(container, 'content.payPath', {value: ''}).value;
742
823
  this.paySuccessPath = getContainerPropsValue(container, 'content.paySuccessPath', {value: "/pages/order/success"}).value;
743
824
  this.bindCard = getContainerPropsValue(container,"content.bindCard","1");
825
+ this.couponBtnRadius = getContainerPropsValue(container, "content.couponBtnRadius", 16);
826
+ this.couponUseBtnPadding = getContainerPropsValue(container, "content.couponUseBtnPadding", {top: 20, left: 20, right: 20, bottom: 20});
827
+ this.couponBtnTextStyle = getContainerPropsValue(container, "content.couponBtnTextStyle", {
828
+ color: '#fff',
829
+ bgColor: '#ff5722',
830
+ fontSize: '30rpx',
831
+ fontWeight: 'normal'
832
+ });
833
+ this.couponTitleBgColor = getContainerPropsValue(container, "content.couponTitleBgColor", 'rgba(255, 87, 51, 0.1)');
834
+ this.couponRadius = getContainerPropsValue(container, "content.couponRadius", 16);
835
+ this.couponLeftBgColor = getContainerPropsValue(container, "content.couponLeftBgColor", "linear-gradient(180deg, #FFA852 0%, #FF5733 100%)");
836
+ this.couponImageUrl = getContainerPropsValue(container, "content.couponImageUrl", "");
744
837
  this.getContent();
745
838
  },
746
839
  handleCreateSuccess(val) {
@@ -766,6 +859,63 @@
766
859
  }
767
860
  },
768
861
 
862
+ addSettleCoupon(options, successCb, errCb) {
863
+
864
+ this.$xdShowLoading({})
865
+ jfbRootExec('movieAddCard', {
866
+ vm: this,
867
+ data: {
868
+ ...options,
869
+ cart_order_id: this.tempOrderId,
870
+ show_type: 'coupon'
871
+ }
872
+ }).then(res => {
873
+ this.$xdHideLoading();
874
+ uni.showToast({
875
+ title: "添加成功",
876
+ icon: "none"
877
+ });
878
+ successCb(res);
879
+ }).catch(err => {
880
+ console.log(err, 'err')
881
+ this.$xdHideLoading();
882
+ if(errCb) errCb();
883
+ this.$xdLog.catch(err);
884
+ })
885
+ },
886
+ getSettleListCoupons(cb) {
887
+
888
+ jfbRootExec('movieCardList', {
889
+ vm: this,
890
+ data: {
891
+ show_type: 'coupon'
892
+ }
893
+ }).then(res => {
894
+ cb(res.list)
895
+ this.cardList = res.list
896
+ }).catch(this.$xdLog.catch)
897
+ },
898
+ setSettleSelectCoupon(options, successCb, errCb) {
899
+
900
+ this.$xdShowLoading({})
901
+ let cart_order_id = this.tempOrderId;
902
+ jfbRootExec('movieSelectCard', {
903
+ vm: this,
904
+ data: {
905
+ cart_order_id: cart_order_id,
906
+ select_content: 1,
907
+ ...options,
908
+ }
909
+ }).then(res => {
910
+ successCb(res)
911
+ this.$xdHideLoading()
912
+ }).catch(err => {
913
+ if(errCb) errCb(err)
914
+ this.$xdHideLoading()
915
+ this.$xdLog.catch(err);
916
+ })
917
+ },
918
+
769
919
  onJfbBack(options) {
770
920
  this.$xdUniHelper.navigateBack()
771
921
  },