@tplc/business 0.4.59 → 0.4.60

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.4.60](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.59...v0.4.60) (2025-04-06)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 调整数据 ([3778c3c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3778c3caf8ff0193ebac4206945b52c75be8d7af))
11
+
5
12
  ### [0.4.59](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.58...v0.4.59) (2025-04-05)
6
13
 
7
14
 
@@ -140,6 +140,20 @@ const onActionClick = async () => {
140
140
  break
141
141
  /** 退出登录 */
142
142
  case 13:
143
+ uni.showModal({
144
+ title: '提示',
145
+ content: '确定退出登录吗?',
146
+ success: async (res) => {
147
+ if (res.confirm) {
148
+ await uni.$lcb.http.post('/user/user/loginout')
149
+ uni.$lcb.userStore?.().updateUser({
150
+ phone: '',
151
+ userName: '',
152
+ headImgUrl: '',
153
+ })
154
+ }
155
+ },
156
+ })
143
157
  break
144
158
  /** 小程序弹框 */
145
159
  case 14:
@@ -150,7 +164,6 @@ const onActionClick = async () => {
150
164
  if (url) {
151
165
  onPageScrollSelector(url)
152
166
  }
153
-
154
167
  break
155
168
  case 17:
156
169
  if (props.requestInfo)
@@ -30,7 +30,12 @@
30
30
  <view class="flex items-center justify-center text-[var(--content-color)] gap-16rpx">
31
31
  <lcb-city-select :location="userLocation" v-model="addressCity">
32
32
  <view class="flex items-center gap-16rpx">
33
- <view class="text-30rpx max-w-13 truncate">
33
+ <view
34
+ class="max-w-14 truncate"
35
+ :style="{
36
+ fontSize: (addressCity?.addressName || '').length > 4 ? '22rpx' : '30rpx',
37
+ }"
38
+ >
34
39
  {{ addressCity?.addressName || '全国' }}
35
40
  </view>
36
41
  <img
@@ -26,7 +26,7 @@
26
26
  ]"
27
27
  >
28
28
  <lcb-action-view
29
- v-for="(item, index) in items"
29
+ v-for="(item, index) in renderItems"
30
30
  :key="item.title"
31
31
  v-bind="item.link"
32
32
  @click="onItemClick(item)"
@@ -59,6 +59,7 @@
59
59
  :color="iconColor"
60
60
  />
61
61
  <wd-img
62
+ v-else
62
63
  :width="iconSize + 'rpx'"
63
64
  :height="iconSize + 'rpx'"
64
65
  :radius="iconRadius + 'rpx'"
@@ -89,10 +90,14 @@
89
90
  </template>
90
91
 
91
92
  <script lang="ts" setup>
93
+ import { computed, inject, Ref } from 'vue'
92
94
  import { ActionView } from '../../action'
93
95
  import { transformValueUnit } from '../../utils/transform'
94
96
  import { LcbImgNavProps } from './types'
97
+ import { PAGE_PROVIDE_KEY } from '../../constants'
95
98
  const emits = defineEmits(['click'])
99
+ const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
100
+ const userStore = uni.$lcb.userStore?.()
96
101
  const onItemClick = (item: ActionView) => {
97
102
  emits('click', item)
98
103
  }
@@ -105,7 +110,7 @@ defineOptions({
105
110
  },
106
111
  })
107
112
 
108
- withDefaults(defineProps<LcbImgNavProps>(), {
113
+ const props = withDefaults(defineProps<LcbImgNavProps>(), {
109
114
  textColor: '#212121',
110
115
  iconColor: '#212121',
111
116
  iconRadius: 0,
@@ -125,6 +130,21 @@ withDefaults(defineProps<LcbImgNavProps>(), {
125
130
  arrowSize: 44,
126
131
  arrowColor: '#212121',
127
132
  })
133
+
134
+ const renderItems = computed(() => {
135
+ return (
136
+ props.items?.filter((item) => {
137
+ if (item.dependKey) {
138
+ if (item.keyFromUser) {
139
+ return Boolean(userStore?.userInfo?.[item.dependKey])
140
+ } else {
141
+ return Boolean(pageInfo.value?.[item.dependKey])
142
+ }
143
+ }
144
+ return true
145
+ }) || []
146
+ )
147
+ })
128
148
  </script>
129
149
 
130
150
  <style lang="scss" scoped>
@@ -13,7 +13,12 @@ export interface LcbImgNavProps extends LcbBlockProps {
13
13
  /** 图标类型 0.系统 1.自定义 */
14
14
  iconType?: 0 | 1
15
15
  /** 数据内容 */
16
- items?: ActionView[]
16
+ items?: (ActionView & {
17
+ /** 依赖值 */
18
+ dependKey?: string
19
+ /** 依赖值类型 */
20
+ keyFromUser?: boolean
21
+ })[]
17
22
  /** 排布方式每行几个 */
18
23
  pictureDistribution?: 3 | 4 | 5
19
24
  /** 图标尺寸 0.小40px 2.大50px */
@@ -33,7 +33,13 @@
33
33
  授权登录
34
34
  </view>
35
35
  <view v-else class="leading-none">
36
- <view class="text-32rpx font-#000 font-500 mb-20rpx">
36
+ <view
37
+ class="text-32rpx font-#000 font-500 mb-20rpx"
38
+ :style="{
39
+ fontSize: transformValueUnit(textSize),
40
+ color: textColor,
41
+ }"
42
+ >
37
43
  {{ userStore?.userInfo?.userName || '微信用户' }}
38
44
  </view>
39
45
  <view class="flex" @click="toEdit">
@@ -41,7 +47,7 @@
41
47
  class="flex flex-content-center flex-items-center mt-5px border-style-solid"
42
48
  :style="{
43
49
  color: textColor,
44
- borderWidth: editBorder ? transformValueUnit(1) : 0,
50
+ borderWidth: editBorder ? transformValueUnit(2) : 0,
45
51
  borderColor: textColor,
46
52
  padding: editBorder ? `2px ${editSize / 2.5}px 2px ${editSize / 2.5}px` : '',
47
53
  borderRadius: transformValueUnit(30),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.59",
3
+ "version": "0.4.60",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -12,7 +12,12 @@ export interface LcbImgNavProps extends LcbBlockProps {
12
12
  /** 图标类型 0.系统 1.自定义 */
13
13
  iconType?: 0 | 1
14
14
  /** 数据内容 */
15
- items?: ActionView[]
15
+ items?: (ActionView & {
16
+ /** 依赖值 */
17
+ dependKey?: string
18
+ /** 依赖值类型 */
19
+ keyFromUser?: boolean
20
+ })[]
16
21
  /** 排布方式每行几个 */
17
22
  pictureDistribution?: 3 | 4 | 5
18
23
  /** 图标尺寸 0.小40px 2.大50px */