jufubao-base 1.0.356 → 1.0.357-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-base",
3
- "version": "1.0.356",
3
+ "version": "1.0.357-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -57,7 +57,8 @@ export default {
57
57
  backgroundColor: "",
58
58
  fontStyle: {},
59
59
  changeCompanyPath: "",
60
- company_name: ''
60
+ company_name: '',
61
+ if_redirect_url: 'Y'
61
62
  };
62
63
  },
63
64
  watch: {
@@ -96,6 +97,7 @@ export default {
96
97
  init(container) {
97
98
  //content
98
99
  this.companyPosition = gCPVal(container, "companyPosition", "left", {});
100
+ this.if_redirect_url = gCPVal(container, "if_redirect_url", "Y", {});
99
101
  //style
100
102
  this.contentPadding = gCPVal(
101
103
  container,
@@ -137,8 +139,9 @@ export default {
137
139
  redirect_url = this["$xdUniHelper"].parseURL().source;
138
140
  if (store.state.configProject.platform === "h5")
139
141
  redirect_url = this.$route.fullPath;
142
+ //加配置面板是否需要设置返回地址进行判断是否加?redirect_url=${Base64.encodeURI(redirect_url)}
140
143
  this.$xdUniHelper.navigateTo({
141
- url: `${this.changeCompanyPath}?redirect_url=${Base64.encodeURI(redirect_url)}`,
144
+ url: this.if_redirect_url === 'Y' ? `${this.changeCompanyPath}?redirect_url=${Base64.encodeURI(redirect_url)}` : `${this.changeCompanyPath}`,
142
145
  });
143
146
  },
144
147
  onJfbScroll(options) {
@@ -23,5 +23,17 @@ export default (data, gValue, gColor, oldData) => {
23
23
  { label: '居中', value: 'center' },
24
24
  ]
25
25
  },
26
+ {
27
+ label: '返回本页',
28
+ ele: 'xd-radio',
29
+ groupKey: 'content',
30
+ valueKey: 'if_redirect_url',
31
+ value: dataVal({ data, key: 'if_redirect_url', dValue: 'Y' }),
32
+ labelInline: true,
33
+ list: [
34
+ { label: '是', value: 'Y' },
35
+ { label: '否', value: 'N' },
36
+ ]
37
+ },
26
38
  ]
27
39
  }
@@ -53,7 +53,7 @@
53
53
  </view>
54
54
  <view :style="[addCoMpStyle]" class="jfb-base-chose-company__body-add"
55
55
  >{{ addTitle
56
- }}<view @click="handleToAdd" :style="{color:mainColor}"
56
+ }}<view v-if="addCompanyPath" @click="handleToAdd" :style="{color:mainColor}"
57
57
  >去添加<XdFontIcon
58
58
  size="28"
59
59
  icon="iconxiangyou_xian"
@@ -140,9 +140,9 @@ export default {
140
140
  data: {},
141
141
  }).then((res) => {
142
142
  console.log(res, "resgetChoseCompanyList");
143
- if (res.list.length === 0) {
144
- this.handleToAdd();
145
- return;
143
+ //如果只有一个企业,直接选择该企业
144
+ if(res.list.length === 1) {
145
+ this.handleChoseCompany(res.list[0]);
146
146
  }
147
147
  this.companyList = res.list;
148
148
  });
@@ -266,6 +266,9 @@ export default {
266
266
  ).value;
267
267
  },
268
268
  handleChoseCompany(item) {
269
+ if(this.$configProject["isPreview"]){
270
+ return;
271
+ }
269
272
  jfbRootExec("switchChoseCompany", {
270
273
  vm: this,
271
274
  data: {
@@ -281,16 +284,16 @@ export default {
281
284
  this.jfbAuthorize.removeAllCardToken();
282
285
  }
283
286
  //#endif
284
-
285
- if (this.redirect_url) {
286
- this.$xdUniHelper.redirectTo({
287
- url: this.redirect_url,
288
- });
289
- } else {
290
- this.$xdUniHelper.redirectTo({
291
- url: this.settings.index,
292
- });
293
- }
287
+ let real_index_url = '';
288
+ try {
289
+ let jsonData = JSON.parse(item.index_url);
290
+ real_index_url = jsonData['app']['frontPath'];
291
+ } catch (error) {
292
+ real_index_url = item.index_url;
293
+ }
294
+ this.$xdUniHelper.redirectTo({
295
+ url: this.redirect_url || real_index_url || this.settings.index,
296
+ });
294
297
  });
295
298
  },
296
299
  handleToAdd() {
@@ -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']['authorization_url'])
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;