@tplc/business 0.2.21 → 0.2.23
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 +39 -0
- package/components/lcb-absolute-config-layout/lcb-absolute-config-layout.vue +206 -0
- package/components/lcb-absolute-config-layout/types.ts +29 -0
- package/components/lcb-action-view/lcb-action-view.vue +15 -2
- package/components/lcb-action-view/types.ts +10 -2
- package/components/lcb-product/lcb-product.vue +50 -1
- package/components/lcb-product/types.ts +9 -0
- package/constants.ts +2 -0
- package/global.d.ts +1 -0
- package/package.json +1 -1
- package/types/components/lcb-absolute-config-layout/lcb-absolute-config-layout.vue.d.ts +71 -0
- package/types/components/lcb-absolute-config-layout/types.d.ts +26 -0
- package/types/components/lcb-action-view/lcb-action-view.vue.d.ts +0 -1
- package/types/components/lcb-action-view/types.d.ts +10 -2
- package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +1 -1
- package/types/components/lcb-list/components/FilterSelect/index.vue.d.ts +1 -1
- package/types/components/lcb-list/components/TreeSelect/index.vue.d.ts +1 -1
- package/types/components/lcb-notice/lcb-notice.vue.d.ts +2 -2
- package/types/components/lcb-product/lcb-product.vue.d.ts +9 -0
- package/types/components/lcb-product/types.d.ts +9 -0
- package/types/components/lcb-swiper/lcb-swiper.vue.d.ts +1 -1
- package/types/constants.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,45 @@
|
|
|
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.23](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.17...v0.2.23) (2024-12-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
9
|
+
|
|
10
|
+
* banner-block 兼容小程序 ([aa79283](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/aa79283f24e97ca68d8ad7fd18863b05dc5c9e26))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
14
|
+
|
|
15
|
+
* **release:** 0.2.18 ([c4cc997](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/c4cc997bad57984a73337fe84d09a2bfbddaa03b))
|
|
16
|
+
* **release:** 0.2.19 ([8244906](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/82449068dc7466bdb4c881254f150af4b4721d1e))
|
|
17
|
+
* **release:** 0.2.20 ([40b1730](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/40b1730473b764d84e3259235fd3ee44b1ed2b54))
|
|
18
|
+
* **release:** 0.2.21 ([736c482](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/736c482a6827a75606eec8774c9f6b31daa0f096))
|
|
19
|
+
* **release:** 0.2.22 ([230f4dd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/230f4dd925a132878a2601b2bd239e23b7a4b806))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### ✨ Features | 新功能
|
|
23
|
+
|
|
24
|
+
* action-view pop ([3695f0b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3695f0be2d1bfb025822be3190c96bb9cb71ea05))
|
|
25
|
+
* search 调整查询模式 ([7fa381d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7fa381daab8935c27005615ddc15252ec01f8399))
|
|
26
|
+
* 引擎支持list ([012e9cb](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/012e9cbf03cff9a434fd6f9adbb4aa6b7f88d8f4))
|
|
27
|
+
* 新增action地图查看 ([b1b4a51](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b1b4a5159c431dd8b8a4518ce6699e34f393c206))
|
|
28
|
+
* 自定义组件支持变量 ([237bc85](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/237bc85163905f4a9d776e14027c53392cb0b3df))
|
|
29
|
+
* 调整action样式 ([04ed49d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/04ed49dd37e2db636f2a2dd02064bd869f0bb550))
|
|
30
|
+
|
|
31
|
+
### [0.2.22](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.21...v0.2.22) (2024-12-14)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
35
|
+
|
|
36
|
+
* banner-block 兼容小程序 ([aa79283](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/aa79283f24e97ca68d8ad7fd18863b05dc5c9e26))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### ✨ Features | 新功能
|
|
40
|
+
|
|
41
|
+
* 引擎支持list ([012e9cb](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/012e9cbf03cff9a434fd6f9adbb4aa6b7f88d8f4))
|
|
42
|
+
* 自定义组件支持变量 ([237bc85](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/237bc85163905f4a9d776e14027c53392cb0b3df))
|
|
43
|
+
|
|
5
44
|
### [0.2.21](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.20...v0.2.21) (2024-12-06)
|
|
6
45
|
|
|
7
46
|
### [0.2.20](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.19...v0.2.20) (2024-12-06)
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
import { LcbAbsoluteConfigLayoutProps, LcbAbsoluteConfigLayoutBlock } from './types'
|
|
5
|
+
defineOptions({
|
|
6
|
+
name: 'LcbAbsoluteConfigLayout',
|
|
7
|
+
options: {
|
|
8
|
+
addGlobalClass: true,
|
|
9
|
+
virtualHost: true,
|
|
10
|
+
styleIsolation: 'shared',
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
const props = withDefaults(defineProps<LcbAbsoluteConfigLayoutProps>(), {
|
|
14
|
+
mode: 'view',
|
|
15
|
+
dataset: {},
|
|
16
|
+
blocks: [],
|
|
17
|
+
canvas: {
|
|
18
|
+
width: 0,
|
|
19
|
+
height: 0,
|
|
20
|
+
},
|
|
21
|
+
} as any)
|
|
22
|
+
const highlightId = defineModel<number>()
|
|
23
|
+
const emit = defineEmits(['startCanvasResize', 'startDragBlock', 'removeBlock', 'startResizeBlock'])
|
|
24
|
+
|
|
25
|
+
function startCanvasResize(...args: any[]) {
|
|
26
|
+
if (props.mode !== 'edit') return
|
|
27
|
+
emit('startCanvasResize', ...args)
|
|
28
|
+
}
|
|
29
|
+
function startDragBlock(...args: any[]) {
|
|
30
|
+
highlightId.value = args[1].id
|
|
31
|
+
if (props.mode !== 'edit') return
|
|
32
|
+
emit('startDragBlock', ...args)
|
|
33
|
+
}
|
|
34
|
+
function removeBlock(...args: any[]) {
|
|
35
|
+
if (props.mode !== 'edit') return
|
|
36
|
+
emit('removeBlock', ...args)
|
|
37
|
+
}
|
|
38
|
+
function startResizeBlock(...args: any[]) {
|
|
39
|
+
if (props.mode !== 'edit') return
|
|
40
|
+
emit('startResizeBlock', ...args)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function resolvePlaceholders(template, values) {
|
|
44
|
+
// 递归处理模板
|
|
45
|
+
const resolveValue = (value) => {
|
|
46
|
+
if (typeof value === 'string' && value.startsWith('$')) {
|
|
47
|
+
const resolvedKey = value.slice(1) // 去掉占位符前的 '$'
|
|
48
|
+
return values.hasOwnProperty(resolvedKey) ? values[resolvedKey] : '' // 替换或置空
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(value)) {
|
|
51
|
+
return value.map(resolveValue) // 递归处理数组
|
|
52
|
+
}
|
|
53
|
+
if (value && typeof value === 'object') {
|
|
54
|
+
return resolvePlaceholders(value, values) // 递归处理对象
|
|
55
|
+
}
|
|
56
|
+
return value // 非占位符值直接返回
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 遍历模板对象的键值对
|
|
60
|
+
return Object.fromEntries(
|
|
61
|
+
Object.entries(template).map(([key, value]) => [key, resolveValue(value)]),
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const calcBlocks = computed<LcbAbsoluteConfigLayoutBlock[]>(() => {
|
|
66
|
+
if (!props?.dataset) {
|
|
67
|
+
return props.blocks
|
|
68
|
+
}
|
|
69
|
+
// const currentBlockString = JSON.stringify(props.blocks)
|
|
70
|
+
// const mapBlockString = Object.entries(props?.dataset ?? {}).reduce((string, [key, value]) => {
|
|
71
|
+
// const reg = new RegExp(`\\$${key}`, 'g')
|
|
72
|
+
// // @ts-ignore
|
|
73
|
+
// const nextString = string.replace(reg, Array.isArray(value) ? JSON.stringify(value) : value)
|
|
74
|
+
|
|
75
|
+
// return nextString
|
|
76
|
+
// }, currentBlockString)
|
|
77
|
+
|
|
78
|
+
// console.log('mapBlockString', currentBlockString, props?.dataset, mapBlockString)
|
|
79
|
+
|
|
80
|
+
// return JSON.parse(mapBlockString) as LcbAbsoluteConfigLayoutBlock[]
|
|
81
|
+
|
|
82
|
+
return ((props.blocks as any) ?? [])?.map?.((block) => {
|
|
83
|
+
return {
|
|
84
|
+
...block,
|
|
85
|
+
props: resolvePlaceholders(block.props, props?.dataset ?? {}),
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
</script>
|
|
90
|
+
<template>
|
|
91
|
+
<view
|
|
92
|
+
:class="[
|
|
93
|
+
'relative',
|
|
94
|
+
{
|
|
95
|
+
'border border-gray-100 border-solid': mode === 'edit',
|
|
96
|
+
},
|
|
97
|
+
]"
|
|
98
|
+
:style="{
|
|
99
|
+
width: `${canvas?.width}px`,
|
|
100
|
+
height: `${canvas?.height}px`,
|
|
101
|
+
backgroundColor: canvas?.backgroundColor,
|
|
102
|
+
}"
|
|
103
|
+
>
|
|
104
|
+
<view
|
|
105
|
+
v-if="mode === 'edit'"
|
|
106
|
+
class="absolute text-white bottom-0 -right-[2px] translate-y-[100%] bg-gray-500/50 flex gap-2 p-1"
|
|
107
|
+
>
|
|
108
|
+
<!-- 画布调整大小 -->
|
|
109
|
+
<view
|
|
110
|
+
class="cursor-se-resize flex items-center justify-center"
|
|
111
|
+
@mousedown="startCanvasResize($event)"
|
|
112
|
+
>
|
|
113
|
+
<wd-icon name="fullsreen" size="14px" custom-class="!block"></wd-icon>
|
|
114
|
+
</view>
|
|
115
|
+
</view>
|
|
116
|
+
|
|
117
|
+
<!-- 渲染块 -->
|
|
118
|
+
<view
|
|
119
|
+
v-for="block in mode === 'edit' ? blocks : calcBlocks"
|
|
120
|
+
:key="block.id"
|
|
121
|
+
:class="[
|
|
122
|
+
'absolute',
|
|
123
|
+
{
|
|
124
|
+
'cursor-move group hover:outline hover:outline-blue hover:bg-gray-100/20':
|
|
125
|
+
mode === 'edit',
|
|
126
|
+
'outline outline-blue/30 ': mode === 'edit' && highlightId === block.id,
|
|
127
|
+
},
|
|
128
|
+
]"
|
|
129
|
+
:style="{
|
|
130
|
+
// background: block.color,
|
|
131
|
+
zIndex: block.zIndex,
|
|
132
|
+
left: block.x + 'px',
|
|
133
|
+
top: block.y + 'px',
|
|
134
|
+
width: block.width + 'px',
|
|
135
|
+
height: block.height + 'px',
|
|
136
|
+
}"
|
|
137
|
+
@mousedown="startDragBlock($event, block)"
|
|
138
|
+
>
|
|
139
|
+
<wd-text
|
|
140
|
+
v-if="block.type === 'text'"
|
|
141
|
+
custom-class="!break-all"
|
|
142
|
+
:lines="99"
|
|
143
|
+
v-bind="block.props"
|
|
144
|
+
:size="`${block?.props?.size ?? 12}px`"
|
|
145
|
+
/>
|
|
146
|
+
<wd-button
|
|
147
|
+
v-else-if="block.type === 'button'"
|
|
148
|
+
custom-class="!min-w-full !min-h-full !w-full !h-full"
|
|
149
|
+
:style="{
|
|
150
|
+
backgroundColor: block.props?.backgroundColor,
|
|
151
|
+
...(block.props?.style ?? {}),
|
|
152
|
+
}"
|
|
153
|
+
v-bind="block.props"
|
|
154
|
+
>
|
|
155
|
+
{{ block.props?.content }}
|
|
156
|
+
</wd-button>
|
|
157
|
+
<wd-img
|
|
158
|
+
v-else-if="block.type === 'image'"
|
|
159
|
+
:custom-class="`!w-full !h-full ${!block?.props?.src ? '!bg-coolGray' : ''}`"
|
|
160
|
+
v-bind="block.props"
|
|
161
|
+
:src="block?.props?.src"
|
|
162
|
+
/>
|
|
163
|
+
|
|
164
|
+
<view
|
|
165
|
+
v-else-if="block.type === 'tags'"
|
|
166
|
+
:class="[
|
|
167
|
+
'flex gap-1',
|
|
168
|
+
{
|
|
169
|
+
'whitespace-nowrap overflow-auto': !block.props?.overflowWrap,
|
|
170
|
+
'flex-wrap': block.props?.overflowWrap,
|
|
171
|
+
},
|
|
172
|
+
]"
|
|
173
|
+
>
|
|
174
|
+
<wd-tag v-for="tag in block?.props?.tags ?? []" :key="tag" v-bind="block.props">
|
|
175
|
+
{{ tag }}
|
|
176
|
+
</wd-tag>
|
|
177
|
+
</view>
|
|
178
|
+
|
|
179
|
+
<view class="bg-gray-500/30 group-hover:bg-gray-500/70" v-else>
|
|
180
|
+
{{ block.type ?? 'unknow type' }}
|
|
181
|
+
</view>
|
|
182
|
+
|
|
183
|
+
<view
|
|
184
|
+
v-if="mode === 'edit'"
|
|
185
|
+
class="absolute text-white bottom-0 -right-[2px] translate-y-[100%] bg-gray-500/50 flex gap-2 p-1 group-hover:visible invisible"
|
|
186
|
+
>
|
|
187
|
+
<wd-icon
|
|
188
|
+
name="delete"
|
|
189
|
+
size="14px"
|
|
190
|
+
color="red"
|
|
191
|
+
custom-class="!cursor-pointer"
|
|
192
|
+
@click="removeBlock(block)"
|
|
193
|
+
></wd-icon>
|
|
194
|
+
<!-- 调整块大小 -->
|
|
195
|
+
<view
|
|
196
|
+
class="cursor-se-resize flex items-center justify-center group-hover:visible invisible"
|
|
197
|
+
@mousedown="startResizeBlock($event, block)"
|
|
198
|
+
>
|
|
199
|
+
<wd-icon name="fullsreen" size="14px" custom-class="!block"></wd-icon>
|
|
200
|
+
</view>
|
|
201
|
+
</view>
|
|
202
|
+
</view>
|
|
203
|
+
</view>
|
|
204
|
+
</template>
|
|
205
|
+
|
|
206
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface LcbAbsoluteConfigLayoutBlock {
|
|
2
|
+
id: number
|
|
3
|
+
x: number
|
|
4
|
+
y: number
|
|
5
|
+
offsetX: number
|
|
6
|
+
offsetY: number
|
|
7
|
+
zIndex: number
|
|
8
|
+
width: number
|
|
9
|
+
height: number
|
|
10
|
+
minWidth: number
|
|
11
|
+
minHeight: number
|
|
12
|
+
maxWidth: number
|
|
13
|
+
maxHeight: number
|
|
14
|
+
type: string
|
|
15
|
+
props: Record<string, any>
|
|
16
|
+
// color: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface LcbAbsoluteConfigLayoutProps {
|
|
20
|
+
// Define the component's prop types here
|
|
21
|
+
mode: 'edit' | 'view'
|
|
22
|
+
dataset?: Record<string, any>
|
|
23
|
+
blocks: LcbAbsoluteConfigLayoutBlock[]
|
|
24
|
+
canvas: {
|
|
25
|
+
width: number
|
|
26
|
+
height: number
|
|
27
|
+
backgroundColor?: string
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -34,10 +34,11 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script setup lang="ts">
|
|
37
|
-
import { computed, ref } from 'vue'
|
|
37
|
+
import { computed, inject, Ref, ref } from 'vue'
|
|
38
38
|
import { LcbActionViewProps } from './types'
|
|
39
39
|
import { uploadFile } from '../../hooks/useUpload'
|
|
40
40
|
import mpHtml from 'mp-html/src/uni-app/components/mp-html/mp-html.vue'
|
|
41
|
+
import { PAGE_ANCHOR_PROVIDE_KEY } from '../../constants'
|
|
41
42
|
defineOptions({
|
|
42
43
|
name: 'LcbActionView',
|
|
43
44
|
options: {
|
|
@@ -54,6 +55,8 @@ const emits = defineEmits<{
|
|
|
54
55
|
}>()
|
|
55
56
|
|
|
56
57
|
const show = ref(false)
|
|
58
|
+
// 锚点
|
|
59
|
+
const anchor = inject(PAGE_ANCHOR_PROVIDE_KEY) as Ref<string>
|
|
57
60
|
|
|
58
61
|
const openType = computed(() => {
|
|
59
62
|
return {
|
|
@@ -66,7 +69,7 @@ const openType = computed(() => {
|
|
|
66
69
|
}[props.jumpType || '']
|
|
67
70
|
})
|
|
68
71
|
const onActionClick = () => {
|
|
69
|
-
const { jumpAppid, jumpUrl: url, jumpType, phoneNumber } = props
|
|
72
|
+
const { jumpAppid, jumpUrl: url, jumpType, phoneNumber, addressInfo } = props
|
|
70
73
|
/**
|
|
71
74
|
* 跳转类型 1: 网页 2: 小程序内页 10: 跳转小程序 11: 跳转半屏小程序 12: 小程序客服
|
|
72
75
|
* 13: 退出登录 14: 小程序弹框 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
|
|
@@ -113,6 +116,11 @@ const onActionClick = () => {
|
|
|
113
116
|
case 14:
|
|
114
117
|
show.value = true
|
|
115
118
|
break
|
|
119
|
+
|
|
120
|
+
/** 锚点跳转 */
|
|
121
|
+
case 16:
|
|
122
|
+
if (url) anchor.value = url
|
|
123
|
+
break
|
|
116
124
|
/** 新窗口跳到页面 */
|
|
117
125
|
case 21:
|
|
118
126
|
if (url) {
|
|
@@ -160,6 +168,11 @@ const onActionClick = () => {
|
|
|
160
168
|
phoneNumber,
|
|
161
169
|
})
|
|
162
170
|
break
|
|
171
|
+
case 105:
|
|
172
|
+
if (addressInfo) {
|
|
173
|
+
uni.openLocation(addressInfo)
|
|
174
|
+
}
|
|
175
|
+
break
|
|
163
176
|
default:
|
|
164
177
|
emits('click')
|
|
165
178
|
break
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface LcbActionViewProps {
|
|
2
2
|
/**
|
|
3
3
|
* 跳转类型 1: 网页 2: 小程序内页 10: 跳转小程序 11: 跳转半屏小程序 12: 小程序客服
|
|
4
|
-
* 13: 退出登录 14: 小程序弹框 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
|
|
5
|
-
* 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页
|
|
4
|
+
* 13: 退出登录 14: 小程序弹框 16: 小程序锚点 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
|
|
5
|
+
* 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页 105 查看地图
|
|
6
6
|
*/
|
|
7
7
|
jumpType?:
|
|
8
8
|
| 1
|
|
@@ -12,6 +12,7 @@ export interface LcbActionViewProps {
|
|
|
12
12
|
| 12
|
|
13
13
|
| 13
|
|
14
14
|
| 14
|
|
15
|
+
| 16
|
|
15
16
|
| 21
|
|
16
17
|
| 22
|
|
17
18
|
| 23
|
|
@@ -24,6 +25,7 @@ export interface LcbActionViewProps {
|
|
|
24
25
|
| 102
|
|
25
26
|
| 103
|
|
26
27
|
| 104
|
|
28
|
+
| 105
|
|
27
29
|
/** 跳转路径 */
|
|
28
30
|
jumpUrl?: string
|
|
29
31
|
/** 小程序appid */
|
|
@@ -33,4 +35,10 @@ export interface LcbActionViewProps {
|
|
|
33
35
|
content?: string
|
|
34
36
|
title?: string
|
|
35
37
|
position?: string
|
|
38
|
+
addressInfo?: {
|
|
39
|
+
address: string
|
|
40
|
+
latitude: number
|
|
41
|
+
longitude: number
|
|
42
|
+
name: string
|
|
43
|
+
}
|
|
36
44
|
}
|
|
@@ -33,7 +33,17 @@ defineSlots<{
|
|
|
33
33
|
v-bind="item.link"
|
|
34
34
|
>
|
|
35
35
|
<slot name="item" :item="item">
|
|
36
|
+
<lcb-absolute-config-layout
|
|
37
|
+
v-if="renderItemAbsoluteConfigLayout"
|
|
38
|
+
:blocks="renderItemAbsoluteConfigLayout?.blocks"
|
|
39
|
+
:canvas="renderItemAbsoluteConfigLayout?.canvas"
|
|
40
|
+
:dataset="{
|
|
41
|
+
...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
|
|
42
|
+
...item,
|
|
43
|
+
}"
|
|
44
|
+
/>
|
|
36
45
|
<lcb-product-item
|
|
46
|
+
v-else
|
|
37
47
|
v-bind="{ ...item, ...attrs }"
|
|
38
48
|
:imageStyle="{
|
|
39
49
|
width: imageWidth ?? `${imageWidthPercent}%`,
|
|
@@ -77,7 +87,17 @@ defineSlots<{
|
|
|
77
87
|
<view class="p-1 overflow-hidden">
|
|
78
88
|
<view class="rounded overflow-hidden" :style="{ height: `${itemHeight}rpx` }">
|
|
79
89
|
<slot name="item" :item="item">
|
|
90
|
+
<lcb-absolute-config-layout
|
|
91
|
+
v-if="renderItemAbsoluteConfigLayout"
|
|
92
|
+
:blocks="renderItemAbsoluteConfigLayout?.blocks"
|
|
93
|
+
:canvas="renderItemAbsoluteConfigLayout?.canvas"
|
|
94
|
+
:dataset="{
|
|
95
|
+
...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
|
|
96
|
+
...item,
|
|
97
|
+
}"
|
|
98
|
+
/>
|
|
80
99
|
<lcb-product-item
|
|
100
|
+
v-else
|
|
81
101
|
v-bind="{ ...item, ...attrs }"
|
|
82
102
|
layoutType="vertical"
|
|
83
103
|
className="!h-full"
|
|
@@ -114,7 +134,17 @@ defineSlots<{
|
|
|
114
134
|
class="rounded overflow-hidden"
|
|
115
135
|
>
|
|
116
136
|
<slot name="item" :item="item">
|
|
137
|
+
<lcb-absolute-config-layout
|
|
138
|
+
v-if="renderItemAbsoluteConfigLayout"
|
|
139
|
+
:blocks="renderItemAbsoluteConfigLayout?.blocks"
|
|
140
|
+
:canvas="renderItemAbsoluteConfigLayout?.canvas"
|
|
141
|
+
:dataset="{
|
|
142
|
+
...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
|
|
143
|
+
...item,
|
|
144
|
+
}"
|
|
145
|
+
/>
|
|
117
146
|
<lcb-product-item
|
|
147
|
+
v-else
|
|
118
148
|
v-bind="{ ...item, ...attrs }"
|
|
119
149
|
layoutType="vertical"
|
|
120
150
|
tag-overflow-wrap
|
|
@@ -161,7 +191,17 @@ defineSlots<{
|
|
|
161
191
|
class="rounded overflow-hidden"
|
|
162
192
|
>
|
|
163
193
|
<slot name="item" :item="item">
|
|
194
|
+
<lcb-absolute-config-layout
|
|
195
|
+
v-if="renderItemAbsoluteConfigLayout"
|
|
196
|
+
:blocks="renderItemAbsoluteConfigLayout?.blocks"
|
|
197
|
+
:canvas="renderItemAbsoluteConfigLayout?.canvas"
|
|
198
|
+
:dataset="{
|
|
199
|
+
...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
|
|
200
|
+
...item,
|
|
201
|
+
}"
|
|
202
|
+
/>
|
|
164
203
|
<lcb-product-item
|
|
204
|
+
v-else
|
|
165
205
|
v-bind="{ ...item, ...attrs }"
|
|
166
206
|
layoutType="vertical"
|
|
167
207
|
tag-overflow-wrap
|
|
@@ -210,7 +250,16 @@ defineSlots<{
|
|
|
210
250
|
class="!w-66vw flex-shrink-0"
|
|
211
251
|
>
|
|
212
252
|
<slot name="item" :item="item">
|
|
213
|
-
<lcb-
|
|
253
|
+
<lcb-absolute-config-layout
|
|
254
|
+
v-if="renderItemAbsoluteConfigLayout"
|
|
255
|
+
:blocks="renderItemAbsoluteConfigLayout?.blocks"
|
|
256
|
+
:canvas="renderItemAbsoluteConfigLayout?.canvas"
|
|
257
|
+
:dataset="{
|
|
258
|
+
...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
|
|
259
|
+
...item,
|
|
260
|
+
}"
|
|
261
|
+
/>
|
|
262
|
+
<lcb-product-item v-else v-bind="item" imageClass="!w-1/2"></lcb-product-item>
|
|
214
263
|
</slot>
|
|
215
264
|
</view>
|
|
216
265
|
</view>
|
|
@@ -8,4 +8,13 @@ export interface LcbProductProps {
|
|
|
8
8
|
imageRadius?: number
|
|
9
9
|
itemHeight?: number // 列表项高度
|
|
10
10
|
items?: Record<string, any>[]
|
|
11
|
+
renderItemAbsoluteConfigLayout?: {
|
|
12
|
+
dataset?: Record<string, any>
|
|
13
|
+
blocks: any[]
|
|
14
|
+
canvas: {
|
|
15
|
+
width: number
|
|
16
|
+
height: number
|
|
17
|
+
backgroundColor?: string
|
|
18
|
+
}
|
|
19
|
+
}
|
|
11
20
|
}
|
package/constants.ts
CHANGED
package/global.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare module 'vue' {
|
|
2
2
|
// Helper for Volar
|
|
3
3
|
export interface GlobalComponents {
|
|
4
|
+
'lcb-absolute-config-layout': (typeof import('./types/components/lcb-absolute-config-layout/lcb-absolute-config-layout.vue'))['default']
|
|
4
5
|
'lcb-action-view': (typeof import('./types/components/lcb-action-view/lcb-action-view.vue'))['default']
|
|
5
6
|
'lcb-advert': (typeof import('./types/components/lcb-advert/lcb-advert.vue'))['default']
|
|
6
7
|
'lcb-area-picker': (typeof import('./types/components/lcb-area-picker/lcb-area-picker.vue'))['default']
|
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { LcbAbsoluteConfigLayoutProps, LcbAbsoluteConfigLayoutBlock } from './types'
|
|
2
|
+
declare let __VLS_typeProps: LcbAbsoluteConfigLayoutProps
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: number
|
|
5
|
+
} & typeof __VLS_typeProps
|
|
6
|
+
declare const _default: import('vue').DefineComponent<
|
|
7
|
+
__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, any>,
|
|
8
|
+
{},
|
|
9
|
+
unknown,
|
|
10
|
+
{},
|
|
11
|
+
{},
|
|
12
|
+
import('vue').ComponentOptionsMixin,
|
|
13
|
+
import('vue').ComponentOptionsMixin,
|
|
14
|
+
{
|
|
15
|
+
'update:modelValue': (modelValue: number) => void
|
|
16
|
+
startCanvasResize: (...args: any[]) => void
|
|
17
|
+
startDragBlock: (...args: any[]) => void
|
|
18
|
+
removeBlock: (...args: any[]) => void
|
|
19
|
+
startResizeBlock: (...args: any[]) => void
|
|
20
|
+
},
|
|
21
|
+
string,
|
|
22
|
+
import('vue').PublicProps,
|
|
23
|
+
Readonly<
|
|
24
|
+
import('vue').ExtractPropTypes<
|
|
25
|
+
__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, any>
|
|
26
|
+
>
|
|
27
|
+
> & {
|
|
28
|
+
onStartCanvasResize?: ((...args: any[]) => any) | undefined
|
|
29
|
+
onStartDragBlock?: ((...args: any[]) => any) | undefined
|
|
30
|
+
onRemoveBlock?: ((...args: any[]) => any) | undefined
|
|
31
|
+
onStartResizeBlock?: ((...args: any[]) => any) | undefined
|
|
32
|
+
'onUpdate:modelValue'?: ((modelValue: number) => any) | undefined
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
mode: 'edit' | 'view'
|
|
36
|
+
dataset: Record<string, any>
|
|
37
|
+
blocks: LcbAbsoluteConfigLayoutBlock[]
|
|
38
|
+
canvas: {
|
|
39
|
+
width: number
|
|
40
|
+
height: number
|
|
41
|
+
backgroundColor?: string
|
|
42
|
+
}
|
|
43
|
+
modelValue: number
|
|
44
|
+
},
|
|
45
|
+
{}
|
|
46
|
+
>
|
|
47
|
+
export default _default
|
|
48
|
+
|
|
49
|
+
type __VLS_WithDefaults<P, D> = {
|
|
50
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D
|
|
51
|
+
? __VLS_Prettify<
|
|
52
|
+
P[K] & {
|
|
53
|
+
default: D[K]
|
|
54
|
+
}
|
|
55
|
+
>
|
|
56
|
+
: P[K]
|
|
57
|
+
}
|
|
58
|
+
type __VLS_Prettify<T> = {
|
|
59
|
+
[K in keyof T]: T[K]
|
|
60
|
+
} & {}
|
|
61
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
|
|
62
|
+
type __VLS_TypePropsToOption<T> = {
|
|
63
|
+
[K in keyof T]-?: {} extends Pick<T, K>
|
|
64
|
+
? {
|
|
65
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
|
|
66
|
+
}
|
|
67
|
+
: {
|
|
68
|
+
type: import('vue').PropType<T[K]>
|
|
69
|
+
required: true
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface LcbAbsoluteConfigLayoutBlock {
|
|
2
|
+
id: number
|
|
3
|
+
x: number
|
|
4
|
+
y: number
|
|
5
|
+
offsetX: number
|
|
6
|
+
offsetY: number
|
|
7
|
+
zIndex: number
|
|
8
|
+
width: number
|
|
9
|
+
height: number
|
|
10
|
+
minWidth: number
|
|
11
|
+
minHeight: number
|
|
12
|
+
maxWidth: number
|
|
13
|
+
maxHeight: number
|
|
14
|
+
type: string
|
|
15
|
+
props: Record<string, any>
|
|
16
|
+
}
|
|
17
|
+
export interface LcbAbsoluteConfigLayoutProps {
|
|
18
|
+
mode: 'edit' | 'view'
|
|
19
|
+
dataset?: Record<string, any>
|
|
20
|
+
blocks: LcbAbsoluteConfigLayoutBlock[]
|
|
21
|
+
canvas: {
|
|
22
|
+
width: number
|
|
23
|
+
height: number
|
|
24
|
+
backgroundColor?: string
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface LcbActionViewProps {
|
|
2
2
|
/**
|
|
3
3
|
* 跳转类型 1: 网页 2: 小程序内页 10: 跳转小程序 11: 跳转半屏小程序 12: 小程序客服
|
|
4
|
-
* 13: 退出登录 14: 小程序弹框 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
|
|
5
|
-
* 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页
|
|
4
|
+
* 13: 退出登录 14: 小程序弹框 16: 小程序锚点 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
|
|
5
|
+
* 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页 105 查看地图
|
|
6
6
|
*/
|
|
7
7
|
jumpType?:
|
|
8
8
|
| 1
|
|
@@ -12,6 +12,7 @@ export interface LcbActionViewProps {
|
|
|
12
12
|
| 12
|
|
13
13
|
| 13
|
|
14
14
|
| 14
|
|
15
|
+
| 16
|
|
15
16
|
| 21
|
|
16
17
|
| 22
|
|
17
18
|
| 23
|
|
@@ -24,6 +25,7 @@ export interface LcbActionViewProps {
|
|
|
24
25
|
| 102
|
|
25
26
|
| 103
|
|
26
27
|
| 104
|
|
28
|
+
| 105
|
|
27
29
|
/** 跳转路径 */
|
|
28
30
|
jumpUrl?: string
|
|
29
31
|
/** 小程序appid */
|
|
@@ -33,4 +35,10 @@ export interface LcbActionViewProps {
|
|
|
33
35
|
content?: string
|
|
34
36
|
title?: string
|
|
35
37
|
position?: string
|
|
38
|
+
addressInfo?: {
|
|
39
|
+
address: string
|
|
40
|
+
latitude: number
|
|
41
|
+
longitude: number
|
|
42
|
+
name: string
|
|
43
|
+
}
|
|
36
44
|
}
|
|
@@ -20,8 +20,8 @@ declare const _default: import('vue').DefineComponent<
|
|
|
20
20
|
string,
|
|
21
21
|
import('vue').PublicProps,
|
|
22
22
|
Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
|
|
23
|
-
onSubmit?: ((...args: any[]) => any) | undefined
|
|
24
23
|
'onUpdate:modelValue'?: ((modelValue: string | string[]) => any) | undefined
|
|
24
|
+
onSubmit?: ((...args: any[]) => any) | undefined
|
|
25
25
|
'onUpdate:title'?: ((title: string) => any) | undefined
|
|
26
26
|
},
|
|
27
27
|
{},
|
|
@@ -20,8 +20,8 @@ declare const _default: import('vue').DefineComponent<
|
|
|
20
20
|
string,
|
|
21
21
|
import('vue').PublicProps,
|
|
22
22
|
Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
|
|
23
|
-
onSubmit?: ((...args: any[]) => any) | undefined
|
|
24
23
|
'onUpdate:modelValue'?: ((modelValue: string | string[]) => any) | undefined
|
|
24
|
+
onSubmit?: ((...args: any[]) => any) | undefined
|
|
25
25
|
'onUpdate:title'?: ((title: string) => any) | undefined
|
|
26
26
|
},
|
|
27
27
|
{},
|
|
@@ -40,10 +40,10 @@ declare const _default: import('vue').DefineComponent<
|
|
|
40
40
|
>
|
|
41
41
|
>,
|
|
42
42
|
{
|
|
43
|
-
|
|
43
|
+
backgroundColor: string
|
|
44
44
|
color: string
|
|
45
|
+
direction: import('@tplc/wot/types/components/wd-notice-bar/types').NoticeBarScrollDirection
|
|
45
46
|
paddingVertical: number
|
|
46
|
-
backgroundColor: string
|
|
47
47
|
borderColor: string
|
|
48
48
|
iconSize: number
|
|
49
49
|
speed: number
|
|
@@ -29,6 +29,15 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
29
29
|
imageWidthPercent: number
|
|
30
30
|
imageHeightPercent: number
|
|
31
31
|
itemHeight: number
|
|
32
|
+
renderItemAbsoluteConfigLayout: {
|
|
33
|
+
dataset?: Record<string, any>
|
|
34
|
+
blocks: any[]
|
|
35
|
+
canvas: {
|
|
36
|
+
width: number
|
|
37
|
+
height: number
|
|
38
|
+
backgroundColor?: string
|
|
39
|
+
}
|
|
40
|
+
}
|
|
32
41
|
},
|
|
33
42
|
{}
|
|
34
43
|
>
|
|
@@ -7,4 +7,13 @@ export interface LcbProductProps {
|
|
|
7
7
|
imageRadius?: number
|
|
8
8
|
itemHeight?: number
|
|
9
9
|
items?: Record<string, any>[]
|
|
10
|
+
renderItemAbsoluteConfigLayout?: {
|
|
11
|
+
dataset?: Record<string, any>
|
|
12
|
+
blocks: any[]
|
|
13
|
+
canvas: {
|
|
14
|
+
width: number
|
|
15
|
+
height: number
|
|
16
|
+
backgroundColor?: string
|
|
17
|
+
}
|
|
18
|
+
}
|
|
10
19
|
}
|
|
@@ -70,11 +70,11 @@ declare const _default: import('vue').DefineComponent<
|
|
|
70
70
|
>
|
|
71
71
|
>,
|
|
72
72
|
{
|
|
73
|
+
height: number
|
|
73
74
|
duration: number
|
|
74
75
|
autoplay: boolean
|
|
75
76
|
direction: 'horizontal' | 'vertical'
|
|
76
77
|
displayMultipleItems: number
|
|
77
|
-
height: number
|
|
78
78
|
loop: boolean
|
|
79
79
|
indicatorPosition:
|
|
80
80
|
| 'left'
|
package/types/constants.d.ts
CHANGED