jufubao-third 1.0.5 → 1.0.6-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.5",
3
+ "version": "1.0.6-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件第三方购物平台包",
6
6
  "main": "index.js",
@@ -9,6 +9,7 @@ export default {
9
9
  ele: "xd-choose-namespace",
10
10
  valueKey: "xnamespace",
11
11
  value: "",
12
+ groupKey: "advanced",
12
13
  handleCustom: (cb) => {
13
14
  XdBus.getParentApi('getOptionsNamespaces')()
14
15
  .then(res => {
@@ -23,6 +24,7 @@ export default {
23
24
  valueKey: 'orderSuccessPath', //form[valueKey]
24
25
  placeholder: '请选择核销成功路径',
25
26
  value: null,
27
+ groupKey: "advanced",
26
28
  setting: {
27
29
  router: XdBus.getParentApi('getPagesTree'),
28
30
 
@@ -35,6 +37,7 @@ export default {
35
37
  valueKey: 'thirdPayPath', //form[valueKey]
36
38
  placeholder: '请选择支付路径',
37
39
  value: null,
40
+ groupKey: "advanced",
38
41
  setting: {
39
42
  router: XdBus.getParentApi('getPagesTree'),
40
43
 
@@ -166,6 +166,7 @@
166
166
  :getUserWalletList="getUserWalletList"
167
167
  :useBindedWallet="p_useBindedWallet"
168
168
  @onChose="handleWalletChose"
169
+ @onAlert="() => hasAlertCardChose = true"
169
170
  ></xd-wallet-chose>
170
171
  </template>
171
172
 
@@ -467,7 +468,13 @@
467
468
  const { main_order_id, submitCardList, needPayPrice } = this;
468
469
 
469
470
  if(!submitCardList.length){
470
- await this.handleConfirmAllWxPay();
471
+ //支持补差, 提示是否使用补差
472
+ if(this.payThird){
473
+ await this.handleConfirmAllWxPay();
474
+ }else{
475
+ //不支持补差,仅提示
476
+ return this.$xdAlert({content: "请选择兑换方式"})
477
+ }
471
478
  }
472
479
 
473
480
  this.createSettleOrder({
@@ -558,7 +565,7 @@
558
565
  vm: this,
559
566
  data: {
560
567
  ...cardForm,
561
- selected_card_list: submitCardList,
568
+ selected_card_list_json: JSON.stringify(submitCardList),
562
569
  total_price,
563
570
  namespace: this.xnamespace,
564
571
  ...options,
@@ -670,7 +677,7 @@
670
677
  data: {
671
678
  total_price,
672
679
  card_number: ticket.card_number,
673
- selected_card_list: submitCardList,
680
+ selected_card_list_json: JSON.stringify(submitCardList),
674
681
  namespace: this.xnamespace,
675
682
  ...options,
676
683
  ...this.options,
@@ -21,6 +21,10 @@ export default {
21
21
  payCard(){
22
22
  return this.otherPayMethod.find(item => item.method === 'card')
23
23
  },
24
+ //是否支持三方支付、补差
25
+ payThird(){
26
+ return this.otherPayMethod.find(item => item.method === 'third')
27
+ },
24
28
  orderNeedPayPrice(){
25
29
  let choseCardPay = this.choseCard ? this.choseCard.cardPayPrice : 0;
26
30
  let choseWalletPay = this.choseWallet ? this.choseWallet.walletPayPrice : 0;
@@ -174,10 +178,20 @@ export default {
174
178
  //票券跟钱包都未选择,给用户提示
175
179
  if(selected_card_list.length == 0 && selected_wallet_list.length == 0){
176
180
  if(!this.hasAlertCardChose){
177
- this.showCardPayChose = true;
181
+ if(this.payCard){
182
+ this.showCardPayChose = true;
183
+ }else{
184
+ this.showWalletChose = true;
185
+ }
178
186
  return false;
179
187
  }else{
180
- await this.handleConfirmAllWxPay();
188
+ //支持补差, 提示是否使用补差
189
+ if(this.payThird){
190
+ await this.handleConfirmAllWxPay();
191
+ }else{
192
+ //不支持补差,仅提示
193
+ return this.$xdAlert({content: "请选择兑换方式"})
194
+ }
181
195
  }
182
196
  }
183
197
  this.useTickAndWalletPay(selected_card_list, selected_wallet_list);
@@ -224,9 +238,19 @@ export default {
224
238
  url: this.orderSuccessPath + `?order_id=${res.order_id}`
225
239
  })
226
240
  }else{
227
- this.$xdUniHelper.redirectTo({
228
- url: this.thirdPayPath + `?order_id=${res.pay_order_id}&main_order_id=${res.order_id}`
229
- })
241
+ //支持补差, 跳转补差页
242
+ if(this.payThird){
243
+ this.$xdUniHelper.redirectTo({
244
+ url: this.thirdPayPath + `?order_id=${res.pay_order_id}&main_order_id=${res.order_id}`
245
+ })
246
+ }else{
247
+ this.$xdAlert({
248
+ content: '余额不足,请选择其他票券',
249
+ time: 1500,
250
+ isClose: false,
251
+ zIndex: 5000
252
+ });
253
+ }
230
254
  }
231
255
  })
232
256
  }