@tplc/business 0.0.27 → 0.0.29
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 +48 -0
- package/components/lcb-area-picker/api/index.ts +45 -0
- package/components/lcb-area-picker/lcb-area-picker.vue +77 -0
- package/components/lcb-area-picker/types.ts +3 -0
- package/components/lcb-banner-block/lcb-banner-block.vue +2 -2
- package/components/lcb-calendar/lcb-calendar.vue +3 -3
- package/components/lcb-calendar-search/lcb-calendar-search.vue +5 -2
- package/components/lcb-city-select/api/index.ts +15 -1
- package/components/lcb-city-select/components/lcb-city-letter/index.vue +171 -0
- package/components/lcb-city-select/components/lcb-city-list/index.vue +127 -0
- package/components/lcb-city-select/components/lcb-city-list/types.ts +6 -0
- package/components/lcb-city-select/images/hot.png +0 -0
- package/components/lcb-city-select/lcb-city-select.vue +95 -118
- package/components/lcb-dynamic-data/lcb-dynamic-data.vue +25 -0
- package/components/lcb-dynamic-data/types.ts +7 -0
- package/components/lcb-home-search/lcb-home-search.vue +16 -7
- package/components/lcb-image/lcb-image.vue +35 -23
- package/components/lcb-image/types.ts +1 -1
- package/components/lcb-img-nav/lcb-img-nav.vue +70 -30
- package/components/lcb-img-nav/types.ts +3 -3
- package/components/{lcb-filter → lcb-list}/api.ts +20 -9
- package/components/{lcb-filter → lcb-list}/components/ComponentGroup/index.vue +1 -1
- package/components/lcb-list/components/FilterList/index.vue +85 -0
- package/components/lcb-list/components/FilterList/type.ts +9 -0
- package/components/{lcb-filter → lcb-list}/components/FilterSlider/index.vue +2 -1
- package/components/lcb-list/components/FilterSlider/types.ts +3 -0
- package/components/lcb-list/components/FilterTabs/index.vue +27 -0
- package/components/lcb-list/components/FilterTabs/type.ts +6 -0
- package/components/{lcb-filter → lcb-list}/index.scss +23 -0
- package/components/lcb-list/lcb-list.vue +179 -0
- package/components/{lcb-filter → lcb-list}/types.ts +6 -1
- package/components/lcb-nav/lcb-nav.vue +10 -22
- package/components/lcb-notice/Item/index.vue +4 -4
- package/components/lcb-notice/lcb-notice.vue +10 -8
- package/components/lcb-notice/types.ts +4 -1
- package/components/lcb-product/lcb-product.vue +7 -7
- package/components/lcb-product/types.ts +3 -3
- package/components/lcb-product-item/lcb-product-item.vue +24 -12
- package/components/lcb-user-order/lcb-user-order.vue +44 -23
- package/components/lcb-user-top/lcb-user-top.vue +77 -48
- package/global.d.ts +3 -1
- package/hooks/usePageScroll.ts +10 -0
- package/iconfonts/index.css +1 -175
- package/package.json +5 -2
- package/types/components/lcb-area-picker/api/index.d.ts +38 -0
- package/types/components/lcb-area-picker/lcb-area-picker.vue.d.ts +67 -0
- package/types/components/lcb-area-picker/types.d.ts +1 -0
- package/types/components/lcb-calendar-search/lcb-calendar-search.vue.d.ts +1 -1
- package/types/components/lcb-city-select/api/index.d.ts +14 -1
- package/types/components/lcb-city-select/components/lcb-city-letter/index.vue.d.ts +53 -0
- package/types/components/{lcb-filter/lcb-filter.vue.d.ts → lcb-city-select/components/lcb-city-list/index.vue.d.ts} +9 -18
- package/types/components/lcb-city-select/components/lcb-city-list/types.d.ts +5 -0
- package/types/components/lcb-city-select/lcb-city-select.vue.d.ts +13 -4
- package/types/components/lcb-dynamic-data/lcb-dynamic-data.vue.d.ts +44 -0
- package/types/components/lcb-dynamic-data/types.d.ts +7 -0
- package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +1 -1
- package/types/components/lcb-image/lcb-image.vue.d.ts +1 -1
- package/types/components/lcb-img-nav/types.d.ts +2 -2
- package/types/components/{lcb-filter → lcb-list}/api.d.ts +18 -7
- package/types/components/lcb-list/components/FilterList/index.vue.d.ts +28 -0
- package/types/components/lcb-list/components/FilterList/type.d.ts +9 -0
- package/types/components/lcb-list/components/FilterSlider/types.d.ts +2 -0
- package/types/components/lcb-list/components/FilterTabs/index.vue.d.ts +36 -0
- package/types/components/lcb-list/components/FilterTabs/type.d.ts +5 -0
- package/types/components/lcb-list/lcb-list.vue.d.ts +74 -0
- package/types/components/{lcb-filter → lcb-list}/types.d.ts +5 -1
- package/types/components/lcb-notice/lcb-notice.vue.d.ts +3 -0
- package/types/components/lcb-notice/types.d.ts +3 -0
- package/types/hooks/usePageScroll.d.ts +2 -0
- package/components/lcb-filter/components/FilterSlider/types.ts +0 -3
- package/components/lcb-filter/lcb-filter.vue +0 -147
- package/types/components/lcb-filter/components/FilterSlider/types.d.ts +0 -2
- /package/components/{lcb-filter → lcb-list}/components/ActionView/index.vue +0 -0
- /package/components/{lcb-filter → lcb-list}/components/ComponentGroup/type.ts +0 -0
- /package/components/{lcb-filter → lcb-list}/components/FilterSelect/index.vue +0 -0
- /package/components/{lcb-filter → lcb-list}/components/FilterSelect/type.ts +0 -0
- /package/components/{lcb-filter → lcb-list}/components/SelectTagView/index.vue +0 -0
- /package/components/{lcb-filter → lcb-list}/components/TagSelect/index.vue +0 -0
- /package/components/{lcb-filter → lcb-list}/components/TagSelect/type.ts +0 -0
- /package/components/{lcb-filter → lcb-list}/components/TreeSelect/index.vue +0 -0
- /package/components/{lcb-filter → lcb-list}/components/TreeSelect/type.ts +0 -0
- /package/components/{lcb-filter → lcb-list}/hooks/useSelect.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/ActionView/index.vue.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/ComponentGroup/index.vue.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/ComponentGroup/type.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/FilterSelect/index.vue.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/FilterSelect/type.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/FilterSlider/index.vue.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/SelectTagView/index.vue.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/TagSelect/index.vue.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/TagSelect/type.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/TreeSelect/index.vue.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/components/TreeSelect/type.d.ts +0 -0
- /package/types/components/{lcb-filter → lcb-list}/hooks/useSelect.d.ts +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<z-paging
|
|
3
|
+
ref="paging"
|
|
4
|
+
:empty-view-z-index="0"
|
|
5
|
+
:auto="true"
|
|
6
|
+
v-model="dataList"
|
|
7
|
+
@query="queryList"
|
|
8
|
+
use-page-scroll
|
|
9
|
+
>
|
|
10
|
+
<lcb-product v-bind="{ ...productProps }" :items="dataList" />
|
|
11
|
+
</z-paging>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { ref, watch } from 'vue'
|
|
16
|
+
import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging'
|
|
17
|
+
import { LcbFilterListProps } from './type'
|
|
18
|
+
|
|
19
|
+
defineOptions({
|
|
20
|
+
name: 'FilterList',
|
|
21
|
+
options: {
|
|
22
|
+
addGlobalClass: true,
|
|
23
|
+
virtualHost: true,
|
|
24
|
+
styleIsolation: 'shared',
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
const props = defineProps<LcbFilterListProps>()
|
|
28
|
+
const dataList = ref<unknown[]>([])
|
|
29
|
+
const paging = ref()
|
|
30
|
+
useZPaging(paging)
|
|
31
|
+
watch(
|
|
32
|
+
() => props.url,
|
|
33
|
+
async (val) => {
|
|
34
|
+
if (val) {
|
|
35
|
+
paging.value?.reload()
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
immediate: true,
|
|
40
|
+
deep: true,
|
|
41
|
+
},
|
|
42
|
+
)
|
|
43
|
+
watch(
|
|
44
|
+
() => props.filter,
|
|
45
|
+
async (val) => {
|
|
46
|
+
if (val) {
|
|
47
|
+
paging.value?.reload()
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
immediate: true,
|
|
52
|
+
deep: true,
|
|
53
|
+
},
|
|
54
|
+
)
|
|
55
|
+
const queryList = async (pageNo: number, pageSize: number) => {
|
|
56
|
+
try {
|
|
57
|
+
const { data } = await uni.$lcb.http.post(props.url, {
|
|
58
|
+
...props.baseParam,
|
|
59
|
+
...props.filter,
|
|
60
|
+
pageNo,
|
|
61
|
+
pageSize,
|
|
62
|
+
})
|
|
63
|
+
paging.value.complete(data)
|
|
64
|
+
} catch (error) {
|
|
65
|
+
paging.value.complete(false)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
69
|
+
<style lang="scss" scoped>
|
|
70
|
+
.action-view {
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 118rpx;
|
|
73
|
+
background: #ffffff;
|
|
74
|
+
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(0, 0, 0, 0.04);
|
|
75
|
+
gap: 50rpx;
|
|
76
|
+
padding: 20rpx 52rpx;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
:deep(.wd-button) {
|
|
79
|
+
height: 100%;
|
|
80
|
+
line-height: 100%;
|
|
81
|
+
font-size: 30rpx;
|
|
82
|
+
border-radius: 40rpx;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LcbListInfo } from '../../api'
|
|
2
|
+
import { LcbProductProps } from '../../../lcb-product/types'
|
|
3
|
+
export interface PageListProps {
|
|
4
|
+
emptyImage?: string
|
|
5
|
+
productProps?: LcbProductProps
|
|
6
|
+
}
|
|
7
|
+
export interface LcbFilterListProps extends PageListProps, LcbListInfo {
|
|
8
|
+
filter?: Record<string, any>
|
|
9
|
+
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
custom-min-class="left-0 slider-text"
|
|
14
14
|
custom-max-class="right--2 slider-text"
|
|
15
15
|
/>
|
|
16
|
-
<view class="grid grid-cols-4 gap-4 mt-2">
|
|
16
|
+
<view class="grid grid-cols-4 gap-4 mt-2" v-if="options.length">
|
|
17
17
|
<SelectTagView
|
|
18
18
|
v-for="item in options"
|
|
19
19
|
:key="item.label"
|
|
@@ -51,6 +51,7 @@ const onItemClick = (value) => {
|
|
|
51
51
|
innerValue.value = [value[0], value[0]]
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
model.value = innerValue.value
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
const onDropOpened = () => {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wd-tabs
|
|
3
|
+
:mode="mode"
|
|
4
|
+
custom-class="!bg-transparent"
|
|
5
|
+
v-model="modelValue"
|
|
6
|
+
:slidable-num="slidableNum"
|
|
7
|
+
>
|
|
8
|
+
<block v-for="item in options" :key="item.value">
|
|
9
|
+
<wd-tab :title="item.label" :name="`${item.value}`" />
|
|
10
|
+
</block>
|
|
11
|
+
</wd-tabs>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { FilterTabsProps } from './type'
|
|
16
|
+
defineOptions({
|
|
17
|
+
name: 'FilterTabs',
|
|
18
|
+
options: {
|
|
19
|
+
addGlobalClass: true,
|
|
20
|
+
virtualHost: true,
|
|
21
|
+
styleIsolation: 'shared',
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
defineProps<FilterTabsProps>()
|
|
25
|
+
const modelValue = defineModel<string>()
|
|
26
|
+
</script>
|
|
27
|
+
<style lang="scss" scoped></style>
|
|
@@ -9,6 +9,29 @@
|
|
|
9
9
|
color: $-color-theme !important;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
&__border-top {
|
|
13
|
+
border-top: 1px solid #F3F5F9;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__plain {
|
|
17
|
+
:deep(.wd-drop-menu__list) {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
margin-top: 20rpx;
|
|
20
|
+
gap: 20rpx;
|
|
21
|
+
padding: 0 24rpx;
|
|
22
|
+
|
|
23
|
+
.wd-drop-menu__item {
|
|
24
|
+
height: 48rpx;
|
|
25
|
+
line-height: 48rpx;
|
|
26
|
+
background: #fff;
|
|
27
|
+
border-radius: 8rpx;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:deep(.wd-tabs__nav) {
|
|
32
|
+
background-color: transparent;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
12
35
|
|
|
13
36
|
}
|
|
14
37
|
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="info">
|
|
3
|
+
<wd-sticky @sticky="sticky = $event">
|
|
4
|
+
<view
|
|
5
|
+
:class="{
|
|
6
|
+
'lcb-filter__border-top': styleMode === 'plain' && !sticky ? false : border,
|
|
7
|
+
'lcb-filter__plain': styleMode === 'plain' && !sticky,
|
|
8
|
+
}"
|
|
9
|
+
class="w-100vw"
|
|
10
|
+
>
|
|
11
|
+
<FilterTabs
|
|
12
|
+
v-model="filter[info?.filterTabs?.valueName]"
|
|
13
|
+
v-bind="info?.filterTabs?.componentProps"
|
|
14
|
+
v-if="info?.filterTabs"
|
|
15
|
+
/>
|
|
16
|
+
<wd-drop-menu>
|
|
17
|
+
<wd-drop-menu-item
|
|
18
|
+
v-for="(item, index) in info?.filterComponent"
|
|
19
|
+
:key="item.valueName"
|
|
20
|
+
:title="titleObj[item.valueName] || item.filterName"
|
|
21
|
+
icon="caret-down-small"
|
|
22
|
+
icon-size="26px"
|
|
23
|
+
:selected="getSelect(item)"
|
|
24
|
+
ref="dropMenu"
|
|
25
|
+
@opened="handleOpened"
|
|
26
|
+
>
|
|
27
|
+
<view class="lcb-filter__popup">
|
|
28
|
+
<FilterSelect
|
|
29
|
+
v-if="item.component === 'select'"
|
|
30
|
+
v-bind="item.componentProps"
|
|
31
|
+
v-model="filter[item.valueName]"
|
|
32
|
+
v-model:title="titleObj[item.valueName]"
|
|
33
|
+
@submit="onSubmit(index)"
|
|
34
|
+
/>
|
|
35
|
+
<TreeSelect
|
|
36
|
+
v-else-if="item.component === 'treeSelect'"
|
|
37
|
+
v-bind="item.componentProps"
|
|
38
|
+
v-model="filter[item.valueName]"
|
|
39
|
+
v-model:title="titleObj[item.valueName]"
|
|
40
|
+
@submit="onSubmit(index)"
|
|
41
|
+
/>
|
|
42
|
+
<ComponentGroup
|
|
43
|
+
v-else-if="item.component === 'componentGroup'"
|
|
44
|
+
v-bind="item.componentProps"
|
|
45
|
+
:filter="filter"
|
|
46
|
+
@submit="onSubmit(index, $event)"
|
|
47
|
+
/>
|
|
48
|
+
</view>
|
|
49
|
+
</wd-drop-menu-item>
|
|
50
|
+
</wd-drop-menu>
|
|
51
|
+
<view
|
|
52
|
+
v-if="info?.filterTags || info.btnComponent"
|
|
53
|
+
class="bg-white px-3 pb-2 box-border flex items-center"
|
|
54
|
+
>
|
|
55
|
+
<view class="flex gap-3.5 flex-1">
|
|
56
|
+
<TagSelect
|
|
57
|
+
v-if="info.filterTags"
|
|
58
|
+
size="small"
|
|
59
|
+
v-bind="info.filterTags.componentProps"
|
|
60
|
+
v-model="filter[info.filterTags.valueName]"
|
|
61
|
+
/>
|
|
62
|
+
</view>
|
|
63
|
+
<wd-button v-if="info.btnComponent" custom-class="!h-60rpx opacity-primary">
|
|
64
|
+
{{ info.btnComponent?.postRequest }}
|
|
65
|
+
</wd-button>
|
|
66
|
+
</view>
|
|
67
|
+
</view>
|
|
68
|
+
</wd-sticky>
|
|
69
|
+
|
|
70
|
+
<FilterList v-bind="{ ...info.listInfo, ...pageListProps, filter }" />
|
|
71
|
+
</view>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script setup lang="ts">
|
|
75
|
+
import { inject, Ref, ref, watch } from 'vue'
|
|
76
|
+
import { LcbListProps } from './types'
|
|
77
|
+
import { FilterComponent, getFilterDetail, LcbFilterResult } from './api'
|
|
78
|
+
import FilterSelect from './components/FilterSelect/index.vue'
|
|
79
|
+
import TreeSelect from './components/TreeSelect/index.vue'
|
|
80
|
+
import ComponentGroup from './components/ComponentGroup/index.vue'
|
|
81
|
+
import TagSelect from './components/TagSelect/index.vue'
|
|
82
|
+
import FilterList from './components/FilterList/index.vue'
|
|
83
|
+
import FilterTabs from './components/FilterTabs/index.vue'
|
|
84
|
+
import './index.scss'
|
|
85
|
+
import { FORM_KEY } from '../../constants'
|
|
86
|
+
defineOptions({
|
|
87
|
+
name: 'LcbList',
|
|
88
|
+
options: {
|
|
89
|
+
addGlobalClass: true,
|
|
90
|
+
virtualHost: true,
|
|
91
|
+
styleIsolation: 'shared',
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
const form = inject<Ref<Record<string, any>>>(FORM_KEY)
|
|
95
|
+
const dropMenu = ref()
|
|
96
|
+
const props = withDefaults(defineProps<LcbListProps>(), {
|
|
97
|
+
pageFilterType: 'hotelTravelFilter',
|
|
98
|
+
border: true,
|
|
99
|
+
styleMode: 'default',
|
|
100
|
+
pageListProps: () => ({
|
|
101
|
+
productProps: {
|
|
102
|
+
styleGroup: 1,
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
})
|
|
106
|
+
const info = ref<LcbFilterResult>()
|
|
107
|
+
const filter = ref<Record<string, any>>({})
|
|
108
|
+
const titleObj = ref<Record<string, any>>({})
|
|
109
|
+
/** 是否悬停 */
|
|
110
|
+
const sticky = ref(false)
|
|
111
|
+
watch(
|
|
112
|
+
() => props.pageFilterType,
|
|
113
|
+
async (val) => {
|
|
114
|
+
if (val) {
|
|
115
|
+
const { data } = await getFilterDetail(val)
|
|
116
|
+
data.filterComponent.forEach((item) => {
|
|
117
|
+
filter.value[item.valueName] = item.defaultValue
|
|
118
|
+
titleObj.value[item.valueName] = item.filterName
|
|
119
|
+
if (item.componentProps?.componentList) {
|
|
120
|
+
item.componentProps.componentList.forEach((data) => {
|
|
121
|
+
filter.value[data.valueName] = data.defaultValue
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
if (data.filterTags) {
|
|
126
|
+
filter.value[data.filterTags.valueName] = data.filterTags.defaultValue
|
|
127
|
+
titleObj.value[data.filterTags.valueName] = data.filterTags.defaultName
|
|
128
|
+
}
|
|
129
|
+
if (data.filterTabs) {
|
|
130
|
+
filter.value[data.filterTabs.valueName] =
|
|
131
|
+
data.filterTabs.defaultValue || data.filterTabs.componentProps.options?.[0]?.value
|
|
132
|
+
}
|
|
133
|
+
info.value = data
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
immediate: true,
|
|
138
|
+
},
|
|
139
|
+
)
|
|
140
|
+
const onSubmit = (index: number, filterObj?: Record<string, any>) => {
|
|
141
|
+
dropMenu.value?.[index]?.close()
|
|
142
|
+
if (filterObj) {
|
|
143
|
+
filter.value = {
|
|
144
|
+
...filter.value,
|
|
145
|
+
...filterObj,
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const getSelect = (item: FilterComponent) => {
|
|
150
|
+
if (item.component === 'componentGroup') {
|
|
151
|
+
return item.componentProps.componentList?.some((v) => filter.value[v.valueName])
|
|
152
|
+
} else {
|
|
153
|
+
return Boolean(filter.value[item.valueName])
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const handleOpened = () => {
|
|
157
|
+
uni.$emit('drop-opened')
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
watch(
|
|
161
|
+
() => filter.value,
|
|
162
|
+
async (val) => {
|
|
163
|
+
if (form && Object.keys(val).length) {
|
|
164
|
+
form.value = {
|
|
165
|
+
...form.value,
|
|
166
|
+
...val,
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
immediate: true,
|
|
172
|
+
deep: true,
|
|
173
|
+
},
|
|
174
|
+
)
|
|
175
|
+
</script>
|
|
176
|
+
|
|
177
|
+
<style lang="scss" scoped>
|
|
178
|
+
@import './index';
|
|
179
|
+
</style>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { PageListProps } from './components/FilterList/type'
|
|
2
|
+
|
|
3
|
+
export interface LcbListProps {
|
|
2
4
|
pageFilterType?: string
|
|
5
|
+
pageListProps?: PageListProps
|
|
6
|
+
border?: boolean
|
|
7
|
+
styleMode?: 'default' | 'plain'
|
|
3
8
|
}
|
|
4
9
|
export interface Option {
|
|
5
10
|
label: string
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
:class="[capsuleList.length === 1 ? 'px-2' : 'px-2.5']"
|
|
43
43
|
>
|
|
44
44
|
<wd-icon
|
|
45
|
-
class-prefix="
|
|
45
|
+
class-prefix="lcb"
|
|
46
46
|
:name="iconMap[item.action]"
|
|
47
47
|
size="36rpx"
|
|
48
48
|
:color="contentColor"
|
|
@@ -50,12 +50,7 @@
|
|
|
50
50
|
</view>
|
|
51
51
|
</view>
|
|
52
52
|
<template v-else-if="back">
|
|
53
|
-
<wd-icon
|
|
54
|
-
class-prefix="iconfont"
|
|
55
|
-
name="dingdanliebiao"
|
|
56
|
-
@click="toBack"
|
|
57
|
-
:color="contentColor"
|
|
58
|
-
/>
|
|
53
|
+
<wd-icon class-prefix="lcb" name="zuo_left" @click="toBack" :color="contentColor" />
|
|
59
54
|
</template>
|
|
60
55
|
<view class="ml-2" v-if="titleLocation === 'left'">
|
|
61
56
|
<Search
|
|
@@ -72,7 +67,6 @@
|
|
|
72
67
|
<!-- 中间布局 -->
|
|
73
68
|
<view
|
|
74
69
|
class="navbar-center"
|
|
75
|
-
v-if="topStyle === 1"
|
|
76
70
|
:style="{
|
|
77
71
|
paddingTop,
|
|
78
72
|
}"
|
|
@@ -91,8 +85,8 @@ import { computed, ref } from 'vue'
|
|
|
91
85
|
import { ICapsule, NavProps } from './types'
|
|
92
86
|
import Title from './Title/index.vue'
|
|
93
87
|
import Search from './Search/index.vue'
|
|
94
|
-
import { onPageScroll } from '@dcloudio/uni-app'
|
|
95
88
|
import { Locale } from '@tplc/wot'
|
|
89
|
+
import usePageScroll from '../../hooks/usePageScroll'
|
|
96
90
|
defineOptions({
|
|
97
91
|
name: 'LcbNav',
|
|
98
92
|
options: {
|
|
@@ -103,14 +97,14 @@ defineOptions({
|
|
|
103
97
|
})
|
|
104
98
|
const { statusBarHeight } = uni.getSystemInfoSync()
|
|
105
99
|
const iconMap = {
|
|
106
|
-
back: '
|
|
107
|
-
search: '
|
|
108
|
-
scanCode: '
|
|
109
|
-
translate: '
|
|
110
|
-
setting: '
|
|
111
|
-
home: '
|
|
100
|
+
back: 'zuo_left',
|
|
101
|
+
search: 'sousuo_search',
|
|
102
|
+
scanCode: 'gengduo_more-app',
|
|
103
|
+
translate: 'fanyi_translate',
|
|
104
|
+
setting: 'peizhi_config',
|
|
105
|
+
home: 'shouye_home1',
|
|
112
106
|
}
|
|
113
|
-
const scrollTop =
|
|
107
|
+
const [scrollTop] = usePageScroll()
|
|
114
108
|
const props = withDefaults(defineProps<NavProps>(), {
|
|
115
109
|
styleGroup: 1,
|
|
116
110
|
titleLocation: 'center',
|
|
@@ -212,12 +206,6 @@ const onCapsule = ({ action }: ICapsule) => {
|
|
|
212
206
|
const toBack = () => {
|
|
213
207
|
uni.navigateBack()
|
|
214
208
|
}
|
|
215
|
-
|
|
216
|
-
onPageScroll(({ scrollTop: top }) => {
|
|
217
|
-
if (props.immersionMode === 1) {
|
|
218
|
-
scrollTop.value = top
|
|
219
|
-
}
|
|
220
|
-
})
|
|
221
209
|
</script>
|
|
222
210
|
<style lang="scss" scoped>
|
|
223
211
|
.customNavigation {
|
|
@@ -6,31 +6,31 @@
|
|
|
6
6
|
:style="{
|
|
7
7
|
height: transformValueUnit(40),
|
|
8
8
|
width: transformValueUnit(40),
|
|
9
|
-
// color: textColor,
|
|
10
9
|
backgroundImage: `url('${item?.icon}')`,
|
|
11
10
|
}"
|
|
12
11
|
/>
|
|
13
12
|
<view v-if="iconType === 0" class="mr-12rpx">
|
|
14
13
|
<wd-icon
|
|
15
|
-
class-prefix="
|
|
14
|
+
class-prefix="lcb"
|
|
16
15
|
v-bind="{
|
|
17
16
|
name: item?.icon || '',
|
|
18
17
|
size: transformValueUnit(40),
|
|
19
|
-
// color: textColor,
|
|
20
18
|
}"
|
|
21
19
|
/>
|
|
22
20
|
</view>
|
|
23
21
|
<view class="flex-1 noticeBar relative overflow-hidden">
|
|
24
22
|
<view
|
|
25
|
-
:class="`text-
|
|
23
|
+
:class="`text-24rpx absolute left-0 top-0 noticeItem flex overflow-hidden${lens == 1 ? ' infinite' : ''}${showAni ? ' animation' : ''}`"
|
|
26
24
|
:style="{
|
|
27
25
|
animationDuration: getTime(item?.noticeContent),
|
|
26
|
+
color: textColor,
|
|
28
27
|
}"
|
|
29
28
|
>
|
|
30
29
|
{{ item?.noticeContent }}
|
|
31
30
|
<lcb-action-view v-bind="item?.link" customClass="absolute top-0 left-0 right-0 bottom-0" />
|
|
32
31
|
</view>
|
|
33
32
|
</view>
|
|
33
|
+
<wd-icon name="arrow-right" size="32rpx" :color="textColor" />
|
|
34
34
|
</view>
|
|
35
35
|
</template>
|
|
36
36
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<lcb-block
|
|
2
|
+
<lcb-block
|
|
3
|
+
v-bind="$props"
|
|
4
|
+
custom-class="border-solid border-1"
|
|
5
|
+
:style="{
|
|
6
|
+
'border-color': borderColor,
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
3
9
|
<swiper
|
|
4
10
|
class="swiper"
|
|
5
11
|
circular
|
|
@@ -17,20 +23,14 @@
|
|
|
17
23
|
:iconType="iconType"
|
|
18
24
|
:item="item"
|
|
19
25
|
:textSpeed="textSpeed"
|
|
26
|
+
:textColor="textColor"
|
|
20
27
|
/>
|
|
21
28
|
</swiper-item>
|
|
22
|
-
<!-- <swiper-item>
|
|
23
|
-
<Item :idx="1" :current="current" text="请填写公告111" @setInterval="onSetInterval" />
|
|
24
|
-
</swiper-item>
|
|
25
|
-
<swiper-item>
|
|
26
|
-
<Item :idx="2" :current="current" text="请填写公告222" @setInterval="onSetInterval" />
|
|
27
|
-
</swiper-item> -->
|
|
28
29
|
</swiper>
|
|
29
30
|
</lcb-block>
|
|
30
31
|
</template>
|
|
31
32
|
|
|
32
33
|
<script setup lang="ts">
|
|
33
|
-
import { ref } from 'vue'
|
|
34
34
|
import { LcbNoticeBarProps } from './types'
|
|
35
35
|
import Item from './Item/index.vue'
|
|
36
36
|
|
|
@@ -45,7 +45,9 @@ defineOptions({
|
|
|
45
45
|
|
|
46
46
|
const props = withDefaults(defineProps<LcbNoticeBarProps>(), {
|
|
47
47
|
textSpeed: 1,
|
|
48
|
+
borderColor: 'transparent',
|
|
48
49
|
})
|
|
50
|
+
console.log(props, 'props')
|
|
49
51
|
|
|
50
52
|
function getTime(text: string | undefined) {
|
|
51
53
|
const len = text?.length || 0
|
|
@@ -13,6 +13,8 @@ export interface LcbNoticeBarProps {
|
|
|
13
13
|
iconType?: number
|
|
14
14
|
direction?: string
|
|
15
15
|
textSpeed?: number
|
|
16
|
+
textColor?: string
|
|
17
|
+
borderColor?: string
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export interface NoticeBarItemProps {
|
|
@@ -21,7 +23,8 @@ export interface NoticeBarItemProps {
|
|
|
21
23
|
text?: string
|
|
22
24
|
lens?: number
|
|
23
25
|
iconType?: number
|
|
24
|
-
item?: NoticeItem
|
|
26
|
+
item?: NoticeItem
|
|
25
27
|
textSpeed?: number
|
|
28
|
+
textColor?: string
|
|
26
29
|
// setInterval?: Function
|
|
27
30
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<lcb-block v-bind="$props">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
<template v-if="styleGroup !== 2">
|
|
4
|
+
<view v-for="(item, index) in items" :key="index">
|
|
5
|
+
<!-- <view>{{ JSON.stringify(item) }}</view> -->
|
|
6
|
+
<lcb-product-item :styleProps="styleProps" :idx="index" v-bind="item" />
|
|
7
|
+
</view>
|
|
8
|
+
</template>
|
|
7
9
|
<scroll-view v-if="styleGroup == 2" scroll-x class="w-full whitespace-nowrap">
|
|
8
10
|
<view class="flex shrink-0">
|
|
9
11
|
<view v-for="(item, index) in items" :key="index">
|
|
@@ -15,9 +17,8 @@
|
|
|
15
17
|
</template>
|
|
16
18
|
|
|
17
19
|
<script setup lang="ts">
|
|
18
|
-
import { computed } from 'vue'
|
|
20
|
+
import { computed } from 'vue'
|
|
19
21
|
import { LcbProductProps } from './types'
|
|
20
|
-
import { transformValueUnit } from '../../utils/transform'
|
|
21
22
|
defineOptions({
|
|
22
23
|
name: 'LcbProduct',
|
|
23
24
|
options: {
|
|
@@ -41,7 +42,6 @@ const styleProps = computed(() => {
|
|
|
41
42
|
showCollection: props.showCollection,
|
|
42
43
|
}
|
|
43
44
|
})
|
|
44
|
-
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
47
|
<style lang="scss" scoped></style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface LcbProductProps {
|
|
2
2
|
// Define the component's prop types here
|
|
3
|
-
styleGroup?: 1 | 2 | 3 | 4
|
|
3
|
+
styleGroup?: 1 | 2 | 3 | 4 // 1列表 2 左右滑动 3一行两个 4瀑布流
|
|
4
4
|
items?: Record<string, any>
|
|
5
5
|
marginHorizontal?: number
|
|
6
|
-
productStyle?: 'image' | 'flat' | 'card' | 'border'
|
|
7
|
-
productTitle?: 0 | 1 | 2
|
|
6
|
+
productStyle?: 'image' | 'flat' | 'card' | 'border' // 图片, 扁平, 卡片, 描边
|
|
7
|
+
productTitle?: 0 | 1 | 2 // 0默认 1 1行 2 2行
|
|
8
8
|
showTags?: boolean
|
|
9
9
|
showPrice?: boolean
|
|
10
10
|
showScribePrice?: boolean
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<view
|
|
3
|
+
:style="{
|
|
4
|
+
paddingTop: `${transformValueUnit(15)}`,
|
|
5
|
+
paddingBottom: `${transformValueUnit(15)}`,
|
|
6
|
+
paddingLeft: styleProps?.styleGroup != 1 && idx > 0 ? transformValueUnit(15) : 0,
|
|
7
|
+
width: styleProps?.styleGroup != 1 ? transformValueUnit(picWidth) : 'auto',
|
|
8
|
+
// paddingHorizontal: styleProps?.styleGroup == 1 ? null : 15,
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
9
11
|
<view :class="`${styleProps?.styleGroup == 1 ? 'flex' : ''}`">
|
|
10
|
-
<wd-img
|
|
11
|
-
|
|
12
|
-
:
|
|
12
|
+
<wd-img
|
|
13
|
+
:src="realImg"
|
|
14
|
+
:width="transformValueUnit(picWidth)"
|
|
15
|
+
:height="transformValueUnit(picHeight)"
|
|
16
|
+
/>
|
|
17
|
+
<view
|
|
18
|
+
v-if="styleProps?.productStyle != 'image'"
|
|
19
|
+
:class="`${styleProps?.styleGroup == 1 ? 'flex-1 pl-20rpx' : 'pt-20rpx'} pb-20rpx${styleProps?.productTitle == 1 ? ' ellipsis ' : ''}`"
|
|
20
|
+
>
|
|
13
21
|
<view
|
|
14
|
-
:class="`${styleProps?.productTitle == 1 ? 'ellipsis' : styleProps?.productTitle == 2 ? 'mulEllipsis' : 'wordBreak'} text-32rpx color-#333`"
|
|
22
|
+
:class="`${styleProps?.productTitle == 1 ? 'ellipsis' : styleProps?.productTitle == 2 ? 'mulEllipsis' : 'wordBreak'} text-32rpx color-#333`"
|
|
23
|
+
>
|
|
15
24
|
{{ productName }}
|
|
16
25
|
</view>
|
|
17
26
|
<lcb-tags v-if="!!styleProps?.showTags" :mode="2" :tagRadius="3" :items="tags" />
|
|
@@ -19,7 +28,10 @@
|
|
|
19
28
|
<view class="flex items-center mt-15rpx">
|
|
20
29
|
<view v-if="!!styleProps?.showPrice" class="text-30rpx color-red">¥</view>
|
|
21
30
|
<view v-if="!!styleProps?.showPrice" class="text-32rpx color-red">{{ price }}</view>
|
|
22
|
-
<view
|
|
31
|
+
<view
|
|
32
|
+
v-if="!!styleProps?.showScribePrice"
|
|
33
|
+
class="line-through text-22rpx color-#999 ml-10rpx pt-5rpx"
|
|
34
|
+
>
|
|
23
35
|
¥{{ scribePrice }}
|
|
24
36
|
</view>
|
|
25
37
|
</view>
|