@uxda/appkit 1.2.72 → 4.0.0

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 (83) 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 +7 -501
  5. package/dist/index.js +58 -85
  6. package/package.json +78 -78
  7. package/project.config.json +15 -15
  8. package/project.tt.json +13 -13
  9. package/rollup.config.mjs +54 -54
  10. package/src/Appkit.ts +65 -65
  11. package/src/balance/api/endpoints.ts +126 -126
  12. package/src/balance/api/index.ts +82 -82
  13. package/src/balance/components/AccountView.vue +748 -748
  14. package/src/balance/components/BalanceCard.vue +209 -209
  15. package/src/balance/components/BalanceReminder.vue +85 -85
  16. package/src/balance/components/ConsumptionFilter.vue +218 -218
  17. package/src/balance/components/ConsumptionRules.vue +68 -68
  18. package/src/balance/components/DateFilter.vue +235 -235
  19. package/src/balance/components/SecondBalance.vue +71 -71
  20. package/src/balance/components/Tip.vue +45 -45
  21. package/src/balance/components/index.ts +9 -9
  22. package/src/balance/types.ts +90 -90
  23. package/src/components/dd-area/index.vue +225 -225
  24. package/src/components/dd-icon/doc.md +21 -21
  25. package/src/components/dd-icon/index.vue +23 -23
  26. package/src/components/dd-notice-bar/index.vue +78 -78
  27. package/src/components/dd-search/doc.md +34 -34
  28. package/src/components/dd-search/index.vue +168 -168
  29. package/src/components/dd-selector/index.vue +124 -124
  30. package/src/components/ocr-id/index.vue +114 -114
  31. package/src/components/ocr-id/types.d.ts +12 -12
  32. package/src/global.ts +6 -6
  33. package/src/index.ts +88 -88
  34. package/src/main.scss +1 -1
  35. package/src/notice/api/endpoints.ts +17 -17
  36. package/src/notice/api/index.ts +82 -82
  37. package/src/notice/components/LoginSetting.vue +112 -112
  38. package/src/notice/components/NoticeBanner.vue +243 -243
  39. package/src/notice/components/NoticeEntry.vue +99 -99
  40. package/src/notice/components/NoticeList.vue +278 -315
  41. package/src/notice/components/NoticePopup.vue +163 -161
  42. package/src/notice/components/index.ts +6 -6
  43. package/src/notice/components/useCommonList.ts +86 -86
  44. package/src/notice/components/useNotice.ts +35 -35
  45. package/src/notice/index.ts +1 -1
  46. package/src/notice/types.ts +25 -25
  47. package/src/payment/api/config.ts +7 -7
  48. package/src/payment/api/endpoints.ts +103 -103
  49. package/src/payment/api/index.ts +71 -71
  50. package/src/payment/components/AmountPicker.vue +93 -93
  51. package/src/payment/components/RechargeResult.vue +69 -69
  52. package/src/payment/components/RechargeView.vue +154 -154
  53. package/src/payment/components/RightsPicker.vue +105 -105
  54. package/src/payment/components/TradeView.vue +298 -298
  55. package/src/payment/components/UserAgreement.vue +141 -141
  56. package/src/payment/components/index.ts +22 -22
  57. package/src/payment/index.ts +5 -5
  58. package/src/payment/services/index.ts +16 -16
  59. package/src/payment/services/invoke-recharge.ts +25 -25
  60. package/src/payment/services/request-payment.ts +58 -58
  61. package/src/payment/types.ts +28 -28
  62. package/src/register/components/SelfRegistration.vue +227 -227
  63. package/src/register/components/index.ts +2 -2
  64. package/src/shared/components/AppDrawer.vue +58 -58
  65. package/src/shared/components/DeviceVersion.vue +67 -67
  66. package/src/shared/components/EmptyView.vue +33 -33
  67. package/src/shared/components/PageHeader.vue +79 -79
  68. package/src/shared/components/index.ts +5 -5
  69. package/src/shared/composables/index.ts +2 -2
  70. package/src/shared/composables/useSafeArea.ts +46 -46
  71. package/src/shared/composables/useTabbar.ts +24 -24
  72. package/src/shared/http/Http.ts +135 -135
  73. package/src/shared/http/index.ts +1 -1
  74. package/src/shared/http/types.ts +157 -157
  75. package/src/shared/index.ts +3 -3
  76. package/src/shared/weixin/payment.ts +38 -38
  77. package/src/styles/fonts.scss +2 -2
  78. package/src/styles/vars.scss +3 -3
  79. package/tsconfig.json +30 -30
  80. package/types/global.d.ts +21 -21
  81. package/types/vue.d.ts +10 -10
  82. package/dist/main.css +0 -3
  83. package/dist/styles.css +0 -1
@@ -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>