jufubao-base 1.0.356-beta1 → 1.0.357-beta1

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.
@@ -0,0 +1,22 @@
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.356-beta1",
3
+ "version": "1.0.357-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -239,6 +239,7 @@
239
239
  methods: {
240
240
  ...mapMutations(['setShowSwitchCity', 'setCityInfo']),
241
241
  onJfbLoad(options) {
242
+ if(options.keyword) this.keyword = options.keyword;
242
243
  this.loaded = true;
243
244
  },
244
245
  /**
@@ -254,6 +254,7 @@
254
254
  methods: {
255
255
  ...mapMutations(['setShowSwitchCity', 'setCityInfo']),
256
256
  onJfbLoad(options) {
257
+ if(options.keyword) this.keyword = options.keyword;
257
258
  this.loaded = true;
258
259
  },
259
260
  /**
@@ -40,7 +40,8 @@ module.exports = [
40
40
  path: "/pay/v1/pay-channel/list-user-pay-channel",
41
41
  isRule: false,
42
42
  params: {
43
- providers: ['支付方式id 多个用逗号分隔', "String", '必选']
43
+ providers: ['支付方式id 多个用逗号分隔', "String", '必选'],
44
+ callback_url: ['授权成功回调地址', "String", '必选']
44
45
  },
45
46
  isConsole: true,
46
47
  disabled: true
@@ -21,145 +21,147 @@
21
21
  <view v-if="fulfillmentImg" class="fulfillmentImg" :style="[backgroundImageComp]"></view>
22
22
  </template>
23
23
  <template v-else>
24
- <view>
25
- <view class="column-group">
26
- <view class="column-item" style="margin-bottom: 5rpx">
27
- <view class="column_label"> 订单总额 </view>
28
- <view class="column_value text-gray">
29
- <xd-unit
30
- :price="payInfo.total_amount"
31
- :isOld="false"
32
- :font-size="28"
33
- :icon-size="0.28"
34
- ></xd-unit>
35
- </view>
36
- </view>
37
- <view v-if="cardList.length" class="column-item" style="padding-bottom: 0;">
38
- <view class="column_label">
39
- 我的票券
40
- <view class="label_sub">(已使用{{ cardList.length }}张票券)</view>
41
- </view>
42
- <view class="column_value">
43
- <!-- <xd-button width="220rpx" radius="60rpx" type="primary" size="small" @click="xdDownDrawer=true">使用新票券</xd-button> -->
44
- <xd-unit
45
- :price="payInfo.card_amount"
46
- :isOld="false"
47
- :font-size="28"
48
- :icon-size="0.28"
49
- ></xd-unit>
50
- </view>
51
- </view>
52
- </view>
53
- <view class="ticket_list" v-if="cardList.length">
54
- <view
55
- :style="{
56
- backgroundColor:jfbPayBgColor
57
- }"
58
- class="ticket_item"
59
- v-for="ticket in cardList"
60
- :key="ticket.card_number"
61
- >
62
- <view class="_header">
63
- <view class="flex align-center">
64
- <view class="margin-right">
65
- <xd-font-icon
66
- icon="iconkaquan"
67
- color="#ffc65d"
68
- size="32"
69
- ></xd-font-icon>
70
- </view>
71
- <text> {{ ticket.card_type_name }}</text>
24
+ <template v-if="channelListDone">
25
+ <view>
26
+ <view class="column-group">
27
+ <view class="column-item" style="margin-bottom: 5rpx">
28
+ <view class="column_label"> 订单总额 </view>
29
+ <view class="column_value text-gray">
30
+ <xd-unit
31
+ :price="payInfo.total_amount"
32
+ :isOld="false"
33
+ :font-size="28"
34
+ :icon-size="0.28"
35
+ ></xd-unit>
72
36
  </view>
73
- <!-- <xd-radio size="mini" @change="flat => handlerTicketSelect(flat, ticket.card_number)" :value="checkedCards.includes(ticket.card_number)"></xd-radio> -->
74
- </view>
75
- <view class="_cont">
76
- <view>ID:{{ ticket.card_number }}</view>
77
- <view>有效期至:{{ ticket.end_time }}</view>
78
37
  </view>
79
- <view class="_footer" :style="{borderTop:'1px solid ' + borderColor }">
80
- <view class="_item">
81
- <text>剩余:</text>
38
+ <view v-if="cardList.length" class="column-item" style="padding-bottom: 0;">
39
+ <view class="column_label">
40
+ 我的票券
41
+ <view class="label_sub">(已使用{{ cardList.length }}张票券)</view>
42
+ </view>
43
+ <view class="column_value">
44
+ <!-- <xd-button width="220rpx" radius="60rpx" type="primary" size="small" @click="xdDownDrawer=true">使用新票券</xd-button> -->
82
45
  <xd-unit
83
- :price="ticket.card_point"
46
+ :price="payInfo.card_amount"
84
47
  :isOld="false"
85
48
  :font-size="28"
86
49
  :icon-size="0.28"
87
- :unit="ticket.unit"
88
- ></xd-unit
89
- ></view>
90
- <view v-if="ticket.use_card_point" class="_item text-primary">
91
- <text>使用:</text>
50
+ ></xd-unit>
51
+ </view>
52
+ </view>
53
+ </view>
54
+ <view class="ticket_list" v-if="cardList.length">
55
+ <view
56
+ :style="{
57
+ backgroundColor:jfbPayBgColor
58
+ }"
59
+ class="ticket_item"
60
+ v-for="ticket in cardList"
61
+ :key="ticket.card_number"
62
+ >
63
+ <view class="_header">
64
+ <view class="flex align-center">
65
+ <view class="margin-right">
66
+ <xd-font-icon
67
+ icon="iconkaquan"
68
+ color="#ffc65d"
69
+ size="32"
70
+ ></xd-font-icon>
71
+ </view>
72
+ <text> {{ ticket.card_type_name }}</text>
73
+ </view>
74
+ <!-- <xd-radio size="mini" @change="flat => handlerTicketSelect(flat, ticket.card_number)" :value="checkedCards.includes(ticket.card_number)"></xd-radio> -->
75
+ </view>
76
+ <view class="_cont">
77
+ <view>ID:{{ ticket.card_number }}</view>
78
+ <view>有效期至:{{ ticket.end_time }}</view>
79
+ </view>
80
+ <view class="_footer" :style="{borderTop:'1px solid ' + borderColor }">
81
+ <view class="_item">
82
+ <text>剩余:</text>
83
+ <xd-unit
84
+ :price="ticket.card_point"
85
+ :isOld="false"
86
+ :font-size="28"
87
+ :icon-size="0.28"
88
+ :unit="ticket.unit"
89
+ ></xd-unit
90
+ ></view>
91
+ <view v-if="ticket.use_card_point" class="_item text-primary">
92
+ <text>使用:</text>
93
+ <xd-unit
94
+ :price="ticket.use_card_point"
95
+ :isOld="false"
96
+ :font-size="28"
97
+ :icon-size="0.28"
98
+ :unit="ticket.unit"
99
+ ></xd-unit>
100
+ </view>
101
+ </view>
102
+ </view>
103
+ </view>
104
+ </view>
105
+ <view class="remain_pay" v-if="payInfo.channel_amount > 0">
106
+ <view style="border-bottom: 2rpx solid #eee;" class="column-group">
107
+ <view class="column-item" style="padding: 30rpx 60rpx">
108
+ <view class="column_label">{{text1}}<text v-if="showText2==='Y'" class="label_sub">{{ text2 }}</text></view>
109
+ <view class="column_value text-primary">
92
110
  <xd-unit
93
- :price="ticket.use_card_point"
111
+ :price="payInfo.channel_amount"
94
112
  :isOld="false"
95
113
  :font-size="28"
96
114
  :icon-size="0.28"
97
- :unit="ticket.unit"
98
115
  ></xd-unit>
99
116
  </view>
100
117
  </view>
101
118
  </view>
102
- </view>
103
- </view>
104
- <view class="remain_pay" v-if="payInfo.channel_amount > 0">
105
- <view style="border-bottom: 2rpx solid #eee;" class="column-group">
106
- <view class="column-item" style="padding: 30rpx 60rpx">
107
- <view class="column_label">{{text1}}<text v-if="showText2==='Y'" class="label_sub">{{ text2 }}</text></view>
108
- <view class="column_value text-primary">
119
+ <view class="remain_header">
120
+ <view>{{ text3 }}</view>
121
+ <view v-if="showContinuePay==='Y'" class="flex align-center text-primary">
122
+ <view class="margin-right">继续补差</view>
109
123
  <xd-unit
110
124
  :price="payInfo.channel_amount"
125
+ :is-show-icon="false"
126
+ unit="元"
111
127
  :isOld="false"
112
- :font-size="28"
113
- :icon-size="0.28"
128
+ :font-size="24"
129
+ :icon-size="0.3"
114
130
  ></xd-unit>
115
131
  </view>
116
132
  </view>
117
- </view>
118
- <view class="remain_header">
119
- <view>{{ text3 }}</view>
120
- <view v-if="showContinuePay==='Y'" class="flex align-center text-primary">
121
- <view class="margin-right">继续补差</view>
122
- <xd-unit
123
- :price="payInfo.channel_amount"
124
- :is-show-icon="false"
125
- unit=""
126
- :isOld="false"
127
- :font-size="24"
128
- :icon-size="0.3"
129
- ></xd-unit>
133
+ <view class="pay_list">
134
+ <view
135
+ v-for="item in payChannels"
136
+ :key="item.channel_provider_id"
137
+ class="pay_item"
138
+ @click="handlerPayCheck(item.channel_provider_id)"
139
+ >
140
+ <view class="icon">
141
+ <image mode="scaleToFill" :src="item['channel_logo']" style="height:64rpx; width: 64rpx" />
142
+ </view>
143
+ <view class="pay_name">{{ item.channel_provider_name }}</view>
144
+ <xd-radio
145
+ :value="channel_provider_id === item.channel_provider_id"
146
+ :isClickEvent="false"
147
+ size="mini"
148
+ ></xd-radio>
149
+ </view>
130
150
  </view>
131
151
  </view>
132
- <view class="pay_list">
133
- <view
134
- v-for="item in payChannels"
135
- :key="item.channel_provider_id"
136
- class="pay_item"
137
- @click="handlerPayCheck(item.channel_provider_id)"
152
+ <view class="bottom_btn-mask"></view>
153
+ <view v-if="is_can_pay==='Y'" class="bottom_btn" :style="prod_bottom">
154
+ <xd-button
155
+ width="480rpx"
156
+ type="primary"
157
+ radius="50rpx"
158
+ @click="doThirdPay"
138
159
  >
139
- <view class="icon">
140
- <image mode="scaleToFill" :src="item['channel_logo']" style="height:64rpx; width: 64rpx" />
141
- </view>
142
- <view class="pay_name">{{ item.channel_provider_name }}</view>
143
- <xd-radio
144
- :value="channel_provider_id === item.channel_provider_id"
145
- :isClickEvent="false"
146
- size="mini"
147
- ></xd-radio>
148
- </view>
160
+ 确认支付
161
+ ¥{{ $xdUniHelper.divisionFloatNumber(payInfo.channel_amount, 100) }}
162
+ </xd-button>
149
163
  </view>
150
- </view>
151
- <view class="bottom_btn-mask"></view>
152
- <view v-if="is_can_pay==='Y'" class="bottom_btn" :style="prod_bottom">
153
- <xd-button
154
- width="480rpx"
155
- type="primary"
156
- radius="50rpx"
157
- @click="doThirdPay"
158
- >
159
- 确认支付
160
- ¥{{ $xdUniHelper.divisionFloatNumber(payInfo.channel_amount, 100) }}
161
- </xd-button>
162
- </view>
164
+ </template>
163
165
  </template>
164
166
  </view>
165
167
  </view>
@@ -235,6 +237,8 @@ export default {
235
237
  showFulfillment: "",
236
238
  fulfillmentPath: "", //履约分账跳转路径
237
239
  fulfillmentImg: "", //履约分账图片
240
+
241
+ channelListDone: false, //渠道加载完成(这里有一个路径需要重渠道接口中获取)
238
242
  };
239
243
  },
240
244
  watch: {
@@ -290,17 +294,18 @@ export default {
290
294
  },
291
295
  methods: {
292
296
  ...mapActions(["getH5ZFBAuthorize"]),
293
- onJfbLoad(options) {
297
+ async onJfbLoad(options) {
294
298
  this.options = options
295
299
  this.order_id = options.order_id;
296
300
  this.main_order_id = options.main_order_id;
297
301
  this.type = options.type;
302
+ //获取支付渠道接口
303
+ await this.p_getListUserPayChannel();
298
304
  this.p_getPayOrderDetail();
299
- this.p_getListUserPayChannel();
300
305
 
301
306
  //充值延期不进行检查订单状态
302
307
  if((this.type !== 'recharge'&&this.type!=='delay')) {
303
- this.p_getBaseOrderDetail();
308
+ await this.p_getBaseOrderDetail();
304
309
  }
305
310
  },
306
311
  /**
@@ -405,19 +410,42 @@ export default {
405
410
  });
406
411
  },
407
412
  p_getListUserPayChannel() {
408
- const { pay_channels } = this.projectAttr;
409
- jfbRootExec("getListUserPayChannel", {
410
- vm: this,
411
- data: {
412
- providers: pay_channels && pay_channels.join(","),
413
- },
414
- }).then((res) => {
415
- console.log("p_getListUserPayChannel", res);
416
- this.payChannels = res.list;
417
- if(res.list.length > 0){
418
- this.channel_provider_id = res.list[0].channel_provider_id
419
- }
420
- });
413
+ return new Promise((resolve)=>{
414
+ const { pay_channels , login_providers} = this.projectAttr;
415
+ jfbRootExec("getListUserPayChannel", {
416
+ vm: this,
417
+ data: {
418
+ providers: pay_channels && pay_channels.join(","),
419
+ // #ifdef H5
420
+ callback_url: window.location.href, //需要授权的时候使用,授权成功回调地址
421
+ login_providers: (login_providers || []).join(',')
422
+ // #endif
423
+ },
424
+ }).then((res) => {
425
+
426
+ // #ifdef H5
427
+ //需要授权的时候使用,授权成功回调地址
428
+ if(res['silent_auth_info']
429
+ && res['silent_auth_info']['is_need_authorization'] === 'Y'
430
+ ) {
431
+ window.location.replace(res['silent_auth_info']['is_need_authorization'])
432
+ return
433
+ }
434
+ // #endif
435
+
436
+ this.payChannels = res.list;
437
+ if(res.list.length > 0){
438
+ this.channel_provider_id = res.list[0].channel_provider_id
439
+ }
440
+ this.channelListDone = true;
441
+ resolve(true);
442
+
443
+ }).catch(err=>{
444
+ this.channelListDone = true;
445
+ resolve(true);
446
+ });
447
+ })
448
+
421
449
  },
422
450
  p_getH5WxAuthorize() {
423
451
  jfbRootExec("getH5WxAuthorize", {
@@ -671,7 +699,7 @@ export default {
671
699
  }
672
700
  })
673
701
 
674
-
702
+
675
703
  },
676
704
  handlerPayCheck(channel_provider_id) {
677
705
  this.channel_provider_id = channel_provider_id;