@tplc/business 0.2.70 → 0.2.72
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 +4 -0
- package/components/lcb-product/lcb-product.vue +22 -3
- package/components/lcb-product-item/components/ItemValue.vue +4 -3
- package/components/lcb-product-item/lcb-product-item.vue +0 -2
- package/package.json +1 -1
- package/types/utils/utils.d.ts +1 -0
- package/utils/utils.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.2.72](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.71...v0.2.72) (2025-01-06)
|
|
6
|
+
|
|
7
|
+
### [0.2.71](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.70...v0.2.71) (2025-01-06)
|
|
8
|
+
|
|
5
9
|
### [0.2.70](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.56...v0.2.70) (2025-01-06)
|
|
6
10
|
|
|
7
11
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, useAttrs, watch, computed } from 'vue'
|
|
3
3
|
import UWaterfall from 'uview-plus/components/u-waterfall/u-waterfall.vue'
|
|
4
|
+
import ULazyLoad from 'uview-plus/components/u-lazy-load/u-lazy-load.vue'
|
|
4
5
|
import { LcbProductProps } from './types'
|
|
5
6
|
import { transformValueUnit } from '../../utils/transform'
|
|
7
|
+
import { getPreviewImageUrl } from '../../utils/utils'
|
|
6
8
|
|
|
7
9
|
const uWaterfallRef = ref()
|
|
8
10
|
defineOptions({
|
|
@@ -43,6 +45,7 @@ const getData = async () => {
|
|
|
43
45
|
list.value = []
|
|
44
46
|
}
|
|
45
47
|
}
|
|
48
|
+
|
|
46
49
|
watch(() => props.items, getData, { immediate: true, deep: true })
|
|
47
50
|
const renderList = computed(() => {
|
|
48
51
|
return props.filterList ? props.items : list.value
|
|
@@ -137,14 +140,23 @@ const renderList = computed(() => {
|
|
|
137
140
|
...item,
|
|
138
141
|
}"
|
|
139
142
|
/>
|
|
143
|
+
|
|
140
144
|
<lcb-product-item
|
|
141
|
-
v-else
|
|
142
145
|
v-bind="{ ...item, ...$props, ...attrs }"
|
|
143
146
|
layoutType="vertical"
|
|
144
147
|
tag-overflow-wrap
|
|
148
|
+
v-else
|
|
145
149
|
>
|
|
146
150
|
<template #coverImg="{ value }">
|
|
147
|
-
<
|
|
151
|
+
<u-lazy-load
|
|
152
|
+
threshold="-450"
|
|
153
|
+
:border-radius="imageRadius"
|
|
154
|
+
:image="value"
|
|
155
|
+
:is-effect="false"
|
|
156
|
+
:loading-img="getPreviewImageUrl(value)"
|
|
157
|
+
:index="index"
|
|
158
|
+
/>
|
|
159
|
+
<!-- <wd-img :src="value" width="100%" lazyPlaceWidth="250" height="auto" mode="widthFix" /> -->
|
|
148
160
|
</template>
|
|
149
161
|
</lcb-product-item>
|
|
150
162
|
</slot>
|
|
@@ -176,7 +188,14 @@ const renderList = computed(() => {
|
|
|
176
188
|
tag-overflow-wrap
|
|
177
189
|
>
|
|
178
190
|
<template #coverImg="{ value }">
|
|
179
|
-
<
|
|
191
|
+
<u-lazy-load
|
|
192
|
+
threshold="-450"
|
|
193
|
+
:border-radius="imageRadius"
|
|
194
|
+
:image="value"
|
|
195
|
+
:index="index"
|
|
196
|
+
:is-effect="false"
|
|
197
|
+
:loading-img="getPreviewImageUrl(value)"
|
|
198
|
+
/>
|
|
180
199
|
</template>
|
|
181
200
|
</lcb-product-item>
|
|
182
201
|
</slot>
|
|
@@ -96,9 +96,10 @@ const value = computed(() => {
|
|
|
96
96
|
"
|
|
97
97
|
>
|
|
98
98
|
<!-- 图片 -->
|
|
99
|
-
<
|
|
99
|
+
<block :value="value" v-if="prop === 'coverImg'">
|
|
100
100
|
<view :class="`relative ${className}`" :style="style">
|
|
101
|
-
<wd-img :src="value" mode="aspectFill" width="100%" height="100%" />
|
|
101
|
+
<wd-img :src="value" mode="aspectFill" width="100%" height="100%" v-if="!$slots.coverImg" />
|
|
102
|
+
<slot name="coverImg" :value="value" v-else />
|
|
102
103
|
<!-- imgBottomIcon -->
|
|
103
104
|
<view class="absolute bottom-0 left-0 w-full" v-if="itemProps.imgBottomIcon">
|
|
104
105
|
<wd-img
|
|
@@ -121,7 +122,7 @@ const value = computed(() => {
|
|
|
121
122
|
</view>
|
|
122
123
|
<slot></slot>
|
|
123
124
|
</view>
|
|
124
|
-
</
|
|
125
|
+
</block>
|
|
125
126
|
|
|
126
127
|
<!-- 标题 -->
|
|
127
128
|
<slot :value="value" v-if="prop === 'productName'" name="productName">
|
package/package.json
CHANGED
package/types/utils/utils.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare const getPageOptions: () => Record<string, any>
|
|
|
5
5
|
/** 合并url参数 url = /pages/data/index?id=1&name=2 urlParams = id=1&name=2&type=1 */
|
|
6
6
|
export declare const getFinalUrl: (url: string, urlParams?: string) => string
|
|
7
7
|
export declare const onPageScrollSelector: (selector: string) => void
|
|
8
|
+
export declare const getPreviewImageUrl: (url: string, width?: number) => string
|
package/utils/utils.ts
CHANGED
|
@@ -42,3 +42,12 @@ export const onPageScrollSelector = (selector: string) => {
|
|
|
42
42
|
selector: `${prefix}${selector}`,
|
|
43
43
|
})
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
export const getPreviewImageUrl = (url: string, width = 200) => {
|
|
47
|
+
const isctyun = url?.indexOf('.ctyun') >= 0
|
|
48
|
+
const sym = url?.indexOf('?') > 0 ? '&' : '?'
|
|
49
|
+
const suffix = isctyun
|
|
50
|
+
? `${sym}x-amz-process=image/resize,w_${width},m_lfit`
|
|
51
|
+
: `${sym}x-oss-process=image/resize,m_mfit,w_${width}&imageView2/2/w/${width}`
|
|
52
|
+
return `${url}${width > 0 ? suffix : ''}`
|
|
53
|
+
}
|