@uxda/appkit 4.0.0 → 4.0.3

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 (108) 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 +855 -36
  5. package/dist/assets/asset-DcH8Kg-2 +1 -0
  6. package/dist/index.js +3355 -610
  7. package/package.json +80 -78
  8. package/project.config.json +15 -15
  9. package/project.tt.json +13 -13
  10. package/rollup.config.mjs +56 -54
  11. package/src/Appkit.ts +65 -65
  12. package/src/balance/api/endpoints.ts +126 -126
  13. package/src/balance/api/index.ts +82 -82
  14. package/src/balance/components/AccountView.vue +748 -748
  15. package/src/balance/components/BalanceCard.vue +209 -209
  16. package/src/balance/components/BalanceReminder.vue +85 -85
  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 +226 -236
  20. package/src/balance/components/SecondBalance.vue +71 -71
  21. package/src/balance/components/Tip.vue +45 -45
  22. package/src/balance/components/index.ts +9 -9
  23. package/src/balance/types.ts +90 -90
  24. package/src/components/bt-cropper/index.vue +774 -0
  25. package/src/components/bt-cropper/utils/calcCropper.js +42 -0
  26. package/src/components/bt-cropper/utils/calcImagePosition.js +23 -0
  27. package/src/components/bt-cropper/utils/calcImageSize.js +37 -0
  28. package/src/components/bt-cropper/utils/calcPointDistance.js +12 -0
  29. package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -0
  30. package/src/components/bt-cropper/utils/ratio.js +3 -0
  31. package/src/components/bt-cropper/utils/tools.js +25 -0
  32. package/src/components/dd-area/index.vue +225 -225
  33. package/src/components/dd-icon/doc.md +21 -21
  34. package/src/components/dd-icon/index.vue +23 -23
  35. package/src/components/dd-notice-bar/index.vue +78 -78
  36. package/src/components/dd-search/doc.md +34 -34
  37. package/src/components/dd-search/index.vue +168 -168
  38. package/src/components/dd-selector/index.vue +124 -124
  39. package/src/components/dd-skeleton/doc.md +19 -0
  40. package/src/components/dd-skeleton/index.vue +36 -0
  41. package/src/components/ocr-id/index.vue +114 -114
  42. package/src/components/ocr-id/types.d.ts +12 -12
  43. package/src/global.ts +6 -6
  44. package/src/index.ts +89 -88
  45. package/src/main.scss +1 -1
  46. package/src/notice/api/endpoints.ts +17 -17
  47. package/src/notice/api/index.ts +82 -82
  48. package/src/notice/components/NoticeBanner.vue +243 -243
  49. package/src/notice/components/NoticeEntry.vue +99 -99
  50. package/src/notice/components/NoticeList.vue +315 -278
  51. package/src/notice/components/NoticePopup.vue +161 -163
  52. package/src/notice/components/index.ts +5 -6
  53. package/src/notice/components/useCommonList.ts +86 -86
  54. package/src/notice/components/useNotice.ts +35 -35
  55. package/src/notice/index.ts +1 -1
  56. package/src/notice/types.ts +25 -25
  57. package/src/payment/api/config.ts +7 -7
  58. package/src/payment/api/endpoints.ts +103 -103
  59. package/src/payment/api/index.ts +71 -71
  60. package/src/payment/components/AmountPicker.vue +93 -93
  61. package/src/payment/components/RechargeResult.vue +69 -69
  62. package/src/payment/components/RechargeView.vue +154 -154
  63. package/src/payment/components/RightsPicker.vue +105 -105
  64. package/src/payment/components/TradeView.vue +298 -298
  65. package/src/payment/components/UserAgreement.vue +234 -142
  66. package/src/payment/components/index.ts +22 -22
  67. package/src/payment/index.ts +5 -5
  68. package/src/payment/services/index.ts +16 -16
  69. package/src/payment/services/invoke-recharge.ts +25 -25
  70. package/src/payment/services/request-payment.ts +58 -58
  71. package/src/payment/types.ts +28 -28
  72. package/src/register/components/SelfRegistration.vue +254 -228
  73. package/src/register/components/index.ts +2 -2
  74. package/src/shared/components/AppDrawer.vue +58 -58
  75. package/src/shared/components/DeviceVersion.vue +68 -67
  76. package/src/shared/components/EmptyView.vue +33 -33
  77. package/src/shared/components/PageHeader.vue +79 -79
  78. package/src/shared/components/index.ts +5 -5
  79. package/src/shared/composables/index.ts +5 -2
  80. package/src/shared/composables/useCountdown.ts +46 -0
  81. package/src/shared/composables/useDragBox.ts +97 -0
  82. package/src/shared/composables/useEncode.ts +43 -0
  83. package/src/shared/composables/useSafeArea.ts +46 -46
  84. package/src/shared/composables/useTabbar.ts +24 -24
  85. package/src/shared/composables/useValidator.ts +31 -0
  86. package/src/shared/http/Http.ts +136 -135
  87. package/src/shared/http/index.ts +1 -1
  88. package/src/shared/http/types.ts +157 -157
  89. package/src/shared/index.ts +3 -3
  90. package/src/shared/weixin/payment.ts +38 -38
  91. package/src/styles/fonts.scss +2 -2
  92. package/src/styles/vars.scss +3 -3
  93. package/src/user/api/endpoints.ts +17 -0
  94. package/src/user/api/index.ts +87 -0
  95. package/src/{notice → user}/components/LoginSetting.vue +114 -112
  96. package/src/user/components/UserBinding.vue +307 -0
  97. package/src/user/components/UserBindingSuccess.vue +80 -0
  98. package/src/user/components/UserEntry.vue +142 -0
  99. package/src/user/components/UserFeedback.vue +440 -0
  100. package/src/user/components/UserFeedbackEntry.vue +192 -0
  101. package/src/user/components/UserHeadCrop.vue +65 -0
  102. package/src/user/components/UserInfo.vue +632 -0
  103. package/src/user/components/UserResourceEmpty.vue +75 -0
  104. package/src/user/components/index.ts +21 -0
  105. package/src/user/index.ts +1 -0
  106. package/tsconfig.json +30 -30
  107. package/types/global.d.ts +21 -21
  108. package/types/vue.d.ts +10 -10
@@ -1,278 +1,315 @@
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>
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
+ } else if (diffInMinutes === 0) {
136
+ return `刚刚`
137
+ }
138
+
139
+ return dayjs(time).format('YYYY-MM-DD HH:mm:ss')
140
+ }
141
+
142
+ // 消息读取
143
+ async function notifyRead(notice: any, index) {
144
+ if (props.checkBeforeRead) {
145
+ if (!props.checkBeforeRead(notice, index)) return
146
+ }
147
+
148
+ if (notice.isRead == '0') {
149
+ const res = await toReadFun([notice.id])
150
+
151
+ if (res) {
152
+ list.value[index].isRead = '1'
153
+ }
154
+ }
155
+ }
156
+
157
+ // 点击搜索
158
+ function onSearch(key: string) {
159
+ delete query.value.title
160
+ query.value.content = key || ''
161
+ init()
162
+ }
163
+
164
+ // 下拉刷新
165
+ const isRefresh = ref(false)
166
+ async function onRefresh() {
167
+ isRefresh.value = true
168
+ await runRefresh()
169
+ isRefresh.value = false
170
+ }
171
+
172
+ // 查看附件
173
+ function onNoticeView(link) {
174
+ emits('view', link)
175
+ }
176
+
177
+ const appMap = { aiapprove: 'AI审批', corporateStar: '企明星' }
178
+
179
+ // 父组件事件
180
+ const emits = defineEmits(['view'])
181
+ </script>
182
+
183
+ <style lang="scss">
184
+ .notice-list {
185
+ height: 100vh;
186
+ overflow: hidden;
187
+ display: flex;
188
+ flex-direction: column;
189
+ .wrapper {
190
+ height: 100%;
191
+ padding: 10px 12px;
192
+ box-sizing: border-box;
193
+ .content {
194
+ height: 100%;
195
+ background: #ffffff;
196
+ border-radius: 10px;
197
+ .card {
198
+ margin: 0 10px;
199
+ min-height: 64px;
200
+ background: #fff;
201
+ position: relative;
202
+ padding: 10px;
203
+ &::before {
204
+ content: '';
205
+ position: absolute;
206
+ left: 2px;
207
+ top: 0;
208
+ height: 18px;
209
+ width: 1px;
210
+ background: #d8d8d8;
211
+ }
212
+ &::after {
213
+ content: '';
214
+ position: absolute;
215
+ left: 2px;
216
+ top: 18px;
217
+ bottom: 0;
218
+ width: 1px;
219
+ background: #d8d8d8;
220
+ }
221
+ &:first-child::before {
222
+ display: none;
223
+ }
224
+ &:last-child::after {
225
+ display: none;
226
+ }
227
+ .point {
228
+ width: 5px;
229
+ height: 5px;
230
+ background-color: #d8d8d8;
231
+ border-radius: 50%;
232
+ position: absolute;
233
+ left: 0;
234
+ top: 18px;
235
+ z-index: 9;
236
+ }
237
+ .time {
238
+ font-size: 13px;
239
+ color: #353535;
240
+ line-height: 19px;
241
+ opacity: 0.2;
242
+ margin-bottom: 5px;
243
+ }
244
+ .text {
245
+ font-size: 14px;
246
+ line-height: 20px;
247
+ color: #9fa0a1;
248
+ }
249
+ &.active {
250
+ .point {
251
+ background-color: #f43309;
252
+ }
253
+ .text {
254
+ color: #171a1d;
255
+ font-size: 13px;
256
+ &.tit {
257
+ font-size: 15px;
258
+ margin-bottom: 4px;
259
+ }
260
+ }
261
+ .notice-list-label {
262
+ opacity: 1;
263
+ }
264
+ .notice-list-file {
265
+ opacity: 1;
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }
271
+ .no-data {
272
+ background-color: #fff;
273
+ display: flex;
274
+ align-items: center;
275
+ flex-direction: column;
276
+ height: 100%;
277
+ .text {
278
+ height: 20px;
279
+ font-size: 14px;
280
+ color: #7e7e7e;
281
+ line-height: 20px;
282
+ }
283
+ &-img {
284
+ width: 238px;
285
+ height: 157px;
286
+ margin-top: 105px;
287
+ margin-bottom: 19px;
288
+ }
289
+ }
290
+ &-file {
291
+ font-size: 10px;
292
+ color: var(--app-primary-color, #017fff);
293
+ opacity: 0.5;
294
+ }
295
+ .cue-text {
296
+ font-size: 13px;
297
+ color: rgba(60, 60, 60, 0.5);
298
+ padding: 30px 0 calc(30px + env(safe-area-inset-bottom, 0px));
299
+ text-align: center;
300
+ }
301
+ &-label {
302
+ border: 1px solid #caa264;
303
+ color: #caa264;
304
+ border-radius: 1px;
305
+ font-size: 8px;
306
+ display: inline-flex;
307
+ justify-content: center;
308
+ align-items: center;
309
+ height: 14px;
310
+ padding: 0 5px;
311
+ margin-left: 4px;
312
+ opacity: 0.5;
313
+ }
314
+ }
315
+ </style>