@uxda/appkit 4.3.1 → 4.3.2

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/dist/appkit.css CHANGED
@@ -335,14 +335,15 @@
335
335
  .recharge-view2 .bean-buy {
336
336
  margin: 0 15px;
337
337
  padding: 10px;
338
- background: #FFFBF3;
338
+ background: #fffbf3;
339
339
  border-radius: 5px;
340
340
  display: flex;
341
341
  justify-content: space-between;
342
342
  align-items: center;
343
+ flex-wrap: wrap;
343
344
  }
344
345
  .recharge-view2 .bean-buy .left .title {
345
- color: #FD6701;
346
+ color: #fd6701;
346
347
  font-size: 14px;
347
348
  font-weight: 600;
348
349
  line-height: 20px;
@@ -373,9 +374,22 @@
373
374
  height: 16px;
374
375
  font-size: 0;
375
376
  }
377
+ .recharge-view2 .balance-warning {
378
+ width: 100%;
379
+ padding: 8px 10px;
380
+ margin-top: 10px;
381
+ background: #fdefe6;
382
+ border-radius: 5px;
383
+ color: #fd6701;
384
+ font-size: 12px;
385
+ }
386
+ .recharge-view2 .balance-warning-tip {
387
+ margin: 10px 26px 0;
388
+ color: #666666;
389
+ font-size: 10px;
390
+ }
376
391
  .recharge-view2 .amount-footer {
377
392
  padding: 10px 0;
378
- padding-bottom: 20px;
379
393
  }
380
394
  .recharge-view2 .amount-footer .agreement {
381
395
  font-size: 12px;
@@ -399,7 +413,7 @@
399
413
  font-size: 13px;
400
414
  }
401
415
  .recharge-view2 .amount-footer .buy-amount .left .amount {
402
- color: #FD6701;
416
+ color: #fd6701;
403
417
  font-size: 20px;
404
418
  font-weight: 600;
405
419
  }
@@ -408,7 +422,7 @@
408
422
  font-style: normal;
409
423
  }
410
424
  .recharge-view2 .amount-footer .buy-amount .recharge-button {
411
- background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
425
+ background: linear-gradient(90deg, #ffebc1 0%, #ffd7a7 52.29%, #ffb875 100%);
412
426
  color: #353535;
413
427
  margin: 12px 0;
414
428
  border: 0;
@@ -425,7 +439,7 @@
425
439
  }
426
440
  .recharge-view2 .amount-footer .link {
427
441
  display: inline;
428
- color: #FD6701;
442
+ color: #fd6701;
429
443
  }
430
444
  .trade-dialog .nut-dialog__header {
431
445
  font-size: 16px;
@@ -438,12 +452,12 @@
438
452
  }
439
453
  .trade-dialog .nut-dialog__footer-cancel {
440
454
  color: #353535 !important;
441
- border-color: #CCCCCC !important;
455
+ border-color: #cccccc !important;
442
456
  }
443
457
  .trade-dialog .nut-dialog__footer-ok {
444
458
  border: none;
445
459
  color: #353535;
446
- background: linear-gradient(90deg, #FFEBC1 0%, #FFB875 100%);
460
+ background: linear-gradient(90deg, #ffebc1 0%, #ffb875 100%);
447
461
  }
448
462
  page {
449
463
  --text-color: #333;
package/dist/index.js CHANGED
@@ -1501,6 +1501,7 @@ const request = (config) => {
1501
1501
  }
1502
1502
  }).catch((e) => {
1503
1503
  console.log("request.catch===", e);
1504
+ reject(e);
1504
1505
  });
1505
1506
  });
1506
1507
  };
@@ -2694,9 +2695,11 @@ const endpointsList$2 = {
2694
2695
  certificateNo: params.user,
2695
2696
  accountAuthFlag: params.accountAuthFlag || false,
2696
2697
  channelCode: params.channelCode || null,
2697
- payFinishJumpUrl: params.payFinishJumpUrl || null
2698
+ payFinishJumpUrl: params.payFinishJumpUrl || null,
2699
+ useCloudBean: params.useCloudBean || false
2698
2700
  }),
2699
2701
  transform: (data) => {
2702
+ console.log(data, "data-----");
2700
2703
  let json = null;
2701
2704
  try {
2702
2705
  json = JSON.parse(data.prePayStr);
@@ -2764,6 +2767,7 @@ const vendor$2 = {
2764
2767
  title: data.msg,
2765
2768
  icon: "none"
2766
2769
  });
2770
+ reject(data.msg);
2767
2771
  }
2768
2772
  }).catch((e) => {
2769
2773
  reject(e);
@@ -2927,6 +2931,8 @@ const requestBrandWCPayByBean = (params, Appcode = "") => {
2927
2931
  }
2928
2932
  });
2929
2933
  }
2934
+ }).catch(() => {
2935
+ resolve(false);
2930
2936
  });
2931
2937
  });
2932
2938
  };
@@ -3331,17 +3337,25 @@ const _hoisted_6$9 = {
3331
3337
  };
3332
3338
  const _hoisted_7$6 = { class: "amount" };
3333
3339
  const _hoisted_8$5 = ["src"];
3334
- const _hoisted_9$4 = { class: "amount-footer" };
3340
+ const _hoisted_9$4 = {
3341
+ key: 0,
3342
+ class: "balance-warning"
3343
+ };
3335
3344
  const _hoisted_10$3 = {
3345
+ key: 1,
3346
+ class: "balance-warning-tip"
3347
+ };
3348
+ const _hoisted_11$3 = { class: "amount-footer" };
3349
+ const _hoisted_12$3 = {
3336
3350
  key: 0,
3337
3351
  class: "agreement"
3338
3352
  };
3339
- const _hoisted_11$3 = { class: "buy-amount" };
3340
- const _hoisted_12$3 = { class: "left" };
3341
- const _hoisted_13$2 = { class: "amount" };
3342
- const _hoisted_14$2 = { class: "item" };
3343
- const _hoisted_15$2 = { class: "item" };
3353
+ const _hoisted_13$2 = { class: "buy-amount" };
3354
+ const _hoisted_14$2 = { class: "left" };
3355
+ const _hoisted_15$2 = { class: "amount" };
3344
3356
  const _hoisted_16$2 = { class: "item" };
3357
+ const _hoisted_17$2 = { class: "item" };
3358
+ const _hoisted_18$2 = { class: "item" };
3345
3359
  var script$A = /* @__PURE__ */ defineComponent({
3346
3360
  __name: "TradeView",
3347
3361
  props: {
@@ -3374,8 +3388,28 @@ var script$A = /* @__PURE__ */ defineComponent({
3374
3388
  state.selected = selected;
3375
3389
  selectBean.value = false;
3376
3390
  };
3391
+ const extraPaymentAmount = computed(() => {
3392
+ if (!selectBean.value || !amounts.value[state.selected]) {
3393
+ return 0;
3394
+ }
3395
+ const paymentAmount = amounts.value[state.selected].paymentAmount || 0;
3396
+ const currentBalance = balance.value || 0;
3397
+ return Math.max(0, paymentAmount - currentBalance);
3398
+ });
3377
3399
  const currentAmount = computed(() => {
3378
- return amounts.value[state.selected] && !selectBean.value ? amounts.value[state.selected].paymentAmount : 0;
3400
+ if (!amounts.value[state.selected]) {
3401
+ return 0;
3402
+ }
3403
+ if (selectBean.value) {
3404
+ if (balance.value < amounts.value[state.selected].paymentAmount) {
3405
+ return extraPaymentAmount.value;
3406
+ }
3407
+ return 0;
3408
+ }
3409
+ return amounts.value[state.selected].paymentAmount || 0;
3410
+ });
3411
+ const isCombinedPayment = computed(() => {
3412
+ return selectBean.value && amounts.value[state.selected] && balance.value < amounts.value[state.selected].paymentAmount;
3379
3413
  });
3380
3414
  onMounted(() => {
3381
3415
  const $http = useHttp$2({ Appcode: props.headerApp, Tenant: props.tenant });
@@ -3389,24 +3423,28 @@ var script$A = /* @__PURE__ */ defineComponent({
3389
3423
  const showDialog = ref(false);
3390
3424
  async function beanPay() {
3391
3425
  const $http = useHttp$2({ Appcode: props.headerApp, Tenant: props.tenant });
3392
- $http.post(`/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`).then((response) => {
3426
+ try {
3427
+ const response = await $http.post(
3428
+ `/payment/paymentCaseConfig/purchase/${amounts.value[state.selected].id}`
3429
+ );
3393
3430
  if (response) {
3394
3431
  showDialog.value = false;
3395
3432
  emit("complete", { result: response, type: "bean" });
3396
3433
  } else {
3397
3434
  showToast({
3398
- title: response.message,
3435
+ title: response?.message || "\u652F\u4ED8\u5931\u8D25",
3399
3436
  icon: "none"
3400
3437
  });
3401
3438
  }
3402
- });
3403
- }
3404
- const onPayClick = () => {
3405
- if (selectBean.value) {
3406
- showDialog.value = true;
3407
- return;
3439
+ } catch (error) {
3440
+ showToast({
3441
+ title: error?.message || "\u652F\u4ED8\u5931\u8D25",
3442
+ icon: "none"
3443
+ });
3408
3444
  }
3409
- if (!selectBean.value && !state.agreed) {
3445
+ }
3446
+ function proceedWechatPayment() {
3447
+ if (!state.agreed) {
3410
3448
  showToast({
3411
3449
  title: "\u8BF7\u52FE\u9009\u300A\u5927\u9053\u4E91\u5E73\u53F0\u4E91\u8C46\u5145\u503C\u534F\u8BAE\u300B",
3412
3450
  icon: "none"
@@ -3425,40 +3463,75 @@ var script$A = /* @__PURE__ */ defineComponent({
3425
3463
  }
3426
3464
  requestBrandWCPayByBean({
3427
3465
  caseConfigId: amounts.value[state.selected].id,
3428
- amount: amounts.value[state.selected].paymentAmount,
3466
+ amount: currentAmount.value,
3429
3467
  app: "loankitMp",
3430
3468
  tenant: props.tenant,
3431
3469
  accountAuthFlag: false,
3432
3470
  channelCode: "centergzh",
3433
3471
  payFinishJumpUrl: props.payFinishJumpUrl,
3434
- fromMini: !!params.from
3472
+ fromMini: !!params.from,
3473
+ useCloudBean: isCombinedPayment.value
3435
3474
  }).then((result) => {
3436
- console.log(result, "------requestBrandWCPay");
3437
3475
  state.buttonLoading = false;
3438
3476
  if (typeof result === "boolean" && result) {
3439
3477
  window.location.href = props.payFinishJumpUrl;
3440
3478
  } else {
3441
- emit("complete", { result, type: "wePay" });
3479
+ emit("complete", {
3480
+ result,
3481
+ type: isCombinedPayment.value ? "combined" : "wePay"
3482
+ });
3442
3483
  }
3484
+ }).catch((error) => {
3485
+ state.buttonLoading = false;
3486
+ showToast({
3487
+ title: error.message || "\u652F\u4ED8\u5931\u8D25",
3488
+ icon: "none"
3489
+ });
3443
3490
  });
3444
3491
  } else {
3445
3492
  wx.login({
3446
3493
  success({ code }) {
3447
- requestPaymentByBean({
3448
- caseConfigId: amounts.value[state.selected].id,
3449
- amount: amounts.value[state.selected].paymentAmount,
3450
- app: props.app,
3451
- tenant: props.tenant,
3452
- user: code
3453
- }, props.headerApp).then((result) => {
3494
+ requestPaymentByBean(
3495
+ {
3496
+ caseConfigId: amounts.value[state.selected].id,
3497
+ amount: currentAmount.value,
3498
+ app: props.app,
3499
+ tenant: props.tenant,
3500
+ user: code
3501
+ },
3502
+ props.headerApp
3503
+ ).then((result) => {
3454
3504
  state.buttonLoading = false;
3455
3505
  if (result) {
3456
- emit("complete", { result: true, type: "wePay" });
3506
+ emit("complete", {
3507
+ result: true,
3508
+ type: isCombinedPayment.value ? "combined" : "wePay"
3509
+ });
3457
3510
  }
3511
+ }).catch((error) => {
3512
+ state.buttonLoading = false;
3513
+ showToast({
3514
+ title: error.message || "\u652F\u4ED8\u5931\u8D25",
3515
+ icon: "none"
3516
+ });
3517
+ });
3518
+ },
3519
+ fail() {
3520
+ state.buttonLoading = false;
3521
+ showToast({
3522
+ title: "\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
3523
+ icon: "none"
3458
3524
  });
3459
3525
  }
3460
3526
  });
3461
3527
  }
3528
+ }
3529
+ const onPayClick = () => {
3530
+ if (selectBean.value && !isCombinedPayment.value) {
3531
+ showDialog.value = true;
3532
+ return;
3533
+ }
3534
+ proceedWechatPayment();
3462
3535
  };
3463
3536
  return (_ctx, _cache) => {
3464
3537
  const _component_nut_checkbox = Checkbox;
@@ -3481,29 +3554,28 @@ var script$A = /* @__PURE__ */ defineComponent({
3481
3554
  -1
3482
3555
  /* CACHED */
3483
3556
  )),
3484
- !selectBean.value ? (openBlock(), createElementBlock(
3557
+ !selectBean.value || isCombinedPayment.value ? (openBlock(), createElementBlock(
3485
3558
  "div",
3486
3559
  _hoisted_5$c,
3487
- "\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value || 0)),
3560
+ " \u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value || 0)),
3488
3561
  1
3489
3562
  /* TEXT */
3490
3563
  )) : (openBlock(), createElementBlock(
3491
3564
  "div",
3492
3565
  _hoisted_6$9,
3493
- "\u6263\u51CF\u540E\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3566
+ " \u6263\u51CF\u540E\u4F59\u989D " + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3494
3567
  1
3495
3568
  /* TEXT */
3496
3569
  ))
3497
3570
  ]),
3498
- balance.value >= amounts.value[state.selected].paymentAmount ? (openBlock(), createElementBlock("div", {
3499
- key: 0,
3571
+ createElementVNode("div", {
3500
3572
  class: "right",
3501
3573
  onClick: _cache[0] || (_cache[0] = ($event) => selectBean.value = !selectBean.value)
3502
3574
  }, [
3503
3575
  createElementVNode(
3504
3576
  "div",
3505
3577
  _hoisted_7$6,
3506
- "-" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3578
+ " -" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3507
3579
  1
3508
3580
  /* TEXT */
3509
3581
  ),
@@ -3511,12 +3583,20 @@ var script$A = /* @__PURE__ */ defineComponent({
3511
3583
  class: "icon",
3512
3584
  src: selectBean.value ? "https://cdn.ddjf.com/static/images/appkit/select.svg" : "https://cdn.ddjf.com/static/images/appkit/not-select.svg"
3513
3585
  }, null, 8, _hoisted_8$5)
3514
- ])) : createCommentVNode("v-if", true)
3586
+ ]),
3587
+ isCombinedPayment.value ? (openBlock(), createElementBlock(
3588
+ "div",
3589
+ _hoisted_9$4,
3590
+ " \u4E91\u8C46\u4F59\u989D\u4E0D\u8DB3,\u8FD8\u9700\u989D\u5916\u652F\u4ED8" + toDisplayString(unref(formatAmount)(extraPaymentAmount.value)) + "\u5143 ",
3591
+ 1
3592
+ /* TEXT */
3593
+ )) : createCommentVNode("v-if", true)
3515
3594
  ])) : createCommentVNode("v-if", true),
3595
+ isCombinedPayment.value ? (openBlock(), createElementBlock("div", _hoisted_10$3, " \u8BF7\u5728\u652F\u4ED8\u5B8C\u6210\u524D\u786E\u4FDD\u5143\u8C46\u4F59\u989D\u4E0D\u88AB\u6D88\u8017,\u5426\u5219\u672C\u6B21\u6743\u76CA\u53EF\u80FD\u8D2D\u4E70\u5931\u8D25 ")) : createCommentVNode("v-if", true),
3516
3596
  renderSlot(_ctx.$slots, "banner")
3517
3597
  ]),
3518
- createElementVNode("view", _hoisted_9$4, [
3519
- !selectBean.value ? (openBlock(), createElementBlock("view", _hoisted_10$3, [
3598
+ createElementVNode("view", _hoisted_11$3, [
3599
+ !selectBean.value || isCombinedPayment.value ? (openBlock(), createElementBlock("view", _hoisted_12$3, [
3520
3600
  createVNode(_component_nut_checkbox, {
3521
3601
  modelValue: state.agreed,
3522
3602
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => state.agreed = $event)
@@ -3544,14 +3624,14 @@ var script$A = /* @__PURE__ */ defineComponent({
3544
3624
  /* STABLE */
3545
3625
  }, 8, ["modelValue"])
3546
3626
  ])) : createCommentVNode("v-if", true),
3547
- createElementVNode("div", _hoisted_11$3, [
3548
- createElementVNode("div", _hoisted_12$3, [
3627
+ createElementVNode("div", _hoisted_13$2, [
3628
+ createElementVNode("div", _hoisted_14$2, [
3549
3629
  _cache[8] || (_cache[8] = createTextVNode(
3550
3630
  " \u5F85\u652F\u4ED8\uFF1A ",
3551
3631
  -1
3552
3632
  /* CACHED */
3553
3633
  )),
3554
- createElementVNode("span", _hoisted_13$2, [
3634
+ createElementVNode("span", _hoisted_15$2, [
3555
3635
  _cache[7] || (_cache[7] = createElementVNode(
3556
3636
  "i",
3557
3637
  null,
@@ -3602,22 +3682,22 @@ var script$A = /* @__PURE__ */ defineComponent({
3602
3682
  [
3603
3683
  createElementVNode(
3604
3684
  "div",
3605
- _hoisted_14$2,
3606
- "\u4E91\u8C46\u6263\u51CF\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3685
+ _hoisted_16$2,
3686
+ " \u4E91\u8C46\u6263\u51CF\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].paymentAmount || 0)),
3607
3687
  1
3608
3688
  /* TEXT */
3609
3689
  ),
3610
3690
  createElementVNode(
3611
3691
  "div",
3612
- _hoisted_15$2,
3613
- "\u6743\u76CA\u589E\u52A0\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].priceRightNum || 0)) + "\u7B14",
3692
+ _hoisted_17$2,
3693
+ " \u6743\u76CA\u589E\u52A0\uFF1A" + toDisplayString(unref(formatAmount)(amounts.value[state.selected].priceRightNum || 0)) + "\u7B14 ",
3614
3694
  1
3615
3695
  /* TEXT */
3616
3696
  ),
3617
3697
  createElementVNode(
3618
3698
  "div",
3619
- _hoisted_16$2,
3620
- "\u6263\u51CF\u540E\u4E91\u8C46\u4F59\u989D\uFF1A" + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3699
+ _hoisted_18$2,
3700
+ " \u6263\u51CF\u540E\u4E91\u8C46\u4F59\u989D\uFF1A" + toDisplayString(unref(formatAmount)(balance.value - amounts.value[state.selected].paymentAmount)),
3621
3701
  1
3622
3702
  /* TEXT */
3623
3703
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -59,8 +59,10 @@ const endpointsList: HttpEndpoints = {
59
59
  accountAuthFlag: params.accountAuthFlag || false,
60
60
  channelCode: params.channelCode || null,
61
61
  payFinishJumpUrl: params.payFinishJumpUrl || null,
62
+ useCloudBean: params.useCloudBean || false,
62
63
  }),
63
64
  transform: (data: any) => {
65
+ console.log(data, 'data-----')
64
66
  let json = null
65
67
  try {
66
68
  json = JSON.parse(data.prePayStr)
@@ -51,6 +51,7 @@ const vendor = {
51
51
  title: data.msg,
52
52
  icon: 'none',
53
53
  })
54
+ reject(data.msg)
54
55
  }
55
56
  })
56
57
  .catch((e: any) => {
@@ -30,7 +30,6 @@ const views = {
30
30
  function onBackClick () {
31
31
  emit('dismiss')
32
32
  }
33
-
34
33
  </script>
35
34
 
36
35
  <style lang="scss">