af-mobile-client-vue3 1.5.83 → 1.5.85

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,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.5.83",
4
+ "version": "1.5.85",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -0,0 +1,107 @@
1
+ <script setup lang="ts">
2
+ import MessageNotification from '@af-mobile-client-vue3/components/core/MessageNotification/MessageNotification.vue'
3
+ import { useSettingStore } from '@af-mobile-client-vue3/stores/modules/setting'
4
+ import { Icon } from '@iconify/vue'
5
+ import { computed, ref } from 'vue'
6
+
7
+ interface NavigationStyle {
8
+ bgColor?: string
9
+ titleColor?: string
10
+ iconColor?: string
11
+ }
12
+
13
+ interface Props {
14
+ title?: string
15
+ showBack?: boolean
16
+ showMessage?: boolean
17
+ }
18
+
19
+ const props = withDefaults(defineProps<Props>(), {
20
+ title: '',
21
+ showBack: true,
22
+ showMessage: true,
23
+ })
24
+
25
+ const emit = defineEmits<{
26
+ back: []
27
+ }>()
28
+
29
+ // 从 settingStore 获取导航样式配置
30
+ const settingStore = useSettingStore()
31
+ const navigationStyle = computed<NavigationStyle>(() => {
32
+ const config = (settingStore.getSetting() as any)?.navigationStyle
33
+ return {
34
+ bgColor: config?.bgColor || '#fff',
35
+ titleColor: config?.titleColor || '#000',
36
+ iconColor: config?.iconColor || '#666',
37
+ }
38
+ })
39
+
40
+ const headerRef = ref<HTMLElement>()
41
+
42
+ function onBack() {
43
+ emit('back')
44
+ }
45
+
46
+ defineExpose({
47
+ getHeaderHeight: () => {
48
+ if (headerRef.value) {
49
+ const rect = headerRef.value.getBoundingClientRect()
50
+ const height = rect.height
51
+ if (height > 0) {
52
+ document.documentElement.style.setProperty('--system-header-height', `${height}px`)
53
+ }
54
+ return height
55
+ }
56
+ return 0
57
+ },
58
+ })
59
+ </script>
60
+
61
+ <template>
62
+ <div ref="headerRef" class="app-header" :style="{ backgroundColor: navigationStyle.bgColor }">
63
+ <Icon
64
+ v-if="props.showBack"
65
+ icon="mdi:arrow-left"
66
+ :width="24"
67
+ :height="24"
68
+ size="1.15em"
69
+ :style="{ color: navigationStyle.iconColor }"
70
+ @click="onBack"
71
+ />
72
+ <span class="app-header-title" :style="{ color: navigationStyle.titleColor }">{{ props.title }}</span>
73
+ <div v-if="props.showMessage" class="app-header-action">
74
+ <MessageNotification :icon-color="navigationStyle.iconColor" />
75
+ </div>
76
+ <div v-else class="app-header-action-placeholder" />
77
+ </div>
78
+ </template>
79
+
80
+ <style lang="less" scoped>
81
+ .app-header {
82
+ position: sticky;
83
+ top: 0;
84
+ z-index: 10001;
85
+ display: flex;
86
+ align-items: center;
87
+ height: 56px;
88
+ padding-left: 16px;
89
+ padding-right: 16px;
90
+ border-bottom: 1px solid #ebedf0;
91
+ }
92
+
93
+ .app-header-title {
94
+ padding-left: 10px;
95
+ font-size: 1.15rem;
96
+ font-weight: 600;
97
+ }
98
+
99
+ .app-header-action {
100
+ margin-left: auto;
101
+ }
102
+
103
+ .app-header-action-placeholder {
104
+ margin-left: auto;
105
+ width: 36px;
106
+ }
107
+ </style>
@@ -8,6 +8,14 @@ import { closeWebSocket, initWebSocket } from './webSocket'
8
8
  import 'vant/es/badge/style'
9
9
  import 'vant/es/icon/style'
10
10
 
11
+ interface Props {
12
+ iconColor?: string
13
+ }
14
+
15
+ const props = withDefaults(defineProps<Props>(), {
16
+ iconColor: '#666',
17
+ })
18
+
11
19
  const userInfo = useUserStore().getUserInfo()
12
20
 
13
21
  // 未读消息数量
@@ -137,9 +145,9 @@ onUnmounted(() => {
137
145
  <template>
138
146
  <div ref="messageNotificationRef" class="message_icon" @click="showMessageDropdown">
139
147
  <VanBadge v-if="unreadCount > 0" :content="unreadCount" max="99">
140
- <VanIcon name="bell" />
148
+ <VanIcon name="bell" :color="props.iconColor" />
141
149
  </VanBadge>
142
- <VanIcon v-else name="bell" />
150
+ <VanIcon v-else name="bell" :color="props.iconColor" />
143
151
  </div>
144
152
 
145
153
  <div v-if="isShowMessageDropdown" class="message_overlay" @click="isShowMessageDropdown = false" />
@@ -313,7 +321,6 @@ onUnmounted(() => {
313
321
 
314
322
  .van-icon {
315
323
  font-size: 20px;
316
- color: #666;
317
324
  }
318
325
  }
319
326
  </style>
@@ -26,9 +26,10 @@ export interface WebConfig {
26
26
  hiddenTraditionalLogin: boolean
27
27
  isFaceRecognition: boolean // 登录是否需要人脸识别
28
28
  intervalFaceRecognition: boolean // 登录是否需要开启定时人脸识别
29
- faceIntervalMinutes: number // 定时时间
30
- faceRetryCount: number // 重试次数
29
+ faceIntervalMinutes: number // 定时时间 单位分钟
30
+ faceRetryCount: number // 定时验证 重试次数
31
31
  getPlatformUser: boolean // 获取外部用户信息
32
+ navigationStyle: any // app顶部导航区域样式控制
32
33
  }
33
34
 
34
35
  // 存放 webConfig 中的 setting 配置
@@ -247,6 +247,13 @@ export const useUserStore = defineStore('app-user', () => {
247
247
  }
248
248
  // save token
249
249
  setToken(data.access_token)
250
+ const LoginTicket = crypto.AESEncrypt(JSON.stringify(params), '3KMKqvgwR8ULbR8Z')
251
+ if (data.session && useSettingStore().getSetting().requestEncrypt) {
252
+ const k = encryptUtil.RSADecrypt(data.session as string)
253
+ localStorage.setItem('v4-session-key', k)
254
+ secureStorageWrite('v4-session-key', k)
255
+ }
256
+ Storage.set('LoginTicket', LoginTicket)
250
257
  return Promise.resolve(data)
251
258
  }
252
259
  catch (error) {
@@ -1,11 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import type { PhoneLocationStatus } from '@af-mobile-client-vue3/components/data/XOlMap/types'
3
- import MessageNotification from '@af-mobile-client-vue3/components/core/MessageNotification/MessageNotification.vue'
3
+ import AppHeader from '@af-mobile-client-vue3/components/core/AppHeader/index.vue'
4
4
  import useSettingStore from '@af-mobile-client-vue3/stores/modules/setting'
5
5
  import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
6
6
  import { openDrivingConfigPopup } from '@af-mobile-client-vue3/utils/driving/drivingUtils'
7
7
  import { mobileUtil } from '@af-mobile-client-vue3/utils/mobileUtil'
8
- import { Dialog as vanDialog, Icon as vanIcon, Sticky as VanSticky, Switch as VanSwitch,
8
+ import { Dialog as vanDialog, Icon as vanIcon, Switch as VanSwitch,
9
9
  } from 'vant'
10
10
  import { onMounted, onUnmounted, ref } from 'vue'
11
11
  import { useRouter } from 'vue-router'
@@ -167,22 +167,7 @@ function syncAudioPlayEnabled() {
167
167
  <template>
168
168
  <main class="my_main">
169
169
  <!-- 顶部导航栏 -->
170
- <VanSticky :offset-top="0">
171
- <nav class="header_nav">
172
- <div class="header_content">
173
- <h1 class="main_title">
174
- 我的
175
- </h1>
176
- <!-- <div class="setting_section"> -->
177
- <!-- <van-icon name="setting-o" class="setting-icon" /> -->
178
- <!-- </div> -->
179
- <div class="action_section">
180
- <MessageNotification />
181
- </div>
182
- </div>
183
- </nav>
184
- </VanSticky>
185
-
170
+ <AppHeader title="工作台" :show-back="false" :show-message="true" />
186
171
  <!-- 主要内容区域 -->
187
172
  <div class="content">
188
173
  <!-- 用户信息卡片 -->