jufubao-third 1.0.10 → 1.0.11-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-third",
3
- "version": "1.0.10",
3
+ "version": "1.0.11-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件第三方购物平台包",
6
6
  "main": "index.js",
@@ -149,5 +149,16 @@ module.exports = [
149
149
  },
150
150
  isConsole: true,
151
151
  disabled: true
152
+ },
153
+ {
154
+ mapFnName: "getVipList",
155
+ title: "会员中心 - 会员卡列表",
156
+ path: "/member/v1/vip-card",
157
+ isRule: false,
158
+ params: {
159
+ is_show_exchange_code: ['是否展示 兑换码 ', 'Y/N,默认N', false],
160
+ },
161
+ isConsole: true,
162
+ disabled: true
152
163
  }
153
164
  ];
@@ -15,88 +15,129 @@
15
15
  </view>
16
16
  </view>
17
17
  <!-- #endif -->
18
- <view class="jfb-third-pay__body">
18
+ <view class="jfb-third-pay__body" :style="[bodyWrapStyle]">
19
19
  <view class="column-group">
20
- <view style="padding: 20rpx 0 0;">
21
- <view class="column-item noBorder">
22
- <view v-if="product_total_price" class="column_label text_gray">商品总额</view>
23
- <view class="column_value text-gray">
24
- <xd-unit :price="product_total_price" :isOld="false" :font-size="24" :icon-size="0.3"></xd-unit>
20
+ <view class="pay_section">
21
+ <view style="padding: 20rpx 0 0;">
22
+ <view class="column-item noBorder">
23
+ <view v-if="product_total_price" class="column_label text_gray">商品总额</view>
24
+ <view class="column_value text-gray">
25
+ <xd-unit
26
+ :isShowIcon="isShowIcon"
27
+ :colorNew="isShowIcon ? '': '#999'"
28
+ :price="product_total_price"
29
+ :isOld="false"
30
+ :font-size="24"
31
+ :icon-size="0.3"
32
+ ></xd-unit>
33
+ </view>
25
34
  </view>
26
- </view>
27
- <view v-if="servicePrice" class="column-item noBorder">
28
- <view class="column_label text_gray">平台服务费总额</view>
29
- <view class="column_value text-gray">
30
- <xd-unit :price="servicePrice" :isOld="false" :font-size="24" :icon-size="0.3"></xd-unit>
35
+ <view v-if="servicePrice" class="column-item noBorder">
36
+ <view class="column_label text_gray">平台服务费总额</view>
37
+ <view class="column_value text-gray">
38
+ <xd-unit
39
+ :isShowIcon="isShowIcon"
40
+ :colorNew="isShowIcon ? '': '#999'"
41
+ :price="servicePrice" :isOld="false" :font-size="24" :icon-size="0.3"></xd-unit>
42
+ </view>
43
+ </view>
44
+ <view v-if="logisticsPrice" class="column-item noBorder">
45
+ <view class="column_label text_gray">运费</view>
46
+ <view class="column_value text-gray">
47
+ <xd-unit
48
+ :isShowIcon="isShowIcon"
49
+ :colorNew="isShowIcon ? '': '#999'"
50
+ :price="logisticsPrice" :isOld="false" :font-size="24" :icon-size="0.3"></xd-unit>
51
+ </view>
31
52
  </view>
32
53
  </view>
33
- <view v-if="logisticsPrice" class="column-item noBorder">
34
- <view class="column_label text_gray">运费</view>
54
+ <view class="column-item">
55
+ <view class="column_label text_gray">
56
+ 订单总额
57
+ </view>
35
58
  <view class="column_value text-gray">
36
- <xd-unit :price="logisticsPrice" :isOld="false" :font-size="24" :icon-size="0.3"></xd-unit>
59
+ <xd-unit
60
+ :isShowIcon="isShowIcon"
61
+ :colorNew="isShowIcon ? '': '#999'"
62
+ :price="origin_total_price"
63
+ :isOld="false"
64
+ :font-size="24"
65
+ :icon-size="0.3"
66
+ ></xd-unit>
37
67
  </view>
38
68
  </view>
39
69
  </view>
40
- <view class="column-item">
41
- <view class="column_label">
42
- 订单总额
43
- </view>
44
- <view class="column_value text-gray">
45
- <xd-unit
46
- :price="total_price"
47
- :isOld="false"
48
- :font-size="24"
49
- :icon-size="0.3"
50
- ></xd-unit>
51
- </view>
70
+
71
+ <view v-if="show_vip_card==='Y'" class="pay_section">
72
+ <cus-vip-list :list="vipCardList"
73
+ :vip_card_id="vip_card_id"
74
+ :plus_saving_money="plus_saving_money"
75
+ @choseVipCard="handleChoseVipCard"></cus-vip-list>
52
76
  </view>
53
- <view class="column-item">
54
- <view class="column_label">
55
- 仍需支付
56
- <view class="label_sub">(可使用多张票券支付)</view>
57
- </view>
58
- <view class="column_value text-primary">
59
- <xd-unit
60
- :price="showOldPay ? needPayPrice :orderNeedPayPrice"
61
- :isOld="false"
62
- :font-size="24"
63
- :icon-size="0.3"
64
- ></xd-unit>
65
- </view>
77
+ <view v-if="isShowPlusSaveMoney" class="pay_section">
78
+ <xd-list-item label="PLUS专项立减" size="small" paddingLR="40rpx" >
79
+ <view slot="label" style="color: #86541E;">PLUS专享立减</view>
80
+ <!-- <view style="color: #FF7070;">-5.00</view> -->
81
+ <xd-unit :isShowIcon="isShowIcon" :price="-plus_saving_money" :largeZero="false" :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
82
+ </xd-list-item>
66
83
  </view>
67
- <view v-if="showOldPay" class="column-item">
68
- <view class="column_label">
69
- 我的票券
70
- <view class="label_sub">(已使用{{checkedCards.length}}张票券)</view>
84
+
85
+ <view v-if="!isPlusSite" class="pay_section">
86
+ <view class="column-item">
87
+ <view class="column_label">
88
+ 仍需支付
89
+ <view class="label_sub">(可使用多张票券支付)</view>
90
+ </view>
91
+ <view class="column_value text-primary">
92
+ <xd-unit
93
+ :isShowIcon="isShowIcon"
94
+ :price="showOldPay ? needPayPrice :orderNeedPayPrice"
95
+ :isOld="false"
96
+ :font-size="24"
97
+ :icon-size="0.3"
98
+ ></xd-unit>
99
+ </view>
71
100
  </view>
72
- <view class="column_value">
73
- <xd-button
74
- width="220rpx"
75
- radius="60rpx"
76
- type="primary"
77
- size="small"
78
- @click="xdDownDrawer=true; switchValidToken()"
79
- >使用新票券</xd-button>
101
+ <view v-if="showOldPay" class="column-item">
102
+ <view class="column_label">
103
+ 我的票券
104
+ <view class="label_sub">(已使用{{checkedCards.length}}张票券)</view>
105
+ </view>
106
+ <view class="column_value">
107
+ <xd-button
108
+ width="220rpx"
109
+ radius="60rpx"
110
+ type="primary"
111
+ size="small"
112
+ @click="xdDownDrawer=true; switchValidToken()"
113
+ >使用新票券</xd-button>
114
+ </view>
80
115
  </view>
81
116
  </view>
82
117
  </view>
83
- <template v-if="!showOldPay">
118
+ <!-- <view class="pay_section">
119
+ <xd-list-item label="账户余额" size="small" paddingLR="40rpx" showRight>
120
+ <view style="color: #999999;">30.00</view>
121
+ </xd-list-item>
122
+ </view> -->
123
+ <view class="pay_section" v-if="!showOldPay">
84
124
  <template v-for="item in otherPayMethod">
85
- <xd-list-item v-if="item.method === 'card'" :key="item.method" :label="item.show_name" paddingLR="60rpx" size="small" showRight @click="toChoseCard">
125
+ <xd-list-item v-if="item.method === 'card'" :key="item.method" :label="item.show_name" paddingLR="40rpx" size="small" showRight @click="toChoseCard">
86
126
  <view v-if="choseCard && choseCard.cardPayPrice" slot="label">{{item.show_name}} <text style="color:red;margin-left: 4px;">(已选{{ choseCard.selectedCardList.length }}张)</text></view>
87
127
  <xd-unit v-if="choseCard && choseCard.cardPayPrice" :price="choseCard.cardPayPrice" :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
88
128
  <view v-else>请选择</view>
89
129
  </xd-list-item>
90
- <xd-list-item v-if="item.method === 'wallet'" :key="item.method" :label="item.show_name" paddingLR="60rpx" size="small" showRight @click="toChoseWallet">
130
+ <xd-list-item v-if="item.method === 'wallet'" :key="item.method" :label="item.show_name" paddingLR="40rpx" size="small" showRight @click="toChoseWallet">
91
131
  <xd-unit v-if="choseWallet && choseWallet.walletPayPrice" :price='choseWallet.walletPayPrice' :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
92
132
  <view v-else>请选择</view>
93
133
  </xd-list-item>
94
134
  </template>
95
- </template>
135
+ </view>
96
136
 
97
137
  <view
98
138
  class="ticket_list"
99
139
  :key="renderChecked"
140
+ v-if="!isPlusSite"
100
141
  >
101
142
  <view
102
143
  class="ticket_item"
@@ -148,7 +189,21 @@
148
189
  </view>
149
190
  </view>
150
191
  </view>
192
+ <view v-if="isPlusSite" class="bottom_btn plus_btm" :style="{bottom: layoutInfo.bottom+'rpx'}">
193
+ <view class="flex_l">实付:
194
+ <xd-unit
195
+ :isShowIcon="isShowIcon"
196
+ :price="showOldPay ? needPayPrice :orderNeedPayPrice"
197
+ :isOld="false"
198
+ :font-size="40"
199
+ :icon-size="0.3"
200
+ ></xd-unit></view>
201
+ <view>
202
+ <xd-button type="primary" @click="doAllPay">支付</xd-button>
203
+ </view>
204
+ </view>
151
205
  <view
206
+ v-else
152
207
  class="bottom_btn"
153
208
  :style="{bottom: layoutInfo.bottom+'rpx'}"
154
209
  >
@@ -283,6 +338,7 @@
283
338
  import XdListItem from "./XdListItem.vue"
284
339
  import XdCardPayChose from "@/components/XdCardPayChose/XdCardPayChose"
285
340
  import XdWalletChose from "@/components/XdWalletChose/XdWalletChose"
341
+ import CusVipList from "@/components/CusVipList/CusVipList"
286
342
  import {mapState} from "vuex"
287
343
  import { getContainerPropsValue } from "@/utils/xd.base";
288
344
  export default {
@@ -299,14 +355,15 @@
299
355
  XdUnit,
300
356
  XdListItem,
301
357
  XdCardPayChose,
302
- XdWalletChose
358
+ XdWalletChose,
359
+ CusVipList
303
360
  },
304
361
  mixins: [
305
362
  componentsMixins, extsMixins, JfbThirdPayMixin, WalletMixins
306
363
  ],
307
364
  data() {
308
365
  return {
309
-
366
+ isVip: false,
310
367
  xdDownDrawer: false,
311
368
  payChannels: [],
312
369
  channel_provider_id: "",
@@ -322,6 +379,7 @@
322
379
 
323
380
  product_total_price: "",
324
381
  total_price: "",
382
+ origin_total_price: "",
325
383
  servicePrice: "",
326
384
  logisticsPrice: "",
327
385
 
@@ -335,6 +393,11 @@
335
393
  selectedCardList: [], //卡绑定使用的
336
394
  options: {},
337
395
 
396
+ show_vip_card: "",
397
+ vipCardList: [],
398
+ vip_card_id: 0,
399
+ plus_saving_money: 0,
400
+
338
401
  //面板
339
402
  orderSuccessPath: "",
340
403
  thirdPayPath: "",
@@ -350,8 +413,27 @@
350
413
  },
351
414
  computed: {
352
415
  ...mapState({
353
- brandInfo: state => state.brandInfo
416
+ brandInfo: state => state.brandInfo,
417
+ siteInfo: state => state.siteInfo,
354
418
  }),
419
+ bodyWrapStyle(){
420
+ return {
421
+ background: 'rgb(249, 249, 249)',
422
+ minHeight: this.layoutInfo.bodyMinHeightRpx + 'rpx'
423
+ }
424
+ },
425
+ isShowIcon() {
426
+ if(this.$configProject['isPreview']) return true;
427
+ return this.siteInfo.mapping.is_show_coin_icon==='Y'
428
+ },
429
+ isPlusSite(){
430
+ return this.projectAttr.headers['X-Site-Group']==="vip";
431
+ },
432
+ //是否展示vip减免
433
+ isShowPlusSaveMoney(){
434
+ if(this.show_vip_card === 'Y') return this.vip_card_id;
435
+ else return this.isVip && this.plus_saving_money;
436
+ },
355
437
  showCardList(){
356
438
  //筛选出不存在于cardList的数据
357
439
  let otherCardList = this.selectedCardList.filter(item =>{
@@ -381,6 +463,7 @@
381
463
  this.init(this.container);
382
464
  let valid_token = this.$xdUniHelper.randomChar(20);
383
465
  this.$set(this.cardForm, "valid_token", valid_token);
466
+ this.isVip = this.getTokenForKey('user_level') === 'VIP';
384
467
 
385
468
  // #ifdef H5
386
469
  if (!this.$configProject.isPreview) {
@@ -399,6 +482,7 @@
399
482
  this.validImageAPIUrl = this.brandInfo['api_host'] + '/common/v1/valid_code/image/show'
400
483
 
401
484
  this.getOrderConfirm();
485
+
402
486
  },
403
487
  /**
404
488
  * @description 监听事件变化
@@ -419,12 +503,27 @@
419
503
  }
420
504
  return time;
421
505
  },
506
+ handleChoseVipCard(vip_card_id){
507
+ this.vip_card_id = vip_card_id;
508
+ this.getOrderConfirm();
509
+ },
510
+ p_getVipList(xnamespace){
511
+ jfbRootExec("getVipList", {
512
+ vm: this,
513
+ data: {
514
+ namespace: xnamespace,
515
+ }
516
+ }).then(res => {
517
+ this.vipCardList = res.list;
518
+ })
519
+ },
422
520
  getOrderConfirm(){
423
521
  jfbRootExec("getThirdOrderInfo", {
424
522
  vm: this,
425
523
  data: {
426
524
  main_order_id: this.main_order_id,
427
525
  namespace: this.xnamespace,
526
+ vip_card_id: this.vip_card_id,
428
527
  ...this.options,
429
528
  }
430
529
  }).then(res => {
@@ -444,12 +543,17 @@
444
543
  return;
445
544
  }
446
545
  this.p_getPayMethod(res.pay_methods);
447
-
448
- this.total_price = this.$xdUniHelper.multiplyFloatNumber(res.total_price, 1);
546
+ this.origin_total_price = res.total_price;
547
+ this.total_price = this.$xdUniHelper.multiplyFloatNumber(res.real_pay_price, 1);
449
548
  this.needPayPrice = this.total_price;
450
549
  this.servicePrice = this.$xdUniHelper.multiplyFloatNumber(res.service_fee, 1);
451
550
  this.logisticsPrice = this.$xdUniHelper.multiplyFloatNumber(res.logistics_amount, 1);
452
551
  this.product_total_price = this.$xdUniHelper.multiplyFloatNumber(res.product_total_price, 1);
552
+ this.plus_saving_money = this.$xdUniHelper.multiplyFloatNumber(res.discount_price, 1);
553
+ this.show_vip_card = res.show_vip_card;
554
+ if(res.show_vip_card === 'Y' && !this.vipCardList.length){
555
+ this.p_getVipList(res.business_code);
556
+ }
453
557
  })
454
558
  },
455
559
  p_getH5WxAuthorize(){
@@ -502,7 +606,9 @@
502
606
  if(!submitCardList.length){
503
607
  //支持补差, 提示是否使用补差
504
608
  if(this.payThird){
505
- await this.handleConfirmAllWxPay();
609
+ if(!this.isPlusSite){
610
+ await this.handleConfirmAllWxPay();
611
+ }
506
612
  }else{
507
613
  //不支持补差,仅提示
508
614
  return this.$xdAlert({content: "请选择兑换方式"})
@@ -514,6 +620,7 @@
514
620
  other_channel_pay_price: needPayPrice,
515
621
  need_pay_price: needPayPrice,
516
622
  namespace: this.xnamespace,
623
+ vip_card_id: this.vip_card_id,
517
624
  ...this.options,
518
625
  }, res => {
519
626
  this.$xdLog.setARMSInfo({
@@ -808,23 +915,32 @@
808
915
 
809
916
  .jfb-third-pay {
810
917
  &__body{
811
- padding-bottom: 150rpx;
812
- background: #FFFFFF;
918
+ // padding-bottom: 150rpx;
919
+ // background: #FFFFFF;
813
920
 
921
+ .pay_section{
922
+ margin: 24rpx;
923
+ background-color: #FFFFFF;
924
+ border-radius: 20rpx;
925
+ overflow: hidden;
926
+ }
814
927
  .text_gray{
815
928
  color: #666666 !important;
929
+ }
930
+ .vip_list_wrap{
931
+
816
932
  }
817
933
  .column-group{
818
934
  .column-item{
819
935
  display: flex;
820
936
  align-items: center;
821
937
  justify-content: space-between;
822
- border-bottom: 1px solid rgba(238, 238, 238, 1);
823
- padding: 30rpx 50rpx;
938
+ // border-bottom: 1px solid rgba(238, 238, 238, 1);
939
+ padding: 30rpx 40rpx;
824
940
 
825
941
  &.noBorder{
826
942
  border-bottom: none;
827
- padding: 12rpx 50rpx;
943
+ padding: 12rpx 40rpx;
828
944
  }
829
945
 
830
946
  .column_label{
@@ -922,6 +1038,19 @@
922
1038
  padding: 24rpx 0;
923
1039
  background: #FFFFFF;
924
1040
  box-shadow: 0 0 0px 1px rgba(0, 0, 0, 0.1);
1041
+ box-sizing: border-box;
1042
+ &.plus_btm{
1043
+ display: flex;
1044
+ align-items: center;
1045
+ justify-content: space-between;
1046
+ padding-left:40rpx;
1047
+ padding-right: 40rpx;
1048
+ .flex_l{
1049
+ color: #FF5A39;
1050
+ display: flex;
1051
+ align-items: center;
1052
+ }
1053
+ }
925
1054
  }
926
1055
  }
927
1056
  }
@@ -1,8 +1,66 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  module.exports = {
4
- getThirdOrderInfo: {"main_order_id":"b517729203734716416","address":"北京市东城区崇文门外大街18号1幢(F1-1)号商铺","phone":"13611111111","total_price":"1680","show_time":1684396260,"remark":"","count_down":897,"request_id":"d2002455fa902b94"},
5
- getThirdListCards: {"list":[{"card_number":"101001000005388","card_type_name":"聚福宝福","end_time":1764345599,"card_point":8319,"is_bind_card":true}],"request_id":"7a01f757e9c2b1ab"},
6
- getPayMethod: {"list":[{"method":"wallet","show_name":"使用我的元宝","icon":"icon_1"},{"method":"third","show_name":"使用补差","icon":"icon_2"},{"method":"score","show_name":"使用积分","icon":"icon_3"},{"method":"card","show_name":"使用票券1","icon":"icon_4"}],"request_id":"6549409a86024ecf"},
7
- getUserWallet: {"show_name":"我的元宝","icon":"icon_1","total_amount":127134,"list":[{"wallet_type":"UC","wallet_name":"测试账户1","wallet_virtual_number":"1000000000000245","amount":66955,"business_codes":"cake,v-RcA8Mv-Gpd96_Y_mjIf,movie","business_codes_name":"蛋糕(勿改),商城,电影(勿改)","wallet_rule":"<p>UC使用规则说明<\/p>\n<p>123<\/p>\n<p>阿达我娃的啊我啊我啊我啊我<\/p>\n<p><span style=\"color: #ff0000;\">阿我打我爱我的啊我啊我<\/span><\/p>"},{"wallet_type":"UB","wallet_name":"测试账户3","wallet_virtual_number":"1000000000000244","amount":60179,"business_codes":"cake,movie,market,video,book","business_codes_name":"蛋糕(勿改),电影(勿改),商城(对应百货)(勿改),网络视听(勿改),图书(勿改)","wallet_rule":"<p>UB使用规则说明<\/p>\n<p>123456<\/p>"}],"request_id":"c9975f7b9bc426a5"},
8
- }
4
+ getThirdOrderInfo: {
5
+ main_order_id: "b517729203734716416",
6
+ address: "北京市东城区崇文门外大街18号1幢(F1-1)号商铺",
7
+ phone: "13611111111",
8
+ total_price: "1680",
9
+ show_time: 1684396260,
10
+ remark: "",
11
+ count_down: 897,
12
+ product_total_price: "1680",
13
+ logistics_amount: "100",
14
+ request_id: "d2002455fa902b94"
15
+ },
16
+ getThirdListCards: {
17
+ list: [
18
+ {
19
+ card_number: "101001000005388",
20
+ card_type_name: "聚福宝福",
21
+ end_time: 1764345599,
22
+ card_point: 8319,
23
+ is_bind_card: true
24
+ }
25
+ ],
26
+ request_id: "7a01f757e9c2b1ab"
27
+ },
28
+ getPayMethod: {
29
+ list: [
30
+ { method: "wallet", show_name: "使用我的元宝", icon: "icon_1" },
31
+ { method: "third", show_name: "使用补差", icon: "icon_2" },
32
+ { method: "score", show_name: "使用积分", icon: "icon_3" },
33
+ { method: "card", show_name: "使用票券1", icon: "icon_4" }
34
+ ],
35
+ request_id: "6549409a86024ecf"
36
+ },
37
+ getUserWallet: {
38
+ show_name: "我的元宝",
39
+ icon: "icon_1",
40
+ total_amount: 127134,
41
+ list: [
42
+ {
43
+ wallet_type: "UC",
44
+ wallet_name: "测试账户1",
45
+ wallet_virtual_number: "1000000000000245",
46
+ amount: 66955,
47
+ business_codes: "cake,v-RcA8Mv-Gpd96_Y_mjIf,movie",
48
+ business_codes_name: "蛋糕(勿改),商城,电影(勿改)",
49
+ wallet_rule:
50
+ '<p>UC使用规则说明</p>\n<p>123</p>\n<p>阿达我娃的啊我啊我啊我啊我</p>\n<p><span style="color: #ff0000;">阿我打我爱我的啊我啊我</span></p>'
51
+ },
52
+ {
53
+ wallet_type: "UB",
54
+ wallet_name: "测试账户3",
55
+ wallet_virtual_number: "1000000000000244",
56
+ amount: 60179,
57
+ business_codes: "cake,movie,market,video,book",
58
+ business_codes_name:
59
+ "蛋糕(勿改),电影(勿改),商城(对应百货)(勿改),网络视听(勿改),图书(勿改)",
60
+ wallet_rule: "<p>UB使用规则说明</p>\n<p>123456</p>"
61
+ }
62
+ ],
63
+ request_id: "c9975f7b9bc426a5"
64
+ },
65
+ getVipList:{"total_size":3,"next_page_token":"","list":[{"vip_card_id":3,"product_id":60038520,"product_name":"体验卡","sale_price":10000000,"vip_card_icon":""},{"vip_card_id":2,"product_id":60038519,"product_name":"月卡","sale_price":10000000,"vip_card_icon":""},{"vip_card_id":1,"product_id":60038515,"product_name":"测1","sale_price":10000000,"vip_card_icon":""}],"request_id":"c5cf58415cffdc30"},
66
+ };
@@ -209,6 +209,7 @@ export default {
209
209
  selected_wallet_list_json: JSON.stringify(selected_wallet_list),
210
210
  need_pay_price: this.orderNeedPayPrice,
211
211
  namespace: this.xnamespace,
212
+ vip_card_id: this.vip_card_id,
212
213
  ...this.options,
213
214
  }, (res) => {
214
215
  console.warn("创建订单成功");