@uxda/appkit 1.2.8 → 1.2.12

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 (66) hide show
  1. package/.eslintrc.mjs +7 -7
  2. package/README.md +187 -187
  3. package/babel.config.js +12 -12
  4. package/dist/appkit.css +289 -71
  5. package/dist/index.js +862 -341
  6. package/dist/styles.css +1 -0
  7. package/package.json +78 -78
  8. package/project.config.json +15 -15
  9. package/project.tt.json +13 -13
  10. package/rollup.config.mjs +54 -54
  11. package/src/Appkit.ts +65 -65
  12. package/src/balance/api/endpoints.ts +125 -122
  13. package/src/balance/api/index.ts +82 -82
  14. package/src/balance/components/AccountView.vue +754 -649
  15. package/src/balance/components/BalanceCard.vue +209 -209
  16. package/src/balance/components/BalanceReminder.vue +83 -83
  17. package/src/balance/components/ConsumptionFilter.vue +218 -218
  18. package/src/balance/components/ConsumptionRules.vue +68 -68
  19. package/src/balance/components/DateFilter.vue +235 -235
  20. package/src/balance/components/SecondBalance.vue +71 -71
  21. package/src/balance/components/Tip.vue +46 -0
  22. package/src/balance/components/index.ts +9 -9
  23. package/src/balance/types.ts +90 -88
  24. package/src/components/dd-area/index.vue +222 -222
  25. package/src/components/dd-icon/doc.md +21 -21
  26. package/src/components/dd-icon/index.vue +23 -23
  27. package/src/components/dd-selector/index.vue +124 -124
  28. package/src/components/ocr-id/index.vue +110 -110
  29. package/src/components/ocr-id/types.d.ts +12 -12
  30. package/src/global.ts +6 -6
  31. package/src/index.ts +88 -86
  32. package/src/main.scss +1 -1
  33. package/src/payment/api/config.ts +7 -7
  34. package/src/payment/api/endpoints.ts +103 -78
  35. package/src/payment/api/index.ts +71 -71
  36. package/src/payment/components/AmountPicker.vue +93 -93
  37. package/src/payment/components/RechargeResult.vue +66 -54
  38. package/src/payment/components/RechargeView.vue +154 -154
  39. package/src/payment/components/RightsPicker.vue +106 -0
  40. package/src/payment/components/TradeView.vue +298 -0
  41. package/src/payment/components/UserAgreement.vue +141 -141
  42. package/src/payment/components/index.ts +22 -19
  43. package/src/payment/index.ts +5 -5
  44. package/src/payment/services/index.ts +16 -16
  45. package/src/payment/services/invoke-recharge.ts +25 -25
  46. package/src/payment/services/request-payment.ts +58 -31
  47. package/src/payment/types.ts +28 -23
  48. package/src/register/components/SelfRegistration.vue +227 -227
  49. package/src/register/components/index.ts +2 -2
  50. package/src/shared/components/AppDrawer.vue +58 -58
  51. package/src/shared/components/EmptyView.vue +33 -33
  52. package/src/shared/components/PageHeader.vue +79 -79
  53. package/src/shared/components/index.ts +6 -6
  54. package/src/shared/composables/index.ts +2 -2
  55. package/src/shared/composables/useSafeArea.ts +43 -43
  56. package/src/shared/composables/useTabbar.ts +24 -24
  57. package/src/shared/http/Http.ts +126 -126
  58. package/src/shared/http/index.ts +1 -1
  59. package/src/shared/http/types.ts +157 -157
  60. package/src/shared/index.ts +3 -3
  61. package/src/shared/weixin/payment.ts +38 -38
  62. package/src/styles/fonts.scss +2 -2
  63. package/src/styles/vars.scss +3 -3
  64. package/tsconfig.json +30 -30
  65. package/types/global.d.ts +21 -21
  66. package/types/vue.d.ts +10 -10
@@ -1,228 +1,228 @@
1
- <script setup lang="ts">
2
- import { reactive } from 'vue'
3
- import OcrId from './../../components/ocr-id/index.vue'
4
- import { OcrResultType } from '../../components/ocr-id/types'
5
- import DdArea from './../../components/dd-area/index.vue'
6
- import DdSelector from './../../components/dd-selector/index.vue'
7
- import Taro from "@tarojs/taro";
8
-
9
- const props = withDefaults(defineProps<{
10
- banner?: string
11
- }>(), {
12
- banner: 'https://cdn.ddjf.com/static/images/wx-yunservice/ai-form-bg2.png'
13
- })
14
-
15
- const formState = reactive({
16
- name: '',
17
- certNo: '',
18
- scene: 'person',
19
- areaCode: '',
20
- position: '',
21
- companyName: '',
22
- companyNo: ''
23
- })
24
-
25
- const positionOptions = [
26
- {
27
- label: "老板",
28
- value: "老板",
29
- },
30
- {
31
- label: "业务负责人",
32
- value: "业务负责人",
33
- },
34
- {
35
- label: "风控负责人",
36
- value: "风控负责人",
37
- },
38
- {
39
- label: "其它",
40
- value: "其它",
41
- },
42
- ]
43
-
44
- const emit = defineEmits(['submit'])
45
-
46
- function onOCRInfo(payload: OcrResultType) {
47
- if (!payload) return
48
- formState.name = payload.faceInfo.name
49
- formState.certNo = payload.faceInfo.certNo
50
- }
51
-
52
- function showVerifyToast(tip: string, duration = 1500) {
53
- if (!tip) return
54
- Taro.showToast({
55
- title: tip,
56
- icon: 'none',
57
- duration,
58
- })
59
- }
60
-
61
- async function submit() {
62
- if (!formState.name){
63
- showVerifyToast('请输入你的姓名')
64
- return
65
- }
66
- const params = {
67
- useCase: formState.scene,
68
- customerName: formState.name
69
- }
70
- if (formState.scene === 'person') {
71
- if (!formState.certNo){
72
- showVerifyToast('请输入身份证号码')
73
- return
74
- }
75
- if (formState.certNo.length != 18){
76
- showVerifyToast('请输入正确的身份证号码')
77
- return
78
- }
79
- params['idCardNo'] = formState.certNo
80
- } else {
81
- if (!formState.position){
82
- showVerifyToast('请选择你的职位')
83
- return
84
- }
85
- if (!formState.companyName){
86
- showVerifyToast('请输入公司名称')
87
- return
88
- }
89
- if (!formState.companyNo){
90
- showVerifyToast('请输入社会统一信用代码')
91
- return
92
- }
93
- if (formState.companyNo.length != 18){
94
- showVerifyToast('请输入正确的社会统一信用代码')
95
- return
96
- }
97
- if (!formState.areaCode){
98
- showVerifyToast('请选择所在地区')
99
- return
100
- }
101
- params['customerPosition'] = formState.position
102
- params['companyName'] = formState.companyName
103
- params['idCardNo'] = formState.companyNo
104
- params['customerArea'] = formState.areaCode
105
- }
106
- console.log(formState)
107
- emit('submit', params)
108
- }
109
- </script>
110
-
111
- <template>
112
- <div class="self-registration">
113
- <div class="self-registration-body">
114
- <img :src="banner" class="self-registration-banner" alt=""/>
115
- <nut-form>
116
- <nut-form-item label="使用场景" required body-align="right">
117
- <nut-radiogroup v-model="formState.scene" direction="horizontal">
118
- <nut-radio label="person">个人使用</nut-radio>
119
- <nut-radio label="company">公司使用</nut-radio>
120
- </nut-radiogroup>
121
- </nut-form-item>
122
- <nut-form-item label="你的姓名" required>
123
- <div class="self-registration__input">
124
- <input v-model="formState.name" class="nut-input-text" placeholder="请输入或拍照识别" type="text" :maxlength="20"/>
125
- <OcrId @ocr="onOCRInfo" style="margin-left: 5px"/>
126
- </div>
127
- </nut-form-item>
128
-
129
- <nut-form-item v-if="formState.scene === 'person'" label="身份证号码" required>
130
- <input v-model="formState.certNo" class="nut-input-text" placeholder="请输入" type="text" :maxlength="18"/>
131
- </nut-form-item>
132
-
133
- <template v-else>
134
- <nut-form-item label="你的职位" required>
135
- <DdSelector v-model:value="formState.position" :options="positionOptions"/>
136
- </nut-form-item>
137
- <nut-form-item label="公司名称" required>
138
- <input v-model="formState.companyName" class="nut-input-text" placeholder="请输入" type="text"
139
- :maxlength="50"/>
140
- </nut-form-item>
141
- <nut-form-item label="社会统一信用代码" required>
142
- <input v-model="formState.companyNo" class="nut-input-text" placeholder="请输入" type="text" :maxlength="18"/>
143
- </nut-form-item>
144
- <nut-form-item label="所在地区" required>
145
- <DdArea
146
- v-model:value="formState.areaCode"
147
- type="city"
148
- placeholder="请选择"/>
149
- </nut-form-item>
150
- </template>
151
- </nut-form>
152
- </div>
153
- <div class="self-registration-bottom">
154
- <nut-button block type="primary" class="experience-button" @click="submit">立即体验</nut-button>
155
- </div>
156
- </div>
157
- </template>
158
-
159
- <style lang="scss">
160
- .self-registration {
161
- width: 100%;
162
- height: 100%;
163
- display: flex;
164
- flex-direction: column;
165
-
166
- &-body {
167
- flex: 1;
168
- padding: 12px;
169
- overflow: auto;
170
- }
171
-
172
- &-banner {
173
- width: 100%;
174
- height: 170px;
175
- }
176
-
177
- .nut-cell-group__warp {
178
- border-radius: 5px;
179
- margin: 12px 0 0;
180
- }
181
-
182
- &__input {
183
- display: flex;
184
- align-items: center;
185
- }
186
-
187
- &-bottom {
188
- background-color: white;
189
- padding-bottom: var(--safe-bottom-height);
190
- }
191
-
192
- .experience-button {
193
- margin: 7.5px 12px;
194
- border-radius: 5px;
195
- width: calc(100% - 24px);
196
- }
197
-
198
- .nut-input-text {
199
- text-align: right !important;
200
- }
201
-
202
- .nut-form-item__label.required::before {
203
- display: none;
204
- }
205
-
206
- .nut-form-item__label.required::after {
207
- content: "*";
208
- color: #fa2c19;
209
- margin-right: 4px;
210
- }
211
-
212
- .nut-form-item__label {
213
- width: unset;
214
- }
215
-
216
- .input-placeholder {
217
- color: #cccccc;
218
- }
219
-
220
- .nut-radio__icon {
221
- font-size: 16px;
222
- }
223
-
224
- .nut-radio__icon--unchecked {
225
- font-size: 16px;
226
- }
227
- }
1
+ <script setup lang="ts">
2
+ import { reactive } from 'vue'
3
+ import OcrId from './../../components/ocr-id/index.vue'
4
+ import { OcrResultType } from '../../components/ocr-id/types'
5
+ import DdArea from './../../components/dd-area/index.vue'
6
+ import DdSelector from './../../components/dd-selector/index.vue'
7
+ import Taro from "@tarojs/taro";
8
+
9
+ const props = withDefaults(defineProps<{
10
+ banner?: string
11
+ }>(), {
12
+ banner: 'https://cdn.ddjf.com/static/images/wx-yunservice/ai-form-bg2.png'
13
+ })
14
+
15
+ const formState = reactive({
16
+ name: '',
17
+ certNo: '',
18
+ scene: 'person',
19
+ areaCode: '',
20
+ position: '',
21
+ companyName: '',
22
+ companyNo: ''
23
+ })
24
+
25
+ const positionOptions = [
26
+ {
27
+ label: "老板",
28
+ value: "老板",
29
+ },
30
+ {
31
+ label: "业务负责人",
32
+ value: "业务负责人",
33
+ },
34
+ {
35
+ label: "风控负责人",
36
+ value: "风控负责人",
37
+ },
38
+ {
39
+ label: "其它",
40
+ value: "其它",
41
+ },
42
+ ]
43
+
44
+ const emit = defineEmits(['submit'])
45
+
46
+ function onOCRInfo(payload: OcrResultType) {
47
+ if (!payload) return
48
+ formState.name = payload.faceInfo.name
49
+ formState.certNo = payload.faceInfo.certNo
50
+ }
51
+
52
+ function showVerifyToast(tip: string, duration = 1500) {
53
+ if (!tip) return
54
+ Taro.showToast({
55
+ title: tip,
56
+ icon: 'none',
57
+ duration,
58
+ })
59
+ }
60
+
61
+ async function submit() {
62
+ if (!formState.name){
63
+ showVerifyToast('请输入你的姓名')
64
+ return
65
+ }
66
+ const params = {
67
+ useCase: formState.scene,
68
+ customerName: formState.name
69
+ }
70
+ if (formState.scene === 'person') {
71
+ if (!formState.certNo){
72
+ showVerifyToast('请输入身份证号码')
73
+ return
74
+ }
75
+ if (formState.certNo.length != 18){
76
+ showVerifyToast('请输入正确的身份证号码')
77
+ return
78
+ }
79
+ params['idCardNo'] = formState.certNo
80
+ } else {
81
+ if (!formState.position){
82
+ showVerifyToast('请选择你的职位')
83
+ return
84
+ }
85
+ if (!formState.companyName){
86
+ showVerifyToast('请输入公司名称')
87
+ return
88
+ }
89
+ if (!formState.companyNo){
90
+ showVerifyToast('请输入社会统一信用代码')
91
+ return
92
+ }
93
+ if (formState.companyNo.length != 18){
94
+ showVerifyToast('请输入正确的社会统一信用代码')
95
+ return
96
+ }
97
+ if (!formState.areaCode){
98
+ showVerifyToast('请选择所在地区')
99
+ return
100
+ }
101
+ params['customerPosition'] = formState.position
102
+ params['companyName'] = formState.companyName
103
+ params['idCardNo'] = formState.companyNo
104
+ params['customerArea'] = formState.areaCode
105
+ }
106
+ console.log(formState)
107
+ emit('submit', params)
108
+ }
109
+ </script>
110
+
111
+ <template>
112
+ <div class="self-registration">
113
+ <div class="self-registration-body">
114
+ <img :src="banner" class="self-registration-banner" alt=""/>
115
+ <nut-form>
116
+ <nut-form-item label="使用场景" required body-align="right">
117
+ <nut-radiogroup v-model="formState.scene" direction="horizontal">
118
+ <nut-radio label="person">个人使用</nut-radio>
119
+ <nut-radio label="company">公司使用</nut-radio>
120
+ </nut-radiogroup>
121
+ </nut-form-item>
122
+ <nut-form-item label="你的姓名" required>
123
+ <div class="self-registration__input">
124
+ <input v-model="formState.name" class="nut-input-text" placeholder="请输入或拍照识别" type="text" :maxlength="20"/>
125
+ <OcrId @ocr="onOCRInfo" style="margin-left: 5px"/>
126
+ </div>
127
+ </nut-form-item>
128
+
129
+ <nut-form-item v-if="formState.scene === 'person'" label="身份证号码" required>
130
+ <input v-model="formState.certNo" class="nut-input-text" placeholder="请输入" type="text" :maxlength="18"/>
131
+ </nut-form-item>
132
+
133
+ <template v-else>
134
+ <nut-form-item label="你的职位" required>
135
+ <DdSelector v-model:value="formState.position" :options="positionOptions"/>
136
+ </nut-form-item>
137
+ <nut-form-item label="公司名称" required>
138
+ <input v-model="formState.companyName" class="nut-input-text" placeholder="请输入" type="text"
139
+ :maxlength="50"/>
140
+ </nut-form-item>
141
+ <nut-form-item label="社会统一信用代码" required>
142
+ <input v-model="formState.companyNo" class="nut-input-text" placeholder="请输入" type="text" :maxlength="18"/>
143
+ </nut-form-item>
144
+ <nut-form-item label="所在地区" required>
145
+ <DdArea
146
+ v-model:value="formState.areaCode"
147
+ type="city"
148
+ placeholder="请选择"/>
149
+ </nut-form-item>
150
+ </template>
151
+ </nut-form>
152
+ </div>
153
+ <div class="self-registration-bottom">
154
+ <nut-button block type="primary" class="experience-button" @click="submit">立即体验</nut-button>
155
+ </div>
156
+ </div>
157
+ </template>
158
+
159
+ <style lang="scss">
160
+ .self-registration {
161
+ width: 100%;
162
+ height: 100%;
163
+ display: flex;
164
+ flex-direction: column;
165
+
166
+ &-body {
167
+ flex: 1;
168
+ padding: 12px;
169
+ overflow: auto;
170
+ }
171
+
172
+ &-banner {
173
+ width: 100%;
174
+ height: 170px;
175
+ }
176
+
177
+ .nut-cell-group__warp {
178
+ border-radius: 5px;
179
+ margin: 12px 0 0;
180
+ }
181
+
182
+ &__input {
183
+ display: flex;
184
+ align-items: center;
185
+ }
186
+
187
+ &-bottom {
188
+ background-color: white;
189
+ padding-bottom: var(--safe-bottom-height);
190
+ }
191
+
192
+ .experience-button {
193
+ margin: 7.5px 12px;
194
+ border-radius: 5px;
195
+ width: calc(100% - 24px);
196
+ }
197
+
198
+ .nut-input-text {
199
+ text-align: right !important;
200
+ }
201
+
202
+ .nut-form-item__label.required::before {
203
+ display: none;
204
+ }
205
+
206
+ .nut-form-item__label.required::after {
207
+ content: "*";
208
+ color: #fa2c19;
209
+ margin-right: 4px;
210
+ }
211
+
212
+ .nut-form-item__label {
213
+ width: unset;
214
+ }
215
+
216
+ .input-placeholder {
217
+ color: #cccccc;
218
+ }
219
+
220
+ .nut-radio__icon {
221
+ font-size: 16px;
222
+ }
223
+
224
+ .nut-radio__icon--unchecked {
225
+ font-size: 16px;
226
+ }
227
+ }
228
228
  </style>
@@ -1,3 +1,3 @@
1
- import SelfRegistration from './SelfRegistration.vue'
2
-
1
+ import SelfRegistration from './SelfRegistration.vue'
2
+
3
3
  export { SelfRegistration }
@@ -1,59 +1,59 @@
1
- <template>
2
- <nut-popup
3
- :pop-class="`app-drawer ${modelValue ? 'open' : ''}`"
4
- position="right"
5
- :visible="modelValue"
6
- @update:visible="onVisibleChange">
7
- <page-header
8
- :title="title"
9
- @close="onPageHeaderClose" />
10
- <div class="drawer-body">
11
- <slot></slot>
12
- </div>
13
- </nut-popup>
14
- </template>
15
-
16
- <script lang="ts" setup>
17
- // 右侧页面
18
- // 模仿页面打开
19
- // 假的标题栏和返回按钮
20
- import PageHeader from './PageHeader.vue'
21
-
22
- export interface AppDrawerProps {
23
- modelValue: boolean,
24
- title?: string,
25
- }
26
-
27
- const emit = defineEmits<{
28
- (event: 'update:modelValue', value: boolean): void
29
- }>()
30
-
31
- const onVisibleChange = (value: boolean) => {
32
- emit('update:modelValue', value)
33
- }
34
-
35
- defineProps<AppDrawerProps>()
36
-
37
- const onPageHeaderClose = () => {
38
- emit('update:modelValue', false)
39
- }
40
- </script>
41
-
42
- <style lang="scss">
43
- .app-drawer {
44
- position: absolute;
45
- display: flex;
46
- flex-direction: column;
47
- &.open {
48
- height: 100vh;
49
- }
50
- .page-header {
51
- flex-grow: 0;
52
- background-color: #fff;
53
- }
54
- .drawer-body {
55
- flex-grow: 1;
56
- overflow: scroll;
57
- }
58
- }
1
+ <template>
2
+ <nut-popup
3
+ :pop-class="`app-drawer ${modelValue ? 'open' : ''}`"
4
+ position="right"
5
+ :visible="modelValue"
6
+ @update:visible="onVisibleChange">
7
+ <page-header
8
+ :title="title"
9
+ @close="onPageHeaderClose" />
10
+ <div class="drawer-body">
11
+ <slot></slot>
12
+ </div>
13
+ </nut-popup>
14
+ </template>
15
+
16
+ <script lang="ts" setup>
17
+ // 右侧页面
18
+ // 模仿页面打开
19
+ // 假的标题栏和返回按钮
20
+ import PageHeader from './PageHeader.vue'
21
+
22
+ export interface AppDrawerProps {
23
+ modelValue: boolean,
24
+ title?: string,
25
+ }
26
+
27
+ const emit = defineEmits<{
28
+ (event: 'update:modelValue', value: boolean): void
29
+ }>()
30
+
31
+ const onVisibleChange = (value: boolean) => {
32
+ emit('update:modelValue', value)
33
+ }
34
+
35
+ defineProps<AppDrawerProps>()
36
+
37
+ const onPageHeaderClose = () => {
38
+ emit('update:modelValue', false)
39
+ }
40
+ </script>
41
+
42
+ <style lang="scss">
43
+ .app-drawer {
44
+ position: absolute;
45
+ display: flex;
46
+ flex-direction: column;
47
+ &.open {
48
+ height: 100vh;
49
+ }
50
+ .page-header {
51
+ flex-grow: 0;
52
+ background-color: #fff;
53
+ }
54
+ .drawer-body {
55
+ flex-grow: 1;
56
+ overflow: scroll;
57
+ }
58
+ }
59
59
  </style>
@@ -1,34 +1,34 @@
1
- <template>
2
- <div class="empty-view">
3
- <img
4
- class="empty-view-image"
5
- src="https://cdn.ddjf.com/static/images/nutshell/empty-data.png" />
6
- <div class="empty-view-text">暂无数据</div>
7
- </div>
8
- </template>
9
-
10
- <script lang="ts" setup>
11
- </script>
12
-
13
- <style lang="scss">
14
- .empty-view {
15
- display: flex;
16
- flex-direction: column;
17
- justify-content: center;
18
- align-items: center;
19
- margin-top: 80px;
20
- &-image {
21
- display: block;
22
- font-size: 0;
23
- width: 144px;
24
- height: 80px;
25
- filter: grayscale(1);
26
- }
27
- &-text {
28
- opacity: 0.4;
29
- color: #353535;
30
- font-size: 12px;
31
- line-height: 28px;
32
- }
33
- }
1
+ <template>
2
+ <div class="empty-view">
3
+ <img
4
+ class="empty-view-image"
5
+ src="https://cdn.ddjf.com/static/images/nutshell/empty-data.png" />
6
+ <div class="empty-view-text">暂无数据</div>
7
+ </div>
8
+ </template>
9
+
10
+ <script lang="ts" setup>
11
+ </script>
12
+
13
+ <style lang="scss">
14
+ .empty-view {
15
+ display: flex;
16
+ flex-direction: column;
17
+ justify-content: center;
18
+ align-items: center;
19
+ margin-top: 80px;
20
+ &-image {
21
+ display: block;
22
+ font-size: 0;
23
+ width: 144px;
24
+ height: 80px;
25
+ filter: grayscale(1);
26
+ }
27
+ &-text {
28
+ opacity: 0.4;
29
+ color: #353535;
30
+ font-size: 12px;
31
+ line-height: 28px;
32
+ }
33
+ }
34
34
  </style>