jufubao-base 1.0.357-beta1 → 1.0.358-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.357-beta1",
3
+ "version": "1.0.358-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -51,7 +51,7 @@
51
51
  "dingtalk-jsapi": "^3.0.31",
52
52
  "flyio": "^0.6.2",
53
53
  "gxd-commands-bussiness": "^1.0.12",
54
- "gxd-uni-library-editx": "1.0.188",
54
+ "gxd-uni-library-editx": "1.0.190",
55
55
  "jweixin-module": "^1.6.0",
56
56
  "md5": "^2.3.0",
57
57
  "path-to-regexp": "^6.2.1",
@@ -22,6 +22,17 @@ module.exports = [
22
22
  isConsole: true,
23
23
  disabled: true,
24
24
  },
25
+ {
26
+ mapFnName: 'getSpShopId', //自定义方法名字(必选)
27
+ title: '特殊扫水牌地址兼容获取shopid',
28
+ path: '/mall/v1/shop/old-to-new',
29
+ isRule: false,
30
+ params: {
31
+ shop_id: ['门店ID', 'Number', '必选'],
32
+ },
33
+ isConsole: true,
34
+ disabled: true,
35
+ },
25
36
  {
26
37
  mapFnName: 'getBaseOrderStatus', //自定义方法名字(必选)
27
38
  title: '获取订单详情',
@@ -40,8 +51,7 @@ module.exports = [
40
51
  path: "/pay/v1/pay-channel/list-user-pay-channel",
41
52
  isRule: false,
42
53
  params: {
43
- providers: ['支付方式id 多个用逗号分隔', "String", '必选'],
44
- callback_url: ['授权成功回调地址', "String", '必选']
54
+ providers: ['支付方式id 多个用逗号分隔', "String", '必选']
45
55
  },
46
56
  isConsole: true,
47
57
  disabled: true
@@ -21,147 +21,145 @@
21
21
  <view v-if="fulfillmentImg" class="fulfillmentImg" :style="[backgroundImageComp]"></view>
22
22
  </template>
23
23
  <template v-else>
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>
36
- </view>
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>
37
35
  </view>
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> -->
45
- <xd-unit
46
- :price="payInfo.card_amount"
47
- :isOld="false"
48
- :font-size="28"
49
- :icon-size="0.28"
50
- ></xd-unit>
51
- </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>
52
50
  </view>
53
51
  </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>
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>
100
70
  </view>
71
+ <text> {{ ticket.card_type_name }}</text>
101
72
  </view>
73
+ <!-- <xd-radio size="mini" @change="flat => handlerTicketSelect(flat, ticket.card_number)" :value="checkedCards.includes(ticket.card_number)"></xd-radio> -->
102
74
  </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">
75
+ <view class="_cont">
76
+ <view>ID:{{ ticket.card_number }}</view>
77
+ <view>有效期至:{{ ticket.end_time }}</view>
78
+ </view>
79
+ <view class="_footer" :style="{borderTop:'1px solid ' + borderColor }">
80
+ <view class="_item">
81
+ <text>剩余:</text>
110
82
  <xd-unit
111
- :price="payInfo.channel_amount"
83
+ :price="ticket.card_point"
112
84
  :isOld="false"
113
85
  :font-size="28"
114
86
  :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>
92
+ <xd-unit
93
+ :price="ticket.use_card_point"
94
+ :isOld="false"
95
+ :font-size="28"
96
+ :icon-size="0.28"
97
+ :unit="ticket.unit"
115
98
  ></xd-unit>
116
99
  </view>
117
100
  </view>
118
101
  </view>
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>
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">
123
109
  <xd-unit
124
110
  :price="payInfo.channel_amount"
125
- :is-show-icon="false"
126
- unit="元"
127
111
  :isOld="false"
128
- :font-size="24"
129
- :icon-size="0.3"
112
+ :font-size="28"
113
+ :icon-size="0.28"
130
114
  ></xd-unit>
131
115
  </view>
132
116
  </view>
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>
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>
150
130
  </view>
151
131
  </view>
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"
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)"
159
138
  >
160
- 确认支付
161
- ¥{{ $xdUniHelper.divisionFloatNumber(payInfo.channel_amount, 100) }}
162
- </xd-button>
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>
163
149
  </view>
164
- </template>
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>
165
163
  </template>
166
164
  </view>
167
165
  </view>
@@ -237,8 +235,6 @@ export default {
237
235
  showFulfillment: "",
238
236
  fulfillmentPath: "", //履约分账跳转路径
239
237
  fulfillmentImg: "", //履约分账图片
240
-
241
- channelListDone: false, //渠道加载完成(这里有一个路径需要重渠道接口中获取)
242
238
  };
243
239
  },
244
240
  watch: {
@@ -294,18 +290,17 @@ export default {
294
290
  },
295
291
  methods: {
296
292
  ...mapActions(["getH5ZFBAuthorize"]),
297
- async onJfbLoad(options) {
293
+ onJfbLoad(options) {
298
294
  this.options = options
299
295
  this.order_id = options.order_id;
300
296
  this.main_order_id = options.main_order_id;
301
297
  this.type = options.type;
302
- //获取支付渠道接口
303
- await this.p_getListUserPayChannel();
304
298
  this.p_getPayOrderDetail();
299
+ this.p_getListUserPayChannel();
305
300
 
306
301
  //充值延期不进行检查订单状态
307
302
  if((this.type !== 'recharge'&&this.type!=='delay')) {
308
- await this.p_getBaseOrderDetail();
303
+ this.p_getBaseOrderDetail();
309
304
  }
310
305
  },
311
306
  /**
@@ -410,42 +405,19 @@ export default {
410
405
  });
411
406
  },
412
407
  p_getListUserPayChannel() {
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
-
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
+ });
449
421
  },
450
422
  p_getH5WxAuthorize() {
451
423
  jfbRootExec("getH5WxAuthorize", {
@@ -699,7 +671,7 @@ export default {
699
671
  }
700
672
  })
701
673
 
702
-
674
+
703
675
  },
704
676
  handlerPayCheck(channel_provider_id) {
705
677
  this.channel_provider_id = channel_provider_id;
@@ -125,7 +125,26 @@ export default {
125
125
  const matches = hostname.match(/[^.]+\.[^.]+$/);
126
126
  return matches ? matches[0] : hostname;
127
127
  },
128
+
128
129
  //#ifdef H5
130
+ spLink(params){
131
+ jfbRootExec("getSpShopId", {
132
+ vm: this,
133
+ data: params,
134
+ })
135
+ .then(res => {
136
+ if(res["x-params"]) {
137
+ //x-params=base64(a:1,b:3);
138
+ this.$xdUniHelper.navigateTo({
139
+ url: `${this.change_url}?x-params=${res["x-params"]}&referrer=official`,
140
+ });
141
+ }
142
+ })
143
+ .catch(error=>{
144
+ console.error(error);
145
+ })
146
+ },
147
+
129
148
  handleH5() {
130
149
  // 判断jwxSDK是否为空
131
150
  if (this.jwxSDK !== null) {
@@ -137,7 +156,13 @@ export default {
137
156
  scanType: ["qrCode"],
138
157
  // 扫描成功后的回调函数
139
158
  success: (res) => {
140
- console.log(res.resultStr,'res.resultStr');
159
+
160
+ //特殊地址
161
+ if(res['resultStr'].includes('/main/goods/index')) {
162
+ let params = this.$xdUniHelper.parseURL(res['resultStr'])['params'];
163
+ if(params.shop_id) this.spLink(params);
164
+ return
165
+ }
141
166
  // 判断res.resultStr是否包含'wx/cake/index/'
142
167
  if(res.resultStr.includes('wx/cake/index/')){
143
168
  // 将res.resultStr以'wx/cake/index/'分割,取分割后的第一个元素
@@ -152,7 +177,7 @@ export default {
152
177
  // 拼接change_url和x-params参数
153
178
  let path = `${this.change_url}?x-params=${xParams}&referrer=official`;
154
179
  // 打印xParams和path
155
- console.log(xParams,'pathpath');
180
+ console.log(xParams,'pathpath');
156
181
  // 跳转到指定路径
157
182
  this.$xdUniHelper.navigateTo({
158
183
  url: path,
@@ -261,7 +286,7 @@ export default {
261
286
  // 拼接change_url和x-params参数
262
287
  let path = `${this.change_url}?x-params=${xParams}&referrer=official`;
263
288
  // 打印xParams和path
264
- console.log(xParams,'pathpath');
289
+ console.log(xParams,'pathpath');
265
290
  // 跳转到指定路径
266
291
  this.$xdUniHelper.navigateTo({
267
292
  url: path,