@uxda/appkit 4.3.15 → 4.3.17

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 (32) hide show
  1. package/dist/appkit.css +105 -12
  2. package/dist/index.js +1110 -414
  3. package/package.json +2 -5
  4. package/src/balance/api/index.ts +2 -2
  5. package/src/balance/components/PromoterCard.vue +1 -0
  6. package/src/notice/api/index.ts +2 -2
  7. package/src/notice/components/NoticeList2.vue +234 -73
  8. package/src/notice/components/useCommonList.ts +1 -0
  9. package/src/payment/api/endpoints.ts +2 -0
  10. package/src/payment/api/index.ts +4 -2
  11. package/src/payment/components/RechargeResult.vue +0 -1
  12. package/src/payment/components/TradeView.vue +313 -108
  13. package/src/payment/services/request-payment.ts +9 -3
  14. package/src/payment/types.ts +1 -0
  15. package/src/register/components/SelfRegistration.vue +1 -1
  16. package/src/shared/components/AppVerify.vue +15 -6
  17. package/src/shared/components/OcrBank.vue +202 -0
  18. package/src/shared/components/OcrBusinessLicense.vue +20 -37
  19. package/src/shared/components/OcrIcon.vue +105 -67
  20. package/src/shared/components/OcrInvoice.vue +322 -0
  21. package/src/shared/components/index.ts +3 -1
  22. package/src/shared/composables/index.ts +1 -0
  23. package/src/shared/composables/useCompress.ts +64 -0
  24. package/src/shared/composables/useUpload.ts +96 -51
  25. package/src/shared/http/Http.ts +1 -0
  26. package/src/shared/tracking/tracking-sdk.ts +0 -1
  27. package/src/shared/weixin/jssdk.ts +1 -0
  28. package/src/user/api/index.ts +2 -2
  29. package/src/user/components/UserAuth.vue +1 -1
  30. package/src/user/components/UserFeedback.vue +1 -0
  31. package/src/user/components/UserInfo.vue +2 -0
  32. package/types/global.d.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.3.15",
3
+ "version": "4.3.17",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -34,7 +34,7 @@
34
34
  "@tarojs/shared": "^4.1.7",
35
35
  "@tarojs/taro": "^4.1.7",
36
36
  "@types/wechat-miniprogram": "^3.4.7",
37
- "@uxda/nutshell": "^1.0.0",
37
+ "@uxda/nutshell": "^1.6.98",
38
38
  "dayjs": "^1.11.18",
39
39
  "dsbridge": "^3.1.4",
40
40
  "lodash-es": "^4.17.21",
@@ -75,8 +75,5 @@
75
75
  "unplugin-auto-import": "^20.2.0",
76
76
  "unplugin-vue-components": "^29.1.0",
77
77
  "webpack": "^5.78.0"
78
- },
79
- "peerDependencies": {
80
- "@uxda/nutshell": "^1.0.0"
81
78
  }
82
79
  }
@@ -40,7 +40,7 @@ const vendor = {
40
40
  duration: endTime - startTime,
41
41
  })
42
42
 
43
- if (data.success) {
43
+ if (data.success || data.code === '401') {
44
44
  resolve({
45
45
  status: +data.code,
46
46
  message: data.msg,
@@ -65,7 +65,7 @@ function useHttp() {
65
65
  const headers = {
66
66
  Token: appkitOptions.tempToken() || appkitOptions.token(),
67
67
  Appcode: appkitOptions.app(),
68
- cookie: `tid=${appkitOptions.tenant()}`,
68
+ tid: appkitOptions.tenant(),
69
69
  gray: appkitOptions.gray ? appkitOptions.gray() : '0',
70
70
  }
71
71
  /**
@@ -152,6 +152,7 @@ function onHelpClick(type: string) {
152
152
  showModal({
153
153
  content: toastMap[type],
154
154
  showCancel: false,
155
+ confirmColor: '#017fff',
155
156
  confirmText: '知道了',
156
157
  })
157
158
  }
@@ -40,7 +40,7 @@ const vendor = {
40
40
  duration: endTime - startTime,
41
41
  })
42
42
 
43
- if (data.success) {
43
+ if (data.success || data.code === '401') {
44
44
  resolve({
45
45
  status: +data.code,
46
46
  message: data.msg,
@@ -65,7 +65,7 @@ function useHttp() {
65
65
  const headers = {
66
66
  Token: appkitOptions.tempToken() || appkitOptions.token(),
67
67
  Appcode: appkitOptions.app(),
68
- cookie: `tid=${appkitOptions.tenant()}`,
68
+ tid: appkitOptions.tenant(),
69
69
  gray: appkitOptions.gray ? appkitOptions.gray() : '0',
70
70
  }
71
71
  /**
@@ -1,41 +1,106 @@
1
1
  <template>
2
2
  <ns-page class="news-list">
3
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">
4
+ <!-- <ns-tabs
5
+ v-model="state.tab"
6
+ fill="#fff"
7
+ square
8
+ size="xl"
9
+ style="height: 46px"
10
+ @change="onTabChange"
11
+ >
15
12
  <ns-tabs-item key="全部" tab="全部"></ns-tabs-item>
16
13
  <ns-tabs-item key="业务消息" tab="业务消息"></ns-tabs-item>
17
14
  <ns-tabs-item key="系统公告" tab="系统公告"></ns-tabs-item>
18
15
  <ns-tabs-item key="未读" tab="未读"></ns-tabs-item>
16
+ </ns-tabs> -->
17
+ <ns-tabs
18
+ v-model="state.tab"
19
+ fill="#fff"
20
+ square
21
+ size="xl"
22
+ style="height: 46px"
23
+ class="news-tab"
24
+ :items="tabList"
25
+ >
26
+ <template #titles>
27
+ <div
28
+ v-for="item in tabList"
29
+ :class="{ customLine: state.tab === item.value }"
30
+ :key="item.value"
31
+ class="nut-tabs__titles-item custom-tab-item"
32
+ @click="
33
+ state.tab = item.value;
34
+ onTabChange();
35
+ "
36
+ >
37
+ <div
38
+ class="custom-title"
39
+ :class="{ active: state.tab === item.value }"
40
+ >
41
+ <div>{{ item.label }}</div>
42
+ <div
43
+ class="custom-title-dot"
44
+ v-if="item.value === '未读' && noticeShow"
45
+ >
46
+ •••
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </template>
19
51
  </ns-tabs>
52
+
20
53
  <div v-if="state.list.length > 0" class="read-all">
21
- <div v-track-click class="btn" @click="readAll">全部已读</div>
54
+ <div v-track-click class="btn" @click="readAll">全部已读</div>
22
55
  </div>
23
56
  </div>
24
- <ns-page-content class="mt-68px" scrollable refreshable :refresh-triggered="isRefresh"
25
- @pull-down-refresh="onRefresh" @bottom-reached="nextPage">
57
+ <ns-page-content
58
+ class="mt-68px"
59
+ scrollable
60
+ refreshable
61
+ :refresh-triggered="isRefresh"
62
+ @pull-down-refresh="onRefresh"
63
+ @bottom-reached="nextPage"
64
+ >
26
65
  <ns-skeleton :row="8" v-if="显示骨架屏" />
27
66
 
28
67
  <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="'消息详情'" :r="5" fill="#fff" class="news-item w-full" @click="itemClick(item)">
32
- <div v-if="item.标题" :style="{ color: item.已读 ? '#35353599' : '#353535' }" class="news-item-title">
33
- <img v-if="item.是公告" class="news-item-title-icon"
34
- src="https://cdn.ddjf.com/static/images/loan-manage-app/ic_msg_system_notice.webp" />
68
+ <ns-repeator
69
+ v-slot="item"
70
+ align="stretch"
71
+ direction="column"
72
+ :gap="10"
73
+ :data="state.list"
74
+ :show-no-more="paging.isLastPage"
75
+ >
76
+ <ns-card
77
+ v-track-click="'消息详情'"
78
+ :r="5"
79
+ fill="#fff"
80
+ class="news-item w-full"
81
+ @click="itemClick(item)"
82
+ >
83
+ <div
84
+ v-if="item.标题"
85
+ :style="{ color: item.已读 ? '#35353599' : '#353535' }"
86
+ class="news-item-title"
87
+ >
88
+ <img
89
+ v-if="item.是公告"
90
+ class="news-item-title-icon"
91
+ src="https://cdn.ddjf.com/static/images/fnfundkit/ic_msg_system_notice.png"
92
+ />
35
93
  {{ item.标题 }}
36
94
  </div>
37
- <nut-ellipsis :style="{ color: item.已读 ? '#35353566' : '#353535CC' }" class="news-item-content"
38
- direction="end" rows="3" expand-text="展开" collapse-text="收起" :content="item.内容"></nut-ellipsis>
95
+ <nut-ellipsis
96
+ :style="{ color: item.已读 ? '#35353566' : '#353535CC' }"
97
+ class="news-item-content"
98
+ direction="end"
99
+ rows="3"
100
+ expand-text="展开"
101
+ collapse-text="收起"
102
+ :content="item.内容"
103
+ ></nut-ellipsis>
39
104
  <div class="news-item-time">{{ item.时间 }}</div>
40
105
  </ns-card>
41
106
  </ns-repeator>
@@ -47,12 +112,12 @@
47
112
  </template>
48
113
 
49
114
  <script setup lang="ts">
50
- import { useDidShow } from '@tarojs/taro'
51
- import { showLoading, hideLoading } from '@tarojs/taro'
52
- import { type WithPaging, usePaging } from '@uxda/nutshell/taro'
53
- import { useHttp, endpoints } from '../api'
54
- import { reactive, ref } from 'vue'
55
- import { useAppKitOptions } from '../../Appkit'
115
+ import { useDidShow } from '@tarojs/taro';
116
+ import { showLoading, hideLoading } from '@tarojs/taro';
117
+ import { type WithPaging, usePaging } from '@uxda/nutshell/taro';
118
+ import { useHttp, endpoints } from '../api';
119
+ import { reactive, ref } from 'vue';
120
+ import { useAppKitOptions } from '../../Appkit';
56
121
  import {
57
122
  NsTabs,
58
123
  NsTabsItem,
@@ -62,7 +127,7 @@ import {
62
127
  NsPageContent,
63
128
  NsSkeleton,
64
129
  NsEmpty,
65
- } from "@uxda/nutshell/taro";
130
+ } from '@uxda/nutshell/taro';
66
131
  import { isWeb } from '../../utils/utils';
67
132
 
68
133
  const props = withDefaults(
@@ -72,31 +137,56 @@ const props = withDefaults(
72
137
  app: string;
73
138
  }>(),
74
139
  {
75
- deviceType: "2",
76
- userId: "",
77
- app: "",
140
+ deviceType: '2',
141
+ userId: '',
142
+ app: '',
78
143
  }
79
144
  );
80
145
 
146
+ interface tabListType {
147
+ label: string;
148
+ value: string;
149
+ hasRead?: boolean;
150
+ }
151
+ const tabList = ref<tabListType[]>([
152
+ {
153
+ label: '全部',
154
+ value: '全部',
155
+ },
156
+ {
157
+ label: '业务消息',
158
+ value: '业务消息',
159
+ },
160
+ {
161
+ label: '系统公告',
162
+ value: '系统公告',
163
+ },
164
+ {
165
+ label: '未读',
166
+ value: '未读',
167
+ },
168
+ ]);
169
+
81
170
  const $http = useHttp(),
82
- 显示骨架屏 = ref(true)
171
+ 显示骨架屏 = ref(true);
83
172
 
84
173
  useDidShow(() => {
85
- nextPage(1)
86
- })
174
+ nextPage(1);
175
+ getNotice();
176
+ });
87
177
  const state = reactive({
88
178
  search: '',
89
179
  tab: '全部',
90
180
  list: [] as any[],
91
- })
181
+ });
92
182
 
93
183
  async function load(page: number) {
94
184
  if (!props.app?.replace(',cloudkitPro', '')) {
95
- state.list = []
96
- return { paging: { page: 1, pageSize: 10, total: 0 }, data: [] }
185
+ state.list = [];
186
+ return { paging: { page: 1, pageSize: 10, total: 0 }, data: [] };
97
187
  }
98
188
 
99
- const appkitOptions = useAppKitOptions()
189
+ const appkitOptions = useAppKitOptions();
100
190
  const data = {
101
191
  page,
102
192
  pageSize: 10,
@@ -105,85 +195,109 @@ async function load(page: number) {
105
195
  userId: props.userId,
106
196
  deviceType: props.deviceType,
107
197
  readOrderStatus: '1',
108
- }
198
+ };
109
199
 
110
200
  if (state.tab == '业务消息') {
111
- data['msgType'] = '1'
201
+ data['msgType'] = '1';
112
202
  } else if (state.tab == '系统公告') {
113
- data['msgType'] = '3'
203
+ data['msgType'] = '3';
114
204
  }
115
205
 
116
206
  if (state.tab == '未读') {
117
- data['isRead'] = '0'
207
+ data['isRead'] = '0';
118
208
  }
119
209
 
120
- const ep = endpoints['消息列表']
210
+ const ep = endpoints['消息列表'];
121
211
  return $http.post<WithPaging<any[]>>(ep, data).then((res) => {
122
- 显示骨架屏.value = false
212
+ 显示骨架屏.value = false;
123
213
  if (page === 1) {
124
- state.list = []
214
+ state.list = [];
125
215
  }
126
- state.list = [...state.list, ...res.data]
127
- return { paging: res.paging, data: res.data }
128
- })
216
+ state.list = [...state.list, ...res.data];
217
+ return { paging: res.paging, data: res.data };
218
+ });
129
219
  }
130
220
 
131
- const { paging, nextPage } = usePaging(load)
221
+ const { paging, nextPage } = usePaging(load);
132
222
 
133
223
  function onTabChange() {
134
- 显示骨架屏.value = true
135
- nextPage(1)
224
+ 显示骨架屏.value = true;
225
+ nextPage(1);
136
226
  }
137
227
 
138
- const isRefresh = ref(false)
228
+ const isRefresh = ref(false);
139
229
  async function onRefresh() {
140
- isRefresh.value = true
141
- await nextPage(1)
142
- isRefresh.value = false
230
+ isRefresh.value = true;
231
+ await nextPage(1);
232
+ isRefresh.value = false;
143
233
  }
144
234
 
145
235
  function itemClick(item: any) {
146
- read(item)
147
-
148
- emits('itemClick', item)
236
+ read(item);
237
+ getNotice();
238
+ emits('itemClick', item);
149
239
  }
150
240
 
151
241
  function read(item: any) {
152
- if (item.isRead == '1') return
153
- const ep = endpoints['已读']
242
+ if (item.isRead == '1') return;
243
+ const ep = endpoints['已读'];
154
244
  $http.post(ep, [item.id]).then(() => {
155
- item['已读'] = true
156
- })
245
+ item['已读'] = true;
246
+ });
157
247
  }
158
248
 
159
249
  async function readAll() {
160
250
  try {
161
251
  showLoading({
162
252
  title: '请稍后...',
163
- })
253
+ mask: true,
254
+ });
164
255
 
165
- const appkitOptions = useAppKitOptions()
166
- const ep = endpoints['全部已读']
256
+ const appkitOptions = useAppKitOptions();
257
+ const ep = endpoints['全部已读'];
167
258
  const data = {
168
259
  tenantId: appkitOptions.tenant(),
169
260
  userId: props.userId,
170
261
  deviceType: props.deviceType,
171
- }
262
+ };
172
263
  $http.post(ep, data).then(() => {
173
264
  state.list.forEach((item) => {
174
- item['已读'] = true
175
- })
176
- })
265
+ item['已读'] = true;
266
+ });
267
+ });
177
268
  } finally {
178
- hideLoading()
269
+ setTimeout(() => {
270
+ getNotice();
271
+ }, 300);
272
+ hideLoading();
179
273
  }
180
274
  }
181
275
 
182
- const emits = defineEmits(['itemClick'])
276
+ // 通知红点
277
+ const noticeShow = ref(false);
278
+ async function getNotice() {
279
+ const appkitOptions = useAppKitOptions();
280
+ const $http = useHttp();
281
+
282
+ $http
283
+ .get('/cas/msg/count-unread', {
284
+ deviceType: 2,
285
+ appCode: props.app,
286
+ tenantId: appkitOptions.tenant(),
287
+ userId: props.userId,
288
+ })
289
+ .then((result: any) => {
290
+ if (typeof result === 'object') return;
291
+
292
+ noticeShow.value = result > 0;
293
+ });
294
+ }
295
+
296
+ const emits = defineEmits(['itemClick']);
183
297
 
184
298
  defineExpose({
185
299
  readAll,
186
- })
300
+ });
187
301
  </script>
188
302
 
189
303
  <style lang="scss">
@@ -237,4 +351,51 @@ defineExpose({
237
351
  }
238
352
  }
239
353
  }
354
+ .news-tab {
355
+ .nut-tabs__list {
356
+ display: flex;
357
+ }
358
+ .custom-tab-item {
359
+ flex: 1;
360
+ display: flex;
361
+ flex-direction: column;
362
+ justify-content: center;
363
+ align-items: center;
364
+ padding: 10px;
365
+ }
366
+ .customLine {
367
+ position: relative;
368
+ }
369
+ .customLine::after {
370
+ content: '';
371
+ position: absolute;
372
+ width: 50px;
373
+ height: 2px;
374
+ background: #017fff;
375
+ bottom: 0;
376
+ left: 50%;
377
+ transform: translateX(-50%);
378
+ }
379
+ .custom-title {
380
+ color: #8a8a8a;
381
+ font-size: 15px;
382
+ display: flex;
383
+ align-items: center;
384
+ &-dot {
385
+ height: 12px;
386
+ line-height: 12px;
387
+ padding: 0 6px;
388
+ color: #fff;
389
+ border-radius: 8px;
390
+ background: #e04747;
391
+ margin-left: 2px;
392
+ font-size: 9px;
393
+ }
394
+ }
395
+ .custom-title.active {
396
+ color: #017fff;
397
+ font-weight: 600;
398
+ font-size: 17px;
399
+ }
400
+ }
240
401
  </style>
@@ -30,6 +30,7 @@ export function useCommonList<R, Q extends QueryLimit>(
30
30
  loading &&
31
31
  showLoading({
32
32
  title: '加载中...',
33
+ mask: true,
33
34
  })
34
35
  isLoading.value = true
35
36
 
@@ -63,8 +63,10 @@ const endpointsList: HttpEndpoints = {
63
63
  accountAuthFlag: params.accountAuthFlag || false,
64
64
  channelCode: params.channelCode || null,
65
65
  payFinishJumpUrl: params.payFinishJumpUrl || null,
66
+ useCloudBean: params.useCloudBean || false,
66
67
  }),
67
68
  transform: (data: any) => {
69
+ console.log(data, 'data-----')
68
70
  let json = null
69
71
  try {
70
72
  json = JSON.parse(data.prePayStr)
@@ -40,7 +40,7 @@ const vendor = {
40
40
  duration: endTime - startTime,
41
41
  })
42
42
 
43
- if (data.success) {
43
+ if (data.success || data.code === '401') {
44
44
  resolve({
45
45
  status: +data.code,
46
46
  message: data.msg,
@@ -51,6 +51,7 @@ const vendor = {
51
51
  title: data.msg,
52
52
  icon: 'none',
53
53
  })
54
+ reject(data.msg)
54
55
  }
55
56
  })
56
57
  .catch((e: any) => {
@@ -70,7 +71,7 @@ function useHttp(defaultHeader?: DefaultHeaderType) {
70
71
  const headers = {
71
72
  Token: appkitOptions.tempToken() || appkitOptions.token(),
72
73
  Appcode: defaultHeader?.Appcode || appkitOptions.app(),
73
- cookie: `tid=${defaultHeader?.Tenant || appkitOptions.tenant()}`,
74
+ tid: defaultHeader?.Tenant || appkitOptions.tenant(),
74
75
  gray: appkitOptions.gray ? appkitOptions.gray() : '0',
75
76
  }
76
77
 
@@ -83,6 +84,7 @@ function useHttp(defaultHeader?: DefaultHeaderType) {
83
84
  headers,
84
85
  interceptors: [
85
86
  (raw) => {
87
+ console.log(raw, '=======raw')
86
88
  if (raw.status == 401) {
87
89
  appkitOptions[401]()
88
90
  return true
@@ -30,7 +30,6 @@ const views = {
30
30
  function onBackClick () {
31
31
  emit('dismiss')
32
32
  }
33
-
34
33
  </script>
35
34
 
36
35
  <style lang="scss">