@uxda/appkit 4.3.28 → 4.3.32

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.
Files changed (141) hide show
  1. package/.cursor/skills/appkit-build-update-component-rules/SKILL.md +54 -49
  2. package/.cursor/skills/appkit-sync-component-rules/SKILL.md +60 -0
  3. package/.eslintrc.mjs +7 -7
  4. package/Appkit/347/273/204/344/273/266/344/275/277/347/224/250/350/247/204/345/210/231.md +2002 -1786
  5. package/PROJECT_DOCS.md +142 -142
  6. package/README.md +194 -194
  7. package/babel.config.js +12 -12
  8. package/dist/appkit.css +112 -3
  9. package/dist/index.js +158 -28
  10. package/package.json +82 -82
  11. package/project.config.json +15 -15
  12. package/project.tt.json +13 -13
  13. package/rollup.config.mjs +81 -81
  14. package/src/Appkit.ts +72 -72
  15. package/src/balance/api/endpoints.ts +133 -133
  16. package/src/balance/api/index.ts +118 -118
  17. package/src/balance/components/AccountView.vue +770 -770
  18. package/src/balance/components/BalanceCard.vue +210 -210
  19. package/src/balance/components/BalanceReminder.vue +84 -84
  20. package/src/balance/components/ConsumptionFilter.vue +218 -218
  21. package/src/balance/components/ConsumptionRules.vue +68 -68
  22. package/src/balance/components/DateFilter.vue +259 -259
  23. package/src/balance/components/DateRange.vue +111 -111
  24. package/src/balance/components/ListFilter.vue +62 -62
  25. package/src/balance/components/ListFilterPicker.vue +191 -191
  26. package/src/balance/components/PromoterCard.vue +308 -308
  27. package/src/balance/components/SecondBalance.vue +77 -77
  28. package/src/balance/components/Tip.vue +45 -45
  29. package/src/balance/components/index.ts +8 -8
  30. package/src/balance/types.ts +99 -99
  31. package/src/components/bt-cropper/index.vue +730 -730
  32. package/src/components/bt-cropper/utils/calcCropper.js +42 -42
  33. package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
  34. package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
  35. package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
  36. package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
  37. package/src/components/bt-cropper/utils/ratio.js +3 -3
  38. package/src/components/bt-cropper/utils/tools.js +25 -25
  39. package/src/components/dd-area/index.vue +225 -225
  40. package/src/components/dd-icon/doc.md +21 -21
  41. package/src/components/dd-icon/index.vue +23 -23
  42. package/src/components/dd-notice-bar/index.vue +78 -78
  43. package/src/components/dd-search/doc.md +34 -34
  44. package/src/components/dd-search/index.vue +168 -168
  45. package/src/components/dd-selector/index.vue +124 -124
  46. package/src/components/dd-skeleton/doc.md +19 -19
  47. package/src/components/dd-skeleton/index.vue +36 -36
  48. package/src/global.ts +6 -6
  49. package/src/index.ts +101 -101
  50. package/src/main.scss +1 -1
  51. package/src/notice/api/endpoints.ts +54 -54
  52. package/src/notice/api/index.ts +121 -121
  53. package/src/notice/components/NoticeBanner.vue +247 -247
  54. package/src/notice/components/NoticeEntry.vue +99 -99
  55. package/src/notice/components/NoticeList.vue +311 -311
  56. package/src/notice/components/NoticeList2.vue +401 -401
  57. package/src/notice/components/NoticePopup.vue +163 -163
  58. package/src/notice/components/index.ts +6 -6
  59. package/src/notice/components/useCommonList.ts +87 -87
  60. package/src/notice/components/useNotice.ts +35 -35
  61. package/src/notice/index.ts +1 -1
  62. package/src/notice/types.ts +25 -25
  63. package/src/payment/api/config.ts +7 -7
  64. package/src/payment/api/endpoints.ts +112 -112
  65. package/src/payment/api/index.ts +108 -108
  66. package/src/payment/components/AmountPicker.vue +77 -68
  67. package/src/payment/components/RechargeResult.vue +68 -68
  68. package/src/payment/components/RechargeView.vue +414 -227
  69. package/src/payment/components/RightsPicker.vue +105 -105
  70. package/src/payment/components/TradeView.vue +616 -616
  71. package/src/payment/components/UserAgreement.vue +234 -234
  72. package/src/payment/components/index.ts +22 -22
  73. package/src/payment/components/recharge-amount.spec.ts +54 -0
  74. package/src/payment/components/recharge-amount.ts +67 -0
  75. package/src/payment/index.ts +5 -5
  76. package/src/payment/services/index.ts +16 -16
  77. package/src/payment/services/invoke-recharge.ts +25 -25
  78. package/src/payment/services/request-payment.ts +136 -136
  79. package/src/payment/types.ts +34 -34
  80. package/src/register/components/SelfRegistration.vue +233 -233
  81. package/src/register/components/index.ts +2 -2
  82. package/src/scenarios/components/SharePoster.vue +364 -364
  83. package/src/scenarios/components/index.ts +2 -2
  84. package/src/scenarios/components/poster-paste.vue +93 -93
  85. package/src/scenarios/components/share-poster.md +273 -273
  86. package/src/shared/components/AppDrawer.vue +53 -53
  87. package/src/shared/components/AppVerify.vue +137 -137
  88. package/src/shared/components/DeviceVersion.vue +78 -78
  89. package/src/shared/components/EmptyView.vue +33 -33
  90. package/src/shared/components/OcrBank.vue +202 -202
  91. package/src/shared/components/OcrBusinessLicense.vue +120 -120
  92. package/src/shared/components/OcrIcon.vue +267 -267
  93. package/src/shared/components/OcrInvoice.vue +323 -323
  94. package/src/shared/components/OfficeDocx.vue +33 -33
  95. package/src/shared/components/OfficePdf.vue +35 -35
  96. package/src/shared/components/PageHeader.vue +84 -84
  97. package/src/shared/components/index.ts +12 -12
  98. package/src/shared/composables/index.ts +10 -10
  99. package/src/shared/composables/useAmount.ts +46 -46
  100. package/src/shared/composables/useCompress.ts +64 -64
  101. package/src/shared/composables/useCountdown.ts +46 -46
  102. package/src/shared/composables/useCrypto.ts +76 -76
  103. package/src/shared/composables/useDeviceEnv.ts +61 -61
  104. package/src/shared/composables/useDragBox.ts +97 -97
  105. package/src/shared/composables/useEncode.ts +43 -43
  106. package/src/shared/composables/useLogger.ts +149 -149
  107. package/src/shared/composables/useSafeArea.ts +46 -46
  108. package/src/shared/composables/useTabbar.ts +24 -24
  109. package/src/shared/composables/useUpload.ts +106 -106
  110. package/src/shared/composables/useValidator.ts +32 -32
  111. package/src/shared/composables/useWxAuth.ts +49 -49
  112. package/src/shared/http/Http.ts +149 -149
  113. package/src/shared/http/index.ts +1 -1
  114. package/src/shared/http/types.ts +163 -163
  115. package/src/shared/index.ts +9 -9
  116. package/src/shared/tracking/directives/index.ts +40 -40
  117. package/src/shared/tracking/examples/page-tracking-template.vue +27 -27
  118. package/src/shared/weixin/index.ts +9 -9
  119. package/src/shared/weixin/jssdk.ts +104 -104
  120. package/src/shared/weixin/payment.ts +38 -38
  121. package/src/styles/vars.scss +3 -3
  122. package/src/user/api/endpoints.ts +17 -17
  123. package/src/user/api/index.ts +123 -123
  124. package/src/user/components/LoginSetting.vue +114 -114
  125. package/src/user/components/UserAuth.vue +218 -218
  126. package/src/user/components/UserBinding.vue +277 -277
  127. package/src/user/components/UserBindingSuccess.vue +80 -80
  128. package/src/user/components/UserEntry.vue +139 -139
  129. package/src/user/components/UserFeedback.vue +428 -428
  130. package/src/user/components/UserFeedbackEntry.vue +175 -175
  131. package/src/user/components/UserHeadCrop.vue +65 -65
  132. package/src/user/components/UserInfo.vue +711 -711
  133. package/src/user/components/UserResourceEmpty.vue +75 -75
  134. package/src/user/components/index.ts +23 -23
  135. package/src/user/index.ts +1 -1
  136. package/src/utils/utils.ts +33 -33
  137. package/tsconfig.json +30 -30
  138. package/types/global.d.ts +23 -23
  139. package/types/vue.d.ts +10 -10
  140. package/dist/assets/asset-3B_CoPto +0 -1
  141. package/dist/assets/asset-DcH8Kg-2 +0 -1
package/babel.config.js CHANGED
@@ -1,12 +1,12 @@
1
- // babel-preset-taro 更多选项和默认值:
2
- // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3
- module.exports = {
4
- presets: [
5
- ['taro', {
6
- framework: 'vue3',
7
- ts: true
8
- }]
9
- ],
10
- plugins: [
11
- ],
12
- }
1
+ // babel-preset-taro 更多选项和默认值:
2
+ // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3
+ module.exports = {
4
+ presets: [
5
+ ['taro', {
6
+ framework: 'vue3',
7
+ ts: true
8
+ }]
9
+ ],
10
+ plugins: [
11
+ ],
12
+ }
package/dist/appkit.css CHANGED
@@ -12,6 +12,15 @@
12
12
  .amount-picker .tile.selected .nut-grid-item__content {
13
13
  background: linear-gradient(#FFF7E3, #FEFDE6) padding-box, linear-gradient(to bottom, #efd082, #ffb877) border-box;
14
14
  }
15
+ .amount-picker .tile.custom h4.token-line {
16
+ background-image: none;
17
+ padding-left: 0;
18
+ color: #353535;
19
+ font-size: 14px;
20
+ }
21
+ .amount-picker .tile.custom h5 {
22
+ color: #353535;
23
+ }
15
24
  .amount-picker h4.token-line {
16
25
  background-image: url("https://cdn.ddjf.com/static/images/appkit/yundou.png");
17
26
  background-size: 20px;
@@ -247,6 +256,106 @@
247
256
  .recharge-view .flex-grow {
248
257
  flex-grow: 1;
249
258
  }
259
+ .recharge-view .custom-amount-panel {
260
+ box-sizing: border-box;
261
+ display: block;
262
+ overflow: hidden;
263
+ margin: 8px 12px 12px;
264
+ padding: 12px;
265
+ background-color: rgba(255, 244, 223, 0.3);
266
+ border-radius: 5px;
267
+ border: 1px solid #fd6701;
268
+ }
269
+ .recharge-view .custom-amount-title,
270
+ .recharge-view .custom-amount-input,
271
+ .recharge-view .custom-amount-tip {
272
+ background: transparent;
273
+ }
274
+ .recharge-view .custom-amount-title {
275
+ display: flex;
276
+ align-items: center;
277
+ justify-content: space-between;
278
+ color: #262626;
279
+ font-size: 15px;
280
+ font-weight: 600;
281
+ line-height: 22px;
282
+ }
283
+ .recharge-view .custom-amount-tag {
284
+ color: #fd6701;
285
+ background: rgb(255, 244, 223);
286
+ border-radius: 12px;
287
+ padding: 3px 8px;
288
+ font-size: 10px;
289
+ font-weight: 600;
290
+ line-height: 14px;
291
+ }
292
+ .recharge-view .custom-amount-input {
293
+ display: flex;
294
+ align-items: center;
295
+ min-height: 50px;
296
+ margin-top: 8px;
297
+ padding: 0;
298
+ border: 0;
299
+ background: transparent;
300
+ }
301
+ .recharge-view .custom-amount-input .currency {
302
+ flex: none;
303
+ margin-right: 10px;
304
+ color: #9a9a9a;
305
+ font-size: 26px;
306
+ font-weight: 600;
307
+ line-height: 36px;
308
+ }
309
+ .recharge-view .custom-amount-control {
310
+ flex: 1;
311
+ min-width: 0;
312
+ height: 42px;
313
+ padding: 0;
314
+ border: 0;
315
+ outline: none;
316
+ background: transparent;
317
+ color: #353535;
318
+ caret-color: #fd6701;
319
+ font-size: 28px;
320
+ font-weight: 700;
321
+ line-height: 42px;
322
+ }
323
+ .recharge-view .custom-amount-control:focus, .recharge-view .custom-amount-control:focus-visible {
324
+ border: 0;
325
+ outline: none;
326
+ box-shadow: none;
327
+ }
328
+ .recharge-view .custom-amount-control::placeholder, .recharge-view .custom-amount-control::-webkit-input-placeholder {
329
+ color: #b8b8b8;
330
+ font-size: 26px;
331
+ font-weight: 700;
332
+ }
333
+ .recharge-view .custom-amount-placeholder {
334
+ color: #b8b8b8;
335
+ font-size: 26px;
336
+ font-weight: 700;
337
+ line-height: 42px;
338
+ }
339
+ .recharge-view .custom-amount-tip {
340
+ display: flex;
341
+ align-items: center;
342
+ gap: 6px;
343
+ margin-top: 10px;
344
+ color: #a5a5a5;
345
+ font-size: 10px;
346
+ line-height: 15px;
347
+ }
348
+ .recharge-view .custom-amount-tip-icon {
349
+ flex: none;
350
+ width: 12px;
351
+ height: 12px;
352
+ border: 1px solid #b8b8b8;
353
+ border-radius: 50%;
354
+ color: #9a9a9a;
355
+ font-size: 9px;
356
+ line-height: 12px;
357
+ text-align: center;
358
+ }
250
359
  .recharge-view .amount-footer {
251
360
  position: fixed;
252
361
  bottom: 0;
@@ -514,9 +623,9 @@
514
623
  color: #353535;
515
624
  background: linear-gradient(90deg, #ffebc1 0%, #ffb875 100%);
516
625
  }
517
- page {
518
- --text-color: #333;
519
- --text-color-dark-mode: #eee;
626
+ page {
627
+ --text-color: #333;
628
+ --text-color-dark-mode: #eee;
520
629
  }
521
630
  .account-card .card {
522
631
  background: linear-gradient(90deg, #EEF1FA 0%, #E4E6F3 100%);
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Grid, GridItem, Popup, ActionSheet, Checkbox, Button, Dialog, DatePicker, Form, FormItem, RadioGroup, Radio, Ellipsis, Skeleton, Cell, Input, Steps, Step } from '@nutui/nutui-taro';
2
2
  import '@nutui/nutui-taro/dist/packages/button/style/css';
3
3
  import '@nutui/nutui-taro/dist/packages/checkbox/style/css';
4
- import { defineComponent, reactive, createBlock, openBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, ref, computed, onUnmounted, resolveDirective, createCommentVNode, withDirectives, renderSlot, createVNode, normalizeStyle, unref, isRef, onMounted, createStaticVNode, watch, vShow, mergeModels, useModel, resolveComponent, vModelText, watchPostEffect, withModifiers } from 'vue';
4
+ import { defineComponent, createBlock, openBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, ref, computed, onUnmounted, resolveDirective, createCommentVNode, withDirectives, renderSlot, createVNode, normalizeStyle, unref, reactive, isRef, onMounted, createStaticVNode, watch, vShow, mergeModels, useModel, resolveComponent, vModelText, watchPostEffect, withModifiers } from 'vue';
5
5
  import '@nutui/nutui-taro/dist/packages/grid/style/css';
6
6
  import '@nutui/nutui-taro/dist/packages/griditem/style/css';
7
7
  import Taro, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, request as request$1, uploadFile, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, getStorageSync, setStorageSync, getSystemInfo, getNetworkType, getEnv, getAccountInfoSync, getPerformance, onAppHide, useDidShow, onAppShow, onNetworkStatusChange, useRouter } from '@tarojs/taro';
@@ -36,7 +36,10 @@ import '@nutui/nutui-taro/dist/packages/steps/style/css';
36
36
  import '@nutui/nutui-taro/dist/packages/step/style/css';
37
37
 
38
38
  const _hoisted_1$I = { class: "token-line number" };
39
- const _hoisted_2$t = { class: "number" };
39
+ const _hoisted_2$t = { key: 0 };
40
+ const _hoisted_3$n = { class: "number" };
41
+ const _hoisted_4$j = { key: 1 };
42
+ const _hoisted_5$g = { class: "number" };
40
43
  var script$Q = /* @__PURE__ */ defineComponent({
41
44
  __name: "AmountPicker",
42
45
  props: {
@@ -46,12 +49,9 @@ var script$Q = /* @__PURE__ */ defineComponent({
46
49
  emits: ["change"],
47
50
  setup(__props, { emit: __emit }) {
48
51
  const emit = __emit;
49
- const state = reactive({
50
- selected: 0
51
- });
52
+ const props = __props;
52
53
  const onGridItemClick = (index) => {
53
- state.selected = index;
54
- emit("change", state.selected);
54
+ emit("change", index);
55
55
  };
56
56
  return (_ctx, _cache) => {
57
57
  const _component_nut_grid_item = GridItem;
@@ -68,7 +68,7 @@ var script$Q = /* @__PURE__ */ defineComponent({
68
68
  null,
69
69
  renderList(__props.items, (amount, index) => {
70
70
  return openBlock(), createBlock(_component_nut_grid_item, {
71
- class: normalizeClass(["tile", { selected: state.selected === index }]),
71
+ class: normalizeClass(["tile", { selected: props.selected === index, custom: amount.custom }]),
72
72
  onClick: () => onGridItemClick(index),
73
73
  key: index
74
74
  }, {
@@ -80,7 +80,15 @@ var script$Q = /* @__PURE__ */ defineComponent({
80
80
  1
81
81
  /* TEXT */
82
82
  ),
83
- createElementVNode("h5", null, [
83
+ amount.custom ? (openBlock(), createElementBlock("h5", _hoisted_2$t, [
84
+ createElementVNode(
85
+ "span",
86
+ _hoisted_3$n,
87
+ toDisplayString(amount.amount),
88
+ 1
89
+ /* TEXT */
90
+ )
91
+ ])) : (openBlock(), createElementBlock("h5", _hoisted_4$j, [
84
92
  _cache[0] || (_cache[0] = createTextVNode(
85
93
  "\xA5",
86
94
  -1
@@ -88,12 +96,12 @@ var script$Q = /* @__PURE__ */ defineComponent({
88
96
  )),
89
97
  createElementVNode(
90
98
  "span",
91
- _hoisted_2$t,
99
+ _hoisted_5$g,
92
100
  toDisplayString(amount.amount),
93
101
  1
94
102
  /* TEXT */
95
103
  )
96
- ])
104
+ ]))
97
105
  ]),
98
106
  _: 2
99
107
  /* DYNAMIC */
@@ -747,11 +755,11 @@ const _hoisted_1$F = { class: "app-verify column" };
747
755
  const _hoisted_2$s = { class: "caption" };
748
756
  const _hoisted_3$m = { class: "number" };
749
757
  const _hoisted_4$i = { class: "form-btn" };
750
- const _hoisted_5$e = {
758
+ const _hoisted_5$f = {
751
759
  key: 1,
752
760
  class: "caption"
753
761
  };
754
- const _hoisted_6$a = { class: "row buttons" };
762
+ const _hoisted_6$b = { class: "row buttons" };
755
763
  var script$N = /* @__PURE__ */ defineComponent({
756
764
  __name: "AppVerify",
757
765
  props: {
@@ -846,7 +854,7 @@ var script$N = /* @__PURE__ */ defineComponent({
846
854
  ]) : createCommentVNode("v-if", true),
847
855
  sent.value ? (openBlock(), createElementBlock(
848
856
  "div",
849
- _hoisted_5$e,
857
+ _hoisted_5$f,
850
858
  toDisplayString(countdown.value) + "s\u540E\u91CD\u65B0\u53D1\u9001",
851
859
  1
852
860
  /* TEXT */
@@ -856,7 +864,7 @@ var script$N = /* @__PURE__ */ defineComponent({
856
864
  _: 1
857
865
  /* STABLE */
858
866
  }, 8, ["modelValue"]),
859
- createElementVNode("div", _hoisted_6$a, [
867
+ createElementVNode("div", _hoisted_6$b, [
860
868
  withDirectives((openBlock(), createBlock(unref(NsButton), {
861
869
  class: "cancel-btn",
862
870
  r: 20,
@@ -3554,10 +3562,57 @@ const isIOS = () => {
3554
3562
  return false;
3555
3563
  };
3556
3564
 
3565
+ const CUSTOM_RECHARGE_AMOUNT_MIN = 1e4;
3566
+ const CUSTOM_RECHARGE_AMOUNT_MAX = 5e4;
3567
+ const CUSTOM_RECHARGE_AMOUNT_ITEM = {
3568
+ token: "\u81EA\u5B9A\u4E49",
3569
+ amount: "1W \u8D77\u5145",
3570
+ custom: true
3571
+ };
3572
+ function appendCustomAmountOption(items, shouldAppendCustom = true) {
3573
+ if (!shouldAppendCustom) {
3574
+ return [...items];
3575
+ }
3576
+ return [...items, CUSTOM_RECHARGE_AMOUNT_ITEM];
3577
+ }
3578
+ function normalizeCustomRechargeAmountInput(value) {
3579
+ return String(value ?? "").replace(/[^\d]/g, "");
3580
+ }
3581
+ function validateCustomRechargeAmount(value) {
3582
+ const amount = Number(value);
3583
+ if (!Number.isFinite(amount) || amount <= 0) {
3584
+ return { valid: false, message: "\u8BF7\u8F93\u5165\u5145\u503C\u91D1\u989D" };
3585
+ }
3586
+ if (!Number.isInteger(amount)) {
3587
+ return { valid: false, message: "\u8BF7\u8F93\u5165\u6574\u6570\u5145\u503C\u91D1\u989D" };
3588
+ }
3589
+ if (amount < CUSTOM_RECHARGE_AMOUNT_MIN) {
3590
+ return { valid: false, message: "\u5145\u503C\u91D1\u989D\u4E0D\u80FD\u4F4E\u4E8E10000\u5143" };
3591
+ }
3592
+ if (amount > CUSTOM_RECHARGE_AMOUNT_MAX) {
3593
+ return { valid: false, message: "\u5145\u503C\u91D1\u989D\u4E0D\u80FD\u9AD8\u4E8E50000\u5143" };
3594
+ }
3595
+ return { valid: true, amount };
3596
+ }
3597
+ function resolveRechargeAmount(items, selected, customAmount) {
3598
+ const selectedItem = items[selected];
3599
+ if (selectedItem?.custom) {
3600
+ const validation = validateCustomRechargeAmount(customAmount);
3601
+ return validation.valid ? validation.amount : 0;
3602
+ }
3603
+ return Number(selectedItem?.amount || 0);
3604
+ }
3605
+
3557
3606
  const _hoisted_1$B = { class: "view recharge-view" };
3558
3607
  const _hoisted_2$r = { class: "flex-grow" };
3559
- const _hoisted_3$l = { class: "amount-footer" };
3560
- const _hoisted_4$h = { class: "agreement" };
3608
+ const _hoisted_3$l = {
3609
+ key: 0,
3610
+ class: "custom-amount-panel"
3611
+ };
3612
+ const _hoisted_4$h = { class: "custom-amount-input" };
3613
+ const _hoisted_5$e = ["value", "min", "max"];
3614
+ const _hoisted_6$a = { class: "amount-footer" };
3615
+ const _hoisted_7$7 = { class: "agreement" };
3561
3616
  var script$E = /* @__PURE__ */ defineComponent({
3562
3617
  __name: "RechargeView",
3563
3618
  props: {
@@ -3575,9 +3630,12 @@ var script$E = /* @__PURE__ */ defineComponent({
3575
3630
  selected: 0,
3576
3631
  agreementOpen: false,
3577
3632
  buttonLoading: false,
3578
- thirdPayId: ""
3633
+ thirdPayId: "",
3634
+ customAmountText: ""
3579
3635
  });
3580
3636
  const amounts = ref([]);
3637
+ const rechargeAmountItems = computed(() => appendCustomAmountOption(amounts.value, !isWechat()));
3638
+ const isCustomAmountSelected = computed(() => rechargeAmountItems.value[state.selected]?.custom === true);
3581
3639
  const onAgreementLinkClick = (e) => {
3582
3640
  e.preventDefault();
3583
3641
  e.stopImmediatePropagation();
@@ -3585,6 +3643,24 @@ var script$E = /* @__PURE__ */ defineComponent({
3585
3643
  };
3586
3644
  const onAmountSelect = (selected) => {
3587
3645
  state.selected = selected;
3646
+ if (!rechargeAmountItems.value[selected]?.custom) {
3647
+ state.customAmountText = "";
3648
+ }
3649
+ };
3650
+ const onCustomAmountInput = (event) => {
3651
+ const value = normalizeCustomRechargeAmountInput(event?.detail?.value ?? event?.target?.value);
3652
+ state.customAmountText = value;
3653
+ return value;
3654
+ };
3655
+ const getSelectedRechargeAmount = () => {
3656
+ if (isCustomAmountSelected.value) {
3657
+ return validateCustomRechargeAmount(state.customAmountText);
3658
+ }
3659
+ const amount = resolveRechargeAmount(rechargeAmountItems.value, state.selected, state.customAmountText);
3660
+ if (!amount) {
3661
+ return { valid: false, message: "\u8BF7\u9009\u62E9\u5145\u503C\u91D1\u989D" };
3662
+ }
3663
+ return { valid: true, amount };
3588
3664
  };
3589
3665
  onMounted(async () => {
3590
3666
  const $http = useHttp$2({ Appcode: props.app !== "cloudkitPro" ? props.app : "", Tenant: props.tenant });
@@ -3598,6 +3674,14 @@ var script$E = /* @__PURE__ */ defineComponent({
3598
3674
  });
3599
3675
  });
3600
3676
  const onPayClick = () => {
3677
+ const selectedAmount = getSelectedRechargeAmount();
3678
+ if (!selectedAmount.valid) {
3679
+ showToast({
3680
+ title: selectedAmount.message,
3681
+ icon: "none"
3682
+ });
3683
+ return false;
3684
+ }
3601
3685
  if (!state.agreed) {
3602
3686
  showToast({
3603
3687
  title: "\u8BF7\u52FE\u9009\u300A\u5927\u9053\u4E91\u5E73\u53F0\u4E91\u8C46\u5145\u503C\u534F\u8BAE\u300B",
@@ -3608,7 +3692,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3608
3692
  state.buttonLoading = true;
3609
3693
  if (Taro.getEnv() === "WEB") {
3610
3694
  requestBrandWCPay({
3611
- amount: amounts.value[state.selected].amount,
3695
+ amount: selectedAmount.amount,
3612
3696
  app: "loankitMp",
3613
3697
  tenant: props.tenant,
3614
3698
  accountAuthFlag: false,
@@ -3633,7 +3717,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3633
3717
  wx.login({
3634
3718
  success({ code }) {
3635
3719
  requestPayment({
3636
- amount: amounts.value[state.selected].amount,
3720
+ amount: selectedAmount.amount,
3637
3721
  app: props.app,
3638
3722
  tenant: props.tenant,
3639
3723
  user: code
@@ -3675,20 +3759,66 @@ var script$E = /* @__PURE__ */ defineComponent({
3675
3759
  return openBlock(), createElementBlock("view", _hoisted_1$B, [
3676
3760
  createElementVNode("view", _hoisted_2$r, [
3677
3761
  createVNode(script$Q, {
3678
- items: amounts.value,
3762
+ items: rechargeAmountItems.value,
3679
3763
  selected: state.selected,
3680
3764
  onChange: onAmountSelect
3681
3765
  }, null, 8, ["items", "selected"]),
3766
+ isCustomAmountSelected.value ? (openBlock(), createElementBlock("view", _hoisted_3$l, [
3767
+ _cache[2] || (_cache[2] = createElementVNode(
3768
+ "view",
3769
+ { class: "custom-amount-title" },
3770
+ [
3771
+ createElementVNode("text", null, "\u8F93\u5165\u5145\u503C\u91D1\u989D"),
3772
+ createElementVNode("text", { class: "custom-amount-tag" }, "\u81EA\u5B9A\u4E49\u5927\u989D")
3773
+ ],
3774
+ -1
3775
+ /* CACHED */
3776
+ )),
3777
+ createElementVNode("view", _hoisted_4$h, [
3778
+ _cache[1] || (_cache[1] = createElementVNode(
3779
+ "text",
3780
+ { class: "currency" },
3781
+ "\xA5",
3782
+ -1
3783
+ /* CACHED */
3784
+ )),
3785
+ createElementVNode("input", {
3786
+ class: "custom-amount-control",
3787
+ type: "number",
3788
+ value: state.customAmountText,
3789
+ placeholder: "\u6700\u4F4E1w\u5143\u8D77,\u6700\u9AD85w\u5143",
3790
+ "placeholder-class": "custom-amount-placeholder",
3791
+ "placeholder-style": "color: #b8b8b8; font-size: 26px; font-weight: 700;",
3792
+ inputmode: "numeric",
3793
+ pattern: "[0-9]*",
3794
+ step: "1",
3795
+ min: unref(CUSTOM_RECHARGE_AMOUNT_MIN),
3796
+ max: unref(CUSTOM_RECHARGE_AMOUNT_MAX),
3797
+ maxlength: "6",
3798
+ onInput: onCustomAmountInput
3799
+ }, null, 40, _hoisted_5$e)
3800
+ ]),
3801
+ _cache[3] || (_cache[3] = createElementVNode(
3802
+ "view",
3803
+ { class: "custom-amount-tip" },
3804
+ [
3805
+ createElementVNode("text", { class: "custom-amount-tip-icon" }, "i"),
3806
+ createElementVNode("text", null, "\u81EA\u5B9A\u4E49\u5927\u989D\u5145\u503C\u5C06\u6839\u636E\u5145\u503C\u91D1\u989D\u5373\u65F6\u6362\u7B97\u4E91\u8C46\uFF0C\u6BD4\u4F8B\u4E3A 1:1\u3002")
3807
+ ],
3808
+ -1
3809
+ /* CACHED */
3810
+ ))
3811
+ ])) : createCommentVNode("v-if", true),
3682
3812
  renderSlot(_ctx.$slots, "banner")
3683
3813
  ]),
3684
- createElementVNode("view", _hoisted_3$l, [
3685
- createElementVNode("view", _hoisted_4$h, [
3814
+ createElementVNode("view", _hoisted_6$a, [
3815
+ createElementVNode("view", _hoisted_7$7, [
3686
3816
  createVNode(_component_nut_checkbox, {
3687
3817
  modelValue: state.agreed,
3688
3818
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.agreed = $event)
3689
3819
  }, {
3690
3820
  default: withCtx(() => [
3691
- _cache[2] || (_cache[2] = createTextVNode(
3821
+ _cache[5] || (_cache[5] = createTextVNode(
3692
3822
  "\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F",
3693
3823
  -1
3694
3824
  /* CACHED */
@@ -3696,7 +3826,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3696
3826
  withDirectives((openBlock(), createElementBlock("a", {
3697
3827
  class: "link inline",
3698
3828
  onClick: onAgreementLinkClick
3699
- }, [..._cache[1] || (_cache[1] = [
3829
+ }, [..._cache[4] || (_cache[4] = [
3700
3830
  createTextVNode(
3701
3831
  "\u300A\u5927\u9053\u4E91\u5E73\u53F0\u4E91\u8C46\u5145\u503C\u670D\u52A1\u534F\u8BAE\u300B",
3702
3832
  -1
@@ -3717,7 +3847,7 @@ var script$E = /* @__PURE__ */ defineComponent({
3717
3847
  onClick: onPayClick,
3718
3848
  class: "recharge-button"
3719
3849
  }, {
3720
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
3850
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
3721
3851
  createTextVNode(
3722
3852
  "\u7ACB\u5373\u5145\u503C",
3723
3853
  -1
@@ -4507,7 +4637,7 @@ var script$z = /* @__PURE__ */ defineComponent({
4507
4637
  ])
4508
4638
  ])
4509
4639
  ]),
4510
- createCommentVNode(' <div class="line"></div>\n <div class="card-row">\n <div class="card-row-left desc">\u6743\u76CA\u4F7F\u7528\u65F6\u81EA\u52A8\u6263\u51CF\u4E91\u8C46</div>\n <div class="card-row-right">\n <div class="pay" v-track-click @click="gotoRecharge">\n <div>\u5145\u503C</div>\n <img\n class="pay-icon"\n src="https://cdn.ddjf.com/static/images/bpms-workBench/bean-right.png"\n />\n </div>\n </div>\n </div> ')
4640
+ createCommentVNode(' <div class="line"></div>\r\n <div class="card-row">\r\n <div class="card-row-left desc">\u6743\u76CA\u4F7F\u7528\u65F6\u81EA\u52A8\u6263\u51CF\u4E91\u8C46</div>\r\n <div class="card-row-right">\r\n <div class="pay" v-track-click @click="gotoRecharge">\r\n <div>\u5145\u503C</div>\r\n <img\r\n class="pay-icon"\r\n src="https://cdn.ddjf.com/static/images/bpms-workBench/bean-right.png"\r\n />\r\n </div>\r\n </div>\r\n </div> ')
4511
4641
  ])
4512
4642
  ]);
4513
4643
  };
@@ -8188,7 +8318,7 @@ var script$e = /* @__PURE__ */ defineComponent({
8188
8318
  class: normalizeClass(["tabContainer", { inH5: unref(isWeb)() }])
8189
8319
  },
8190
8320
  [
8191
- createCommentVNode(' <ns-tabs\n v-model="state.tab"\n fill="#fff"\n square\n size="xl"\n style="height: 46px"\n @change="onTabChange"\n >\n <ns-tabs-item key="\u5168\u90E8" tab="\u5168\u90E8"></ns-tabs-item>\n <ns-tabs-item key="\u4E1A\u52A1\u6D88\u606F" tab="\u4E1A\u52A1\u6D88\u606F"></ns-tabs-item>\n <ns-tabs-item key="\u7CFB\u7EDF\u516C\u544A" tab="\u7CFB\u7EDF\u516C\u544A"></ns-tabs-item>\n <ns-tabs-item key="\u672A\u8BFB" tab="\u672A\u8BFB"></ns-tabs-item>\n </ns-tabs> '),
8321
+ createCommentVNode(' <ns-tabs\r\n v-model="state.tab"\r\n fill="#fff"\r\n square\r\n size="xl"\r\n style="height: 46px"\r\n @change="onTabChange"\r\n >\r\n <ns-tabs-item key="\u5168\u90E8" tab="\u5168\u90E8"></ns-tabs-item>\r\n <ns-tabs-item key="\u4E1A\u52A1\u6D88\u606F" tab="\u4E1A\u52A1\u6D88\u606F"></ns-tabs-item>\r\n <ns-tabs-item key="\u7CFB\u7EDF\u516C\u544A" tab="\u7CFB\u7EDF\u516C\u544A"></ns-tabs-item>\r\n <ns-tabs-item key="\u672A\u8BFB" tab="\u672A\u8BFB"></ns-tabs-item>\r\n </ns-tabs> '),
8192
8322
  createVNode(unref(NsTabs), {
8193
8323
  modelValue: state.tab,
8194
8324
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.tab = $event),
package/package.json CHANGED
@@ -1,82 +1,82 @@
1
- {
2
- "name": "@uxda/appkit",
3
- "version": "4.3.28",
4
- "description": "小程序应用开发包",
5
- "main": "dist/index.js",
6
- "module": "dist/index.ts",
7
- "moduleResolution": "node",
8
- "scripts": {
9
- "dev": "rollup -c rollup.config.mjs --watch",
10
- "build": "rollup -c rollup.config.mjs"
11
- },
12
- "exports": {
13
- ".": "./dist/index.js",
14
- "./appkit.css": "./dist/appkit.css"
15
- },
16
- "browserslist": [
17
- "last 3 versions",
18
- "Android >= 4.1",
19
- "ios >= 8"
20
- ],
21
- "author": "",
22
- "dependencies": {
23
- "@babel/runtime": "^7.28.4",
24
- "@nutui/auto-import-resolver": "^1.0.0",
25
- "@nutui/icons-vue-taro": "^0.0.9",
26
- "@nutui/nutui-taro": "^4.3.14",
27
- "@tarojs/components": "^4.1.7",
28
- "@tarojs/helper": "^4.1.7",
29
- "@tarojs/plugin-framework-vue3": "^4.1.7",
30
- "@tarojs/plugin-html": "^4.1.7",
31
- "@tarojs/plugin-platform-weapp": "^4.1.7",
32
- "@tarojs/router": "^4.1.7",
33
- "@tarojs/runtime": "^4.1.7",
34
- "@tarojs/shared": "^4.1.7",
35
- "@tarojs/taro": "^4.1.7",
36
- "@types/wechat-miniprogram": "^3.4.7",
37
- "@uxda/nutshell": "^1.6.98",
38
- "@vue-office/docx": "^1.6.3",
39
- "@vue-office/pdf": "^2.0.10",
40
- "dayjs": "^1.11.18",
41
- "dsbridge": "^3.1.4",
42
- "lodash-es": "^4.17.21",
43
- "pako": "^2.1.0",
44
- "validator": "^13.15.15",
45
- "vue": "^3.5.22",
46
- "vue-demi": "^0.14.10"
47
- },
48
- "devDependencies": {
49
- "@babel/core": "^7.28.4",
50
- "@tarojs/cli": "^4.1.7",
51
- "@tarojs/taro-loader": "^4.1.7",
52
- "@tarojs/webpack5-runner": "^4.1.7",
53
- "@types/node": "^24.5.2",
54
- "@types/webpack-env": "^1.13.6",
55
- "@typescript-eslint/eslint-plugin": "^8.44.1",
56
- "@typescript-eslint/parser": "^8.44.1",
57
- "@vue/babel-plugin-jsx": "^1.0.6",
58
- "@vue/compiler-sfc": "^3.5.22",
59
- "babel-preset-taro": "^4.0.4",
60
- "css-loader": "^7.1.2",
61
- "eslint": "^9.9.0",
62
- "eslint-config-taro": "^4.0.4",
63
- "eslint-plugin-vue": "^10.5.0",
64
- "postcss": "^8.5.6",
65
- "postcss-import": "^16.1.1",
66
- "rollup": "^4.6.1",
67
- "rollup-plugin-css-only": "^4.5.5",
68
- "rollup-plugin-dts": "^6.1.0",
69
- "rollup-plugin-esbuild": "^6.1.0",
70
- "rollup-plugin-postcss": "^4.0.2",
71
- "rollup-plugin-scss": "^4.0.0",
72
- "rollup-plugin-visualizer": "^6.0.3",
73
- "rollup-plugin-vue": "^6.0.0",
74
- "style-loader": "^4.0.0",
75
- "stylelint": "^16.8.2",
76
- "ts-node": "^10.9.1",
77
- "typescript": "^5.0.0",
78
- "unplugin-auto-import": "^20.2.0",
79
- "unplugin-vue-components": "^29.1.0",
80
- "webpack": "^5.78.0"
81
- }
82
- }
1
+ {
2
+ "name": "@uxda/appkit",
3
+ "version": "4.3.32",
4
+ "description": "小程序应用开发包",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.ts",
7
+ "moduleResolution": "node",
8
+ "scripts": {
9
+ "dev": "rollup -c rollup.config.mjs --watch",
10
+ "build": "rollup -c rollup.config.mjs"
11
+ },
12
+ "exports": {
13
+ ".": "./dist/index.js",
14
+ "./appkit.css": "./dist/appkit.css"
15
+ },
16
+ "browserslist": [
17
+ "last 3 versions",
18
+ "Android >= 4.1",
19
+ "ios >= 8"
20
+ ],
21
+ "author": "",
22
+ "dependencies": {
23
+ "@babel/runtime": "^7.28.4",
24
+ "@nutui/auto-import-resolver": "^1.0.0",
25
+ "@nutui/icons-vue-taro": "^0.0.9",
26
+ "@nutui/nutui-taro": "^4.3.14",
27
+ "@tarojs/components": "^4.1.7",
28
+ "@tarojs/helper": "^4.1.7",
29
+ "@tarojs/plugin-framework-vue3": "^4.1.7",
30
+ "@tarojs/plugin-html": "^4.1.7",
31
+ "@tarojs/plugin-platform-weapp": "^4.1.7",
32
+ "@tarojs/router": "^4.1.7",
33
+ "@tarojs/runtime": "^4.1.7",
34
+ "@tarojs/shared": "^4.1.7",
35
+ "@tarojs/taro": "^4.1.7",
36
+ "@types/wechat-miniprogram": "^3.4.7",
37
+ "@uxda/nutshell": "^1.6.98",
38
+ "@vue-office/docx": "^1.6.3",
39
+ "@vue-office/pdf": "^2.0.10",
40
+ "dayjs": "^1.11.18",
41
+ "dsbridge": "^3.1.4",
42
+ "lodash-es": "^4.17.21",
43
+ "pako": "^2.1.0",
44
+ "validator": "^13.15.15",
45
+ "vue": "^3.5.22",
46
+ "vue-demi": "^0.14.10"
47
+ },
48
+ "devDependencies": {
49
+ "@babel/core": "^7.28.4",
50
+ "@tarojs/cli": "^4.1.7",
51
+ "@tarojs/taro-loader": "^4.1.7",
52
+ "@tarojs/webpack5-runner": "^4.1.7",
53
+ "@types/node": "^24.5.2",
54
+ "@types/webpack-env": "^1.13.6",
55
+ "@typescript-eslint/eslint-plugin": "^8.44.1",
56
+ "@typescript-eslint/parser": "^8.44.1",
57
+ "@vue/babel-plugin-jsx": "^1.0.6",
58
+ "@vue/compiler-sfc": "^3.5.22",
59
+ "babel-preset-taro": "^4.0.4",
60
+ "css-loader": "^7.1.2",
61
+ "eslint": "^9.9.0",
62
+ "eslint-config-taro": "^4.0.4",
63
+ "eslint-plugin-vue": "^10.5.0",
64
+ "postcss": "^8.5.6",
65
+ "postcss-import": "^16.1.1",
66
+ "rollup": "^4.6.1",
67
+ "rollup-plugin-css-only": "^4.5.5",
68
+ "rollup-plugin-dts": "^6.1.0",
69
+ "rollup-plugin-esbuild": "^6.1.0",
70
+ "rollup-plugin-postcss": "^4.0.2",
71
+ "rollup-plugin-scss": "^4.0.0",
72
+ "rollup-plugin-visualizer": "^6.0.3",
73
+ "rollup-plugin-vue": "^6.0.0",
74
+ "style-loader": "^4.0.0",
75
+ "stylelint": "^16.8.2",
76
+ "ts-node": "^10.9.1",
77
+ "typescript": "^5.0.0",
78
+ "unplugin-auto-import": "^20.2.0",
79
+ "unplugin-vue-components": "^29.1.0",
80
+ "webpack": "^5.78.0"
81
+ }
82
+ }