jufubao-mall 2.0.61 → 2.0.62-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-mall",
3
- "version": "2.0.61",
3
+ "version": "2.0.62-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -145,9 +145,9 @@
145
145
  </template>
146
146
 
147
147
  <template v-for="item in otherPayMethod">
148
- <xd-list-item v-if="item.method === 'card'" :key="item.method" :label="item.show_name" :paddingLR="isCardLayout ? '32rpx' : '48rpx'" showBottom :showRight="!(choseCoupon && choseCoupon.cardPayPrice)" @click="toChoseCard">
148
+ <xd-list-item v-if="item.method === 'card'" :key="item.method" :label="item.show_name" :paddingLR="isCardLayout ? '32rpx' : '48rpx'" showBottom :showRight="canUseCard" @click="toChoseCard">
149
149
  <view slot="label">{{item.show_name}} <text v-if="choseCard && choseCard.cardPayPrice" style="color:red;margin-left: 4px;">(已选{{ choseCard.selectedCardList.length }}张)</text></view>
150
- <view v-if="(choseCoupon && choseCoupon.cardPayPrice)">
150
+ <view v-if="!canUseCard">
151
151
  <view style="color:#CCCCCC;font-size: 24rpx">已使用其他票券,不可用</view>
152
152
  </view>
153
153
  <view v-else>
@@ -156,11 +156,11 @@
156
156
  <view v-else>{{cardList.length}}张可用</view>
157
157
  </view>
158
158
  </xd-list-item>
159
- <xd-list-item v-if="item.method === 'wallet'" :key="item.method" :label="item.show_name" :paddingLR="isCardLayout ? '32rpx' : '48rpx'" showBottom :showRight="!(choseCoupon && choseCoupon.cardPayPrice)" @click="toChoseWallet">
159
+ <xd-list-item v-if="item.method === 'wallet'" :key="item.method" :label="item.show_name" :paddingLR="isCardLayout ? '32rpx' : '48rpx'" showBottom :showRight="canUseWallet" @click="toChoseWallet">
160
160
  <view slot="label">
161
161
  {{ item.show_name }}<text :style="{color:mainColor}" style="margin-left: 8px;font-size: 24rpx;">(剩余{{ wallet_total_amount }})</text>
162
162
  </view>
163
- <view v-if="(choseCoupon && choseCoupon.cardPayPrice)">
163
+ <view v-if="!canUseWallet">
164
164
  <view style="color:#CCCCCC;font-size: 24rpx">已使用其他票券,不可用</view>
165
165
  </view>
166
166
  <view v-else>
@@ -168,13 +168,16 @@
168
168
  <view v-else>请选择</view>
169
169
  </view>
170
170
  </xd-list-item>
171
- <xd-list-item v-if="item.method === 'coupon'" :key="item.method" :label="item.show_name" :paddingLR="isCardLayout ? '32rpx' : '48rpx'" showBottom :showRight="!(choseCard && choseCard.cardPayPrice)" @click="toChoseCoupon">
171
+ <xd-list-item v-if="item.method === 'coupon'" :key="item.method" :label="item.show_name" :paddingLR="isCardLayout ? '32rpx' : '48rpx'" showBottom :showRight="canUseCoupon" @click="toChoseCoupon">
172
172
  <view v-if="(choseCoupon && choseCoupon.cardPayPrice)" slot="label">
173
173
  {{item.show_name}} <text style="color:red;margin-left: 4px;">(已选{{ choseCoupon.selectedCardList.length }}张)</text>
174
174
  </view>
175
- <view v-else>
176
- <view style="color:#CCCCCC;font-size: 24rpx" v-if="(choseWallet && choseWallet.walletPayPrice)||(choseCard && choseCard.cardPayPrice)">已使用其他票券,不可用</view>
177
- <view v-else>{{couponList.length}}张可用</view>
175
+ <view>
176
+ <view v-if="!canUseCoupon" style="color:#CCCCCC;font-size: 24rpx" >已使用其他票券,不可用</view>
177
+ <view v-else>
178
+ <xd-unit v-if="choseCoupon && choseCoupon.cardPayPrice" :price="choseCoupon.cardPayPrice" :isOld="false" :fontSize="28" :iconSize="0.3"></xd-unit>
179
+ <view v-else>{{couponList.length}}张可用</view>
180
+ </view>
178
181
  </view>
179
182
  </xd-list-item>
180
183
  </template>
@@ -271,6 +274,7 @@
271
274
  <cus-coupon-chose
272
275
  v-if="payCoupon"
273
276
  ref="xdCouponChose"
277
+ :defaultUseFirst="defaultUseCouponFirst"
274
278
  :hadChoseCoupon="choseCoupon && choseCoupon.selectedCardList"
275
279
  :layoutInfo="layoutInfo"
276
280
  :show.sync="showCouponChose"
@@ -467,6 +471,7 @@
467
471
  choseCoupon: null,
468
472
  showCouponChose: false,
469
473
  couponList: [],
474
+ is_wallet_use_with_coupon: "", //是否钱包与优惠券同时使用
470
475
 
471
476
  fixedBottomBodyHeight: 0,
472
477
 
@@ -673,10 +678,15 @@
673
678
  let choseWalletPay = this.choseWallet ? this.choseWallet.walletPayPrice : 0;
674
679
  let choseCouponPay = this.choseCoupon ? this.choseCoupon.cardPayPrice : 0
675
680
  let total = 0
676
- if(choseCouponPay) {
677
- total = choseCouponPay
678
- } else {
679
- total = this.$xdUniHelper.addFloatNumber(choseCardPay, choseWalletPay);
681
+ if(this.is_wallet_use_with_coupon === 'Y'){
682
+ total = this.$xdUniHelper.addFloatNumber(choseCouponPay, choseWalletPay);
683
+ total = this.$xdUniHelper.addFloatNumber(total, choseCardPay);
684
+ }else{
685
+ if(choseCouponPay) {
686
+ total = choseCouponPay
687
+ } else {
688
+ total = this.$xdUniHelper.addFloatNumber(choseCardPay, choseWalletPay);
689
+ }
680
690
  }
681
691
  let total_amount = this.orderFee.total_amount ? this.orderFee.total_amount : 0;
682
692
  let result = this.$xdUniHelper.cutFloatNumber(total_amount, total);
@@ -730,11 +740,34 @@
730
740
  }
731
741
  return style;
732
742
  },
733
- defaultUseWalletFirst(){
743
+ defaultUseWallet(){
734
744
  return this.checkPayMethod.includes('wallet');
735
745
  },
746
+ defaultUseWalletFirst(){
747
+ //钱包与优惠券可共同使用的情况下, 需要先选优惠券,再选钱包
748
+ //钱包会从被动触发变主动触发, is_wallet_use_with_coupon === 'Y'时,钱包默认不选中
749
+ if(this.is_wallet_use_with_coupon === "Y") return false;
750
+ return this.defaultUseWallet;
751
+ },
752
+ defaultUseCouponFirst(){
753
+ //默认使用优惠券由面板属性 钱包是否默认选中决定
754
+ return this.defaultUseWallet;
755
+ },
736
756
  showOpenVipDialog(){
737
757
  return !this.isVip&&this.is_plus_site;
758
+ },
759
+ canUseCoupon(){
760
+ if(this.is_wallet_use_with_coupon === "Y") return true;
761
+ //默认当有钱包支付或者卡券支付时并且金额大于0,优惠券不可用
762
+ //(choseWallet && choseWallet.walletPayPrice)||(choseCard && choseCard.cardPayPrice)
763
+ return !((this.choseWallet && this.choseWallet.walletPayPrice) || (this.choseCard && this.choseCard.cardPayPrice));
764
+ },
765
+ canUseCard(){
766
+ return !(this.choseCoupon && this.choseCoupon.cardPayPrice);
767
+ },
768
+ canUseWallet(){
769
+ if(this.is_wallet_use_with_coupon === "Y") return true;
770
+ return !(this.choseCoupon && this.choseCoupon.cardPayPrice);
738
771
  }
739
772
  },
740
773
  watch: {
@@ -922,7 +955,7 @@
922
955
  },
923
956
  //选择元宝
924
957
  toChoseWallet(){
925
- if(this.choseCoupon && this.choseCoupon.cardPayPrice) return
958
+ if(!this.canUseWallet) return;
926
959
  this.showWalletChose = true;
927
960
  },
928
961
  handleWalletChose({walletPayPrice, needPayPrice, selectedWalletList}){
@@ -940,7 +973,7 @@
940
973
 
941
974
  //only选择满减券
942
975
  toChoseCoupon(){
943
- if(this.choseCard && this.choseCard.cardPayPrice) return
976
+ if(!this.canUseCoupon) return;
944
977
  this.showCouponChose = true;
945
978
  },
946
979
  //only选择满减券结果
@@ -948,6 +981,10 @@
948
981
  console.log(data,'alalalal')
949
982
  this.choseCoupon = data;
950
983
  this.showCouponChose = false;
984
+ //优惠券跟钱包同时使用,优惠券选完后,钱包默认选中第一张卡
985
+ if(this.is_wallet_use_with_coupon === "Y" && this.defaultUseWallet && data.isAutoTrigger){
986
+ if(this.$refs['xdWalletChose']) this.$refs['xdWalletChose'].handleChoseDefault();
987
+ }
951
988
  },
952
989
  handleCouponInit(coupList){
953
990
  this.couponList = coupList;
@@ -955,7 +992,7 @@
955
992
 
956
993
  //only选择卡片
957
994
  toChoseCard(){
958
- if(this.choseCoupon && this.choseCoupon.cardPayPrice) return
995
+ if(!this.canUseCard) return;
959
996
  this.showCardPayChose = true;
960
997
  this.showCardPayChoseWay = 'chose_card';
961
998
  },
@@ -996,6 +1033,11 @@
996
1033
  console.log("this.choseCard", this.choseCard)
997
1034
  const { choseCard } = this;
998
1035
  let selected_card_list = choseCard ? choseCard.selectedCardList : [];
1036
+ //苏州交投:优惠券跟钱包可同时支持
1037
+ //问题:票券跟优惠券同时存在的话,暂时都放到selected_card_list中,后续再做区分处理
1038
+ if(this.choseCoupon){
1039
+ selected_card_list = selected_card_list.concat(this.choseCoupon.selectedCardList);
1040
+ }
999
1041
  let otherOptions = {};
1000
1042
  let fnName = "useBindedWallet";
1001
1043
  if(this.gift_id) {
@@ -1537,6 +1579,7 @@
1537
1579
  support_methods: JSON.stringify(support_methods)
1538
1580
  }
1539
1581
  }).then(res => {
1582
+ this.is_wallet_use_with_coupon = res.is_wallet_use_with_coupon;
1540
1583
  this.otherPayMethod = res.list;
1541
1584
  this.otherPayLoaded = true;
1542
1585
  })
@@ -139,7 +139,7 @@ export default {
139
139
  data: {
140
140
  namespace,
141
141
  cart_order_id: order_id,
142
- show_type: 'normal'
142
+ show_type: 'normal',
143
143
  }
144
144
  }).then(res => {
145
145
  cb(res.list)
@@ -369,7 +369,8 @@ export default {
369
369
  data: {
370
370
  namespace,
371
371
  cart_order_id: order_id,
372
- show_type: 'coupon'
372
+ show_type: 'coupon',
373
+ total_price: this.orderFee.total_amount
373
374
  }
374
375
  }).then(res => {
375
376
  cb(res.list)
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * @description 第三方库
5
- * @param threePackagePath {String} 第三方库所在项目路径存放路径路
6
- * @param packname {String} 包名字
7
- * @returns {string|*}
8
- */
9
- const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
10
- if(packname === 'gxd-commands-bussiness') {
11
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
12
- }
13
-
14
- if (packname === 'gxd-uni-library-editx') {
15
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
16
- }
17
-
18
- };
19
-
20
- module.exports = {
21
- getPackagePath
22
- }