@uxda/appkit 4.2.83 → 4.2.85

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 (127) 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 +3 -8
  5. package/dist/index.js +10 -10
  6. package/package.json +80 -80
  7. package/project.config.json +15 -15
  8. package/project.tt.json +13 -13
  9. package/rollup.config.mjs +77 -77
  10. package/src/Appkit.ts +67 -67
  11. package/src/balance/api/endpoints.ts +133 -133
  12. package/src/balance/api/index.ts +112 -112
  13. package/src/balance/components/AccountView.vue +773 -773
  14. package/src/balance/components/BalanceCard.vue +210 -210
  15. package/src/balance/components/BalanceReminder.vue +84 -84
  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 +259 -259
  19. package/src/balance/components/DateRange.vue +111 -111
  20. package/src/balance/components/ListFilter.vue +62 -62
  21. package/src/balance/components/ListFilterPicker.vue +191 -191
  22. package/src/balance/components/PromoterCard.vue +310 -310
  23. package/src/balance/components/SecondBalance.vue +77 -77
  24. package/src/balance/components/Tip.vue +45 -45
  25. package/src/balance/components/index.ts +8 -8
  26. package/src/balance/types.ts +99 -99
  27. package/src/components/bt-cropper/index.vue +730 -730
  28. package/src/components/bt-cropper/utils/calcCropper.js +42 -42
  29. package/src/components/bt-cropper/utils/calcImagePosition.js +23 -23
  30. package/src/components/bt-cropper/utils/calcImageSize.js +37 -37
  31. package/src/components/bt-cropper/utils/calcPointDistance.js +12 -12
  32. package/src/components/bt-cropper/utils/calcRightAndBottom.js +7 -7
  33. package/src/components/bt-cropper/utils/ratio.js +3 -3
  34. package/src/components/bt-cropper/utils/tools.js +25 -25
  35. package/src/components/dd-area/index.vue +225 -225
  36. package/src/components/dd-icon/doc.md +21 -21
  37. package/src/components/dd-icon/index.vue +23 -23
  38. package/src/components/dd-notice-bar/index.vue +78 -78
  39. package/src/components/dd-search/doc.md +34 -34
  40. package/src/components/dd-search/index.vue +168 -168
  41. package/src/components/dd-selector/index.vue +124 -124
  42. package/src/components/dd-skeleton/doc.md +19 -19
  43. package/src/components/dd-skeleton/index.vue +36 -36
  44. package/src/global.ts +6 -6
  45. package/src/index.ts +93 -93
  46. package/src/main.scss +1 -1
  47. package/src/notice/api/endpoints.ts +54 -54
  48. package/src/notice/api/index.ts +115 -115
  49. package/src/notice/components/NoticeBanner.vue +247 -247
  50. package/src/notice/components/NoticeEntry.vue +99 -99
  51. package/src/notice/components/NoticeList.vue +311 -311
  52. package/src/notice/components/NoticeList2.vue +243 -249
  53. package/src/notice/components/NoticePopup.vue +163 -163
  54. package/src/notice/components/index.ts +6 -6
  55. package/src/notice/components/useCommonList.ts +86 -86
  56. package/src/notice/components/useNotice.ts +35 -35
  57. package/src/notice/index.ts +1 -1
  58. package/src/notice/types.ts +25 -25
  59. package/src/payment/api/config.ts +7 -7
  60. package/src/payment/api/endpoints.ts +95 -95
  61. package/src/payment/api/index.ts +101 -101
  62. package/src/payment/components/AmountPicker.vue +90 -90
  63. package/src/payment/components/RechargeResult.vue +69 -69
  64. package/src/payment/components/RechargeView.vue +190 -190
  65. package/src/payment/components/RightsPicker.vue +105 -105
  66. package/src/payment/components/TradeView.vue +363 -363
  67. package/src/payment/components/UserAgreement.vue +234 -234
  68. package/src/payment/components/index.ts +22 -22
  69. package/src/payment/index.ts +5 -5
  70. package/src/payment/services/index.ts +16 -16
  71. package/src/payment/services/invoke-recharge.ts +25 -25
  72. package/src/payment/services/request-payment.ts +130 -130
  73. package/src/payment/types.ts +32 -32
  74. package/src/register/components/SelfRegistration.vue +233 -233
  75. package/src/register/components/index.ts +2 -2
  76. package/src/scenarios/components/SharePoster.vue +364 -364
  77. package/src/scenarios/components/index.ts +2 -2
  78. package/src/scenarios/components/poster-paste.vue +93 -93
  79. package/src/scenarios/components/share-poster.md +273 -273
  80. package/src/shared/components/AppDrawer.vue +53 -53
  81. package/src/shared/components/AppVerify.vue +128 -128
  82. package/src/shared/components/DeviceVersion.vue +78 -78
  83. package/src/shared/components/EmptyView.vue +33 -33
  84. package/src/shared/components/OcrBusinessLicense.vue +137 -137
  85. package/src/shared/components/OcrIcon.vue +229 -229
  86. package/src/shared/components/PageHeader.vue +84 -84
  87. package/src/shared/components/index.ts +8 -8
  88. package/src/shared/composables/index.ts +9 -9
  89. package/src/shared/composables/useAmount.ts +46 -46
  90. package/src/shared/composables/useCountdown.ts +46 -46
  91. package/src/shared/composables/useCrypto.ts +76 -76
  92. package/src/shared/composables/useDeviceEnv.ts +11 -11
  93. package/src/shared/composables/useDragBox.ts +97 -97
  94. package/src/shared/composables/useEncode.ts +43 -43
  95. package/src/shared/composables/useLogger.ts +131 -131
  96. package/src/shared/composables/useSafeArea.ts +46 -46
  97. package/src/shared/composables/useTabbar.ts +24 -24
  98. package/src/shared/composables/useUpload.ts +61 -61
  99. package/src/shared/composables/useValidator.ts +32 -32
  100. package/src/shared/composables/useWxAuth.ts +48 -48
  101. package/src/shared/http/Http.ts +148 -148
  102. package/src/shared/http/index.ts +1 -1
  103. package/src/shared/http/types.ts +163 -163
  104. package/src/shared/index.ts +8 -8
  105. package/src/shared/weixin/index.ts +9 -9
  106. package/src/shared/weixin/jssdk.ts +103 -103
  107. package/src/shared/weixin/payment.ts +38 -38
  108. package/src/styles/vars.scss +3 -3
  109. package/src/user/api/endpoints.ts +17 -17
  110. package/src/user/api/index.ts +117 -117
  111. package/src/user/components/LoginSetting.vue +114 -114
  112. package/src/user/components/UserAuth.vue +220 -220
  113. package/src/user/components/UserBinding.vue +277 -277
  114. package/src/user/components/UserBindingSuccess.vue +80 -80
  115. package/src/user/components/UserEntry.vue +139 -139
  116. package/src/user/components/UserFeedback.vue +427 -427
  117. package/src/user/components/UserFeedbackEntry.vue +175 -175
  118. package/src/user/components/UserHeadCrop.vue +65 -65
  119. package/src/user/components/UserInfo.vue +708 -708
  120. package/src/user/components/UserResourceEmpty.vue +75 -75
  121. package/src/user/components/index.ts +23 -23
  122. package/src/user/index.ts +1 -1
  123. package/src/utils/utils.ts +28 -28
  124. package/tsconfig.json +30 -30
  125. package/types/global.d.ts +22 -22
  126. package/types/vue.d.ts +10 -10
  127. /package/dist/assets/{asset-DcH8Kg-2 → asset-3B_CoPto} +0 -0
@@ -1,249 +1,243 @@
1
- <template>
2
- <ns-page class="news-list">
3
- <div class="tabContainer" :class="{ inH5: isWeb() }">
4
- <!-- <ns-search
5
- v-track-search="{
6
- trackInput: false,
7
- trackSubmit: true,
8
- minLength: 2,
9
- }"
10
- style="margin: 0 12px"
11
- placeholder="请输入关键字搜索"
12
- v-model="state.search"
13
- ></ns-search> -->
14
- <ns-tabs v-model="state.tab" fill="#fff" square size="xl" style="height: 46px" @change="onTabChange">
15
- <ns-tabs-item key="全部" tab="全部"></ns-tabs-item>
16
- <ns-tabs-item key="业务消息" tab="业务消息"></ns-tabs-item>
17
- <ns-tabs-item key="系统公告" tab="系统公告"></ns-tabs-item>
18
- <ns-tabs-item key="未读" tab="未读"></ns-tabs-item>
19
- </ns-tabs>
20
- <div v-if="state.list.length > 0" class="read-all">
21
- <div v-track-click="'click'" class="btn" @click="readAll">全部已读</div>
22
- </div>
23
- </div>
24
- <ns-page-content class="mt-68px" scrollable refreshable :refresh-triggered="isRefresh"
25
- @pull-down-refresh="onRefresh" @bottom-reached="nextPage">
26
- <ns-skeleton :row="8" v-if="显示骨架屏" />
27
-
28
- <template v-else>
29
- <ns-repeator v-slot="item" align="stretch" direction="column" :gap="10" :data="state.list"
30
- :show-no-more="paging.isLastPage">
31
- <ns-card v-track-click="{
32
- event: 'click',
33
- elementText: '消息详情',
34
- }" :r="5" fill="#fff" class="news-item w-full" @click="itemClick(item)">
35
- <div v-if="item.标题" :style="{ color: item.已读 ? '#35353599' : '#353535' }" class="news-item-title">
36
- <img v-if="item.是公告" class="news-item-title-icon"
37
- src="https://cdn.ddjf.com/static/images/loan-manage-app/ic_msg_system_notice.webp" />
38
- {{ item.标题 }}
39
- </div>
40
- <nut-ellipsis :style="{ color: item.已读 ? '#35353566' : '#353535CC' }" class="news-item-content"
41
- direction="end" rows="3" expand-text="展开" collapse-text="收起" :content="item.内容"></nut-ellipsis>
42
- <div class="news-item-time">{{ item.时间 }}</div>
43
- </ns-card>
44
- </ns-repeator>
45
- <ns-empty v-if="state.list.length == 0" />
46
- <div class="safe-area-space"></div>
47
- </template>
48
- </ns-page-content>
49
- </ns-page>
50
- </template>
51
-
52
- <script setup lang="ts">
53
- import { useDidShow } from '@tarojs/taro'
54
- import Taro from '@tarojs/taro'
55
- import { type WithPaging, usePaging } from '@uxda/nutshell/taro'
56
- import { useHttp, endpoints } from '../api'
57
- import { reactive, ref } from 'vue'
58
- import { useAppKitOptions } from '../../Appkit'
59
- import {
60
- NsTabs,
61
- NsTabsItem,
62
- NsRepeator,
63
- NsCard,
64
- NsPage,
65
- NsPageContent,
66
- NsSkeleton,
67
- NsEmpty,
68
- } from "@uxda/nutshell/taro";
69
- import { isWeb } from '../../utils/utils';
70
-
71
- const props = withDefaults(
72
- defineProps<{
73
- deviceType?: string;
74
- userId: string;
75
- app: string;
76
- }>(),
77
- {
78
- deviceType: "2",
79
- userId: "",
80
- app: "",
81
- }
82
- );
83
-
84
- const $http = useHttp(),
85
- 显示骨架屏 = ref(true)
86
-
87
- useDidShow(() => {
88
- nextPage(1)
89
- })
90
- const state = reactive({
91
- search: '',
92
- tab: '全部',
93
- list: [] as any[],
94
- })
95
-
96
- async function load(page: number) {
97
- if (!props.app?.replace(',cloudkitPro', '')) {
98
- state.list = []
99
- return { paging: { page: 1, pageSize: 10, total: 0 }, data: [] }
100
- }
101
-
102
- const appkitOptions = useAppKitOptions()
103
- const data = {
104
- page,
105
- pageSize: 10,
106
- appCode: props.app,
107
- tenantId: appkitOptions.tenant(),
108
- userId: props.userId,
109
- deviceType: props.deviceType,
110
- readOrderStatus: '1',
111
- }
112
-
113
- if (state.tab == '业务消息') {
114
- data['msgType'] = '1'
115
- } else if (state.tab == '系统公告') {
116
- data['msgType'] = '3'
117
- }
118
-
119
- if (state.tab == '未读') {
120
- data['isRead'] = '0'
121
- }
122
-
123
- const ep = endpoints['消息列表']
124
- return $http.post<WithPaging<any[]>>(ep, data).then((res) => {
125
- 显示骨架屏.value = false
126
- if (page === 1) {
127
- state.list = []
128
- }
129
- state.list = [...state.list, ...res.data]
130
- return { paging: res.paging, data: res.data }
131
- })
132
- }
133
-
134
- const { paging, nextPage } = usePaging(load)
135
-
136
- function onTabChange() {
137
- 显示骨架屏.value = true
138
- nextPage(1)
139
- }
140
-
141
- const isRefresh = ref(false)
142
- async function onRefresh() {
143
- isRefresh.value = true
144
- await nextPage(1)
145
- isRefresh.value = false
146
- }
147
-
148
- function itemClick(item: any) {
149
- read(item)
150
-
151
- emits('itemClick', item)
152
- }
153
-
154
- function read(item: any) {
155
- if (item.isRead == '1') return
156
- const ep = endpoints['已读']
157
- $http.post(ep, [item.id]).then(() => {
158
- item['已读'] = true
159
- })
160
- }
161
-
162
- async function readAll() {
163
- try {
164
- Taro.showLoading({
165
- title: '请稍后...',
166
- })
167
-
168
- const appkitOptions = useAppKitOptions()
169
- const ep = endpoints['全部已读']
170
- const data = {
171
- tenantId: appkitOptions.tenant(),
172
- userId: props.userId,
173
- deviceType: props.deviceType,
174
- }
175
- $http.post(ep, data).then(() => {
176
- state.list.forEach((item) => {
177
- item['已读'] = true
178
- })
179
- })
180
- } finally {
181
- Taro.hideLoading()
182
- }
183
- }
184
-
185
- const emits = defineEmits(['itemClick'])
186
-
187
- defineExpose({
188
- readAll,
189
- })
190
- </script>
191
-
192
- <style lang="scss">
193
- .news-list {
194
- .safe-area-space {
195
- padding-bottom: calc(var(--bottom) + 60px);
196
- padding-bottom: calc(env(safe-area-inset-bottom) + 60px);
197
- }
198
-
199
- .tabContainer {
200
- &.inH5 {
201
- width: 100%;
202
- position: fixed;
203
- z-index: 100;
204
- }
205
-
206
- .read-all {
207
- width: 100%;
208
- text-align: end;
209
- height: 22px;
210
- line-height: 22px;
211
- padding: 5px 0;
212
- background-color: var(--fill, var(--ns-background));
213
-
214
- .btn {
215
- color: #017fff;
216
- font-size: 14px;
217
- font-weight: 500;
218
- margin-right: 16px;
219
- }
220
- }
221
- }
222
-
223
- .news-item {
224
- &-title {
225
- font-size: 16px;
226
- font-weight: 500;
227
- display: flex;
228
- flex-direction: row;
229
- align-items: center;
230
-
231
- &-icon {
232
- width: 20px;
233
- height: 20px;
234
- margin-right: 4px;
235
- }
236
- }
237
-
238
- &-content {
239
- font-size: 14px;
240
- }
241
-
242
- &-time {
243
- font-size: 13px;
244
- color: #35353566;
245
- text-align: end;
246
- }
247
- }
248
- }
249
- </style>
1
+ <template>
2
+ <ns-page class="news-list">
3
+ <div class="tabContainer" :class="{ inH5: isWeb() }">
4
+ <!-- <ns-search
5
+ v-track-search="{
6
+ trackInput: false,
7
+ trackSubmit: true,
8
+ minLength: 2,
9
+ }"
10
+ style="margin: 0 12px"
11
+ placeholder="请输入关键字搜索"
12
+ v-model="state.search"
13
+ ></ns-search> -->
14
+ <ns-tabs v-model="state.tab" fill="#fff" square size="xl" style="height: 46px" @change="onTabChange">
15
+ <ns-tabs-item key="全部" tab="全部"></ns-tabs-item>
16
+ <ns-tabs-item key="业务消息" tab="业务消息"></ns-tabs-item>
17
+ <ns-tabs-item key="系统公告" tab="系统公告"></ns-tabs-item>
18
+ <ns-tabs-item key="未读" tab="未读"></ns-tabs-item>
19
+ </ns-tabs>
20
+ <div v-if="state.list.length > 0" class="read-all">
21
+ <div v-track-click="'click'" class="btn" @click="readAll">全部已读</div>
22
+ </div>
23
+ </div>
24
+ <ns-page-content class="mt-68px" scrollable refreshable :refresh-triggered="isRefresh"
25
+ @pull-down-refresh="onRefresh" @bottom-reached="nextPage">
26
+ <ns-skeleton :row="8" v-if="显示骨架屏" />
27
+
28
+ <template v-else>
29
+ <ns-repeator v-slot="item" align="stretch" direction="column" :gap="10" :data="state.list"
30
+ :show-no-more="paging.isLastPage">
31
+ <ns-card v-track-click="{
32
+ event: 'click',
33
+ elementText: '消息详情',
34
+ }" :r="5" fill="#fff" class="news-item w-full" @click="itemClick(item)">
35
+ <div v-if="item.标题" :style="{ color: item.已读 ? '#35353599' : '#353535' }" class="news-item-title">
36
+ <img v-if="item.是公告" class="news-item-title-icon"
37
+ src="https://cdn.ddjf.com/static/images/loan-manage-app/ic_msg_system_notice.webp" />
38
+ {{ item.标题 }}
39
+ </div>
40
+ <nut-ellipsis :style="{ color: item.已读 ? '#35353566' : '#353535CC' }" class="news-item-content"
41
+ direction="end" rows="3" expand-text="展开" collapse-text="收起" :content="item.内容"></nut-ellipsis>
42
+ <div class="news-item-time">{{ item.时间 }}</div>
43
+ </ns-card>
44
+ </ns-repeator>
45
+ <ns-empty v-if="state.list.length == 0" />
46
+ <div class="safe-area-space"></div>
47
+ </template>
48
+ </ns-page-content>
49
+ </ns-page>
50
+ </template>
51
+
52
+ <script setup lang="ts">
53
+ import { useDidShow } from '@tarojs/taro'
54
+ import Taro from '@tarojs/taro'
55
+ import { type WithPaging, usePaging } from '@uxda/nutshell/taro'
56
+ import { useHttp, endpoints } from '../api'
57
+ import { reactive, ref } from 'vue'
58
+ import { useAppKitOptions } from '../../Appkit'
59
+ import {
60
+ NsTabs,
61
+ NsTabsItem,
62
+ NsRepeator,
63
+ NsCard,
64
+ NsPage,
65
+ NsPageContent,
66
+ NsSkeleton,
67
+ NsEmpty,
68
+ } from "@uxda/nutshell/taro";
69
+ import { isWeb } from '../../utils/utils';
70
+
71
+ const props = withDefaults(
72
+ defineProps<{
73
+ deviceType?: string;
74
+ userId: string;
75
+ app: string;
76
+ }>(),
77
+ {
78
+ deviceType: "2",
79
+ userId: "",
80
+ app: "",
81
+ }
82
+ );
83
+
84
+ const $http = useHttp(),
85
+ 显示骨架屏 = ref(true)
86
+
87
+ useDidShow(() => {
88
+ nextPage(1)
89
+ })
90
+ const state = reactive({
91
+ search: '',
92
+ tab: '全部',
93
+ list: [] as any[],
94
+ })
95
+
96
+ async function load(page: number) {
97
+ if (!props.app?.replace(',cloudkitPro', '')) {
98
+ state.list = []
99
+ return { paging: { page: 1, pageSize: 10, total: 0 }, data: [] }
100
+ }
101
+
102
+ const appkitOptions = useAppKitOptions()
103
+ const data = {
104
+ page,
105
+ pageSize: 10,
106
+ appCode: props.app,
107
+ tenantId: appkitOptions.tenant(),
108
+ userId: props.userId,
109
+ deviceType: props.deviceType,
110
+ readOrderStatus: '1',
111
+ }
112
+
113
+ if (state.tab == '业务消息') {
114
+ data['msgType'] = '1'
115
+ } else if (state.tab == '系统公告') {
116
+ data['msgType'] = '3'
117
+ }
118
+
119
+ if (state.tab == '未读') {
120
+ data['isRead'] = '0'
121
+ }
122
+
123
+ const ep = endpoints['消息列表']
124
+ return $http.post<WithPaging<any[]>>(ep, data).then((res) => {
125
+ 显示骨架屏.value = false
126
+ if (page === 1) {
127
+ state.list = []
128
+ }
129
+ state.list = [...state.list, ...res.data]
130
+ return { paging: res.paging, data: res.data }
131
+ })
132
+ }
133
+
134
+ const { paging, nextPage } = usePaging(load)
135
+
136
+ function onTabChange() {
137
+ 显示骨架屏.value = true
138
+ nextPage(1)
139
+ }
140
+
141
+ const isRefresh = ref(false)
142
+ async function onRefresh() {
143
+ isRefresh.value = true
144
+ await nextPage(1)
145
+ isRefresh.value = false
146
+ }
147
+
148
+ function itemClick(item: any) {
149
+ read(item)
150
+
151
+ emits('itemClick', item)
152
+ }
153
+
154
+ function read(item: any) {
155
+ if (item.isRead == '1') return
156
+ const ep = endpoints['已读']
157
+ $http.post(ep, [item.id]).then(() => {
158
+ item['已读'] = true
159
+ })
160
+ }
161
+
162
+ async function readAll() {
163
+ try {
164
+ Taro.showLoading({
165
+ title: '请稍后...',
166
+ })
167
+
168
+ const appkitOptions = useAppKitOptions()
169
+ const ep = endpoints['全部已读']
170
+ const data = {
171
+ tenantId: appkitOptions.tenant(),
172
+ userId: props.userId,
173
+ deviceType: props.deviceType,
174
+ }
175
+ $http.post(ep, data).then(() => {
176
+ state.list.forEach((item) => {
177
+ item['已读'] = true
178
+ })
179
+ })
180
+ } finally {
181
+ Taro.hideLoading()
182
+ }
183
+ }
184
+
185
+ const emits = defineEmits(['itemClick'])
186
+
187
+ defineExpose({
188
+ readAll,
189
+ })
190
+ </script>
191
+
192
+ <style lang="scss">
193
+ .news-list {
194
+ .safe-area-space {
195
+ padding-bottom: calc(var(--bottom) + 60px);
196
+ padding-bottom: calc(env(safe-area-inset-bottom) + 60px);
197
+ }
198
+
199
+ .tabContainer {
200
+ .read-all {
201
+ width: 100%;
202
+ text-align: end;
203
+ height: 22px;
204
+ line-height: 22px;
205
+ padding: 5px 0;
206
+ background-color: var(--fill, var(--ns-background));
207
+
208
+ .btn {
209
+ color: #017fff;
210
+ font-size: 14px;
211
+ font-weight: 500;
212
+ margin-right: 16px;
213
+ }
214
+ }
215
+ }
216
+
217
+ .news-item {
218
+ &-title {
219
+ font-size: 16px;
220
+ font-weight: 500;
221
+ display: flex;
222
+ flex-direction: row;
223
+ align-items: center;
224
+
225
+ &-icon {
226
+ width: 20px;
227
+ height: 20px;
228
+ margin-right: 4px;
229
+ }
230
+ }
231
+
232
+ &-content {
233
+ font-size: 14px;
234
+ }
235
+
236
+ &-time {
237
+ font-size: 13px;
238
+ color: #35353566;
239
+ text-align: end;
240
+ }
241
+ }
242
+ }
243
+ </style>