@tplc/business 0.0.27 → 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.
Files changed (79) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/components/lcb-area-picker/api/index.ts +45 -0
  3. package/components/lcb-area-picker/lcb-area-picker.vue +77 -0
  4. package/components/lcb-area-picker/types.ts +3 -0
  5. package/components/lcb-banner-block/lcb-banner-block.vue +2 -2
  6. package/components/lcb-calendar/lcb-calendar.vue +3 -3
  7. package/components/lcb-calendar-search/lcb-calendar-search.vue +5 -2
  8. package/components/lcb-city-select/api/index.ts +15 -1
  9. package/components/lcb-city-select/components/lcb-city-letter/index.vue +171 -0
  10. package/components/lcb-city-select/components/lcb-city-list/index.vue +127 -0
  11. package/components/lcb-city-select/components/lcb-city-list/types.ts +6 -0
  12. package/components/lcb-city-select/images/hot.png +0 -0
  13. package/components/lcb-city-select/lcb-city-select.vue +95 -118
  14. package/components/lcb-dynamic-data/lcb-dynamic-data.vue +25 -0
  15. package/components/lcb-dynamic-data/types.ts +7 -0
  16. package/components/lcb-home-search/lcb-home-search.vue +16 -7
  17. package/components/lcb-img-nav/lcb-img-nav.vue +70 -30
  18. package/components/lcb-img-nav/types.ts +3 -3
  19. package/components/{lcb-filter → lcb-list}/api.ts +7 -2
  20. package/components/lcb-list/components/FilterList/index.vue +78 -0
  21. package/components/lcb-list/components/FilterList/type.ts +9 -0
  22. package/components/{lcb-filter → lcb-list}/components/FilterSlider/index.vue +2 -1
  23. package/components/{lcb-filter → lcb-list}/index.scss +3 -0
  24. package/components/{lcb-filter/lcb-filter.vue → lcb-list/lcb-list.vue} +66 -50
  25. package/components/{lcb-filter → lcb-list}/types.ts +5 -1
  26. package/components/lcb-nav/lcb-nav.vue +8 -13
  27. package/components/lcb-notice/Item/index.vue +1 -1
  28. package/components/lcb-product/lcb-product.vue +7 -7
  29. package/components/lcb-product/types.ts +3 -3
  30. package/components/lcb-product-item/lcb-product-item.vue +24 -12
  31. package/components/lcb-user-order/lcb-user-order.vue +44 -23
  32. package/components/lcb-user-top/lcb-user-top.vue +77 -48
  33. package/global.d.ts +3 -1
  34. package/iconfonts/index.css +1 -175
  35. package/package.json +5 -2
  36. package/types/components/lcb-area-picker/api/index.d.ts +38 -0
  37. package/types/components/lcb-area-picker/lcb-area-picker.vue.d.ts +67 -0
  38. package/types/components/lcb-area-picker/types.d.ts +1 -0
  39. package/types/components/lcb-calendar-search/lcb-calendar-search.vue.d.ts +1 -1
  40. package/types/components/lcb-city-select/api/index.d.ts +14 -1
  41. package/types/components/lcb-city-select/components/lcb-city-letter/index.vue.d.ts +53 -0
  42. package/types/components/{lcb-filter/lcb-filter.vue.d.ts → lcb-city-select/components/lcb-city-list/index.vue.d.ts} +9 -18
  43. package/types/components/lcb-city-select/components/lcb-city-list/types.d.ts +5 -0
  44. package/types/components/lcb-city-select/lcb-city-select.vue.d.ts +13 -4
  45. package/types/components/lcb-dynamic-data/lcb-dynamic-data.vue.d.ts +44 -0
  46. package/types/components/lcb-dynamic-data/types.d.ts +7 -0
  47. package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +1 -1
  48. package/types/components/lcb-image/lcb-image.vue.d.ts +1 -1
  49. package/types/components/lcb-img-nav/types.d.ts +2 -2
  50. package/types/components/{lcb-filter → lcb-list}/api.d.ts +5 -0
  51. package/types/components/lcb-list/components/FilterList/index.vue.d.ts +28 -0
  52. package/types/components/lcb-list/components/FilterList/type.d.ts +9 -0
  53. package/types/components/lcb-list/lcb-list.vue.d.ts +71 -0
  54. package/types/components/{lcb-filter → lcb-list}/types.d.ts +4 -1
  55. /package/components/{lcb-filter → lcb-list}/components/ActionView/index.vue +0 -0
  56. /package/components/{lcb-filter → lcb-list}/components/ComponentGroup/index.vue +0 -0
  57. /package/components/{lcb-filter → lcb-list}/components/ComponentGroup/type.ts +0 -0
  58. /package/components/{lcb-filter → lcb-list}/components/FilterSelect/index.vue +0 -0
  59. /package/components/{lcb-filter → lcb-list}/components/FilterSelect/type.ts +0 -0
  60. /package/components/{lcb-filter → lcb-list}/components/FilterSlider/types.ts +0 -0
  61. /package/components/{lcb-filter → lcb-list}/components/SelectTagView/index.vue +0 -0
  62. /package/components/{lcb-filter → lcb-list}/components/TagSelect/index.vue +0 -0
  63. /package/components/{lcb-filter → lcb-list}/components/TagSelect/type.ts +0 -0
  64. /package/components/{lcb-filter → lcb-list}/components/TreeSelect/index.vue +0 -0
  65. /package/components/{lcb-filter → lcb-list}/components/TreeSelect/type.ts +0 -0
  66. /package/components/{lcb-filter → lcb-list}/hooks/useSelect.ts +0 -0
  67. /package/types/components/{lcb-filter → lcb-list}/components/ActionView/index.vue.d.ts +0 -0
  68. /package/types/components/{lcb-filter → lcb-list}/components/ComponentGroup/index.vue.d.ts +0 -0
  69. /package/types/components/{lcb-filter → lcb-list}/components/ComponentGroup/type.d.ts +0 -0
  70. /package/types/components/{lcb-filter → lcb-list}/components/FilterSelect/index.vue.d.ts +0 -0
  71. /package/types/components/{lcb-filter → lcb-list}/components/FilterSelect/type.d.ts +0 -0
  72. /package/types/components/{lcb-filter → lcb-list}/components/FilterSlider/index.vue.d.ts +0 -0
  73. /package/types/components/{lcb-filter → lcb-list}/components/FilterSlider/types.d.ts +0 -0
  74. /package/types/components/{lcb-filter → lcb-list}/components/SelectTagView/index.vue.d.ts +0 -0
  75. /package/types/components/{lcb-filter → lcb-list}/components/TagSelect/index.vue.d.ts +0 -0
  76. /package/types/components/{lcb-filter → lcb-list}/components/TagSelect/type.d.ts +0 -0
  77. /package/types/components/{lcb-filter → lcb-list}/components/TreeSelect/index.vue.d.ts +0 -0
  78. /package/types/components/{lcb-filter → lcb-list}/components/TreeSelect/type.d.ts +0 -0
  79. /package/types/components/{lcb-filter → lcb-list}/hooks/useSelect.d.ts +0 -0
@@ -5,47 +5,50 @@
5
5
  <wd-popup
6
6
  v-model="show"
7
7
  position="bottom"
8
+ @after-enter="isOver = true"
9
+ custom-class="lcb-city__p"
8
10
  custom-style="height: 90vh;border-top-left-radius: 24rpx;border-top-right-radius: 24rpx;"
9
11
  :safe-area-inset-bottom="true"
10
12
  >
11
13
  <view class="flex flex-col h-full">
12
- <wd-search hide-cancel :placeholder="placeholder" />
13
- <view class="h-0 flex-1" v-if="addressRef.length > 0">
14
- <wd-index-bar>
15
- <view
16
- v-for="item in [...locationAddress, ...historyList, ...addressRef]"
17
- :key="item.categoryName"
18
- >
19
- <wd-index-anchor
20
- :index="item.categoryName"
21
- :hint="item.hint"
22
- customClass="!bg-transparent !pb-0 font-bold !text-28rpx !pl-4"
23
- />
24
- <view class="grid grid-cols-4 gap-3 py-3 pl-4 pr-10 box-border">
25
- <view
26
- class="address-tag"
27
- :class="{
28
- 'current-address':
29
- currentAddress && currentAddress.hotAddressId === city.hotAddressId,
30
- }"
31
- v-for="city in item.childHotAddress"
32
- :key="city.addr"
33
- @click="onAddrClick(city)"
34
- >
35
- {{ city.addr }}
36
- </view>
37
- </view>
38
- </view>
39
- </wd-index-bar>
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
+ />
40
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" />
41
40
  </view>
42
41
  </wd-popup>
43
42
  </template>
44
43
 
45
44
  <script setup lang="ts">
46
- import { computed, onMounted, ref, watch } from 'vue'
47
- import { ChildHotAddress, getHotAddress, HotAddress } from './api'
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'
48
49
  import { LcbCitySelectProps } from './types'
50
+ import { debounce } from '@tplc/wot/components/common/util'
51
+ import qs from 'qs'
49
52
  defineOptions({
50
53
  name: 'LcbCitySelect',
51
54
  options: {
@@ -57,56 +60,43 @@ defineOptions({
57
60
  const props = withDefaults(defineProps<LcbCitySelectProps>(), {
58
61
  placeholder: '搜索城市/区域/景点',
59
62
  })
60
- const addressRef = ref<HotAddress[]>([])
61
- const historyAddress = ref<ChildHotAddress[]>([])
62
- const currentAddress = ref<ChildHotAddress | undefined>(
63
- props.location
64
- ? ({
65
- addressInfo: props.location.addressInfo,
66
- addr: props.location.cityName,
67
- hotAddressId: props.location.cityId,
68
- } as ChildHotAddress)
69
- : undefined,
70
- )
63
+ const modelValue = defineModel<ChildHotAddress>()
64
+ const isOver = ref(false)
65
+ const searchValue = ref('')
71
66
  const show = ref(false)
72
- onMounted(async () => {
73
- const { data } = await getHotAddress()
74
- addressRef.value = data
75
- })
76
- const locationAddress = computed<HotAddress[]>(() => {
77
- return props.location
78
- ? ([
79
- {
80
- categoryName: '定位',
81
- hint: '当前定位',
82
- childHotAddress: [
83
- {
84
- addressInfo: props.location.addressInfo,
85
- addr: props.location.cityName,
86
- hotAddressId: props.location.cityId,
87
- },
88
- ],
89
- },
90
- ] as HotAddress[])
91
- : []
92
- })
67
+ const lcbAddress = ref<LcbAddress[]>([])
68
+ const showList = ref(false)
93
69
 
94
- const historyList = computed<HotAddress[]>(() => {
95
- return historyAddress.value.length
96
- ? [
97
- {
98
- categoryName: '历史',
99
- hint: '历史记录',
100
- childHotAddress: historyAddress.value,
101
- },
102
- ]
103
- : []
104
- })
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
+ }
105
91
  watch(
106
- () => show.value,
92
+ () => props.location,
107
93
  (val) => {
108
- if (val) {
109
- historyAddress.value = JSON.parse(uni.getStorageSync('historyAddress') || '[]')
94
+ if (val && !modelValue.value) {
95
+ modelValue.value = {
96
+ addressInfo: val.addressInfo,
97
+ addr: val.cityName,
98
+ hotAddressId: val.cityId,
99
+ } as ChildHotAddress
110
100
  }
111
101
  },
112
102
  {
@@ -115,54 +105,41 @@ watch(
115
105
  )
116
106
 
117
107
  watch(
118
- () => historyAddress.value,
108
+ () => modelValue.value,
109
+ () => {
110
+ show.value = false
111
+ },
112
+ )
113
+
114
+ watch(
115
+ () => show.value,
119
116
  (val) => {
120
- if (val.length) {
121
- uni.setStorageSync('historyAddress', JSON.stringify(val))
117
+ if (!val) {
118
+ onCancel()
122
119
  }
123
120
  },
124
121
  )
125
- const onAddrClick = (city: ChildHotAddress) => {
126
- currentAddress.value = city
127
- show.value = false
128
- historyAddress.value = historyAddress.value.filter(
129
- (item) => item.hotAddressId !== city.hotAddressId,
130
- )
131
- if (historyAddress.value.length === 8) {
132
- historyAddress.value = [city, ...historyAddress.value.slice(0, 7)]
133
- } else {
134
- historyAddress.value = [city, ...historyAddress.value]
135
- }
136
- }
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)
137
138
  </script>
138
139
 
139
140
  <style lang="scss" scoped>
140
- @import '@tplc/wot/components/common/abstracts/variable';
141
- .address-tag {
142
- background: #f7f7f7;
143
- height: 80rpx;
144
- display: flex;
145
- align-items: center;
146
- justify-content: center;
147
- padding: 0 16rpx;
148
- border-radius: 10rpx;
149
- font-size: 24rpx;
150
- text-align: center;
151
- overflow: hidden;
152
- }
153
- .current-address {
154
- color: $-color-theme;
155
- position: relative;
156
- &::after {
157
- content: '';
158
- position: absolute;
159
- bottom: 0;
160
- left: 0;
161
- width: 100%;
162
- height: 100%;
163
- z-index: 1;
164
- background: $-color-theme;
165
- opacity: 0.15;
166
- }
141
+ .top-search {
142
+ background: #ffffff;
143
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(243, 245, 249, 0.94);
167
144
  }
168
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>
@@ -0,0 +1,7 @@
1
+ export interface LcbDynamicDataProps {
2
+ items: {
3
+ title: string
4
+ unit?: string
5
+ key?: string
6
+ }[]
7
+ }
@@ -17,12 +17,19 @@
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
- <view class="text-30rpx font-bold">义乌</view>
21
- <img
22
- class="w-30rpx h-30rpx"
23
- mode="aspectFit"
24
- src="https://ddll-lycs.oss-cn-hangzhou.aliyuncs.com/default/1/20240914164446/%E5%BD%A2%E7%8A%B6%2092%402x.png"
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>
@@ -78,9 +85,11 @@ import { LcbHomeSearch } from './types'
78
85
  import dayjs from 'dayjs/esm'
79
86
  import useLocation from '../../hooks/useLocation'
80
87
  import { useTranslate } from '@tplc/wot'
88
+ import { ChildHotAddress } from '../lcb-city-select/api'
81
89
  const dayRange = ref([dayjs().valueOf(), dayjs().add(1, 'day').valueOf()])
82
90
  const { translate } = useTranslate()
83
- const { getLocation, locationIng } = useLocation()
91
+ const { getLocation, userLocation, locationIng } = useLocation()
92
+ const addressCity = ref<ChildHotAddress>()
84
93
  getLocation()
85
94
  const nightCount = computed(() => {
86
95
  return dayjs(dayRange.value[1]).diff(dayRange.value[0], 'day')
@@ -1,33 +1,61 @@
1
1
  <template>
2
2
  <lcb-block v-bind="$props">
3
- <lcb-title v-if="showTitle" v-bind="{
4
- title,
5
- marginHorizontal: 0,
6
- paddingHorizontal: titlePadding,
7
- paddingBottom: 25,
8
- fontSize,
9
- fontWeight,
10
- color,
11
- }" />
12
- <view :style="{
13
- gridTemplateColumns: `repeat(${pictureDistribution}, minmax(0, 1fr))`,
14
- }" :class="[styleGroup === 2 ? 'mutil' : 'single']">
15
- <lcb-action-view v-for="item in items" :key="item.title" v-bind="item.link"
16
- custom-class="!flex flex-col justify-center items-center">
17
- <view class="overflow-hidden" :style="{
18
- marginBottom: iconTextMargin + 'rpx',
19
- }">
20
- <!-- <div v-if="iconType === 0" class="flex justify-center items-center"> -->
21
- <wd-icon v-if="iconType === 0" class-prefix="iconfont" :name="item.icon!" :size="iconSize + 'rpx'"
22
- :color="iconColor" />
23
- <!-- </div> -->
24
- <img v-else class="block" :style="{
25
- borderRadius: iconRadius + 'rpx',
26
- height: iconSize + 'rpx',
27
- width: iconSize + 'rpx',
28
- }" :src="item.url" />
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: 24rpx;
82
- line-height: 14px;
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/filter/detail', {
55
- pageFilterType: val,
59
+ uni.$lcb.http.post<LcbFilterResult>('/pageDecoration/list//detail', {
60
+ pageListType: val,
56
61
  })
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <z-paging ref="paging" :auto="true" v-model="dataList" @query="queryList" use-page-scroll>
3
+ <lcb-product v-bind="{ ...productProps }" :items="dataList" />
4
+ </z-paging>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { ref, watch } from 'vue'
9
+ import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging'
10
+ import { LcbFilterListProps } from './type'
11
+
12
+ defineOptions({
13
+ name: 'FilterList',
14
+ options: {
15
+ addGlobalClass: true,
16
+ virtualHost: true,
17
+ styleIsolation: 'shared',
18
+ },
19
+ })
20
+ const props = defineProps<LcbFilterListProps>()
21
+ const dataList = ref<unknown[]>([])
22
+ const paging = ref()
23
+ useZPaging(paging)
24
+ watch(
25
+ () => props.url,
26
+ async (val) => {
27
+ if (val) {
28
+ paging.value?.reload()
29
+ }
30
+ },
31
+ {
32
+ immediate: true,
33
+ deep: true,
34
+ },
35
+ )
36
+ watch(
37
+ () => props.filter,
38
+ async (val) => {
39
+ if (val) {
40
+ paging.value?.reload()
41
+ }
42
+ },
43
+ {
44
+ immediate: true,
45
+ deep: true,
46
+ },
47
+ )
48
+ const queryList = async (pageNo: number, pageSize: number) => {
49
+ try {
50
+ const { data } = await uni.$lcb.http.post(props.url, {
51
+ ...props.baseParam,
52
+ ...props.filter,
53
+ pageNo,
54
+ pageSize,
55
+ })
56
+ paging.value.complete(data)
57
+ } catch (error) {
58
+ paging.value.complete(false)
59
+ }
60
+ }
61
+ </script>
62
+ <style lang="scss" scoped>
63
+ .action-view {
64
+ width: 100%;
65
+ height: 118rpx;
66
+ background: #ffffff;
67
+ box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(0, 0, 0, 0.04);
68
+ gap: 50rpx;
69
+ padding: 20rpx 52rpx;
70
+ box-sizing: border-box;
71
+ :deep(.wd-button) {
72
+ height: 100%;
73
+ line-height: 100%;
74
+ font-size: 30rpx;
75
+ border-radius: 40rpx;
76
+ }
77
+ }
78
+ </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 = () => {
@@ -9,6 +9,9 @@
9
9
  color: $-color-theme !important;
10
10
  }
11
11
 
12
+ &__border-top {
13
+ border-top: 1px solid #F3F5F9;
14
+ }
12
15
 
13
16
  }
14
17