wui-components-v2 1.1.59 → 1.1.61

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
+ }
@@ -34,13 +34,14 @@ function clear() {
34
34
 
35
35
  watch(
36
36
  () => props.modelValue,
37
- (val) => {
37
+ val => {
38
38
  currentValue.value = val
39
- },
39
+ }
40
40
  )
41
41
 
42
- watch(currentValue, (val) => {
43
- emit('update:modelValue', val)
42
+ watch(currentValue, val => {
43
+ const newVal = props.type === 'year' ? dayjs(val).format('YYYY') : val
44
+ emit('update:modelValue', newVal)
44
45
  })
45
46
 
46
47
  const labelText = computed(() => {
@@ -51,13 +52,12 @@ const labelText = computed(() => {
51
52
  } = {
52
53
  date: 'YYYY-MM-DD',
53
54
  datetime: 'YYYY-MM-DD HH:mm',
54
- year:'YYYY'
55
+ year: 'YYYY',
55
56
  }
56
57
 
57
58
  if (['date', 'datetime', 'year'].includes(props.type)) {
58
59
  return currentValue.value ? dayjs(currentValue.value).format(formatMap[props.type] as string) : ''
59
- }
60
- else {
60
+ } else {
61
61
  return currentValue.value || ''
62
62
  }
63
63
  })
@@ -65,19 +65,13 @@ const labelText = computed(() => {
65
65
 
66
66
  <template>
67
67
  <div class="flex items-center justify-between">
68
- <wd-input
69
- v-model="labelText"
70
- readonly
71
- :placeholder="placeholder"
72
- class="flex-1"
73
- @click="open = true"
74
- />
68
+ <wd-input v-model="labelText" readonly :placeholder="placeholder" class="flex-1" @click="open = true" />
75
69
  <wd-icon v-if="labelText" name="close-circle" size="16px" @click="clear" />
76
70
  <wd-icon v-else name="right" size="16px" @click="clear" />
77
71
  </div>
78
72
 
79
73
  <wd-calendar
80
- v-if="['date', 'datetime',].includes(type)"
74
+ v-if="['date', 'datetime'].includes(type)"
81
75
  v-model="currentValue"
82
76
  v-model:visible="open"
83
77
  label-key="label"
@@ -100,13 +94,13 @@ const labelText = computed(() => {
100
94
  .custom-date-picker {
101
95
  width: 100%;
102
96
  :deep(.wd-calendar__wrapper) {
103
- padding : 0 20px;
104
- overflow: auto;
105
- scrollbar-width: none;
106
- -ms-overflow-style: none;
107
- }
108
- :deep(.uni-scroll-view) {
109
- scrollbar-width: none;
110
- }
97
+ padding: 0 20px;
98
+ overflow: auto;
99
+ scrollbar-width: none;
100
+ -ms-overflow-style: none;
101
+ }
102
+ :deep(.uni-scroll-view) {
103
+ scrollbar-width: none;
104
+ }
111
105
  }
112
106
  </style>
@@ -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,7 @@ 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'
15
16
 
16
17
  defineOptions({
17
18
  name: 'WuiMenus1',
@@ -23,7 +24,7 @@ const props = defineProps({
23
24
  },
24
25
  load: {
25
26
  type: Function as PropType<() => void>,
26
- default: () => { },
27
+ default: () => {},
27
28
  },
28
29
  menuTopType: {
29
30
  type: String,
@@ -31,6 +32,7 @@ const props = defineProps({
31
32
  },
32
33
  })
33
34
  const languageStore = useLanguageStore()
35
+ const themeConfig = ref<any>({})
34
36
  const pagingRef = ref(null)
35
37
  const {
36
38
  queryList,
@@ -44,10 +46,26 @@ const {
44
46
  sheetGotoPage,
45
47
  navTitle,
46
48
  } = useMenus(props, pagingRef)
49
+ onMounted(() => {
50
+ getThemeConfig().then(res => {
51
+ if (res.status == 'success') {
52
+ themeConfig.value = {
53
+ ...res.themeConfig,
54
+ showHomePage: false,
55
+ }
56
+ }
57
+ })
58
+ })
47
59
  </script>
48
60
 
49
61
  <template>
50
- <z-paging ref="pagingRef" v-model="menuList" :loading-more-enabled="false" @query="queryList" @on-refresh="props.load">
62
+ <z-paging
63
+ ref="pagingRef"
64
+ v-model="menuList"
65
+ :loading-more-enabled="false"
66
+ @query="queryList"
67
+ @on-refresh="props.load"
68
+ >
51
69
  <template #top>
52
70
  <navbar :nav-title="navTitle" />
53
71
  <slot name="top" :style="{ background: currentThemeColor.primary }" />
@@ -55,20 +73,19 @@ const {
55
73
  </template>
56
74
  <view class="px-3 pb-4">
57
75
  <!-- 菜单搜索 -->
58
- <searchBar />
76
+ <searchBar v-if="themeConfig.showHomePage" />
59
77
  <!-- 轮播图 -->
60
- <!-- <wuiMenusTop v-if="props.menuTopType !== '自定义'" /> -->
61
- <bannerCarousel />
78
+ <bannerCarousel v-if="themeConfig.showHomePage" />
62
79
  <!-- 快捷菜单 -->
63
- <sectionMenus />
80
+ <sectionMenus v-if="themeConfig.showHomePage" />
64
81
  <!-- 统计 -->
65
- <quickPanel />
82
+ <quickPanel v-if="themeConfig.showHomePage" />
66
83
  <!-- 消息 -->
67
84
  <!-- <wuiNotifyInfo /> -->
68
85
 
69
86
  <!-- 菜单卡片列表 -->
70
87
  <view class="menu-section">
71
- <view class="section-header">
88
+ <view class="section-header" v-if="themeConfig.showHomePage">
72
89
  <view class="section-title-wrapper">
73
90
  <!-- <view class="section-icon primary">
74
91
  <text class="i-carbon:apps text-sm" />
@@ -78,18 +95,26 @@ const {
78
95
  </text>
79
96
  </view>
80
97
  <view class="section-tag">
81
- <text class="tag-text">
82
- {{ filtermenu.length }} {{ languageStore.t('个分类') }}
83
- </text>
98
+ <text class="tag-text">{{ filtermenu.length }} {{ languageStore.t('个分类') }}</text>
84
99
  </view>
85
100
  </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` }">
101
+ <view v-else class="py-3"></view>
102
+
103
+ <DemoCard
104
+ v-for="(item, index) in filtermenu"
105
+ :key="index"
106
+ :title="languageStore.t(item.title)"
107
+ class="menu-card"
108
+ :style="{ animationDelay: `${(index as number) * 0.1}s` }"
109
+ >
88
110
  <template #content>
89
111
  <view class="menu-grid-container">
90
112
  <wd-grid :column="4" clickable class="menu-grid">
91
113
  <wd-grid-item
92
- v-for="(subItem, subIndex) in item.items" :key="subIndex" use-text-slot use-icon-slot
114
+ v-for="(subItem, subIndex) in item.items"
115
+ :key="subIndex"
116
+ use-text-slot
117
+ use-icon-slot
93
118
  class="menu-grid-item"
94
119
  @click="gotoPage(subItem)"
95
120
  >
@@ -98,10 +123,7 @@ const {
98
123
  class="menu-icon-wrapper flex items-center justify-center"
99
124
  :style="{ background: subItem.color }"
100
125
  >
101
- <text
102
- class="menu-icon !text-xl iconfont"
103
- :class="[subItem.appIcon || 'i-carbon:grid']"
104
- />
126
+ <text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
105
127
  <view class="icon-shine" />
106
128
  </view>
107
129
  </template>
@@ -125,9 +147,7 @@ const {
125
147
  <!-- 底部信息 -->
126
148
  <view class="footer-section">
127
149
  <view class="footer-line" />
128
- <text class="footer-text">
129
- 已经到底了
130
- </text>
150
+ <text class="footer-text">已经到底了</text>
131
151
  <view class="footer-line" />
132
152
  </view>
133
153
 
@@ -139,8 +159,15 @@ const {
139
159
  </template>
140
160
  </z-paging>
141
161
  <wd-action-sheet
142
- v-model="sheetShow" :z-index="9999" :actions="actions" :title="title"
143
- @select="({ item }) => { sheetGotoPage(item) }"
162
+ v-model="sheetShow"
163
+ :z-index="9999"
164
+ :actions="actions"
165
+ :title="title"
166
+ @select="
167
+ ({ item }) => {
168
+ sheetGotoPage(item)
169
+ }
170
+ "
144
171
  />
145
172
  </template>
146
173
 
@@ -202,7 +229,7 @@ const {
202
229
  margin-bottom: 20rpx !important;
203
230
  :deep(.wd-card) {
204
231
  border-radius: 28rpx;
205
- background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,1) 100%);
232
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
206
233
  box-shadow:
207
234
  0 8rpx 32rpx rgba(0, 0, 0, 0.06),
208
235
  0 2rpx 8rpx rgba(0, 0, 0, 0.04),
@@ -226,7 +253,6 @@ const {
226
253
  display: flex;
227
254
  align-items: center;
228
255
  gap: 12rpx;
229
-
230
256
  }
231
257
 
232
258
  :deep(.wd-card__content) {
@@ -282,7 +308,7 @@ const {
282
308
  left: 0;
283
309
  right: 0;
284
310
  height: 50%;
285
- background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, transparent 100%);
311
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
286
312
  border-radius: 28rpx 28rpx 0 0;
287
313
  }
288
314
 
@@ -301,12 +327,7 @@ const {
301
327
  left: -50%;
302
328
  width: 200%;
303
329
  height: 200%;
304
- background: linear-gradient(
305
- 45deg,
306
- transparent 40%,
307
- rgba(255, 255, 255, 0.15) 50%,
308
- transparent 60%
309
- );
330
+ background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
310
331
  animation: shine 15s ease-in-out infinite;
311
332
  pointer-events: none;
312
333
  }
@@ -424,7 +445,8 @@ const {
424
445
  }
425
446
 
426
447
  @keyframes shine {
427
- 0%, 100% {
448
+ 0%,
449
+ 100% {
428
450
  transform: translateX(-100%) rotate(45deg);
429
451
  }
430
452
  50% {
@@ -433,7 +455,8 @@ const {
433
455
  }
434
456
 
435
457
  @keyframes pulseDot {
436
- 0%, 100% {
458
+ 0%,
459
+ 100% {
437
460
  transform: scale(1);
438
461
  opacity: 1;
439
462
  }
@@ -537,7 +560,7 @@ const {
537
560
  }
538
561
  }
539
562
  }
540
- .menu-grid-container :deep(.wd-grid-item__content){
563
+ .menu-grid-container :deep(.wd-grid-item__content) {
541
564
  align-items: normal;
542
565
  }
543
566
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.59",
3
+ "version": "1.1.61",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",