wui-components-v2 1.1.70 → 1.1.71

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 (79) hide show
  1. package/api/feishu.ts +20 -20
  2. package/api/index.ts +4 -4
  3. package/api/login.ts +51 -51
  4. package/api/tree.ts +28 -28
  5. package/components/action-popup/action-popup.vue +116 -116
  6. package/components/add-address-list/add-address-list.vue +187 -187
  7. package/components/add-address-page/config.ts +297 -297
  8. package/components/audio-play/audio-play.vue +220 -220
  9. package/components/batch-upload-file/batch-upload-file.vue +75 -75
  10. package/components/card-botom-buttons/card-botom-buttons.vue +279 -279
  11. package/components/demo-card/demo-card.vue +44 -44
  12. package/components/fold-card/fold-card.vue +2 -2
  13. package/components/global-loading/GlobalLoading.md +366 -366
  14. package/components/global-loading/global-loading.vue +55 -55
  15. package/components/global-message/GlobalMessage.md +570 -570
  16. package/components/global-toast/GlobalToast.md +261 -261
  17. package/components/global-toast/global-toast.vue +56 -56
  18. package/components/label-value/open-value-more.vue +56 -56
  19. package/components/loading/loading.vue +5 -5
  20. package/components/login-form-box/login-form-box.vue +65 -65
  21. package/components/phone-login-form/phone-login-form.vue +204 -204
  22. package/components/privacy-popup/privacy-popup.vue +191 -191
  23. package/components/scan-input/scan-input.vue +406 -406
  24. package/components/select-col-picker/select-col-picker.vue +168 -168
  25. package/components/tab-search/tab-search.vue +73 -73
  26. package/components/tree-select/components/TreeNode.vue +200 -200
  27. package/components/tree-select/components/index.vue +471 -471
  28. package/components/tree-select/components/tree-select.vue +56 -56
  29. package/components/tree-select/index.vue +93 -93
  30. package/components/user-choose/user-choose.vue +169 -151
  31. package/components/video-play/video-play.vue +56 -56
  32. package/components/wui-auto-update-component/wui-auto-update-component.vue +132 -132
  33. package/components/wui-default/wui-default.vue +49 -49
  34. package/components/wui-details-page/wui-details-page.vue +147 -147
  35. package/components/wui-edit-page/wui-edit-page-copy.vue +757 -757
  36. package/components/wui-edit-page/wui-edit-page.vue +793 -793
  37. package/components/wui-login/wui-login.vue +43 -43
  38. package/components/wui-login1/wui-login.vue +41 -41
  39. package/components/wui-menus/wui-menus-top.vue +137 -137
  40. package/components/wui-menus/wui-menus-top1.vue +8 -8
  41. package/components/wui-menus1/components/banner-carousel.vue +320 -320
  42. package/components/wui-menus1/components/quick-panel.vue +55 -55
  43. package/components/wui-menus1/components/search-bar.vue +49 -49
  44. package/components/wui-menus1/components/section-menus.vue +208 -208
  45. package/components/wui-menus1/wui-menus-top.vue +718 -718
  46. package/components/wui-menus1/wui-menus-top1.vue +398 -398
  47. package/components/wui-notify-info/notify-handle.vue +53 -53
  48. package/components/wui-scan-binding-sensor/wui-scan-binding-sensor.vue +75 -75
  49. package/components/wui-search-history-babbar/components/SearchBar.vue +70 -70
  50. package/components/wui-select-popup/wui-select-popup.vue +1 -0
  51. package/components/wui-tree-page/wui-tree-page.vue +297 -297
  52. package/components/wui-update-component/wui-update-component.vue +221 -221
  53. package/composables/types/theme.ts +65 -65
  54. package/composables/types/user.ts +5 -5
  55. package/composables/useColorGenerator.ts +221 -221
  56. package/composables/useEnumes.ts +43 -43
  57. package/composables/useEventBus.ts +37 -37
  58. package/composables/useGlobalLoading.ts +47 -47
  59. package/composables/useGlobalMessage.ts +53 -53
  60. package/composables/useGlobalToast.ts +63 -63
  61. package/composables/useLocale.ts +54 -54
  62. package/composables/useManualTheme.ts +179 -179
  63. package/composables/useSectionMenus.ts +120 -120
  64. package/composables/useTabbar.ts +50 -50
  65. package/composables/useTheme.ts +74 -74
  66. package/composables/useUser.ts +24 -24
  67. package/index.d.ts +90 -90
  68. package/package.json +24 -24
  69. package/store/manualThemeStore.ts +143 -143
  70. package/store/persist.ts +41 -41
  71. package/store/themeStore.ts +74 -74
  72. package/store/userStore.ts +22 -22
  73. package/styles/dark-mode.scss +498 -498
  74. package/type.ts +154 -154
  75. package/utils/control-tree.ts +353 -353
  76. package/utils/eventBus.ts +36 -36
  77. package/utils/idata-scan.ts +99 -99
  78. package/utils/index.ts +979 -979
  79. package/utils/rsaEncrypt.ts +10 -10
@@ -1,187 +1,187 @@
1
- <script setup>
2
- import { computed, onMounted, ref } from 'vue'
3
- import { useGlobalMessage } from '@/core-components/composables/useGlobalMessage'
4
-
5
- defineOptions({
6
- name: 'AddAddressList',
7
- })
8
- const { addAddressPath } = defineProps({
9
- addAddressPath: {
10
- type: String,
11
- default: '',
12
- },
13
- })
14
-
15
- function addAddress() {
16
- uni.navigateTo({
17
- url: addAddressPath,
18
- })
19
- }
20
-
21
- // 搜索关键词
22
- const keyword = ref('')
23
- // 分页配置
24
- const page = ref(1)
25
- const pageSize = ref(5)
26
- const isNoMore = ref(false)
27
- const loadingText = ref('上拉加载更多')
28
-
29
- // 全部数据源
30
- const allAddressList = ref([])
31
- // 页面展示列表
32
- const showList = ref([])
33
-
34
- // 模拟后端批量数据
35
- function mockAllData() {
36
- const arr = []
37
- for (let i = 1; i <= 30; i++) {
38
- arr.push({
39
- name: `用户${i}`,
40
- phone: `138${String(i).padStart(8, '0')}`,
41
- address: `测试地址${i}号 某某小区${i}栋${i}单元`,
42
- })
43
- }
44
- allAddressList.value = arr
45
- }
46
-
47
- // 分页截取数据
48
- function getPageData() {
49
- const start = (page.value - 1) * pageSize.value
50
- const end = page.value * pageSize.value
51
- return allAddressList.value.slice(start, end)
52
- }
53
-
54
- // 加载更多
55
- function loadMore() {
56
- if (isNoMore.value)
57
- return
58
- loadingText.value = '加载中...'
59
- // 模拟接口延迟
60
- setTimeout(() => {
61
- const newData = getPageData()
62
- if (newData.length === 0) {
63
- isNoMore.value = true
64
- loadingText.value = '没有更多了'
65
- return
66
- }
67
- showList.value.push(...newData)
68
- page.value++
69
- loadingText.value = '上拉加载更多'
70
- }, 600)
71
- }
72
-
73
- // 搜索过滤
74
- const filterList = computed(() => {
75
- if (!keyword.value)
76
- return showList.value
77
- return showList.value.filter(item =>
78
- item.name.includes(keyword.value)
79
- || item.phone.includes(keyword.value)
80
- || item.address.includes(keyword.value),
81
- )
82
- })
83
-
84
- // 返回
85
- const goBack = () => history.back()
86
- // 编辑
87
- function editAddress() {}
88
- // 删除
89
- function deleteAddress(idx) {
90
- uni.showModal({
91
- title: '提示',
92
- content: '确定删除该地址?',
93
- success: (res) => {
94
- if (res.confirm)
95
- showList.value.splice(idx, 1)
96
- },
97
- })
98
- }
99
- function selectAddress(item) {
100
- console.log('item', item)
101
- uni.$emit('addressListBack', {...item,id:1111})
102
- uni.navigateBack({
103
- delta: 1,
104
- })
105
- }
106
-
107
- onMounted(() => {
108
- mockAllData()
109
- loadMore()
110
- })
111
- </script>
112
-
113
- <template>
114
- <view class="min-h-screen bg-gray-50 pb-20">
115
- <!-- 搜索框 -->
116
- <view class="p-4">
117
- <view class="flex items-center rounded-full bg-gray-100 px-4 py-2">
118
- <svg class="mr-2 h-4 w-4 text-gray-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
119
- <circle cx="11" cy="11" r="7" />
120
- <path d="M16 16l4 4" stroke-linecap="round" />
121
- </svg>
122
- <input
123
- v-model="keyword"
124
- type="text"
125
- placeholder="请输入姓名/手机号/公司名称"
126
- class="flex-1 bg-transparent text-sm text-gray-700 outline-none placeholder-gray-400"
127
- >
128
- </view>
129
- </view>
130
-
131
- <!-- 列表区域 开启滚动监听 -->
132
- <view
133
- class="overflow-y-auto px-4 space-y-3"
134
- @scrolltolower="loadMore"
135
- >
136
- <view
137
- v-for="(item, index) in showList"
138
- :key="index"
139
- class="rounded-lg bg-white p-4 shadow-sm"
140
- @click="selectAddress(item)"
141
- >
142
- <view class="mb-2 flex items-center">
143
- <text class="mr-3 text-gray-900 font-medium">
144
- {{ item.name }}
145
- </text>
146
- <text class="text-sm text-gray-500">
147
- {{ item.phone }}
148
- </text>
149
- </view>
150
- <text class="mb-3 block text-sm text-gray-500 leading-relaxed">
151
- {{ item.address }}
152
- </text>
153
- <view class="flex justify-end text-sm space-x-6">
154
- <view class="flex items-center text-gray-500" @click="editAddress(item, index)">
155
- <svg class="mr-1 h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
156
- <path d="M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" />
157
- </svg>
158
- 编辑
159
- </view>
160
- <view class="flex items-center text-gray-500" @click="deleteAddress(index)">
161
- <svg class="mr-1 h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
162
- <path d="M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2M10 11v6M14 11v6M5 6h14v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6z" />
163
- </svg>
164
- 删除
165
- </view>
166
- </view>
167
- </view>
168
-
169
- <!-- 加载提示 -->
170
- <view class="py-4 text-center text-sm text-gray-400">
171
- {{ loadingText }}
172
- </view>
173
- </view>
174
-
175
- <!-- 底部新增按钮 -->
176
- <view
177
- class="fixed bottom-6 left-1/2 h-12 w-11/12 flex items-center justify-center rounded-full bg-blue-500 text-white font-medium -translate-x-1/2"
178
- @click="addAddress"
179
- >
180
- 新增地址
181
- </view>
182
- </view>
183
- </template>
184
-
185
- <style scoped>
186
-
187
- </style>
1
+ <script setup>
2
+ import { computed, onMounted, ref } from 'vue'
3
+ import { useGlobalMessage } from '@/core-components/composables/useGlobalMessage'
4
+
5
+ defineOptions({
6
+ name: 'AddAddressList',
7
+ })
8
+ const { addAddressPath } = defineProps({
9
+ addAddressPath: {
10
+ type: String,
11
+ default: '',
12
+ },
13
+ })
14
+
15
+ function addAddress() {
16
+ uni.navigateTo({
17
+ url: addAddressPath,
18
+ })
19
+ }
20
+
21
+ // 搜索关键词
22
+ const keyword = ref('')
23
+ // 分页配置
24
+ const page = ref(1)
25
+ const pageSize = ref(5)
26
+ const isNoMore = ref(false)
27
+ const loadingText = ref('上拉加载更多')
28
+
29
+ // 全部数据源
30
+ const allAddressList = ref([])
31
+ // 页面展示列表
32
+ const showList = ref([])
33
+
34
+ // 模拟后端批量数据
35
+ function mockAllData() {
36
+ const arr = []
37
+ for (let i = 1; i <= 30; i++) {
38
+ arr.push({
39
+ name: `用户${i}`,
40
+ phone: `138${String(i).padStart(8, '0')}`,
41
+ address: `测试地址${i}号 某某小区${i}栋${i}单元`,
42
+ })
43
+ }
44
+ allAddressList.value = arr
45
+ }
46
+
47
+ // 分页截取数据
48
+ function getPageData() {
49
+ const start = (page.value - 1) * pageSize.value
50
+ const end = page.value * pageSize.value
51
+ return allAddressList.value.slice(start, end)
52
+ }
53
+
54
+ // 加载更多
55
+ function loadMore() {
56
+ if (isNoMore.value)
57
+ return
58
+ loadingText.value = '加载中...'
59
+ // 模拟接口延迟
60
+ setTimeout(() => {
61
+ const newData = getPageData()
62
+ if (newData.length === 0) {
63
+ isNoMore.value = true
64
+ loadingText.value = '没有更多了'
65
+ return
66
+ }
67
+ showList.value.push(...newData)
68
+ page.value++
69
+ loadingText.value = '上拉加载更多'
70
+ }, 600)
71
+ }
72
+
73
+ // 搜索过滤
74
+ const filterList = computed(() => {
75
+ if (!keyword.value)
76
+ return showList.value
77
+ return showList.value.filter(item =>
78
+ item.name.includes(keyword.value)
79
+ || item.phone.includes(keyword.value)
80
+ || item.address.includes(keyword.value),
81
+ )
82
+ })
83
+
84
+ // 返回
85
+ const goBack = () => history.back()
86
+ // 编辑
87
+ function editAddress() {}
88
+ // 删除
89
+ function deleteAddress(idx) {
90
+ uni.showModal({
91
+ title: '提示',
92
+ content: '确定删除该地址?',
93
+ success: (res) => {
94
+ if (res.confirm)
95
+ showList.value.splice(idx, 1)
96
+ },
97
+ })
98
+ }
99
+ function selectAddress(item) {
100
+ console.log('item', item)
101
+ uni.$emit('addressListBack', {...item,id:1111})
102
+ uni.navigateBack({
103
+ delta: 1,
104
+ })
105
+ }
106
+
107
+ onMounted(() => {
108
+ mockAllData()
109
+ loadMore()
110
+ })
111
+ </script>
112
+
113
+ <template>
114
+ <view class="min-h-screen bg-gray-50 pb-20">
115
+ <!-- 搜索框 -->
116
+ <view class="p-4">
117
+ <view class="flex items-center rounded-full bg-gray-100 px-4 py-2">
118
+ <svg class="mr-2 h-4 w-4 text-gray-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
119
+ <circle cx="11" cy="11" r="7" />
120
+ <path d="M16 16l4 4" stroke-linecap="round" />
121
+ </svg>
122
+ <input
123
+ v-model="keyword"
124
+ type="text"
125
+ placeholder="请输入姓名/手机号/公司名称"
126
+ class="flex-1 bg-transparent text-sm text-gray-700 outline-none placeholder-gray-400"
127
+ >
128
+ </view>
129
+ </view>
130
+
131
+ <!-- 列表区域 开启滚动监听 -->
132
+ <view
133
+ class="overflow-y-auto px-4 space-y-3"
134
+ @scrolltolower="loadMore"
135
+ >
136
+ <view
137
+ v-for="(item, index) in showList"
138
+ :key="index"
139
+ class="rounded-lg bg-white p-4 shadow-sm"
140
+ @click="selectAddress(item)"
141
+ >
142
+ <view class="mb-2 flex items-center">
143
+ <text class="mr-3 text-gray-900 font-medium">
144
+ {{ item.name }}
145
+ </text>
146
+ <text class="text-sm text-gray-500">
147
+ {{ item.phone }}
148
+ </text>
149
+ </view>
150
+ <text class="mb-3 block text-sm text-gray-500 leading-relaxed">
151
+ {{ item.address }}
152
+ </text>
153
+ <view class="flex justify-end text-sm space-x-6">
154
+ <view class="flex items-center text-gray-500" @click="editAddress(item, index)">
155
+ <svg class="mr-1 h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
156
+ <path d="M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" />
157
+ </svg>
158
+ 编辑
159
+ </view>
160
+ <view class="flex items-center text-gray-500" @click="deleteAddress(index)">
161
+ <svg class="mr-1 h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
162
+ <path d="M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2M10 11v6M14 11v6M5 6h14v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6z" />
163
+ </svg>
164
+ 删除
165
+ </view>
166
+ </view>
167
+ </view>
168
+
169
+ <!-- 加载提示 -->
170
+ <view class="py-4 text-center text-sm text-gray-400">
171
+ {{ loadingText }}
172
+ </view>
173
+ </view>
174
+
175
+ <!-- 底部新增按钮 -->
176
+ <view
177
+ class="fixed bottom-6 left-1/2 h-12 w-11/12 flex items-center justify-center rounded-full bg-blue-500 text-white font-medium -translate-x-1/2"
178
+ @click="addAddress"
179
+ >
180
+ 新增地址
181
+ </view>
182
+ </view>
183
+ </template>
184
+
185
+ <style scoped>
186
+
187
+ </style>