@tplc/business 0.0.26 → 0.0.28
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 +56 -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/api/index.ts +17 -0
- package/components/lcb-calendar/lcb-calendar.vue +116 -0
- package/components/lcb-calendar-search/lcb-calendar-search.vue +72 -0
- package/components/lcb-calendar-search/types.ts +6 -0
- package/components/lcb-city-select/api/index.ts +34 -0
- 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 +145 -0
- package/components/lcb-city-select/types.ts +7 -0
- 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 +52 -18
- package/components/lcb-image/Image/index.vue +41 -20
- 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 +7 -2
- package/components/{lcb-filter → lcb-list}/components/ComponentGroup/index.vue +31 -0
- package/components/lcb-list/components/FilterList/index.vue +78 -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-filter → lcb-list}/components/TreeSelect/index.vue +3 -2
- package/components/{lcb-filter → lcb-list}/index.scss +3 -0
- package/components/lcb-list/lcb-list.vue +163 -0
- package/components/{lcb-filter → lcb-list}/types.ts +5 -1
- package/components/lcb-nav/lcb-nav.vue +8 -13
- package/components/lcb-notice/Item/index.vue +1 -1
- package/components/lcb-product/lcb-product.vue +47 -0
- package/components/lcb-product/types.ts +14 -0
- package/components/lcb-product-item/lcb-product-item.vue +97 -0
- package/components/lcb-product-item/types.ts +14 -0
- package/components/lcb-tags/Tag/index.vue +27 -0
- package/components/lcb-tags/lcb-tags.vue +49 -0
- package/components/lcb-tags/types.ts +30 -0
- package/components/lcb-title/lcb-title.vue +14 -8
- package/components/lcb-title/types.ts +5 -0
- package/components/lcb-user-order/lcb-user-order.vue +44 -23
- package/components/lcb-user-top/lcb-user-top.vue +77 -48
- package/constants.ts +1 -0
- package/global.d.ts +9 -1
- package/hooks/useLocation.api.ts +7 -0
- package/hooks/useLocation.ts +78 -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/api/index.d.ts +16 -0
- package/types/components/lcb-calendar/lcb-calendar.vue.d.ts +137 -0
- package/types/components/lcb-calendar-search/lcb-calendar-search.vue.d.ts +62 -0
- package/types/components/lcb-calendar-search/types.d.ts +4 -0
- package/types/components/lcb-city-select/api/index.d.ts +32 -0
- package/types/components/lcb-city-select/components/lcb-city-letter/index.vue.d.ts +53 -0
- package/types/components/lcb-city-select/components/lcb-city-list/index.vue.d.ts +48 -0
- 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 +77 -0
- package/types/components/lcb-city-select/types.d.ts +5 -0
- 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/lcb-img-nav.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 +5 -0
- 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/lcb-list.vue.d.ts +71 -0
- package/types/components/{lcb-filter → lcb-list}/types.d.ts +4 -1
- package/types/components/lcb-product/lcb-product.vue.d.ts +42 -0
- package/types/components/lcb-product/types.d.ts +13 -0
- package/types/components/lcb-product-item/lcb-product-item.vue.d.ts +62 -0
- package/types/components/lcb-product-item/types.d.ts +13 -0
- package/types/components/lcb-tags/Tag/index.vue.d.ts +44 -0
- package/types/components/{lcb-filter/lcb-filter.vue.d.ts → lcb-tags/lcb-tags.vue.d.ts} +9 -7
- package/types/components/lcb-tags/types.d.ts +13 -0
- package/types/components/lcb-title/types.d.ts +5 -0
- package/types/constants.d.ts +1 -0
- package/types/hooks/useLocation.api.d.ts +9 -0
- package/types/hooks/useLocation.d.ts +7 -0
- package/types/utils/utils.d.ts +1 -0
- package/utils/utils.ts +12 -0
- package/components/lcb-filter/lcb-filter.vue +0 -129
- 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/FilterSlider/types.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/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 +1 -1
- /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/FilterSlider/types.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,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="p-3 box-border flex-1 overflow-y-auto h-0">
|
|
3
|
+
<view v-for="item in list" :key="item.hotAddressId" @click="onItemClick(item)">
|
|
4
|
+
<view class="flex">
|
|
5
|
+
<view class="tag">{{ item.categoryName }}</view>
|
|
6
|
+
<view class="content">
|
|
7
|
+
<rich-text :nodes="getText(item.addr)" />
|
|
8
|
+
<view>{{ item.provinceCityName || item.area }}</view>
|
|
9
|
+
</view>
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
<view v-if="!list.length">
|
|
13
|
+
<view v-if="historyList.length">
|
|
14
|
+
<view class="flex justify-between items-center">
|
|
15
|
+
<view class="text-28rpx text-#333 font-500x">历史搜索</view>
|
|
16
|
+
<wd-icon name="delete" size="30rpx" color="#999" @click="onClear" />
|
|
17
|
+
</view>
|
|
18
|
+
<view class="flex gap-2 flex-wrap">
|
|
19
|
+
<view
|
|
20
|
+
v-for="item in historyList"
|
|
21
|
+
:key="item.hotAddressId"
|
|
22
|
+
@click="emits('click', item)"
|
|
23
|
+
class="history-tag"
|
|
24
|
+
>
|
|
25
|
+
{{ item.addr }},
|
|
26
|
+
{{ item.area || item.provinceCityName }}
|
|
27
|
+
</view>
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
<wd-status-tip
|
|
31
|
+
v-else-if="keyword"
|
|
32
|
+
image="search"
|
|
33
|
+
tip="当前搜索无结果"
|
|
34
|
+
custom-class="!mt-20"
|
|
35
|
+
/>
|
|
36
|
+
</view>
|
|
37
|
+
</view>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import { LcbAddress } from '../../../lcb-city-select/api'
|
|
42
|
+
import { LcbCityListProps } from './types'
|
|
43
|
+
import { ref } from 'vue'
|
|
44
|
+
|
|
45
|
+
defineOptions({
|
|
46
|
+
name: 'LcbCityList',
|
|
47
|
+
options: {
|
|
48
|
+
addGlobalClass: true,
|
|
49
|
+
virtualHost: true,
|
|
50
|
+
styleIsolation: 'shared',
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
const emits = defineEmits(['click'])
|
|
54
|
+
const historyList = ref<LcbAddress[]>(uni.getStorageSync('lcb_city_select_history') || [])
|
|
55
|
+
const props = withDefaults(defineProps<LcbCityListProps>(), {})
|
|
56
|
+
const getText = (text: string) => {
|
|
57
|
+
const str = text.replace(props.keyword, `<div class="text-light">${props.keyword}</div>`)
|
|
58
|
+
return `<div class="flex">${str}</div>`
|
|
59
|
+
}
|
|
60
|
+
const onItemClick = (item: LcbAddress) => {
|
|
61
|
+
if (historyList.value.some((historyItem) => historyItem.hotAddressId === item.hotAddressId)) {
|
|
62
|
+
historyList.value = historyList.value.filter(
|
|
63
|
+
(historyItem) => historyItem.hotAddressId !== item.hotAddressId,
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
historyList.value.unshift(item)
|
|
67
|
+
uni.setStorageSync('lcb_city_select_history', historyList.value)
|
|
68
|
+
emits('click', item)
|
|
69
|
+
}
|
|
70
|
+
const onClear = () => {
|
|
71
|
+
historyList.value = []
|
|
72
|
+
uni.removeStorageSync('lcb_city_select_history')
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
75
|
+
<style lang="scss" scoped>
|
|
76
|
+
@import '@tplc/wot/components/common/abstracts/variable';
|
|
77
|
+
.tag {
|
|
78
|
+
width: 80rpx;
|
|
79
|
+
height: 34rpx;
|
|
80
|
+
line-height: 34rpx;
|
|
81
|
+
text-align: center;
|
|
82
|
+
color: #fff;
|
|
83
|
+
font-size: 20rpx;
|
|
84
|
+
border-radius: 4rpx;
|
|
85
|
+
background-color: $-color-theme;
|
|
86
|
+
}
|
|
87
|
+
.content {
|
|
88
|
+
flex: 1;
|
|
89
|
+
display: flex;
|
|
90
|
+
margin-left: 16rpx;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
border-bottom: 1px solid #eee;
|
|
94
|
+
padding-bottom: 20rpx;
|
|
95
|
+
font-size: 24rpx;
|
|
96
|
+
color: #999;
|
|
97
|
+
> rich-text {
|
|
98
|
+
&:first-child {
|
|
99
|
+
font-size: 30rpx;
|
|
100
|
+
line-height: 34rpx;
|
|
101
|
+
font-weight: bold;
|
|
102
|
+
color: #333;
|
|
103
|
+
margin-bottom: 12rpx;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
.text-light {
|
|
107
|
+
color: $-color-theme;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
.history-tag {
|
|
111
|
+
background: #f7f7f7;
|
|
112
|
+
height: 50rpx;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
padding: 0 24rpx;
|
|
117
|
+
border-radius: 2rpx;
|
|
118
|
+
font-size: 24rpx;
|
|
119
|
+
text-align: center;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
margin-top: 12rpx;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
text-overflow: ellipsis;
|
|
125
|
+
color: #333;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
Binary file
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view @click="show = true">
|
|
3
|
+
<slot />
|
|
4
|
+
</view>
|
|
5
|
+
<wd-popup
|
|
6
|
+
v-model="show"
|
|
7
|
+
position="bottom"
|
|
8
|
+
@after-enter="isOver = true"
|
|
9
|
+
custom-class="lcb-city__p"
|
|
10
|
+
custom-style="height: 90vh;border-top-left-radius: 24rpx;border-top-right-radius: 24rpx;"
|
|
11
|
+
:safe-area-inset-bottom="true"
|
|
12
|
+
>
|
|
13
|
+
<view class="flex flex-col h-full">
|
|
14
|
+
<view class="top-search">
|
|
15
|
+
<view class="text-28rpx text-#333 text-center mt-28rpx mb-2 font-500">选择所在地区</view>
|
|
16
|
+
<wd-icon
|
|
17
|
+
custom-class="absolute top-0 right-0 mt-28rpx mr-5"
|
|
18
|
+
name="close-circle"
|
|
19
|
+
@click="show = false"
|
|
20
|
+
size="40rpx"
|
|
21
|
+
color="#999"
|
|
22
|
+
/>
|
|
23
|
+
<wd-search
|
|
24
|
+
:hide-cancel="!showList"
|
|
25
|
+
:placeholder="placeholder"
|
|
26
|
+
placeholder-left
|
|
27
|
+
v-model="searchValue"
|
|
28
|
+
@focus="onFocus"
|
|
29
|
+
@cancel="onCancel"
|
|
30
|
+
/>
|
|
31
|
+
</view>
|
|
32
|
+
<lcb-city-list
|
|
33
|
+
v-show="showList"
|
|
34
|
+
:list="lcbAddress"
|
|
35
|
+
:keyword="searchValue"
|
|
36
|
+
@click="onAddressClick"
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<lcb-city-letter v-show="!showList && isOver" v-bind="$props" v-model="modelValue" />
|
|
40
|
+
</view>
|
|
41
|
+
</wd-popup>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { ref, watch } from 'vue'
|
|
46
|
+
import { ChildHotAddress, getAddressList, LcbAddress } from './api'
|
|
47
|
+
import LcbCityLetter from './components/lcb-city-letter/index.vue'
|
|
48
|
+
import LcbCityList from './components/lcb-city-list/index.vue'
|
|
49
|
+
import { LcbCitySelectProps } from './types'
|
|
50
|
+
import { debounce } from '@tplc/wot/components/common/util'
|
|
51
|
+
import qs from 'qs'
|
|
52
|
+
defineOptions({
|
|
53
|
+
name: 'LcbCitySelect',
|
|
54
|
+
options: {
|
|
55
|
+
addGlobalClass: true,
|
|
56
|
+
virtualHost: true,
|
|
57
|
+
styleIsolation: 'shared',
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
const props = withDefaults(defineProps<LcbCitySelectProps>(), {
|
|
61
|
+
placeholder: '搜索城市/区域/景点',
|
|
62
|
+
})
|
|
63
|
+
const modelValue = defineModel<ChildHotAddress>()
|
|
64
|
+
const isOver = ref(false)
|
|
65
|
+
const searchValue = ref('')
|
|
66
|
+
const show = ref(false)
|
|
67
|
+
const lcbAddress = ref<LcbAddress[]>([])
|
|
68
|
+
const showList = ref(false)
|
|
69
|
+
|
|
70
|
+
const onFocus = () => {
|
|
71
|
+
showList.value = true
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const onCancel = () => {
|
|
75
|
+
showList.value = false
|
|
76
|
+
searchValue.value = ''
|
|
77
|
+
lcbAddress.value = []
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const onAddressClick = (item: LcbAddress) => {
|
|
81
|
+
if (item.addrFlag) {
|
|
82
|
+
modelValue.value = item as ChildHotAddress
|
|
83
|
+
} else {
|
|
84
|
+
uni.navigateTo({
|
|
85
|
+
url: `/pages/residentialHotel/index?${qs.stringify(item)}`,
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
onCancel()
|
|
89
|
+
show.value = false
|
|
90
|
+
}
|
|
91
|
+
watch(
|
|
92
|
+
() => props.location,
|
|
93
|
+
(val) => {
|
|
94
|
+
if (val && !modelValue.value) {
|
|
95
|
+
modelValue.value = {
|
|
96
|
+
addressInfo: val.addressInfo,
|
|
97
|
+
addr: val.cityName,
|
|
98
|
+
hotAddressId: val.cityId,
|
|
99
|
+
} as ChildHotAddress
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
immediate: true,
|
|
104
|
+
},
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
watch(
|
|
108
|
+
() => modelValue.value,
|
|
109
|
+
() => {
|
|
110
|
+
show.value = false
|
|
111
|
+
},
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
watch(
|
|
115
|
+
() => show.value,
|
|
116
|
+
(val) => {
|
|
117
|
+
if (!val) {
|
|
118
|
+
onCancel()
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
watch(
|
|
124
|
+
() => searchValue.value,
|
|
125
|
+
() => {
|
|
126
|
+
if (!searchValue.value) {
|
|
127
|
+
lcbAddress.value = []
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
search()
|
|
131
|
+
},
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
const search = debounce(async () => {
|
|
135
|
+
const { data } = await getAddressList(searchValue.value)
|
|
136
|
+
lcbAddress.value = data
|
|
137
|
+
}, 200)
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<style lang="scss" scoped>
|
|
141
|
+
.top-search {
|
|
142
|
+
background: #ffffff;
|
|
143
|
+
box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(243, 245, 249, 0.94);
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lcb-block v-bind="$props">
|
|
3
|
+
<view class="flex">
|
|
4
|
+
<view v-for="item in items" :key="item.title">
|
|
5
|
+
<view>{{ item.unit }} {{ item.key }}</view>
|
|
6
|
+
<view>{{ item.title }}</view>
|
|
7
|
+
</view>
|
|
8
|
+
</view>
|
|
9
|
+
</lcb-block>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { LcbDynamicDataProps } from './types'
|
|
14
|
+
defineOptions({
|
|
15
|
+
name: 'LcbDynamicData',
|
|
16
|
+
options: {
|
|
17
|
+
addGlobalClass: true,
|
|
18
|
+
virtualHost: true,
|
|
19
|
+
styleIsolation: 'shared',
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
withDefaults(defineProps<LcbDynamicDataProps>(), {})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style lang="scss" scoped></style>
|
|
@@ -17,33 +17,47 @@
|
|
|
17
17
|
</view>
|
|
18
18
|
<view class="box-border px-3 leading-none">
|
|
19
19
|
<view class="flex items-center justify-center mt-3 text-#333 gap-16rpx">
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
<lcb-city-select :location="userLocation" v-model="addressCity">
|
|
21
|
+
<view class="flex items-center gap-16rpx">
|
|
22
|
+
<view class="text-30rpx font-bold max-w-13 truncate">
|
|
23
|
+
{{ addressCity?.addr || '附近' }}
|
|
24
|
+
</view>
|
|
25
|
+
<img
|
|
26
|
+
class="w-30rpx h-30rpx"
|
|
27
|
+
mode="aspectFit"
|
|
28
|
+
src="https://ddll-lycs.oss-cn-hangzhou.aliyuncs.com/default/1/20240914164446/%E5%BD%A2%E7%8A%B6%2092%402x.png"
|
|
29
|
+
/>
|
|
30
|
+
</view>
|
|
31
|
+
</lcb-city-select>
|
|
32
|
+
|
|
26
33
|
<view class="h-42rpx w-1px bg-#F1F1F1"></view>
|
|
27
34
|
<view class="text-#999 text-28rpx">{{ placeholder }}</view>
|
|
28
35
|
<view class="flex-1"></view>
|
|
29
|
-
<view class="justify-center flex flex-col items-center">
|
|
36
|
+
<view class="justify-center flex flex-col items-center" @click="getLocation">
|
|
37
|
+
<wd-loading size="30rpx" v-if="locationIng" />
|
|
30
38
|
<img
|
|
31
39
|
class="w-30rpx h-30rpx"
|
|
32
40
|
mode="aspectFit"
|
|
33
41
|
src="https://ddll-lycs.oss-cn-hangzhou.aliyuncs.com/default/1/20240914164707/%E5%BD%A2%E7%8A%B6%2095%402x.png"
|
|
42
|
+
v-else
|
|
34
43
|
/>
|
|
35
|
-
<view class="text-26rpx text-#333 mt-12rpx"
|
|
44
|
+
<view class="text-26rpx text-#333 mt-12rpx">
|
|
45
|
+
{{ locationIng ? translate('定位中...') : translate('当前位置') }}
|
|
46
|
+
</view>
|
|
36
47
|
</view>
|
|
37
48
|
</view>
|
|
38
49
|
<view class="w-full h-1px bg-#F1F1F1 mt-26rpx mb-44rpx"></view>
|
|
39
|
-
<
|
|
40
|
-
<view class="
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
<lcb-calendar v-model="dayRange">
|
|
51
|
+
<view class="flex items-center">
|
|
52
|
+
<view class="title">{{ dayjs(dayRange[0]).format('MM月DD日') }}</view>
|
|
53
|
+
<view class="hint ml-1">{{ getDayName(dayRange[0]) }}{{ translate('入住') }}</view>
|
|
54
|
+
<view class="title mx-1">——</view>
|
|
55
|
+
<view class="title">{{ dayjs(dayRange[1]).format('MM月DD日') }}</view>
|
|
56
|
+
|
|
57
|
+
<view class="hint ml-1 flex-1">{{ getDayName(dayRange[1]) }}{{ translate('离店') }}</view>
|
|
58
|
+
<view class="tag">{{ translate('共') }}{{ nightCount }}{{ translate('晚') }}</view>
|
|
59
|
+
</view>
|
|
60
|
+
</lcb-calendar>
|
|
47
61
|
<wd-button type="primary" customClass="!w-full my-42rpx" size="large">
|
|
48
62
|
{{ btnText }}
|
|
49
63
|
</wd-button>
|
|
@@ -69,9 +83,16 @@
|
|
|
69
83
|
import { computed, ref } from 'vue'
|
|
70
84
|
import { LcbHomeSearch } from './types'
|
|
71
85
|
import dayjs from 'dayjs/esm'
|
|
72
|
-
|
|
86
|
+
import useLocation from '../../hooks/useLocation'
|
|
87
|
+
import { useTranslate } from '@tplc/wot'
|
|
88
|
+
import { ChildHotAddress } from '../lcb-city-select/api'
|
|
89
|
+
const dayRange = ref([dayjs().valueOf(), dayjs().add(1, 'day').valueOf()])
|
|
90
|
+
const { translate } = useTranslate()
|
|
91
|
+
const { getLocation, userLocation, locationIng } = useLocation()
|
|
92
|
+
const addressCity = ref<ChildHotAddress>()
|
|
93
|
+
getLocation()
|
|
73
94
|
const nightCount = computed(() => {
|
|
74
|
-
return dayRange.value[1].diff(dayRange.value[0], 'day')
|
|
95
|
+
return dayjs(dayRange.value[1]).diff(dayRange.value[0], 'day')
|
|
75
96
|
})
|
|
76
97
|
defineOptions({
|
|
77
98
|
name: 'LcbHomeSearch',
|
|
@@ -91,6 +112,19 @@ withDefaults(defineProps<LcbHomeSearch>(), {
|
|
|
91
112
|
})
|
|
92
113
|
const tabs = ['全部', '酒店', '民宿']
|
|
93
114
|
const current = ref(0)
|
|
115
|
+
// 今天 明天 后天 周...
|
|
116
|
+
const getDayName = (time: number) => {
|
|
117
|
+
const day = dayjs(time).day()
|
|
118
|
+
if (day === dayjs().day()) {
|
|
119
|
+
return '今天'
|
|
120
|
+
} else if (day === dayjs().add(1, 'day').day()) {
|
|
121
|
+
return '明天'
|
|
122
|
+
} else if (day === dayjs().add(2, 'day').day()) {
|
|
123
|
+
return '后天'
|
|
124
|
+
} else {
|
|
125
|
+
return `周${'日一二三四五六'[day]}`
|
|
126
|
+
}
|
|
127
|
+
}
|
|
94
128
|
</script>
|
|
95
129
|
<style lang="scss" scoped>
|
|
96
130
|
.search-view {
|
|
@@ -1,31 +1,52 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<view
|
|
3
|
+
v-for="(item, index) in items"
|
|
4
|
+
:key="index"
|
|
5
|
+
:class="styleGroup == 2 ? 'flex-1' : ''"
|
|
6
|
+
:style="{
|
|
7
|
+
marginLeft: transformValueUnit(styleGroup != 1 && index > 0 ? imageMargin : 0),
|
|
8
|
+
marginTop: transformValueUnit(styleGroup == 1 && index > 0 ? imageMargin : 0),
|
|
9
|
+
// marginLeft: transformValueUnit(styleGroup == 2 && index > 0 ? imageMargin : 0),
|
|
10
|
+
width: styleGroup == 3 ? transformValueUnit(imageSize) : 'auto',
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
8
13
|
<view class="relative overflow-hidden">
|
|
9
|
-
<wd-img
|
|
10
|
-
|
|
11
|
-
:
|
|
14
|
+
<wd-img
|
|
15
|
+
v-if="!!item.url"
|
|
16
|
+
:width="`${styleGroup == 3 ? transformValueUnit(imageSize) : '100%'}`"
|
|
17
|
+
@click="item.mode == 1 && onClickItem(item)"
|
|
18
|
+
:src="item.url"
|
|
19
|
+
:enable-preview="enablePreview"
|
|
20
|
+
mode="widthFix"
|
|
21
|
+
:class="`${styleGroup == 3 ? 'overflow-hidden' : 'overflow-hidden block'}`"
|
|
22
|
+
:style="{
|
|
12
23
|
borderRadius: transformValueUnit(imageRadius),
|
|
13
24
|
display: 'block',
|
|
14
|
-
}"
|
|
25
|
+
}"
|
|
26
|
+
/>
|
|
15
27
|
|
|
16
|
-
<view
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
<view
|
|
29
|
+
v-if="!item.url"
|
|
30
|
+
class="flex justify-center items-center bg-light color-gray overflow-hidden"
|
|
31
|
+
:style="{
|
|
32
|
+
height: transformValueUnit(styleGroup == 3 ? 300 : 400),
|
|
33
|
+
borderRadius: transformValueUnit(imageRadius),
|
|
34
|
+
}"
|
|
35
|
+
>
|
|
20
36
|
<wd-icon name="image" size="50px"></wd-icon>
|
|
21
37
|
</view>
|
|
22
38
|
|
|
23
|
-
<view
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
<view
|
|
40
|
+
v-for="(each, edx) in item.hotSpot"
|
|
41
|
+
:key="edx"
|
|
42
|
+
class="link absolute"
|
|
43
|
+
:style="{
|
|
44
|
+
width: transformValueUnit(getRealSize(each.width)),
|
|
45
|
+
height: transformValueUnit(getRealSize(each.height)),
|
|
46
|
+
left: transformValueUnit(getRealSize(each.x)),
|
|
47
|
+
top: transformValueUnit(getRealSize(each.y)),
|
|
48
|
+
}"
|
|
49
|
+
>
|
|
29
50
|
<lcb-action-view v-bind="each.urlObj" customClass="link" />
|
|
30
51
|
</view>
|
|
31
52
|
</view>
|
|
@@ -1,33 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<lcb-block v-bind="$props">
|
|
3
|
-
<lcb-title
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
<lcb-title
|
|
4
|
+
v-if="showTitle"
|
|
5
|
+
v-bind="{
|
|
6
|
+
title,
|
|
7
|
+
marginHorizontal: 0,
|
|
8
|
+
paddingHorizontal: titlePadding,
|
|
9
|
+
paddingBottom: 25,
|
|
10
|
+
fontSize,
|
|
11
|
+
fontWeight,
|
|
12
|
+
color,
|
|
13
|
+
}"
|
|
14
|
+
/>
|
|
15
|
+
<view
|
|
16
|
+
:style="{
|
|
17
|
+
gridTemplateColumns: `repeat(${pictureDistribution}, minmax(0, 1fr))`,
|
|
18
|
+
}"
|
|
19
|
+
:class="[
|
|
20
|
+
{
|
|
21
|
+
1: 'single',
|
|
22
|
+
2: 'mutil',
|
|
23
|
+
3: 'cell',
|
|
24
|
+
}[styleGroup!],
|
|
25
|
+
]"
|
|
26
|
+
>
|
|
27
|
+
<lcb-action-view
|
|
28
|
+
v-for="item in items"
|
|
29
|
+
:key="item.title"
|
|
30
|
+
v-bind="item.link"
|
|
31
|
+
custom-class="!flex flex-col justify-center items-center item"
|
|
32
|
+
>
|
|
33
|
+
<view
|
|
34
|
+
class="overflow-hidden"
|
|
35
|
+
:style="{
|
|
36
|
+
marginBottom: iconTextMargin + 'rpx',
|
|
37
|
+
}"
|
|
38
|
+
>
|
|
39
|
+
<wd-icon
|
|
40
|
+
v-if="iconType === 0"
|
|
41
|
+
class-prefix="lcb"
|
|
42
|
+
:name="item.icon!"
|
|
43
|
+
:size="iconSize + 'rpx'"
|
|
44
|
+
:color="iconColor"
|
|
45
|
+
/>
|
|
46
|
+
<img
|
|
47
|
+
v-else
|
|
48
|
+
class="block"
|
|
49
|
+
:style="{
|
|
50
|
+
borderRadius: iconRadius + 'rpx',
|
|
51
|
+
height: iconSize + 'rpx',
|
|
52
|
+
width: iconSize + 'rpx',
|
|
53
|
+
}"
|
|
54
|
+
:src="item.url"
|
|
55
|
+
/>
|
|
29
56
|
</view>
|
|
30
57
|
<view class="title">{{ item.title }}</view>
|
|
58
|
+
<wd-icon v-if="styleGroup === 3" name="chevron-right" size="22"></wd-icon>
|
|
31
59
|
</lcb-action-view>
|
|
32
60
|
</view>
|
|
33
61
|
</lcb-block>
|
|
@@ -65,7 +93,7 @@ withDefaults(defineProps<LcbImgNavProps>(), {
|
|
|
65
93
|
overflow-x: auto;
|
|
66
94
|
white-space: nowrap;
|
|
67
95
|
|
|
68
|
-
>view {
|
|
96
|
+
> view {
|
|
69
97
|
display: inline-flex;
|
|
70
98
|
}
|
|
71
99
|
}
|
|
@@ -74,12 +102,24 @@ withDefaults(defineProps<LcbImgNavProps>(), {
|
|
|
74
102
|
display: grid;
|
|
75
103
|
row-gap: 36rpx;
|
|
76
104
|
}
|
|
77
|
-
|
|
105
|
+
.cell {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
gap: 40rpx;
|
|
109
|
+
.item {
|
|
110
|
+
flex-direction: row;
|
|
111
|
+
}
|
|
112
|
+
.title {
|
|
113
|
+
flex: 1;
|
|
114
|
+
text-align: start;
|
|
115
|
+
margin-left: 24rpx;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
78
118
|
.title {
|
|
79
119
|
width: 68px;
|
|
80
120
|
overflow: hidden;
|
|
81
|
-
font-size:
|
|
82
|
-
line-height:
|
|
121
|
+
font-size: 28rpx;
|
|
122
|
+
line-height: 1;
|
|
83
123
|
text-align: center;
|
|
84
124
|
letter-spacing: 0;
|
|
85
125
|
white-space: nowrap;
|
|
@@ -2,8 +2,8 @@ import { ActionView } from 'action'
|
|
|
2
2
|
import { LcbBlockProps } from '../lcb-block/types'
|
|
3
3
|
|
|
4
4
|
export interface LcbImgNavProps extends LcbBlockProps {
|
|
5
|
-
/** 模式 1.单行 2.多行 */
|
|
6
|
-
styleGroup?: 1 | 2
|
|
5
|
+
/** 模式 1.单行 2.多行 3.cell */
|
|
6
|
+
styleGroup?: 1 | 2 | 3
|
|
7
7
|
/** 文字颜色 #212121 */
|
|
8
8
|
textColor?: string
|
|
9
9
|
/** 背景图片 */
|
|
@@ -23,7 +23,7 @@ export interface LcbImgNavProps extends LcbBlockProps {
|
|
|
23
23
|
/** 文字与图标距离 */
|
|
24
24
|
iconTextMargin?: number
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
// 是否显示标题
|
|
27
27
|
showTitle?: boolean
|
|
28
28
|
title?: string
|
|
29
29
|
fontWeight?: number
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { Option } from './types'
|
|
2
|
+
export interface LcbListInfo {
|
|
3
|
+
url: string
|
|
4
|
+
baseParam: Record<string, unknown>
|
|
5
|
+
}
|
|
2
6
|
export interface LcbFilterResult {
|
|
3
7
|
btnComponent: BtnComponent
|
|
4
8
|
filterTags: FilterTags
|
|
5
9
|
filterComponent: FilterComponent[]
|
|
10
|
+
listInfo: LcbListInfo
|
|
6
11
|
}
|
|
7
12
|
|
|
8
13
|
export interface FilterComponent {
|
|
@@ -51,6 +56,6 @@ interface BtnComponent {
|
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
export const getFilterDetail = (val: string) =>
|
|
54
|
-
uni.$lcb.http.post<LcbFilterResult>('/pageDecoration/
|
|
55
|
-
|
|
59
|
+
uni.$lcb.http.post<LcbFilterResult>('/pageDecoration/list//detail', {
|
|
60
|
+
pageListType: val,
|
|
56
61
|
})
|