@uxda/appkit 4.3.32 → 4.3.33

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 (139) hide show
  1. package/.cursor/skills/appkit-build-update-component-rules/SKILL.md +54 -54
  2. package/.cursor/skills/appkit-sync-component-rules/SKILL.md +60 -60
  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 -2002
  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 +3 -3
  9. package/dist/assets/asset-3B_CoPto +1 -0
  10. package/dist/assets/asset-DcH8Kg-2 +1 -0
  11. package/dist/index.js +315 -81
  12. package/package.json +82 -82
  13. package/project.config.json +15 -15
  14. package/project.tt.json +13 -13
  15. package/rollup.config.mjs +81 -81
  16. package/src/Appkit.ts +72 -72
  17. package/src/balance/api/endpoints.ts +134 -133
  18. package/src/balance/api/index.ts +118 -118
  19. package/src/balance/components/AccountView.vue +834 -770
  20. package/src/balance/components/BalanceCard.vue +210 -210
  21. package/src/balance/components/BalanceReminder.vue +84 -84
  22. package/src/balance/components/ConsumptionFilter.vue +218 -218
  23. package/src/balance/components/ConsumptionRules.vue +68 -68
  24. package/src/balance/components/DateFilter.vue +259 -259
  25. package/src/balance/components/DateRange.vue +111 -111
  26. package/src/balance/components/ListFilter.vue +62 -62
  27. package/src/balance/components/ListFilterPicker.vue +191 -191
  28. package/src/balance/components/PromoterCard.vue +308 -308
  29. package/src/balance/components/SecondBalance.vue +77 -77
  30. package/src/balance/components/Tip.vue +45 -45
  31. package/src/balance/components/index.ts +8 -8
  32. package/src/balance/types.ts +99 -99
  33. package/src/components/bt-cropper/index.vue +730 -730
  34. package/src/components/bt-cropper/utils/calcCropper.js +42 -42
  35. package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
  36. package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
  37. package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
  38. package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
  39. package/src/components/bt-cropper/utils/ratio.js +3 -3
  40. package/src/components/bt-cropper/utils/tools.js +25 -25
  41. package/src/components/dd-area/index.vue +225 -225
  42. package/src/components/dd-icon/doc.md +21 -21
  43. package/src/components/dd-icon/index.vue +23 -23
  44. package/src/components/dd-notice-bar/index.vue +78 -78
  45. package/src/components/dd-search/doc.md +34 -34
  46. package/src/components/dd-search/index.vue +168 -168
  47. package/src/components/dd-selector/index.vue +124 -124
  48. package/src/components/dd-skeleton/doc.md +19 -19
  49. package/src/components/dd-skeleton/index.vue +36 -36
  50. package/src/global.ts +6 -6
  51. package/src/index.ts +101 -101
  52. package/src/main.scss +1 -1
  53. package/src/notice/api/endpoints.ts +54 -54
  54. package/src/notice/api/index.ts +121 -121
  55. package/src/notice/components/NoticeBanner.vue +247 -247
  56. package/src/notice/components/NoticeEntry.vue +99 -99
  57. package/src/notice/components/NoticeList.vue +311 -311
  58. package/src/notice/components/NoticeList2.vue +401 -401
  59. package/src/notice/components/NoticePopup.vue +163 -163
  60. package/src/notice/components/index.ts +6 -6
  61. package/src/notice/components/useCommonList.ts +87 -87
  62. package/src/notice/components/useNotice.ts +35 -35
  63. package/src/notice/index.ts +1 -1
  64. package/src/notice/types.ts +25 -25
  65. package/src/payment/api/config.ts +7 -7
  66. package/src/payment/api/endpoints.ts +112 -112
  67. package/src/payment/api/index.ts +108 -108
  68. package/src/payment/components/AmountPicker.vue +56 -56
  69. package/src/payment/components/RechargeResult.vue +68 -68
  70. package/src/payment/components/RechargeView.vue +388 -388
  71. package/src/payment/components/RightsPicker.vue +105 -105
  72. package/src/payment/components/TradeView.vue +627 -616
  73. package/src/payment/components/UserAgreement.vue +234 -234
  74. package/src/payment/components/index.ts +22 -22
  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
@@ -1,57 +1,57 @@
1
- <template>
2
- <view class="view recharge-view">
3
- <view class="flex-grow">
4
- <amount-picker :items="rechargeAmountItems" :selected="state.selected" @change="onAmountSelect" />
5
- <view class="custom-amount-panel" v-if="isCustomAmountSelected">
6
- <view class="custom-amount-title">
7
- <text>输入充值金额</text>
8
- <text class="custom-amount-tag">自定义大额</text>
9
- </view>
10
- <view class="custom-amount-input">
11
- <text class="currency">¥</text>
12
- <input
13
- class="custom-amount-control"
14
- type="number"
1
+ <template>
2
+ <view class="view recharge-view">
3
+ <view class="flex-grow">
4
+ <amount-picker :items="rechargeAmountItems" :selected="state.selected" @change="onAmountSelect" />
5
+ <view class="custom-amount-panel" v-if="isCustomAmountSelected">
6
+ <view class="custom-amount-title">
7
+ <text>输入充值金额</text>
8
+ <text class="custom-amount-tag">自定义大额</text>
9
+ </view>
10
+ <view class="custom-amount-input">
11
+ <text class="currency">¥</text>
12
+ <input
13
+ class="custom-amount-control"
14
+ type="number"
15
15
  :value="state.customAmountText"
16
16
  placeholder="最低1w元起,最高5w元"
17
17
  placeholder-class="custom-amount-placeholder"
18
18
  placeholder-style="color: #b8b8b8; font-size: 26px; font-weight: 700;"
19
19
  inputmode="numeric"
20
20
  pattern="[0-9]*"
21
- step="1"
22
- :min="CUSTOM_RECHARGE_AMOUNT_MIN"
23
- :max="CUSTOM_RECHARGE_AMOUNT_MAX"
24
- maxlength="6"
25
- @input="onCustomAmountInput"
26
- />
27
- </view>
28
- <view class="custom-amount-tip">
29
- <text class="custom-amount-tip-icon">i</text>
30
- <text>自定义大额充值将根据充值金额即时换算云豆,比例为 1:1。</text>
31
- </view>
32
- </view>
33
-
34
- <slot name="banner"></slot>
35
- </view>
36
- <view class="amount-footer">
37
- <view class="agreement">
38
- <nut-checkbox v-model="state.agreed">我已阅读并同意<a v-track-click class="link inline"
39
- @click="onAgreementLinkClick">《大道云平台云豆充值服务协议》</a></nut-checkbox>
40
- </view>
41
- <nut-button block shape="square" :loading="state.buttonLoading" v-track-click @click="onPayClick"
42
- class="recharge-button">立即充值</nut-button>
43
- </view>
44
- </view>
45
- </template>
46
-
47
- <script lang="ts" setup>
48
- import { computed, onMounted, reactive, ref } from 'vue'
49
- import AmountPicker from './AmountPicker.vue'
50
- import { useHttp, endpoints } from '../api'
51
- import { requestBrandWCPay, requestPayment } from '../services'
52
- import Taro, { showToast, useRouter } from '@tarojs/taro'
53
- import { isAlipay, isAndroid, isChrome, isIOS, isSafari, isWechat } from '../../shared/composables/useDeviceEnv'
54
- import {
21
+ step="1"
22
+ :min="CUSTOM_RECHARGE_AMOUNT_MIN"
23
+ :max="CUSTOM_RECHARGE_AMOUNT_MAX"
24
+ maxlength="6"
25
+ @input="onCustomAmountInput"
26
+ />
27
+ </view>
28
+ <view class="custom-amount-tip">
29
+ <text class="custom-amount-tip-icon">i</text>
30
+ <text>自定义大额充值将根据充值金额即时换算云豆,比例为 1:1。</text>
31
+ </view>
32
+ </view>
33
+
34
+ <slot name="banner"></slot>
35
+ </view>
36
+ <view class="amount-footer">
37
+ <view class="agreement">
38
+ <nut-checkbox v-model="state.agreed">我已阅读并同意<a v-track-click class="link inline"
39
+ @click="onAgreementLinkClick">《大道云平台云豆充值服务协议》</a></nut-checkbox>
40
+ </view>
41
+ <nut-button block shape="square" :loading="state.buttonLoading" v-track-click @click="onPayClick"
42
+ class="recharge-button">立即充值</nut-button>
43
+ </view>
44
+ </view>
45
+ </template>
46
+
47
+ <script lang="ts" setup>
48
+ import { computed, onMounted, reactive, ref } from 'vue'
49
+ import AmountPicker from './AmountPicker.vue'
50
+ import { useHttp, endpoints } from '../api'
51
+ import { requestBrandWCPay, requestPayment } from '../services'
52
+ import Taro, { showToast, useRouter } from '@tarojs/taro'
53
+ import { isAlipay, isAndroid, isChrome, isIOS, isSafari, isWechat } from '../../shared/composables/useDeviceEnv'
54
+ import {
55
55
  CUSTOM_RECHARGE_AMOUNT_MAX,
56
56
  CUSTOM_RECHARGE_AMOUNT_MIN,
57
57
  appendCustomAmountOption,
@@ -59,279 +59,279 @@ import {
59
59
  resolveRechargeAmount,
60
60
  validateCustomRechargeAmount,
61
61
  } from './recharge-amount'
62
-
63
- // 充值用户界面
64
- // 配置了必须的属性后
65
- // 自动获取支付套餐包列表
66
- // 并发起微信支付
67
- export interface RechargeViewProps {
68
- /**
69
- * 应用
70
- **/
71
- app: string,
72
- /**
73
- * 充值场景
74
- */
75
- // stage?: string, // 这个参数暂时不用
76
- /**
77
- * 租户
78
- */
79
- tenant: string,
80
- /**
81
- * h5支付完成后跳转地址
82
- */
83
- payFinishJumpUrl?: ''
84
- }
85
-
86
- const props = defineProps<RechargeViewProps>()
87
- const { params } = useRouter()
88
-
89
- const emit = defineEmits<{
90
- (event: 'complete', value: boolean): void,
91
- (event: 'agree'): void,
92
- (event: 'loaded'): void,
93
- }>()
94
-
95
- const state = reactive({
96
- agreed: false,
97
- selected: 0,
98
- agreementOpen: false,
99
- buttonLoading: false,
100
- thirdPayId: '',
101
- customAmountText: '',
102
- })
103
-
104
- const amounts = ref<any[]>([])
62
+
63
+ // 充值用户界面
64
+ // 配置了必须的属性后
65
+ // 自动获取支付套餐包列表
66
+ // 并发起微信支付
67
+ export interface RechargeViewProps {
68
+ /**
69
+ * 应用
70
+ **/
71
+ app: string,
72
+ /**
73
+ * 充值场景
74
+ */
75
+ // stage?: string, // 这个参数暂时不用
76
+ /**
77
+ * 租户
78
+ */
79
+ tenant: string,
80
+ /**
81
+ * h5支付完成后跳转地址
82
+ */
83
+ payFinishJumpUrl?: ''
84
+ }
85
+
86
+ const props = defineProps<RechargeViewProps>()
87
+ const { params } = useRouter()
88
+
89
+ const emit = defineEmits<{
90
+ (event: 'complete', value: boolean): void,
91
+ (event: 'agree'): void,
92
+ (event: 'loaded'): void,
93
+ }>()
94
+
95
+ const state = reactive({
96
+ agreed: false,
97
+ selected: 0,
98
+ agreementOpen: false,
99
+ buttonLoading: false,
100
+ thirdPayId: '',
101
+ customAmountText: '',
102
+ })
103
+
104
+ const amounts = ref<any[]>([])
105
105
  const rechargeAmountItems = computed(() => appendCustomAmountOption(amounts.value, !isWechat()))
106
- const isCustomAmountSelected = computed(() => rechargeAmountItems.value[state.selected]?.custom === true)
107
-
108
- const onAgreementLinkClick = (e) => {
109
- e.preventDefault()
110
- e.stopImmediatePropagation()
111
- emit('agree')
112
- // state.agreementOpen = true
113
- }
114
-
115
- const onAmountSelect = (selected: number) => {
116
- state.selected = selected
117
-
118
- if (!rechargeAmountItems.value[selected]?.custom) {
119
- state.customAmountText = ''
120
- }
121
- }
122
-
106
+ const isCustomAmountSelected = computed(() => rechargeAmountItems.value[state.selected]?.custom === true)
107
+
108
+ const onAgreementLinkClick = (e) => {
109
+ e.preventDefault()
110
+ e.stopImmediatePropagation()
111
+ emit('agree')
112
+ // state.agreementOpen = true
113
+ }
114
+
115
+ const onAmountSelect = (selected: number) => {
116
+ state.selected = selected
117
+
118
+ if (!rechargeAmountItems.value[selected]?.custom) {
119
+ state.customAmountText = ''
120
+ }
121
+ }
122
+
123
123
  const onCustomAmountInput = (event: any) => {
124
124
  const value = normalizeCustomRechargeAmountInput(event?.detail?.value ?? event?.target?.value)
125
125
  state.customAmountText = value
126
126
  return value
127
127
  }
128
-
129
- const getSelectedRechargeAmount = () => {
130
- if (isCustomAmountSelected.value) {
131
- return validateCustomRechargeAmount(state.customAmountText)
132
- }
133
-
134
- const amount = resolveRechargeAmount(rechargeAmountItems.value, state.selected, state.customAmountText)
135
-
136
- if (!amount) {
137
- return { valid: false, message: '请选择充值金额' } as const
138
- }
139
-
140
- return { valid: true, amount } as const
141
- }
142
-
143
- onMounted(async () => {
144
- const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' ? props.app : '', Tenant: props.tenant })
145
-
146
- $http.get<any[]>(endpoints.获取充值金额列表, {
147
- app: props.app,
148
- tenant: props.tenant,
149
- scene: isWechat() ? '' : 'APP'
150
- }).then(response => {
151
- amounts.value = response
152
- emit('loaded')
153
- })
154
- })
155
-
156
- const onPayClick = () => {
157
- const selectedAmount = getSelectedRechargeAmount()
158
-
159
- if (!selectedAmount.valid) {
160
- showToast({
161
- title: selectedAmount.message,
162
- icon: 'none',
163
- })
164
- return false
165
- }
166
-
167
- if (!state.agreed) {
168
- showToast({
169
- title: '请勾选《大道云平台云豆充值协议》',
170
- icon: 'none',
171
- })
172
- return false
173
- }
174
- state.buttonLoading = true
175
-
176
- if (Taro.getEnv() === 'WEB') {
177
- // if (!isWechat()) {
178
- // showToast({
179
- // title: '请使用微信浏览器打开',
180
- // icon: 'none',
181
- // })
182
- // state.buttonLoading = false
183
- // return false
184
- // }
185
- requestBrandWCPay({
186
- amount: selectedAmount.amount,
187
- app: 'loankitMp',
188
- tenant: props.tenant,
189
- accountAuthFlag: false,
190
- channelCode: getChannelCode(),
191
- payFinishJumpUrl: props.payFinishJumpUrl,
192
- fromMini: !!params.from,
193
- clientInfo: 'H5'
194
- }).then((result: any) => {
195
- state.buttonLoading = false
196
- if (typeof result === 'boolean' && result) {
197
- window.location.href = props.payFinishJumpUrl as string
198
- } else if (typeof result === 'object' && result?.paymentType === 'H5' && result?.prePayStr) {
199
- state.thirdPayId = result?.thirdPayId || ''
200
- window.location.href = result?.prePayStr;
201
- } else {
202
- emit('complete', result)
203
- }
204
- }).catch((error) => {
205
- state.buttonLoading = false
206
- })
207
- } else {
208
- wx.login({
209
- success({ code }: { code: string }) {
210
- requestPayment({
211
- amount: selectedAmount.amount,
212
- app: props.app,
213
- tenant: props.tenant,
214
- user: code
215
- }).then(result => {
216
- state.buttonLoading = false
217
- if (result) {
218
- emit('complete', true)
219
- }
220
- })
221
- }
222
- })
223
- }
224
- }
225
-
226
- // 根据环境判断渠道编码
227
- function getChannelCode() {
228
- if (isWechat()) {
229
- return 'centergzh';
230
- } else {
231
- return 'YundouZfb';
232
- }
233
- }
234
-
235
- const payResultCheck = () => {
236
- if (!state.thirdPayId) return
237
-
238
- const $http = useHttp()
239
- $http.get<any>(endpoints.获取支付结果, {
240
- thirdPayId: state.thirdPayId
241
- }).then(response => {
242
- if (response.payStatus === 'paid') {
243
- emit('complete', true)
244
- }
245
- })
246
- }
247
-
248
- defineExpose({
249
- payResultCheck
250
- })
251
- </script>
252
-
253
- <style lang="scss">
254
- .recharge-view {
255
- height: 100%;
256
- display: flex;
257
- flex-direction: column;
258
- --nut-primary-color: #017fff;
259
-
260
- .flex-grow {
261
- flex-grow: 1;
262
- }
263
-
264
- .custom-amount-panel {
265
- box-sizing: border-box;
266
- display: block;
267
- overflow: hidden;
268
- margin: 8px 12px 12px;
269
- padding: 12px;
270
- background-color: rgb(255, 244, 223,.3);
271
- border-radius: 5px;
272
- border: 1px solid #fd6701;
273
- }
274
-
275
- .custom-amount-title,
276
- .custom-amount-input,
277
- .custom-amount-tip {
278
- background: transparent;
279
- }
280
-
281
- .custom-amount-title {
282
- display: flex;
283
- align-items: center;
284
- justify-content: space-between;
285
- color: #262626;
286
- font-size: 15px;
287
- font-weight: 600;
288
- line-height: 22px;
289
- }
290
-
291
- .custom-amount-tag {
292
- color: #fd6701;
293
- background: rgb(255, 244, 223);
294
- border-radius: 12px;
295
- padding: 3px 8px;
296
- font-size: 10px;
297
- font-weight: 600;
298
- line-height: 14px;
299
- }
300
-
301
- .custom-amount-input {
302
- display: flex;
303
- align-items: center;
304
- min-height: 50px;
305
- margin-top: 8px;
306
- padding: 0;
307
- border: 0;
308
- background: transparent;
309
-
310
- .currency {
311
- flex: none;
312
- margin-right: 10px;
313
- color: #9a9a9a;
314
- font-size: 26px;
315
- font-weight: 600;
316
- line-height: 36px;
317
- }
318
- }
319
-
320
- .custom-amount-control {
321
- flex: 1;
322
- min-width: 0;
323
- height: 42px;
324
- padding: 0;
325
- border: 0;
326
- outline: none;
327
- background: transparent;
328
- color: #353535;
329
- caret-color: #fd6701;
330
- font-size: 28px;
331
- font-weight: 700;
332
- line-height: 42px;
333
-
334
- &:focus,
128
+
129
+ const getSelectedRechargeAmount = () => {
130
+ if (isCustomAmountSelected.value) {
131
+ return validateCustomRechargeAmount(state.customAmountText)
132
+ }
133
+
134
+ const amount = resolveRechargeAmount(rechargeAmountItems.value, state.selected, state.customAmountText)
135
+
136
+ if (!amount) {
137
+ return { valid: false, message: '请选择充值金额' } as const
138
+ }
139
+
140
+ return { valid: true, amount } as const
141
+ }
142
+
143
+ onMounted(async () => {
144
+ const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' ? props.app : '', Tenant: props.tenant })
145
+
146
+ $http.get<any[]>(endpoints.获取充值金额列表, {
147
+ app: props.app,
148
+ tenant: props.tenant,
149
+ scene: isWechat() ? '' : 'APP'
150
+ }).then(response => {
151
+ amounts.value = response
152
+ emit('loaded')
153
+ })
154
+ })
155
+
156
+ const onPayClick = () => {
157
+ const selectedAmount = getSelectedRechargeAmount()
158
+
159
+ if (!selectedAmount.valid) {
160
+ showToast({
161
+ title: selectedAmount.message,
162
+ icon: 'none',
163
+ })
164
+ return false
165
+ }
166
+
167
+ if (!state.agreed) {
168
+ showToast({
169
+ title: '请勾选《大道云平台云豆充值协议》',
170
+ icon: 'none',
171
+ })
172
+ return false
173
+ }
174
+ state.buttonLoading = true
175
+
176
+ if (Taro.getEnv() === 'WEB') {
177
+ // if (!isWechat()) {
178
+ // showToast({
179
+ // title: '请使用微信浏览器打开',
180
+ // icon: 'none',
181
+ // })
182
+ // state.buttonLoading = false
183
+ // return false
184
+ // }
185
+ requestBrandWCPay({
186
+ amount: selectedAmount.amount,
187
+ app: 'loankitMp',
188
+ tenant: props.tenant,
189
+ accountAuthFlag: false,
190
+ channelCode: getChannelCode(),
191
+ payFinishJumpUrl: props.payFinishJumpUrl,
192
+ fromMini: !!params.from,
193
+ clientInfo: 'H5'
194
+ }).then((result: any) => {
195
+ state.buttonLoading = false
196
+ if (typeof result === 'boolean' && result) {
197
+ window.location.href = props.payFinishJumpUrl as string
198
+ } else if (typeof result === 'object' && result?.paymentType === 'H5' && result?.prePayStr) {
199
+ state.thirdPayId = result?.thirdPayId || ''
200
+ window.location.href = result?.prePayStr;
201
+ } else {
202
+ emit('complete', result)
203
+ }
204
+ }).catch((error) => {
205
+ state.buttonLoading = false
206
+ })
207
+ } else {
208
+ wx.login({
209
+ success({ code }: { code: string }) {
210
+ requestPayment({
211
+ amount: selectedAmount.amount,
212
+ app: props.app,
213
+ tenant: props.tenant,
214
+ user: code
215
+ }).then(result => {
216
+ state.buttonLoading = false
217
+ if (result) {
218
+ emit('complete', true)
219
+ }
220
+ })
221
+ }
222
+ })
223
+ }
224
+ }
225
+
226
+ // 根据环境判断渠道编码
227
+ function getChannelCode() {
228
+ if (isWechat()) {
229
+ return 'centergzh';
230
+ } else {
231
+ return 'YundouZfb';
232
+ }
233
+ }
234
+
235
+ const payResultCheck = () => {
236
+ if (!state.thirdPayId) return
237
+
238
+ const $http = useHttp()
239
+ $http.get<any>(endpoints.获取支付结果, {
240
+ thirdPayId: state.thirdPayId
241
+ }).then(response => {
242
+ if (response.payStatus === 'paid') {
243
+ emit('complete', true)
244
+ }
245
+ })
246
+ }
247
+
248
+ defineExpose({
249
+ payResultCheck
250
+ })
251
+ </script>
252
+
253
+ <style lang="scss">
254
+ .recharge-view {
255
+ height: 100%;
256
+ display: flex;
257
+ flex-direction: column;
258
+ --nut-primary-color: #017fff;
259
+
260
+ .flex-grow {
261
+ flex-grow: 1;
262
+ }
263
+
264
+ .custom-amount-panel {
265
+ box-sizing: border-box;
266
+ display: block;
267
+ overflow: hidden;
268
+ margin: 8px 12px 12px;
269
+ padding: 12px;
270
+ background-color: rgb(255, 244, 223,.3);
271
+ border-radius: 5px;
272
+ border: 1px solid #fd6701;
273
+ }
274
+
275
+ .custom-amount-title,
276
+ .custom-amount-input,
277
+ .custom-amount-tip {
278
+ background: transparent;
279
+ }
280
+
281
+ .custom-amount-title {
282
+ display: flex;
283
+ align-items: center;
284
+ justify-content: space-between;
285
+ color: #262626;
286
+ font-size: 15px;
287
+ font-weight: 600;
288
+ line-height: 22px;
289
+ }
290
+
291
+ .custom-amount-tag {
292
+ color: #fd6701;
293
+ background: rgb(255, 244, 223);
294
+ border-radius: 12px;
295
+ padding: 3px 8px;
296
+ font-size: 10px;
297
+ font-weight: 600;
298
+ line-height: 14px;
299
+ }
300
+
301
+ .custom-amount-input {
302
+ display: flex;
303
+ align-items: center;
304
+ min-height: 50px;
305
+ margin-top: 8px;
306
+ padding: 0;
307
+ border: 0;
308
+ background: transparent;
309
+
310
+ .currency {
311
+ flex: none;
312
+ margin-right: 10px;
313
+ color: #9a9a9a;
314
+ font-size: 26px;
315
+ font-weight: 600;
316
+ line-height: 36px;
317
+ }
318
+ }
319
+
320
+ .custom-amount-control {
321
+ flex: 1;
322
+ min-width: 0;
323
+ height: 42px;
324
+ padding: 0;
325
+ border: 0;
326
+ outline: none;
327
+ background: transparent;
328
+ color: #353535;
329
+ caret-color: #fd6701;
330
+ font-size: 28px;
331
+ font-weight: 700;
332
+ line-height: 42px;
333
+
334
+ &:focus,
335
335
  &:focus-visible {
336
336
  border: 0;
337
337
  outline: none;
@@ -345,76 +345,76 @@ defineExpose({
345
345
  font-weight: 700;
346
346
  }
347
347
  }
348
-
349
- .custom-amount-placeholder {
350
- color: #b8b8b8;
351
- font-size: 26px;
352
- font-weight: 700;
353
- line-height: 42px;
354
- }
355
-
356
- .custom-amount-tip {
357
- display: flex;
358
- align-items: center;
359
- gap: 6px;
360
- margin-top: 10px;
361
- color: #a5a5a5;
362
- font-size: 10px;
363
- line-height: 15px;
364
- }
365
-
366
- .custom-amount-tip-icon {
367
- flex: none;
368
- width: 12px;
369
- height: 12px;
370
- border: 1px solid #b8b8b8;
371
- border-radius: 50%;
372
- color: #9a9a9a;
373
- font-size: 9px;
374
- line-height: 12px;
375
- text-align: center;
376
- }
377
-
378
- .amount-footer {
379
- position: fixed;
380
- bottom: 0;
381
- left: 0;
382
- width: 100%;
383
- background-color: #fff;
384
- padding: 10px;
385
- padding-bottom: 20px;
386
- z-index: 10;
387
-
388
- .agreement {
389
- font-size: 12px;
390
- display: flex;
391
- justify-content: center;
392
- align-items: cebter;
393
- height: 40px;
394
- }
395
-
396
- .recharge-button {
397
- background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
398
- color: #353535;
399
- margin: 12px 0;
400
- border: 0;
401
- border-radius: 8px;
402
- }
403
-
404
- .nut-checkbox {
405
- line-height: 40px;
406
- }
407
-
408
- .nut-checkbox__label {
409
- margin-left: 8px;
410
- flex: flex;
411
- font-size: 12px;
412
- }
413
-
414
- .link {
415
- display: inline;
416
- color: #FD6701;
417
- }
418
- }
419
- }
420
- </style>
348
+
349
+ .custom-amount-placeholder {
350
+ color: #b8b8b8;
351
+ font-size: 26px;
352
+ font-weight: 700;
353
+ line-height: 42px;
354
+ }
355
+
356
+ .custom-amount-tip {
357
+ display: flex;
358
+ align-items: center;
359
+ gap: 6px;
360
+ margin-top: 10px;
361
+ color: #a5a5a5;
362
+ font-size: 10px;
363
+ line-height: 15px;
364
+ }
365
+
366
+ .custom-amount-tip-icon {
367
+ flex: none;
368
+ width: 12px;
369
+ height: 12px;
370
+ border: 1px solid #b8b8b8;
371
+ border-radius: 50%;
372
+ color: #9a9a9a;
373
+ font-size: 9px;
374
+ line-height: 12px;
375
+ text-align: center;
376
+ }
377
+
378
+ .amount-footer {
379
+ position: fixed;
380
+ bottom: 0;
381
+ left: 0;
382
+ width: 100%;
383
+ background-color: #fff;
384
+ padding: 10px;
385
+ padding-bottom: 20px;
386
+ z-index: 10;
387
+
388
+ .agreement {
389
+ font-size: 12px;
390
+ display: flex;
391
+ justify-content: center;
392
+ align-items: cebter;
393
+ height: 40px;
394
+ }
395
+
396
+ .recharge-button {
397
+ background: linear-gradient(90deg, #FFEBC1 0%, #FFD7A7 52.29%, #FFB875 100%);
398
+ color: #353535;
399
+ margin: 12px 0;
400
+ border: 0;
401
+ border-radius: 8px;
402
+ }
403
+
404
+ .nut-checkbox {
405
+ line-height: 40px;
406
+ }
407
+
408
+ .nut-checkbox__label {
409
+ margin-left: 8px;
410
+ flex: flex;
411
+ font-size: 12px;
412
+ }
413
+
414
+ .link {
415
+ display: inline;
416
+ color: #FD6701;
417
+ }
418
+ }
419
+ }
420
+ </style>