@uxda/appkit 4.3.7 → 4.3.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.3.7",
3
+ "version": "4.3.11",
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.6.98",
37
+ "@uxda/nutshell": "^1.0.0",
38
38
  "dayjs": "^1.11.18",
39
39
  "dsbridge": "^3.1.4",
40
40
  "lodash-es": "^4.17.21",
@@ -75,5 +75,8 @@
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"
78
81
  }
79
82
  }
@@ -152,7 +152,6 @@ function onHelpClick(type: string) {
152
152
  showModal({
153
153
  content: toastMap[type],
154
154
  showCancel: false,
155
- confirmColor: '#017fff',
156
155
  confirmText: '知道了',
157
156
  })
158
157
  }
@@ -1,106 +1,41 @@
1
1
  <template>
2
2
  <ns-page class="news-list">
3
3
  <div class="tabContainer" :class="{ inH5: isWeb() }">
4
- <!-- <ns-tabs
5
- v-model="state.tab"
6
- fill="#fff"
7
- square
8
- size="xl"
9
- style="height: 46px"
10
- @change="onTabChange"
11
- >
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">
12
15
  <ns-tabs-item key="全部" tab="全部"></ns-tabs-item>
13
16
  <ns-tabs-item key="业务消息" tab="业务消息"></ns-tabs-item>
14
17
  <ns-tabs-item key="系统公告" tab="系统公告"></ns-tabs-item>
15
18
  <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>
51
19
  </ns-tabs>
52
-
53
20
  <div v-if="state.list.length > 0" class="read-all">
54
- <div v-track-click class="btn" @click="readAll">全部已读</div>
21
+ <div v-track-click class="btn" @click="readAll">全部已读</div>
55
22
  </div>
56
23
  </div>
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
- >
24
+ <ns-page-content class="mt-68px" scrollable refreshable :refresh-triggered="isRefresh"
25
+ @pull-down-refresh="onRefresh" @bottom-reached="nextPage">
65
26
  <ns-skeleton :row="8" v-if="显示骨架屏" />
66
27
 
67
28
  <template v-else>
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
- />
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" />
93
35
  {{ item.标题 }}
94
36
  </div>
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>
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>
104
39
  <div class="news-item-time">{{ item.时间 }}</div>
105
40
  </ns-card>
106
41
  </ns-repeator>
@@ -112,12 +47,12 @@
112
47
  </template>
113
48
 
114
49
  <script setup lang="ts">
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';
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'
121
56
  import {
122
57
  NsTabs,
123
58
  NsTabsItem,
@@ -127,7 +62,7 @@ import {
127
62
  NsPageContent,
128
63
  NsSkeleton,
129
64
  NsEmpty,
130
- } from '@uxda/nutshell/taro';
65
+ } from "@uxda/nutshell/taro";
131
66
  import { isWeb } from '../../utils/utils';
132
67
 
133
68
  const props = withDefaults(
@@ -137,56 +72,31 @@ const props = withDefaults(
137
72
  app: string;
138
73
  }>(),
139
74
  {
140
- deviceType: '2',
141
- userId: '',
142
- app: '',
75
+ deviceType: "2",
76
+ userId: "",
77
+ app: "",
143
78
  }
144
79
  );
145
80
 
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
-
170
81
  const $http = useHttp(),
171
- 显示骨架屏 = ref(true);
82
+ 显示骨架屏 = ref(true)
172
83
 
173
84
  useDidShow(() => {
174
- nextPage(1);
175
- getNotice();
176
- });
85
+ nextPage(1)
86
+ })
177
87
  const state = reactive({
178
88
  search: '',
179
89
  tab: '全部',
180
90
  list: [] as any[],
181
- });
91
+ })
182
92
 
183
93
  async function load(page: number) {
184
94
  if (!props.app?.replace(',cloudkitPro', '')) {
185
- state.list = [];
186
- return { paging: { page: 1, pageSize: 10, total: 0 }, data: [] };
95
+ state.list = []
96
+ return { paging: { page: 1, pageSize: 10, total: 0 }, data: [] }
187
97
  }
188
98
 
189
- const appkitOptions = useAppKitOptions();
99
+ const appkitOptions = useAppKitOptions()
190
100
  const data = {
191
101
  page,
192
102
  pageSize: 10,
@@ -195,107 +105,85 @@ async function load(page: number) {
195
105
  userId: props.userId,
196
106
  deviceType: props.deviceType,
197
107
  readOrderStatus: '1',
198
- };
108
+ }
199
109
 
200
110
  if (state.tab == '业务消息') {
201
- data['msgType'] = '1';
111
+ data['msgType'] = '1'
202
112
  } else if (state.tab == '系统公告') {
203
- data['msgType'] = '3';
113
+ data['msgType'] = '3'
204
114
  }
205
115
 
206
116
  if (state.tab == '未读') {
207
- data['isRead'] = '0';
117
+ data['isRead'] = '0'
208
118
  }
209
119
 
210
- const ep = endpoints['消息列表'];
120
+ const ep = endpoints['消息列表']
211
121
  return $http.post<WithPaging<any[]>>(ep, data).then((res) => {
212
- 显示骨架屏.value = false;
122
+ 显示骨架屏.value = false
213
123
  if (page === 1) {
214
- state.list = [];
124
+ state.list = []
215
125
  }
216
- state.list = [...state.list, ...res.data];
217
- return { paging: res.paging, data: res.data };
218
- });
126
+ state.list = [...state.list, ...res.data]
127
+ return { paging: res.paging, data: res.data }
128
+ })
219
129
  }
220
130
 
221
- const { paging, nextPage } = usePaging(load);
131
+ const { paging, nextPage } = usePaging(load)
222
132
 
223
133
  function onTabChange() {
224
- 显示骨架屏.value = true;
225
- nextPage(1);
134
+ 显示骨架屏.value = true
135
+ nextPage(1)
226
136
  }
227
137
 
228
- const isRefresh = ref(false);
138
+ const isRefresh = ref(false)
229
139
  async function onRefresh() {
230
- isRefresh.value = true;
231
- await nextPage(1);
232
- isRefresh.value = false;
140
+ isRefresh.value = true
141
+ await nextPage(1)
142
+ isRefresh.value = false
233
143
  }
234
144
 
235
145
  function itemClick(item: any) {
236
- read(item);
237
- getNotice();
238
- emits('itemClick', item);
146
+ read(item)
147
+
148
+ emits('itemClick', item)
239
149
  }
240
150
 
241
151
  function read(item: any) {
242
- if (item.isRead == '1') return;
243
- const ep = endpoints['已读'];
152
+ if (item.isRead == '1') return
153
+ const ep = endpoints['已读']
244
154
  $http.post(ep, [item.id]).then(() => {
245
- item['已读'] = true;
246
- });
155
+ item['已读'] = true
156
+ })
247
157
  }
248
158
 
249
159
  async function readAll() {
250
160
  try {
251
161
  showLoading({
252
162
  title: '请稍后...',
253
- mask: true,
254
- });
163
+ })
255
164
 
256
- const appkitOptions = useAppKitOptions();
257
- const ep = endpoints['全部已读'];
165
+ const appkitOptions = useAppKitOptions()
166
+ const ep = endpoints['全部已读']
258
167
  const data = {
259
168
  tenantId: appkitOptions.tenant(),
260
169
  userId: props.userId,
261
170
  deviceType: props.deviceType,
262
- };
171
+ }
263
172
  $http.post(ep, data).then(() => {
264
173
  state.list.forEach((item) => {
265
- item['已读'] = true;
266
- });
267
- });
174
+ item['已读'] = true
175
+ })
176
+ })
268
177
  } finally {
269
- getNotice();
270
- hideLoading();
178
+ hideLoading()
271
179
  }
272
180
  }
273
181
 
274
- // 通知红点
275
- const noticeShow = ref(false);
276
- async function getNotice() {
277
- const appkitOptions = useAppKitOptions();
278
- const $http = useHttp();
279
-
280
- $http
281
- .get('/cas/msg/count-unread', {
282
- deviceType: 2,
283
- appCode: props.app,
284
- tenantId: appkitOptions.tenant(),
285
- userId: props.userId,
286
- })
287
- .then((result: any) => {
288
- if (typeof result === 'object') return;
289
-
290
- noticeShow.value = result > 0;
291
- });
292
- }
293
-
294
- const emits = defineEmits(['itemClick']);
182
+ const emits = defineEmits(['itemClick'])
295
183
 
296
184
  defineExpose({
297
185
  readAll,
298
- });
186
+ })
299
187
  </script>
300
188
 
301
189
  <style lang="scss">
@@ -349,51 +237,4 @@ defineExpose({
349
237
  }
350
238
  }
351
239
  }
352
- .news-tab {
353
- .nut-tabs__list {
354
- display: flex;
355
- }
356
- .custom-tab-item {
357
- flex: 1;
358
- display: flex;
359
- flex-direction: column;
360
- justify-content: center;
361
- align-items: center;
362
- padding: 10px;
363
- }
364
- .customLine {
365
- position: relative;
366
- }
367
- .customLine::after {
368
- content: '';
369
- position: absolute;
370
- width: 50px;
371
- height: 2px;
372
- background: #017fff;
373
- bottom: 0;
374
- left: 50%;
375
- transform: translateX(-50%);
376
- }
377
- .custom-title {
378
- color: #8a8a8a;
379
- font-size: 15px;
380
- display: flex;
381
- align-items: center;
382
- &-dot {
383
- height: 12px;
384
- line-height: 12px;
385
- padding: 0 6px;
386
- color: #fff;
387
- border-radius: 8px;
388
- background: #e04747;
389
- margin-left: 2px;
390
- font-size: 9px;
391
- }
392
- }
393
- .custom-title.active {
394
- color: #017fff;
395
- font-weight: 600;
396
- font-size: 17px;
397
- }
398
- }
399
240
  </style>
@@ -30,7 +30,6 @@ export function useCommonList<R, Q extends QueryLimit>(
30
30
  loading &&
31
31
  showLoading({
32
32
  title: '加载中...',
33
- mask: true,
34
33
  })
35
34
  isLoading.value = true
36
35
 
@@ -59,10 +59,8 @@ const endpointsList: HttpEndpoints = {
59
59
  accountAuthFlag: params.accountAuthFlag || false,
60
60
  channelCode: params.channelCode || null,
61
61
  payFinishJumpUrl: params.payFinishJumpUrl || null,
62
- useCloudBean: params.useCloudBean || false,
63
62
  }),
64
63
  transform: (data: any) => {
65
- console.log(data, 'data-----')
66
64
  let json = null
67
65
  try {
68
66
  json = JSON.parse(data.prePayStr)
@@ -51,7 +51,6 @@ const vendor = {
51
51
  title: data.msg,
52
52
  icon: 'none',
53
53
  })
54
- reject(data.msg)
55
54
  }
56
55
  })
57
56
  .catch((e: any) => {
@@ -30,6 +30,7 @@ const views = {
30
30
  function onBackClick () {
31
31
  emit('dismiss')
32
32
  }
33
+
33
34
  </script>
34
35
 
35
36
  <style lang="scss">
@@ -2,6 +2,8 @@
2
2
  <view class="view recharge-view">
3
3
  <view class="flex-grow">
4
4
  <amount-picker :items="amounts" :selected="state.selected" @change="onAmountSelect" />
5
+
6
+ <slot name="banner"></slot>
5
7
  </view>
6
8
  <view class="amount-footer">
7
9
  <view class="agreement">
@@ -51,6 +53,7 @@ const { params } = useRouter()
51
53
  const emit = defineEmits<{
52
54
  (event: 'complete', value: boolean): void,
53
55
  (event: 'agree'): void,
56
+ (event: 'loaded'): void,
54
57
  }>()
55
58
 
56
59
  const state = reactive({
@@ -81,6 +84,7 @@ onMounted(async () => {
81
84
  tenant: props.tenant
82
85
  }).then(response => {
83
86
  amounts.value = response
87
+ emit('loaded')
84
88
  })
85
89
  })
86
90