af-mobile-client-vue3 1.2.5 → 1.2.7

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.2.5",
4
+ "version": "1.2.7",
5
5
  "packageManager": "pnpm@10.12.3",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -617,17 +617,14 @@ defineExpose({
617
617
  <VanCol :span="24">
618
618
  <div class="tag-container">
619
619
  <div class="tag-wrapper">
620
- <VanCol
620
+ <template
621
621
  v-for="column of tagList"
622
622
  :key="`tag_${column.dataIndex}`"
623
- :span="column.flexSpan"
624
- class="tag-col"
625
623
  >
626
624
  <VanTag
627
625
  :text-color="column.tagColor"
628
626
  :color="column.tagBorderColor"
629
- round
630
- size="medium"
627
+ size="large"
631
628
  class="tag-item"
632
629
  >
633
630
  <div class="tag-content">
@@ -640,7 +637,7 @@ defineExpose({
640
637
  />
641
638
  </div>
642
639
  </VanTag>
643
- </VanCol>
640
+ </template>
644
641
  </div>
645
642
  </div>
646
643
  </VanCol>
@@ -822,21 +819,10 @@ defineExpose({
822
819
  width: 100%;
823
820
  margin: 0 -4px;
824
821
 
825
- .tag-col {
826
- display: flex;
827
- align-items: center;
828
- padding: 0 4px;
829
- min-height: 28px;
830
- }
831
-
832
822
  .tag-item {
833
823
  width: auto;
834
- text-align: left;
835
824
  font-size: var(--van-font-size-xs);
836
- display: flex;
837
- align-items: center;
838
- margin: 2px 0;
839
- justify-content: center;
825
+ margin: 2px 4px;
840
826
  :deep(.van-tag) {
841
827
  width: fit-content;
842
828
  display: inline-flex;
@@ -847,7 +833,7 @@ defineExpose({
847
833
  .tag-content {
848
834
  display: flex;
849
835
  align-items: center;
850
- white-space: nowrap;
836
+ //white-space: nowrap;
851
837
  }
852
838
  .tag-icon {
853
839
  margin-right: 4px;
@@ -892,21 +878,19 @@ defineExpose({
892
878
  .card_item_footer {
893
879
  font-size: var(--van-font-size-sm);
894
880
  color: var(--van-text-color-2);
895
- margin-bottom: 12px;
896
881
  padding: 8px 0;
897
- border-top: 1px solid rgba(0, 0, 0, 0.04);
898
-
899
882
  .van-col:last-child {
900
883
  text-align: right;
901
884
  }
902
-
903
885
  .van-col:first-child {
904
886
  text-align: left;
905
887
  }
906
888
  }
907
889
 
908
890
  .card_item_bottom {
909
- margin-top: 4px;
891
+ margin-top: 12px;
892
+ padding-top: 12px;
893
+ border-top: 1px solid rgba(0, 0, 0, 0.06);
910
894
 
911
895
  .more-button {
912
896
  width: 28px;
@@ -933,6 +917,8 @@ defineExpose({
933
917
  }
934
918
 
935
919
  .action-btn {
920
+ --van-button-primary-border-color: #1890ff;
921
+ --van-button-primary-background: #1890ff;
936
922
  min-width: 76px;
937
923
  height: 40px;
938
924
  border-radius: 10px;
@@ -1,34 +1,9 @@
1
1
  <script setup lang="ts">
2
- import useRouteCache from '@af-mobile-client-vue3/stores/modules/routeCache'
3
- import useRouteTransitionNameStore from '@af-mobile-client-vue3/stores/modules/routeTransitionName'
4
- import { storeToRefs } from 'pinia'
5
- import { computed } from 'vue'
6
-
7
- const keepAliveRouteNames = computed(() => {
8
- return useRouteCache().routeCaches as string[]
9
- })
10
- const routeTransitionNameStore = useRouteTransitionNameStore()
11
- const { routeTransitionName } = storeToRefs(routeTransitionNameStore)
12
2
  </script>
13
3
 
14
4
  <template>
15
- <div class="pageLayout">
16
- <router-view v-slot="{ Component, route }">
17
- <transition :name="routeTransitionName">
18
- <keep-alive :include="keepAliveRouteNames">
19
- <div :key="route.name" class="app-wrapper">
20
- <component :is="Component" />
21
- </div>
22
- </keep-alive>
23
- </transition>
24
- </router-view>
25
- </div>
5
+ <div class="pageLayout" />
26
6
  </template>
27
7
 
28
8
  <style lang="less" scoped>
29
- .app-wrapper {
30
- width: 100%;
31
- height: 100%;
32
- overflow-y: auto;
33
- }
34
9
  </style>
@@ -0,0 +1,71 @@
1
+ import { mobileUtil } from './mobileUtil'
2
+
3
+ /**
4
+ * 批量安全存储数据到本地
5
+ * @param storageItems 要存储的数据项数组,每项格式为 {key: string, value: object}
6
+ */
7
+ export function secureStorageBatchWrite(storageItems: Array<{ key: string, value: any }>) {
8
+ console.log('storageItems===', storageItems)
9
+ if (!Array.isArray(storageItems) || storageItems.length === 0)
10
+ return
11
+
12
+ for (const item of storageItems) {
13
+ try {
14
+ mobileUtil.execute({
15
+ funcName: 'secureStorageWrite',
16
+ param: {
17
+ key: item.key,
18
+ value: typeof item.value === 'string' ? item.value : JSON.stringify(item.value),
19
+ },
20
+ callbackFunc: () => {},
21
+ })
22
+ }
23
+ catch (e) {
24
+ console.error(`写入本地缓存失败 [${item.key}]`, e)
25
+ // 单条失败跳过继续处理下一条
26
+ }
27
+ }
28
+ }
29
+
30
+ /**
31
+ * 安全存储单个数据到本地
32
+ * @param key 存储键名
33
+ * @param value 存储值
34
+ * @param callback 可选回调函数
35
+ */
36
+ export function secureStorageWrite(key: string, value: any, callback?: () => void) {
37
+ try {
38
+ mobileUtil.execute({
39
+ funcName: 'secureStorageWrite',
40
+ param: {
41
+ key,
42
+ value: typeof value === 'string' ? value : JSON.stringify(value),
43
+ },
44
+ callbackFunc: callback || (() => {}),
45
+ })
46
+ }
47
+ catch (e) {
48
+ console.error(`写入本地缓存失败 [${key}]`, e)
49
+ }
50
+ }
51
+
52
+ /**
53
+ * 从安全存储读取数据
54
+ * @param key 存储键名
55
+ * @param callback 读取结果回调函数
56
+ */
57
+ export function secureStorageRead(key: string, callback: (result: any) => void) {
58
+ try {
59
+ mobileUtil.execute({
60
+ funcName: 'secureStorageRead',
61
+ param: { key },
62
+ callbackFunc: (result: any) => {
63
+ callback(result)
64
+ },
65
+ })
66
+ }
67
+ catch (e) {
68
+ console.error(`读取本地缓存失败 [${key}]`, e)
69
+ callback({ status: 'error', message: e })
70
+ }
71
+ }