@tplc/business 0.0.6 → 0.0.8
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/components/lcb-banner/lcb-banner.vue +57 -0
- package/components/lcb-banner/types.ts +50 -0
- package/components/lcb-banner-block/lcb-banner-block.vue +70 -0
- package/components/lcb-banner-block/types.ts +13 -0
- package/components/lcb-block/lcb-block.vue +38 -0
- package/components/lcb-block/types.ts +17 -0
- package/components/lcb-grid/lcb-grid.vue +38 -0
- package/components/lcb-grid/types.ts +8 -0
- package/components/lcb-home-search/lcb-home-search.vue +85 -0
- package/components/lcb-img-nav/lcb-img-nav.vue +5 -37
- package/components/lcb-img-nav/types.ts +32 -0
- package/components/lcb-nav/lcb-nav-search.vue +59 -0
- package/components/lcb-nav/lcb-nav-title.vue +48 -0
- package/components/lcb-nav/lcb-nav.vue +183 -164
- package/components/lcb-nav/types.ts +45 -0
- package/components/lcb-swiper/lcb-swiper.vue +95 -0
- package/components/lcb-title/lcb-title.vue +37 -0
- package/components/lcb-title/types.ts +5 -0
- package/global.d.ts +12 -0
- package/package.json +4 -4
- package/tsconfig.dts.json +9 -0
- package/types/components/lcb-banner/lcb-banner.vue.d.ts +63 -0
- package/types/components/lcb-banner/types.d.ts +47 -0
- package/types/components/lcb-banner-block/lcb-banner-block.vue.d.ts +58 -0
- package/types/components/lcb-banner-block/types.d.ts +13 -0
- package/types/components/lcb-block/lcb-block.vue.d.ts +54 -0
- package/types/components/lcb-block/types.d.ts +17 -0
- package/types/components/lcb-grid/lcb-grid.vue.d.ts +62 -0
- package/types/components/lcb-grid/types.d.ts +8 -0
- package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +35 -0
- package/types/components/lcb-img-nav/lcb-img-nav.vue.d.ts +80 -85
- package/types/components/lcb-img-nav/types.d.ts +31 -0
- package/types/components/lcb-nav/lcb-nav-search.vue.d.ts +44 -0
- package/types/components/lcb-nav/lcb-nav-title.vue.d.ts +28 -0
- package/types/components/lcb-nav/lcb-nav.vue.d.ts +92 -87
- package/types/components/lcb-nav/types.d.ts +42 -0
- package/types/components/lcb-swiper/lcb-swiper.vue.d.ts +118 -0
- package/types/components/lcb-title/lcb-title.vue.d.ts +62 -0
- package/types/components/lcb-title/types.d.ts +5 -0
- package/types/utils/transform.d.ts +1 -0
- package/utils/transform.ts +3 -0
- package/types/index.d.ts +0 -0
|
@@ -5,98 +5,85 @@
|
|
|
5
5
|
immersiveTop: topStyle === 2,
|
|
6
6
|
fixed,
|
|
7
7
|
}"
|
|
8
|
-
:style="{
|
|
9
|
-
paddingTop,
|
|
10
|
-
}"
|
|
11
8
|
>
|
|
12
9
|
<view
|
|
13
|
-
class="header"
|
|
10
|
+
class="navbar-header"
|
|
14
11
|
:style="{
|
|
15
|
-
backgroundColor: backgroundType === 'color' ? backColor : '',
|
|
16
12
|
color: contentColor,
|
|
17
|
-
|
|
13
|
+
paddingTop,
|
|
18
14
|
}"
|
|
19
15
|
>
|
|
20
|
-
<view
|
|
16
|
+
<view
|
|
17
|
+
class="navbar-header-background"
|
|
18
|
+
:style="{
|
|
19
|
+
backgroundColor: navbarBgColor,
|
|
20
|
+
opacity: navbarBgOpacity,
|
|
21
|
+
backgroundImage: backgroundType === 'img' ? `url(${backgroundImage})` : '',
|
|
22
|
+
}"
|
|
23
|
+
/>
|
|
24
|
+
<!-- 左边布局 -->
|
|
25
|
+
<view class="navbar-left">
|
|
26
|
+
<!-- 返回按钮 -->
|
|
21
27
|
<view
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}"
|
|
28
|
+
v-if="styleGroup === 3"
|
|
29
|
+
class="navbar-capsule flex justify-center items-center"
|
|
30
|
+
:class="[capsuleMode]"
|
|
26
31
|
>
|
|
27
|
-
<view class="titleContainer" v-if="titleMode === 'text'">
|
|
28
|
-
<view class="images mr-2" v-if="logoImg">
|
|
29
|
-
<img :src="logoImg" />
|
|
30
|
-
</view>
|
|
31
|
-
<view class="title">{{ title }}</view>
|
|
32
|
-
</view>
|
|
33
|
-
<view class="images" v-else>
|
|
34
|
-
<img :src="typographyTextBackground" />
|
|
35
|
-
</view>
|
|
36
|
-
</view>
|
|
37
|
-
<template v-if="styleGroup === 2">
|
|
38
32
|
<view
|
|
39
|
-
class="
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
class="h-full flex items-center"
|
|
34
|
+
@click="onCapsule(item)"
|
|
35
|
+
v-for="item in capsuleList"
|
|
36
|
+
:key="item.icon"
|
|
37
|
+
:class="[capsuleList.length === 1 ? 'px-2' : 'px-2.5']"
|
|
43
38
|
>
|
|
44
|
-
<
|
|
45
|
-
<wd-icon name="search" color="#a1a1a1" />
|
|
46
|
-
<view class="search-text">{{ searchText }}</view>
|
|
47
|
-
</view>
|
|
39
|
+
<wd-icon :name="item.icon" size="20" />
|
|
48
40
|
</view>
|
|
41
|
+
</view>
|
|
42
|
+
<template v-else-if="back">
|
|
43
|
+
<wd-icon name="arrow-left" custom-class="arrow-left" />
|
|
49
44
|
</template>
|
|
45
|
+
<view class="ml-2" v-if="titleLocation === 'left'">
|
|
46
|
+
<lcb-nav-search
|
|
47
|
+
:searchText
|
|
48
|
+
left
|
|
49
|
+
v-if="styleGroup === 2 && titleLocation === 'left'"
|
|
50
|
+
:back
|
|
51
|
+
/>
|
|
52
|
+
<lcb-nav-title v-bind="titleProps" v-else-if="topStyle !== 2" />
|
|
53
|
+
</view>
|
|
50
54
|
</view>
|
|
55
|
+
<!-- 中间布局 -->
|
|
56
|
+
<view class="navbar-center" v-if="topStyle === 1">
|
|
57
|
+
<lcb-nav-search v-if="styleGroup === 2 && titleLocation === 'center'" :back />
|
|
58
|
+
<lcb-nav-title
|
|
59
|
+
v-bind="titleProps"
|
|
60
|
+
v-else-if="styleGroup === 2 || titleLocation === 'center'"
|
|
61
|
+
/>
|
|
62
|
+
</view>
|
|
63
|
+
<!-- </template> -->
|
|
51
64
|
</view>
|
|
52
65
|
</view>
|
|
53
66
|
</template>
|
|
54
67
|
|
|
55
68
|
<script setup lang="ts">
|
|
56
69
|
import { addUnit } from '@tplc/wot/components/common/util'
|
|
57
|
-
import { computed } from 'vue'
|
|
70
|
+
import { computed, ref } from 'vue'
|
|
71
|
+
import { ICapsule, NavProps } from './types'
|
|
72
|
+
import lcbNavTitle from './lcb-nav-title.vue'
|
|
73
|
+
import lcbNavSearch from './lcb-nav-search.vue'
|
|
74
|
+
import { onPageScroll } from '@dcloudio/uni-app'
|
|
58
75
|
|
|
59
76
|
const { statusBarHeight } = uni.getSystemInfoSync()
|
|
60
77
|
defineOptions({
|
|
61
|
-
name: '
|
|
78
|
+
name: 'LcbNav',
|
|
62
79
|
options: {
|
|
63
80
|
addGlobalClass: true,
|
|
64
81
|
virtualHost: true,
|
|
65
82
|
styleIsolation: 'shared',
|
|
66
83
|
},
|
|
67
84
|
})
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
interface NanProps {
|
|
71
|
-
/** 是否固定 */
|
|
72
|
-
fixed?: boolean
|
|
73
|
-
/** 模式 1.标题 2.搜索 3.导航 4.沉浸式 */
|
|
74
|
-
styleGroup?: 1 | 2 | 3 | 4
|
|
75
|
-
/** 方位 */
|
|
76
|
-
titleLocation?: 'left' | 'center'
|
|
77
|
-
/** 是否沉浸式状态栏 */
|
|
78
|
-
// 1 标准 2沉浸式
|
|
79
|
-
topStyle?: 1 | 2
|
|
80
|
-
/** 标题 */
|
|
81
|
-
title?: string
|
|
82
|
-
/** 图片 */
|
|
83
|
-
logoImg?: string
|
|
84
|
-
/** 背景图片 */
|
|
85
|
-
backgroundImage?: string
|
|
86
|
-
/** 模式 */
|
|
87
|
-
titleMode?: 'text' | 'img'
|
|
88
|
-
/** 颜色模式 */
|
|
89
|
-
colorMode?: 'custom' | 'default'
|
|
90
|
-
/** 背景颜色 */
|
|
91
|
-
backColor?: string
|
|
92
|
-
/** 背景样式 */
|
|
93
|
-
backgroundType?: 'img' | 'color'
|
|
94
|
-
/** 内容颜色 */
|
|
95
|
-
contentColor?: string
|
|
96
|
-
searchText?: string
|
|
97
|
-
typographyTextBackground?: string
|
|
98
|
-
}
|
|
99
|
-
withDefaults(defineProps<NanProps>(), {
|
|
85
|
+
const scrollTop = ref(0)
|
|
86
|
+
const props = withDefaults(defineProps<NavProps>(), {
|
|
100
87
|
styleGroup: 1,
|
|
101
88
|
titleLocation: 'center',
|
|
102
89
|
topStyle: 1,
|
|
@@ -107,23 +94,99 @@ withDefaults(defineProps<NanProps>(), {
|
|
|
107
94
|
backColor: '#ffffff',
|
|
108
95
|
contentColor: '#000000',
|
|
109
96
|
logoImg: '',
|
|
110
|
-
|
|
111
|
-
|
|
97
|
+
fixed: false,
|
|
98
|
+
back: false,
|
|
99
|
+
capsuleMode: 'light',
|
|
100
|
+
immersionMode: 1,
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
const navbarBgColor = computed(() => {
|
|
104
|
+
return props.backgroundType === 'color' ? props.backColor : ''
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
// 透明度
|
|
108
|
+
const navbarBgOpacity = computed(() => {
|
|
109
|
+
const { topStyle, immersionMode } = props
|
|
110
|
+
if (topStyle === 2) {
|
|
111
|
+
return immersionMode === 1 ? scrollTop.value / ((statusBarHeight || 0) + 44) : 0
|
|
112
|
+
}
|
|
113
|
+
return 1
|
|
114
|
+
})
|
|
115
|
+
/** 标题样式 */
|
|
116
|
+
const titleProps = computed(() => {
|
|
117
|
+
return {
|
|
118
|
+
titleMode: props.titleMode,
|
|
119
|
+
typographyTextBackground: props.typographyTextBackground,
|
|
120
|
+
logoImg: props.logoImg,
|
|
121
|
+
title: props.title,
|
|
122
|
+
titleLocation: props.titleLocation,
|
|
123
|
+
}
|
|
112
124
|
})
|
|
113
125
|
|
|
114
126
|
const paddingTop = computed(() => {
|
|
115
127
|
return addUnit(statusBarHeight || 0)
|
|
116
128
|
})
|
|
129
|
+
|
|
130
|
+
const capsuleList = computed(() => {
|
|
131
|
+
const list: ICapsule[] = []
|
|
132
|
+
if (props.back) {
|
|
133
|
+
list.push({
|
|
134
|
+
icon: 'chevron-left',
|
|
135
|
+
action: 'link',
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return [
|
|
140
|
+
...list,
|
|
141
|
+
{
|
|
142
|
+
icon: 'home',
|
|
143
|
+
action: 'home',
|
|
144
|
+
},
|
|
145
|
+
...(props.capsules || []),
|
|
146
|
+
] as ICapsule[]
|
|
147
|
+
})
|
|
148
|
+
const onCapsule = (item: ICapsule) => {
|
|
149
|
+
switch (item.action) {
|
|
150
|
+
case 'link':
|
|
151
|
+
if (item.linkUrl) {
|
|
152
|
+
uni.navigateTo({
|
|
153
|
+
url: item.linkUrl,
|
|
154
|
+
})
|
|
155
|
+
} else {
|
|
156
|
+
uni.navigateBack()
|
|
157
|
+
}
|
|
158
|
+
break
|
|
159
|
+
case 'home':
|
|
160
|
+
uni.switchTab({
|
|
161
|
+
url: '/pages/index/index',
|
|
162
|
+
})
|
|
163
|
+
break
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
onPageScroll(({ scrollTop: top }) => {
|
|
168
|
+
if (props.immersionMode === 1) {
|
|
169
|
+
scrollTop.value = top
|
|
170
|
+
}
|
|
171
|
+
})
|
|
117
172
|
</script>
|
|
118
173
|
<style lang="scss" scoped>
|
|
119
174
|
.customNavigation {
|
|
120
175
|
position: relative;
|
|
121
176
|
width: 100%;
|
|
122
177
|
min-height: 44px;
|
|
178
|
+
%action {
|
|
179
|
+
position: absolute;
|
|
180
|
+
top: 0;
|
|
181
|
+
bottom: 0;
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
padding: 0 24rpx;
|
|
185
|
+
box-sizing: border-box;
|
|
186
|
+
}
|
|
123
187
|
|
|
124
|
-
.header {
|
|
188
|
+
.navbar-header {
|
|
125
189
|
position: absolute;
|
|
126
|
-
top: 0px;
|
|
127
190
|
left: 0px;
|
|
128
191
|
width: 100%;
|
|
129
192
|
height: 100%;
|
|
@@ -132,114 +195,71 @@ const paddingTop = computed(() => {
|
|
|
132
195
|
background-position-x: 50%;
|
|
133
196
|
background-position-y: center;
|
|
134
197
|
background-size: cover;
|
|
135
|
-
|
|
136
|
-
.header_body {
|
|
137
|
-
position: absolute;
|
|
138
|
-
bottom: 0;
|
|
139
|
-
box-sizing: border-box;
|
|
140
|
-
display: flex;
|
|
141
|
-
justify-content: space-between;
|
|
198
|
+
&-background {
|
|
142
199
|
width: 100%;
|
|
143
|
-
height:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
display: flex;
|
|
149
|
-
align-items: center;
|
|
150
|
-
height: 100%;
|
|
151
|
-
overflow: hidden;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.center_mod {
|
|
155
|
-
flex: 1 1;
|
|
156
|
-
margin-right: 20rpx;
|
|
157
|
-
margin-left: 20rpx;
|
|
158
|
-
|
|
159
|
-
.search-input {
|
|
160
|
-
display: flex;
|
|
161
|
-
align-items: center;
|
|
162
|
-
justify-content: center;
|
|
163
|
-
width: 100%;
|
|
164
|
-
height: 64rpx;
|
|
165
|
-
padding: 0 24rpx;
|
|
166
|
-
font-size: 26rpx;
|
|
167
|
-
font-weight: 400;
|
|
168
|
-
color: #a1a1a1;
|
|
169
|
-
background: #f5f5f5;
|
|
170
|
-
border-radius: 32rpx;
|
|
200
|
+
height: 100%;
|
|
201
|
+
position: absolute;
|
|
202
|
+
top: 0;
|
|
203
|
+
left: 0;
|
|
204
|
+
}
|
|
171
205
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
206
|
+
.navbar-center {
|
|
207
|
+
@extend %action;
|
|
208
|
+
width: 100vw;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
}
|
|
211
|
+
.navbar-left {
|
|
212
|
+
@extend %action;
|
|
213
|
+
.navbar-capsule {
|
|
214
|
+
margin: auto 20rpx auto 0;
|
|
215
|
+
height: 29px;
|
|
216
|
+
content: '';
|
|
217
|
+
border: 1rpx solid rgba(0, 0, 0, 0.1);
|
|
218
|
+
border-radius: 82rpx;
|
|
219
|
+
padding: 0px;
|
|
220
|
+
background-color: rgba(255, 255, 255, 0.6);
|
|
221
|
+
// 不等于最后一个儿子
|
|
222
|
+
> view {
|
|
223
|
+
position: relative;
|
|
224
|
+
&::after {
|
|
225
|
+
position: absolute;
|
|
226
|
+
right: 0;
|
|
227
|
+
top: 50%;
|
|
228
|
+
transform: translateY(-50%);
|
|
229
|
+
content: ' ';
|
|
230
|
+
width: 1rpx;
|
|
231
|
+
height: 18px;
|
|
232
|
+
background: rgba(0, 0, 0, 0.1);
|
|
179
233
|
}
|
|
180
234
|
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.searchLeft {
|
|
184
|
-
position: absolute;
|
|
185
|
-
left: 0;
|
|
186
235
|
|
|
187
|
-
|
|
188
|
-
|
|
236
|
+
> :last-child {
|
|
237
|
+
&:after {
|
|
189
238
|
display: none;
|
|
190
|
-
border-radius: 100%;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.on_center {
|
|
196
|
-
flex: initial;
|
|
197
|
-
align-items: center;
|
|
198
|
-
justify-content: center;
|
|
199
|
-
height: 60rpx;
|
|
200
|
-
|
|
201
|
-
.titleContainer {
|
|
202
|
-
display: flex;
|
|
203
|
-
align-items: center;
|
|
204
|
-
justify-content: center;
|
|
205
|
-
|
|
206
|
-
.title {
|
|
207
|
-
max-width: 300rpx;
|
|
208
|
-
overflow: hidden;
|
|
209
|
-
font-size: 32rpx;
|
|
210
|
-
font-weight: 500;
|
|
211
|
-
text-overflow: ellipsis;
|
|
212
|
-
white-space: nowrap;
|
|
213
239
|
}
|
|
214
240
|
}
|
|
215
241
|
}
|
|
242
|
+
}
|
|
216
243
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
height: 60rpx;
|
|
226
|
-
-o-object-fit: cover;
|
|
227
|
-
object-fit: cover;
|
|
228
|
-
-o-object-position: center;
|
|
229
|
-
object-position: center;
|
|
244
|
+
.dark {
|
|
245
|
+
border-color: rgba(255, 255, 255, 0.25);
|
|
246
|
+
background-color: rgba(0, 0, 0, 0.15);
|
|
247
|
+
color: #fff;
|
|
248
|
+
> view {
|
|
249
|
+
position: relative;
|
|
250
|
+
&::after {
|
|
251
|
+
background: rgba(255, 255, 255, 0.7);
|
|
230
252
|
}
|
|
231
253
|
}
|
|
232
254
|
}
|
|
233
|
-
|
|
234
|
-
.left {
|
|
235
|
-
justify-content: flex-start;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.center {
|
|
239
|
-
justify-content: center;
|
|
240
|
-
}
|
|
241
255
|
}
|
|
242
256
|
}
|
|
257
|
+
.fixed {
|
|
258
|
+
position: fixed;
|
|
259
|
+
top: 0;
|
|
260
|
+
left: 0;
|
|
261
|
+
z-index: 10;
|
|
262
|
+
}
|
|
243
263
|
|
|
244
264
|
.immersiveTop {
|
|
245
265
|
position: fixed;
|
|
@@ -247,12 +267,11 @@ const paddingTop = computed(() => {
|
|
|
247
267
|
right: 0;
|
|
248
268
|
left: 0;
|
|
249
269
|
z-index: 999999;
|
|
250
|
-
width:
|
|
270
|
+
width: 100vw;
|
|
251
271
|
background: transparent;
|
|
252
272
|
|
|
253
|
-
.header {
|
|
273
|
+
.navbar-header {
|
|
254
274
|
color: rgb(0, 0, 0) !important;
|
|
255
|
-
background-color: rgba(0, 0, 0, 0) !important;
|
|
256
275
|
background-repeat: no-repeat;
|
|
257
276
|
background-size: contain;
|
|
258
277
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface ICapsule {
|
|
2
|
+
icon: string
|
|
3
|
+
action: 'translate' | 'scanCode' | 'link' | 'home'
|
|
4
|
+
linkUrl?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface NavTitleProps {
|
|
8
|
+
/** 模式 */
|
|
9
|
+
titleMode?: 'text' | 'img'
|
|
10
|
+
/** 标题 */
|
|
11
|
+
title?: string
|
|
12
|
+
/** 图片 */
|
|
13
|
+
logoImg?: string
|
|
14
|
+
typographyTextBackground?: string
|
|
15
|
+
/** 方位 */
|
|
16
|
+
titleLocation?: 'left' | 'center'
|
|
17
|
+
}
|
|
18
|
+
export interface NavProps extends NavTitleProps {
|
|
19
|
+
/** 是否固定 */
|
|
20
|
+
fixed?: boolean
|
|
21
|
+
/** 是否沉浸式状态栏 */
|
|
22
|
+
// 1 标准 2沉浸式
|
|
23
|
+
topStyle?: 1 | 2
|
|
24
|
+
// 沉浸规则 1滑动后恢复 2永久沉浸式
|
|
25
|
+
immersionMode?: 1 | 2
|
|
26
|
+
/** 模式 1.标题 2.搜索 3.导航 4.沉浸式 */
|
|
27
|
+
styleGroup?: 1 | 2 | 3 | 4
|
|
28
|
+
/** 背景图片 */
|
|
29
|
+
backgroundImage?: string
|
|
30
|
+
/** 颜色模式 */
|
|
31
|
+
colorMode?: 'custom' | 'default'
|
|
32
|
+
/** 背景颜色 */
|
|
33
|
+
backColor?: string
|
|
34
|
+
/** 背景样式 */
|
|
35
|
+
backgroundType?: 'img' | 'color'
|
|
36
|
+
/** 内容颜色 */
|
|
37
|
+
contentColor?: string
|
|
38
|
+
searchText?: string
|
|
39
|
+
/** 是否显示返回按钮 */
|
|
40
|
+
back?: boolean
|
|
41
|
+
/** 胶囊样式 */
|
|
42
|
+
capsuleMode?: 'light' | 'dark'
|
|
43
|
+
/** 胶囊列表 */
|
|
44
|
+
capsules?: ICapsule[]
|
|
45
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="pl-20rpx pr-20rpx swiper" :style="{ '--wot-swiper-radius': `${borderRadius}rpx` }">
|
|
3
|
+
<wd-swiper
|
|
4
|
+
:list="swiperList"
|
|
5
|
+
:autoplay="autoplay"
|
|
6
|
+
v-model:current="current"
|
|
7
|
+
@click="handleClick"
|
|
8
|
+
:displayMultipleItems="displayMultipleItems"
|
|
9
|
+
:height="height"
|
|
10
|
+
:loop="loop"
|
|
11
|
+
:indicator="indicator ? { type: indicatorType } : false"
|
|
12
|
+
:indicatorPosition="indicatorPosition"
|
|
13
|
+
value-key="value"
|
|
14
|
+
:direction="direction"
|
|
15
|
+
@change="onChange"
|
|
16
|
+
></wd-swiper>
|
|
17
|
+
</view>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { ref } from 'vue'
|
|
22
|
+
|
|
23
|
+
// import { computed } from 'vue'
|
|
24
|
+
defineOptions({
|
|
25
|
+
name: 'Swiper',
|
|
26
|
+
options: {
|
|
27
|
+
addGlobalClass: true,
|
|
28
|
+
virtualHost: true,
|
|
29
|
+
styleIsolation: 'shared',
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const current = ref<number>(0)
|
|
34
|
+
|
|
35
|
+
const swiperList = ref([
|
|
36
|
+
{
|
|
37
|
+
value: 'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg',
|
|
38
|
+
pageUrl: 'fdasfsdfdsf',
|
|
39
|
+
pageType: 1,
|
|
40
|
+
},
|
|
41
|
+
{ value: 'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg' },
|
|
42
|
+
{ value: 'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg' },
|
|
43
|
+
{ value: 'https://registry.npmmirror.com/wot-design-uni-assets/*/files/moon.jpg' },
|
|
44
|
+
{ value: 'https://registry.npmmirror.com/wot-design-uni-assets/*/files/meng.jpg' },
|
|
45
|
+
])
|
|
46
|
+
function handleClick(e) {
|
|
47
|
+
console.log(e, e.item?.value)
|
|
48
|
+
}
|
|
49
|
+
function onChange(e) {
|
|
50
|
+
console.log(e)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface NanProps {
|
|
54
|
+
list?: Array<any> // <SwiperList>
|
|
55
|
+
/** 是否自动播放 */
|
|
56
|
+
autoplay?: boolean
|
|
57
|
+
/** 模式 1.标题 2.搜索 3.导航 4.沉浸式 */
|
|
58
|
+
styleGroup?: 1 | 2 | 3 | 4
|
|
59
|
+
/** 轮播滑动方向 */
|
|
60
|
+
direction?: 'horizontal' | 'vertical'
|
|
61
|
+
// 同时显示的滑块数量
|
|
62
|
+
displayMultipleItems?: number
|
|
63
|
+
// 滑动动画时长
|
|
64
|
+
duration?: number
|
|
65
|
+
// 滑动动画时长
|
|
66
|
+
height?: number
|
|
67
|
+
loop?: boolean
|
|
68
|
+
indicator?: boolean
|
|
69
|
+
indicatorType?: 'dots' | 'dots-bar' | 'fraction'
|
|
70
|
+
indicatorPosition?:
|
|
71
|
+
| 'left'
|
|
72
|
+
| 'top-left'
|
|
73
|
+
| 'top'
|
|
74
|
+
| 'top-right'
|
|
75
|
+
| 'bottom-left'
|
|
76
|
+
| 'bottom'
|
|
77
|
+
| 'bottom-right'
|
|
78
|
+
| 'right'
|
|
79
|
+
borderRadius?: number
|
|
80
|
+
}
|
|
81
|
+
withDefaults(defineProps<NanProps>(), {
|
|
82
|
+
autoplay: false,
|
|
83
|
+
styleGroup: 1,
|
|
84
|
+
direction: 'horizontal',
|
|
85
|
+
displayMultipleItems: 1,
|
|
86
|
+
duration: 300,
|
|
87
|
+
height: 200,
|
|
88
|
+
loop: false,
|
|
89
|
+
indicator: false,
|
|
90
|
+
indicatorType: 'dots',
|
|
91
|
+
indicatorPosition: 'bottom',
|
|
92
|
+
borderRadius: 0, // '10rpx',
|
|
93
|
+
})
|
|
94
|
+
</script>
|
|
95
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<LcbBlock
|
|
3
|
+
v-bind="{
|
|
4
|
+
...$props,
|
|
5
|
+
title: undefined,
|
|
6
|
+
}"
|
|
7
|
+
:marginLeft="12"
|
|
8
|
+
:marginRight="12"
|
|
9
|
+
>
|
|
10
|
+
<text
|
|
11
|
+
:style="{
|
|
12
|
+
fontWeight,
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
{{ title }}
|
|
16
|
+
</text>
|
|
17
|
+
</LcbBlock>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { LcbTitleProps } from './types'
|
|
22
|
+
import LcbBlock from '../lcb-block/lcb-block.vue'
|
|
23
|
+
defineOptions({
|
|
24
|
+
name: 'Lcbtitle',
|
|
25
|
+
options: {
|
|
26
|
+
addGlobalClass: true,
|
|
27
|
+
virtualHost: true,
|
|
28
|
+
styleIsolation: 'shared',
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
withDefaults(defineProps<LcbTitleProps>(), {
|
|
32
|
+
fontWeight: 600,
|
|
33
|
+
fontSize: 14,
|
|
34
|
+
color: '#333',
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
<style lang="scss" scoped></style>
|
package/global.d.ts
CHANGED
|
@@ -3,7 +3,19 @@ declare module 'vue' {
|
|
|
3
3
|
export interface GlobalComponents {
|
|
4
4
|
'lcb-img-nav': (typeof import('./types/components/lcb-img-nav/lcb-img-nav.vue'))['default']
|
|
5
5
|
'lcb-nav': (typeof import('./types/components/lcb-nav/lcb-nav.vue'))['default']
|
|
6
|
+
'lcb-banner': (typeof import('./types/components/lcb-banner/lcb-banner.vue'))['default']
|
|
7
|
+
'lcb-banner-block': (typeof import('./types/components/lcb-banner-block/lcb-banner-block.vue'))['default']
|
|
8
|
+
'lcb-title': (typeof import('./types/components/lcb-title/lcb-title.vue'))['default']
|
|
9
|
+
'lcb-grid': (typeof import('./types/components/lcb-grid/lcb-grid.vue'))['default']
|
|
10
|
+
'lcb-home-search': (typeof import('./types/components/lcb-home-search/lcb-home-search.vue'))['default']
|
|
6
11
|
}
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
export {}
|
|
15
|
+
|
|
16
|
+
export interface ActionView {
|
|
17
|
+
title: string
|
|
18
|
+
icon?: string
|
|
19
|
+
link: string
|
|
20
|
+
url?: string
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tplc/business",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"业务组件i"
|
|
6
6
|
],
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
12
|
"vue": ">=3.2.47",
|
|
13
|
-
"@tplc/wot": "0.1.
|
|
13
|
+
"@tplc/wot": "0.1.3"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=18",
|
|
17
17
|
"pnpm": ">=7.30"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"pub": "
|
|
21
|
-
"dts": "vue-tsc",
|
|
20
|
+
"pub": "pnpm dts && pnpm publish --no-git-checks",
|
|
21
|
+
"dts": "rm -rf types && vue-tsc --project ./tsconfig.dts.json && pnpm prettier --write types",
|
|
22
22
|
"release-major": "standard-version --release-as major ",
|
|
23
23
|
"release-minor": "standard-version --release-as minor",
|
|
24
24
|
"release-patch": "standard-version --release-as patch "
|