wui-components-v2 1.1.60 → 1.1.62

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/api/core/index.ts CHANGED
@@ -21,7 +21,7 @@ function request(options: RequestOptions): Promise<any> {
21
21
  const hydrocarbonProgramToken = uni.getStorageSync('HYDROCARBON_PROGRAM_TOKEN') || ''
22
22
  const token = uni.getStorageSync('TOKEN') || uni.getStorageSync('token') || ''
23
23
  const hydrocarbonClient = uni.getStorageSync('HYDROCARBON_CLIENT') || ''
24
- console.log('request', baseUrl + options.url, options.data)
24
+ const applicationToken = uni.getStorageSync('HYDROCARBON_APPLICATION_TOKEN') || ''
25
25
  return new Promise((resolve, reject) => {
26
26
  // 设置默认值
27
27
  const defaultOptions = {
@@ -32,6 +32,7 @@ function request(options: RequestOptions): Promise<any> {
32
32
  'hydrocarbon-program-token': hydrocarbonProgramToken, // 项目code
33
33
  'hydrocarbon-token': token, // 登录token
34
34
  'hydrocarbon-client': hydrocarbonClient, // 端类型
35
+ 'hydrocarbon-application-token': applicationToken,
35
36
  // #ifdef APP-PLUS
36
37
  'hydrocarbon-app-version': '1.0.0',
37
38
  // #endif
@@ -59,8 +60,7 @@ function request(options: RequestOptions): Promise<any> {
59
60
  return
60
61
  }
61
62
  resolve(res.data)
62
- }
63
- else {
63
+ } else {
64
64
  reject(res)
65
65
  }
66
66
  },
package/api/sys.ts CHANGED
@@ -5,3 +5,8 @@ export function language(language: string): Promise<any> {
5
5
  url: `/v3/multilingual?language=${language}`,
6
6
  })
7
7
  }
8
+ export function getThemeConfig(): Promise<any> {
9
+ return req({
10
+ url: `/v3/theme-config`,
11
+ })
12
+ }
@@ -13,9 +13,7 @@ defineOptions({
13
13
  defineProps<{
14
14
  navTitle: string
15
15
  }>()
16
- const {
17
- currentThemeColor,
18
- } = useManualTheme()
16
+ const { currentThemeColor } = useManualTheme()
19
17
  const { messageBar } = useSectionMenus(true)
20
18
  const { gotoPage } = useMenus()
21
19
  const { nickName } = useUser()
@@ -30,38 +28,16 @@ function messageAction() {
30
28
  <template>
31
29
  <view class="bg-#fff pa-3 backdrop-filter .dark:bg-#000">
32
30
  <view class="mx-auto max-w-7xl p-x-1">
33
- <view class="flex items-center justify-between">
31
+ <view class="flex items-center justify-center">
34
32
  <view
35
33
  class="bg-clip-text font-size-5 text-transparent font-600 font-sans"
36
34
  :style="{ color: currentThemeColor.primary }"
37
35
  >
38
36
  {{ navTitle }}
39
37
  </view>
40
- <view class="flex items-center gap-2">
41
- <button
42
- v-if="messageBar"
43
- :style="{ background: `linear-gradient(135deg, ${desaturateColor(currentThemeColor.primary, 0.1)} 0%, ${desaturateColor(currentThemeColor.primary, 0.1)} 100%)` }"
44
- class="relative h-10 w-10 flex cursor-pointer items-center justify-center rounded-full border-none transition-all duration-300"
45
- @click="messageAction"
46
- >
47
- <wd-icon name="notification" size="40rpx" :color="currentThemeColor.primary" />
48
- <span
49
- v-if="messageBar.count"
50
- class="absolute right-[6px] top-[6px] h-[10px] w-[10px] animate-pulse border-2 border-b-blue rounded-full bg-red-6"
51
- />
52
- </button>
53
- <view
54
- :style="{ background: `linear-gradient(135deg, ${currentThemeColor.primary} 0%, ${currentThemeColor.primary} 100%)` }"
55
- class="h-9 w-9 flex cursor-pointer items-center justify-center rounded-full text-sm text-white font-semibold shadow-sm"
56
- >
57
- {{ getFirstChar(nickName || 'U') }}
58
- </view>
59
- </view>
60
38
  </view>
61
39
  </view>
62
40
  </view>
63
41
  </template>
64
42
 
65
- <style scoped>
66
-
67
- </style>
43
+ <style scoped></style>
@@ -12,6 +12,8 @@ import quickPanel from './components/quick-panel.vue'
12
12
  import bannerCarousel from './components/banner-carousel.vue'
13
13
  import searchBar from './components/search-bar.vue'
14
14
  import '../../static/iconfont/iconfont.css'
15
+ import { getThemeConfig } from '../../api/sys'
16
+ import { onMounted } from 'vue'
15
17
 
16
18
  defineOptions({
17
19
  name: 'WuiMenus1',
@@ -23,7 +25,7 @@ const props = defineProps({
23
25
  },
24
26
  load: {
25
27
  type: Function as PropType<() => void>,
26
- default: () => { },
28
+ default: () => {},
27
29
  },
28
30
  menuTopType: {
29
31
  type: String,
@@ -31,6 +33,7 @@ const props = defineProps({
31
33
  },
32
34
  })
33
35
  const languageStore = useLanguageStore()
36
+ const themeConfig = ref<any>({})
34
37
  const pagingRef = ref(null)
35
38
  const {
36
39
  queryList,
@@ -44,10 +47,26 @@ const {
44
47
  sheetGotoPage,
45
48
  navTitle,
46
49
  } = useMenus(props, pagingRef)
50
+ onMounted(() => {
51
+ getThemeConfig().then(res => {
52
+ if (res.status == 'success') {
53
+ themeConfig.value = {
54
+ ...res.themeConfig,
55
+ showHomePage: false,
56
+ }
57
+ }
58
+ })
59
+ })
47
60
  </script>
48
61
 
49
62
  <template>
50
- <z-paging ref="pagingRef" v-model="menuList" :loading-more-enabled="false" @query="queryList" @on-refresh="props.load">
63
+ <z-paging
64
+ ref="pagingRef"
65
+ v-model="menuList"
66
+ :loading-more-enabled="false"
67
+ @query="queryList"
68
+ @on-refresh="props?.load"
69
+ >
51
70
  <template #top>
52
71
  <navbar :nav-title="navTitle" />
53
72
  <slot name="top" :style="{ background: currentThemeColor.primary }" />
@@ -55,20 +74,19 @@ const {
55
74
  </template>
56
75
  <view class="px-3 pb-4">
57
76
  <!-- 菜单搜索 -->
58
- <searchBar />
77
+ <searchBar v-if="themeConfig.showHomePage" />
59
78
  <!-- 轮播图 -->
60
- <!-- <wuiMenusTop v-if="props.menuTopType !== '自定义'" /> -->
61
- <bannerCarousel />
79
+ <bannerCarousel v-if="themeConfig.showHomePage" />
62
80
  <!-- 快捷菜单 -->
63
- <sectionMenus />
81
+ <sectionMenus v-if="themeConfig.showHomePage" />
64
82
  <!-- 统计 -->
65
- <quickPanel />
83
+ <quickPanel v-if="themeConfig.showHomePage" />
66
84
  <!-- 消息 -->
67
85
  <!-- <wuiNotifyInfo /> -->
68
86
 
69
87
  <!-- 菜单卡片列表 -->
70
88
  <view class="menu-section">
71
- <view class="section-header">
89
+ <view class="section-header" v-if="themeConfig.showHomePage">
72
90
  <view class="section-title-wrapper">
73
91
  <!-- <view class="section-icon primary">
74
92
  <text class="i-carbon:apps text-sm" />
@@ -78,18 +96,26 @@ const {
78
96
  </text>
79
97
  </view>
80
98
  <view class="section-tag">
81
- <text class="tag-text">
82
- {{ filtermenu.length }} {{ languageStore.t('个分类') }}
83
- </text>
99
+ <text class="tag-text">{{ filtermenu.length }} {{ languageStore.t('个分类') }}</text>
84
100
  </view>
85
101
  </view>
86
-
87
- <DemoCard v-for="(item, index) in filtermenu" :key="index" :title="languageStore.t(item.title)" class="menu-card" :style="{ animationDelay: `${(index as number) * 0.1}s` }">
102
+ <view v-else class="py-3"></view>
103
+
104
+ <DemoCard
105
+ v-for="(item, index) in filtermenu"
106
+ :key="index"
107
+ :title="languageStore.t(item.title)"
108
+ class="menu-card"
109
+ :style="{ animationDelay: `${(index as number) * 0.1}s` }"
110
+ >
88
111
  <template #content>
89
112
  <view class="menu-grid-container">
90
113
  <wd-grid :column="4" clickable class="menu-grid">
91
114
  <wd-grid-item
92
- v-for="(subItem, subIndex) in item.items" :key="subIndex" use-text-slot use-icon-slot
115
+ v-for="(subItem, subIndex) in item.items"
116
+ :key="subIndex"
117
+ use-text-slot
118
+ use-icon-slot
93
119
  class="menu-grid-item"
94
120
  @click="gotoPage(subItem)"
95
121
  >
@@ -98,10 +124,7 @@ const {
98
124
  class="menu-icon-wrapper flex items-center justify-center"
99
125
  :style="{ background: subItem.color }"
100
126
  >
101
- <text
102
- class="menu-icon !text-xl iconfont"
103
- :class="[subItem.appIcon || 'i-carbon:grid']"
104
- />
127
+ <text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
105
128
  <view class="icon-shine" />
106
129
  </view>
107
130
  </template>
@@ -125,9 +148,7 @@ const {
125
148
  <!-- 底部信息 -->
126
149
  <view class="footer-section">
127
150
  <view class="footer-line" />
128
- <text class="footer-text">
129
- 已经到底了
130
- </text>
151
+ <text class="footer-text">已经到底了</text>
131
152
  <view class="footer-line" />
132
153
  </view>
133
154
 
@@ -139,8 +160,15 @@ const {
139
160
  </template>
140
161
  </z-paging>
141
162
  <wd-action-sheet
142
- v-model="sheetShow" :z-index="9999" :actions="actions" :title="title"
143
- @select="({ item }) => { sheetGotoPage(item) }"
163
+ v-model="sheetShow"
164
+ :z-index="9999"
165
+ :actions="actions"
166
+ :title="title"
167
+ @select="
168
+ ({ item }) => {
169
+ sheetGotoPage(item)
170
+ }
171
+ "
144
172
  />
145
173
  </template>
146
174
 
@@ -202,7 +230,7 @@ const {
202
230
  margin-bottom: 20rpx !important;
203
231
  :deep(.wd-card) {
204
232
  border-radius: 28rpx;
205
- background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,1) 100%);
233
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
206
234
  box-shadow:
207
235
  0 8rpx 32rpx rgba(0, 0, 0, 0.06),
208
236
  0 2rpx 8rpx rgba(0, 0, 0, 0.04),
@@ -226,7 +254,6 @@ const {
226
254
  display: flex;
227
255
  align-items: center;
228
256
  gap: 12rpx;
229
-
230
257
  }
231
258
 
232
259
  :deep(.wd-card__content) {
@@ -282,7 +309,7 @@ const {
282
309
  left: 0;
283
310
  right: 0;
284
311
  height: 50%;
285
- background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, transparent 100%);
312
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
286
313
  border-radius: 28rpx 28rpx 0 0;
287
314
  }
288
315
 
@@ -301,12 +328,7 @@ const {
301
328
  left: -50%;
302
329
  width: 200%;
303
330
  height: 200%;
304
- background: linear-gradient(
305
- 45deg,
306
- transparent 40%,
307
- rgba(255, 255, 255, 0.15) 50%,
308
- transparent 60%
309
- );
331
+ background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
310
332
  animation: shine 15s ease-in-out infinite;
311
333
  pointer-events: none;
312
334
  }
@@ -424,7 +446,8 @@ const {
424
446
  }
425
447
 
426
448
  @keyframes shine {
427
- 0%, 100% {
449
+ 0%,
450
+ 100% {
428
451
  transform: translateX(-100%) rotate(45deg);
429
452
  }
430
453
  50% {
@@ -433,7 +456,8 @@ const {
433
456
  }
434
457
 
435
458
  @keyframes pulseDot {
436
- 0%, 100% {
459
+ 0%,
460
+ 100% {
437
461
  transform: scale(1);
438
462
  opacity: 1;
439
463
  }
@@ -537,7 +561,7 @@ const {
537
561
  }
538
562
  }
539
563
  }
540
- .menu-grid-container :deep(.wd-grid-item__content){
564
+ .menu-grid-container :deep(.wd-grid-item__content) {
541
565
  align-items: normal;
542
566
  }
543
567
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.60",
3
+ "version": "1.1.62",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",