@uxda/appkit 1.2.73 → 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 -27
  5. package/dist/index.js +58 -84
  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 -313
  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,313 +1,278 @@
1
- <template>
2
- <div class="notice-list">
3
- <DdSearch
4
- :bordered="false"
5
- :focus="false"
6
- :value="query.title"
7
- placeholder="请输入关键字搜索"
8
- @search="onSearch"
9
- />
10
-
11
- <div style="flex: 1; overflow: hidden">
12
- <div class="wrapper" v-if="list.length">
13
- <scroll-view
14
- class="content"
15
- :scroll-y="true"
16
- :refresher-enabled="true"
17
- :refresherTriggered="isRefresh"
18
- @refresherrefresh="onRefresh"
19
- :lower-threshold="100"
20
- @scrolltolower="runNext"
21
- bindscroll=""
22
- >
23
- <div
24
- class="card"
25
- :class="{ active: item.isRead != '1' }"
26
- v-for="(item, index) in list"
27
- :key="index"
28
- @click="notifyRead(item, index)"
29
- >
30
- <div class="point"></div>
31
- <div>
32
- <div class="time">{{ formatMinutes(item.receiveTime) }}</div>
33
- <div
34
- v-if="app !== 'loankit' || (app === 'loankit' && item.title !== item.context)"
35
- class="text tit"
36
- style="display: flex; align-items: center"
37
- :class="{ gray: item.isRead == '1' }"
38
- >
39
- {{ item.title }}
40
- <div class="notice-list-label" v-if="showApp && appMap[item.appCode]">
41
- {{ appMap[item.appCode] }}
42
- </div>
43
- </div>
44
- <div class="text" :class="{ gray: item.isRead == '1' }">
45
- <rich-text style="white-space: pre-wrap" :nodes="item.context"></rich-text>
46
- <span
47
- v-if="item.link && item.msgType == 3"
48
- class="notice-list-file"
49
- @click="onNoticeView(item.link)"
50
- >
51
- 查看附件
52
- </span>
53
- </div>
54
- </div>
55
- </div>
56
- <div v-if="isLast" class="cue-text" style="padding-bottom: 40px">没有更多了</div>
57
- </scroll-view>
58
- </div>
59
- <div v-else class="no-data">
60
- <div class="no-data-img">
61
- <img
62
- style="width: 100%; height: 100%"
63
- src="https://cdn.ddjf.com/static/images/loan-manage/no-data.png"
64
- alt=""
65
- />
66
- </div>
67
- <div class="text">暂无记录</div>
68
- </div>
69
- </div>
70
- </div>
71
- </template>
72
-
73
- <script lang="ts" setup>
74
- import { onMounted, ref } from 'vue'
75
- import Taro from '@tarojs/taro'
76
- import DdSearch from '../../components/dd-search/index.vue'
77
- import dayjs from 'dayjs'
78
- import { useNotice } from './useNotice'
79
- import { useCommonList } from './useCommonList'
80
- import { NoticeListQueryTypes, NoticeListTypes } from '../types'
81
- import { useAppKitOptions } from '../../Appkit'
82
-
83
- const props = withDefaults(
84
- defineProps<{
85
- app: string
86
- userId: string
87
- showApp?: boolean
88
- checkBeforeRead?: Function
89
- }>(),
90
- {
91
- app: '',
92
- userId: '',
93
- showApp: false,
94
- }
95
- )
96
-
97
- const query = ref<any>({
98
- pageNum: 1,
99
- pageSize: 15,
100
- title: '',
101
- deviceType: 2,
102
- })
103
-
104
- const { toReadFun } = useNotice()
105
- const { list, init, runNext, runRefresh, isLast } = useCommonList<
106
- NoticeListTypes,
107
- NoticeListQueryTypes
108
- >('/cas/msg/queryUserMsg', query, true, 'POST')
109
-
110
- onMounted(async () => {
111
- if (!props.app) {
112
- return Taro.showToast({
113
- title: 'NoticeList组件缺少appcode',
114
- icon: 'none',
115
- })
116
- }
117
-
118
- const appkitOptions = useAppKitOptions()
119
- query.value.appCode = props.app
120
- query.value.tenantId = appkitOptions.tenant()
121
- query.value.userId = props.userId
122
- await init()
123
- })
124
-
125
- // 格式化时间
126
- function formatMinutes(time: number) {
127
- if (!time) return ''
128
- const start = dayjs(time)
129
- const end = dayjs()
130
-
131
- // 使用diff方法计算差异,单位为分钟
132
- const diffInMinutes = end.diff(start, 'minute')
133
- if (diffInMinutes < 60 && diffInMinutes > 0) {
134
- return `${diffInMinutes}分钟前`
135
- }
136
-
137
- return dayjs(time).format('YYYY-MM-DD HH:mm:ss')
138
- }
139
-
140
- // 消息读取
141
- async function notifyRead(notice: any, index) {
142
- if (props.checkBeforeRead) {
143
- if (!props.checkBeforeRead(notice, index)) return
144
- }
145
-
146
- if (notice.isRead == '0') {
147
- const res = await toReadFun([notice.id])
148
-
149
- if (res) {
150
- list.value[index].isRead = '1'
151
- }
152
- }
153
- }
154
-
155
- // 点击搜索
156
- function onSearch(key: string) {
157
- delete query.value.title
158
- query.value.content = key || ''
159
- init()
160
- }
161
-
162
- // 下拉刷新
163
- const isRefresh = ref(false)
164
- async function onRefresh() {
165
- isRefresh.value = true
166
- await runRefresh()
167
- isRefresh.value = false
168
- }
169
-
170
- // 查看附件
171
- function onNoticeView(link) {
172
- emits('view', link)
173
- }
174
-
175
- const appMap = { aiapprove: 'AI审批', corporateStar: '企明星' }
176
-
177
- // 父组件事件
178
- const emits = defineEmits(['view'])
179
- </script>
180
-
181
- <style lang="scss">
182
- .notice-list {
183
- height: 100vh;
184
- overflow: hidden;
185
- display: flex;
186
- flex-direction: column;
187
- .wrapper {
188
- height: 100%;
189
- padding: 10px 12px;
190
- box-sizing: border-box;
191
- .content {
192
- height: 100%;
193
- background: #ffffff;
194
- border-radius: 10px;
195
- .card {
196
- margin: 0 10px;
197
- min-height: 64px;
198
- background: #fff;
199
- position: relative;
200
- padding: 10px;
201
- &::before {
202
- content: '';
203
- position: absolute;
204
- left: 2px;
205
- top: 0;
206
- height: 18px;
207
- width: 1px;
208
- background: #d8d8d8;
209
- }
210
- &::after {
211
- content: '';
212
- position: absolute;
213
- left: 2px;
214
- top: 18px;
215
- bottom: 0;
216
- width: 1px;
217
- background: #d8d8d8;
218
- }
219
- &:first-child::before {
220
- display: none;
221
- }
222
- &:last-child::after {
223
- display: none;
224
- }
225
- .point {
226
- width: 5px;
227
- height: 5px;
228
- background-color: #d8d8d8;
229
- border-radius: 50%;
230
- position: absolute;
231
- left: 0;
232
- top: 18px;
233
- z-index: 9;
234
- }
235
- .time {
236
- font-size: 13px;
237
- color: #353535;
238
- line-height: 19px;
239
- opacity: 0.2;
240
- margin-bottom: 5px;
241
- }
242
- .text {
243
- font-size: 14px;
244
- line-height: 20px;
245
- color: #9fa0a1;
246
- }
247
- &.active {
248
- .point {
249
- background-color: #f43309;
250
- }
251
- .text {
252
- color: #171a1d;
253
- font-size: 13px;
254
- &.tit {
255
- font-size: 15px;
256
- margin-bottom: 4px;
257
- }
258
- }
259
- .notice-list-label {
260
- opacity: 1;
261
- }
262
- .notice-list-file {
263
- opacity: 1;
264
- }
265
- }
266
- }
267
- }
268
- }
269
- .no-data {
270
- background-color: #fff;
271
- display: flex;
272
- align-items: center;
273
- flex-direction: column;
274
- height: 100%;
275
- .text {
276
- height: 20px;
277
- font-size: 14px;
278
- color: #7e7e7e;
279
- line-height: 20px;
280
- }
281
- &-img {
282
- width: 238px;
283
- height: 157px;
284
- margin-top: 105px;
285
- margin-bottom: 19px;
286
- }
287
- }
288
- &-file {
289
- font-size: 10px;
290
- color: #017fff;
291
- opacity: 0.5;
292
- }
293
- .cue-text {
294
- font-size: 13px;
295
- color: rgba(60, 60, 60, 0.5);
296
- padding: 30px 0 calc(30px + env(safe-area-inset-bottom, 0px));
297
- text-align: center;
298
- }
299
- &-label {
300
- border: 1px solid #caa264;
301
- color: #caa264;
302
- border-radius: 1px;
303
- font-size: 8px;
304
- display: inline-flex;
305
- justify-content: center;
306
- align-items: center;
307
- height: 14px;
308
- padding: 0 5px;
309
- margin-left: 4px;
310
- opacity: 0.5;
311
- }
312
- }
313
- </style>
1
+ <template>
2
+ <div class="notice-list">
3
+ <DdSearch
4
+ :bordered="false"
5
+ :focus="false"
6
+ :value="query.title"
7
+ placeholder="请输入客户姓名搜索"
8
+ @search="onSearch"
9
+ />
10
+
11
+ <div style="flex: 1; overflow: hidden">
12
+ <div class="wrapper" v-if="list.length">
13
+ <scroll-view
14
+ class="content"
15
+ :scroll-y="true"
16
+ :refresher-enabled="true"
17
+ :refresherTriggered="isRefresh"
18
+ @refresherrefresh="onRefresh"
19
+ :lower-threshold="100"
20
+ @scrolltolower="runNext"
21
+ bindscroll=""
22
+ >
23
+ <div
24
+ class="card"
25
+ :class="{ active: item.isRead != '1' }"
26
+ v-for="(item, index) in list"
27
+ :key="index"
28
+ @click="notifyRead(item, index)"
29
+ >
30
+ <div class="point"></div>
31
+ <div>
32
+ <div class="time">
33
+ {{ formatMinutes(item.receiveTime) }}
34
+ </div>
35
+ <div class="text tit" :class="{ gray: item.isRead == '1' }">
36
+ {{ item.title }}
37
+ </div>
38
+ <div class="text" :class="{ gray: item.isRead == '1' }">
39
+ <rich-text style="white-space: pre-wrap" :nodes="item.context"></rich-text>
40
+ <span
41
+ v-if="item.link && item.msgType == 3"
42
+ class="notice-list-file"
43
+ @click="onNoticeView(item.link)"
44
+ >
45
+ 查看附件
46
+ </span>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ <div v-if="isLast" class="cue-text" style="padding-bottom: 40px">没有更多了</div>
51
+ </scroll-view>
52
+ </div>
53
+ <div v-else class="no-data">
54
+ <div class="no-data-img">
55
+ <img
56
+ style="width: 100%; height: 100%"
57
+ src="https://cdn.ddjf.com/static/images/loan-manage/no-data.png"
58
+ alt=""
59
+ />
60
+ </div>
61
+ <div class="text">暂无记录</div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </template>
66
+
67
+ <script lang="ts" setup>
68
+ import { onMounted, ref } from 'vue'
69
+ import Taro from '@tarojs/taro'
70
+ import DdSearch from '../../components/dd-search/index.vue'
71
+ import dayjs from 'dayjs'
72
+ import { useNotice } from './useNotice'
73
+ import { useCommonList } from './useCommonList'
74
+ import { NoticeListQueryTypes, NoticeListTypes } from '../types'
75
+ import { useAppKitOptions } from '../../Appkit'
76
+
77
+ const props = withDefaults(
78
+ defineProps<{
79
+ app: string
80
+ userId: string
81
+ }>(),
82
+ {
83
+ app: '',
84
+ userId: '',
85
+ }
86
+ )
87
+
88
+ const query = ref<any>({
89
+ pageNum: 1,
90
+ pageSize: 15,
91
+ title: '',
92
+ deviceType: 2,
93
+ })
94
+
95
+ const { toReadFun } = useNotice()
96
+ const { list, init, runNext, runRefresh, isLast } = useCommonList<
97
+ NoticeListTypes,
98
+ NoticeListQueryTypes
99
+ >('/cas/msg/queryUserMsg', query, true, 'POST')
100
+
101
+ onMounted(async () => {
102
+ if (!props.app) {
103
+ return Taro.showToast({
104
+ title: 'NoticeList组件缺少appcode',
105
+ icon: 'none',
106
+ })
107
+ }
108
+
109
+ const appkitOptions = useAppKitOptions()
110
+ query.value.appCode = props.app
111
+ query.value.tenantId = appkitOptions.tenant()
112
+ query.value.userId = props.userId
113
+ await init()
114
+ })
115
+
116
+ // 格式化时间
117
+ function formatMinutes(time: number) {
118
+ if (!time) return ''
119
+ const start = dayjs(time)
120
+ const end = dayjs()
121
+
122
+ // 使用diff方法计算差异,单位为分钟
123
+ const diffInMinutes = end.diff(start, 'minute')
124
+ if (diffInMinutes < 60 && 0 > diffInMinutes) {
125
+ return `${diffInMinutes}分钟前`
126
+ }
127
+
128
+ return dayjs(time).format('YYYY-MM-DD HH:mm:ss')
129
+ }
130
+
131
+ // 消息读取
132
+ async function notifyRead(notice: any, index) {
133
+ if (notice.isRead == '0') {
134
+ const res = await toReadFun([notice.id])
135
+
136
+ if (res) {
137
+ list.value[index].isRead = '1'
138
+ }
139
+ }
140
+ }
141
+
142
+ // 点击搜索
143
+ function onSearch(key: string) {
144
+ delete query.value.title
145
+ query.value.content = key || ''
146
+ init()
147
+ }
148
+
149
+ // 下拉刷新
150
+ const isRefresh = ref(false)
151
+ async function onRefresh() {
152
+ isRefresh.value = true
153
+ await runRefresh()
154
+ isRefresh.value = false
155
+ }
156
+
157
+ // 查看附件
158
+ function onNoticeView(link) {
159
+ emits('view', link)
160
+ }
161
+
162
+ // 父组件事件
163
+ const emits = defineEmits(['view'])
164
+ </script>
165
+
166
+ <style lang="scss">
167
+ .notice-list {
168
+ height: 100vh;
169
+ overflow: hidden;
170
+ display: flex;
171
+ flex-direction: column;
172
+ .wrapper {
173
+ height: 100%;
174
+ padding: 10px 12px;
175
+ box-sizing: border-box;
176
+ .content {
177
+ height: 100%;
178
+ background: #ffffff;
179
+ border-radius: 10px;
180
+ .card {
181
+ margin: 0 10px;
182
+ min-height: 64px;
183
+ background: #fff;
184
+ position: relative;
185
+ padding: 10px;
186
+ &::before {
187
+ content: '';
188
+ position: absolute;
189
+ left: 2px;
190
+ top: 0;
191
+ height: 18px;
192
+ width: 1px;
193
+ background: #d8d8d8;
194
+ }
195
+ &::after {
196
+ content: '';
197
+ position: absolute;
198
+ left: 2px;
199
+ top: 18px;
200
+ bottom: 0;
201
+ width: 1px;
202
+ background: #d8d8d8;
203
+ }
204
+ &:first-child::before {
205
+ display: none;
206
+ }
207
+ &:last-child::after {
208
+ display: none;
209
+ }
210
+ .point {
211
+ width: 5px;
212
+ height: 5px;
213
+ background-color: #d8d8d8;
214
+ border-radius: 50%;
215
+ position: absolute;
216
+ left: 0;
217
+ top: 18px;
218
+ z-index: 9;
219
+ }
220
+ .time {
221
+ font-size: 13px;
222
+ color: #353535;
223
+ line-height: 19px;
224
+ opacity: 0.2;
225
+ margin-bottom: 5px;
226
+ }
227
+ .text {
228
+ font-size: 14px;
229
+ line-height: 20px;
230
+ color: #9fa0a1;
231
+ }
232
+ &.active {
233
+ .point {
234
+ background-color: #f43309;
235
+ }
236
+ .text {
237
+ color: #171a1d;
238
+ font-size: 13px;
239
+ &.tit {
240
+ font-size: 15px;
241
+ margin-bottom: 4px;
242
+ }
243
+ }
244
+ }
245
+ }
246
+ }
247
+ }
248
+ .no-data {
249
+ background-color: #fff;
250
+ display: flex;
251
+ align-items: center;
252
+ flex-direction: column;
253
+ height: 100%;
254
+ .text {
255
+ height: 20px;
256
+ font-size: 14px;
257
+ color: #7e7e7e;
258
+ line-height: 20px;
259
+ }
260
+ &-img {
261
+ width: 238px;
262
+ height: 157px;
263
+ margin-top: 105px;
264
+ margin-bottom: 19px;
265
+ }
266
+ }
267
+ &-file {
268
+ font-size: 10px;
269
+ color: #017fff;
270
+ }
271
+ .cue-text {
272
+ font-size: 13px;
273
+ color: rgba(60, 60, 60, 0.5);
274
+ padding: 30px 0 calc(30px + env(safe-area-inset-bottom, 0px));
275
+ text-align: center;
276
+ }
277
+ }
278
+ </style>