@tplc/business 0.1.13 → 0.1.15

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 (111) hide show
  1. package/CHANGELOG.md +480 -0
  2. package/action.d.ts +2 -0
  3. package/{components/lcb-user-top/api/index.ts → api/user.ts} +1 -0
  4. package/components/lcb-action-view/lcb-action-view.vue +14 -2
  5. package/components/lcb-action-view/types.ts +21 -2
  6. package/components/lcb-advert/lcb-advert.vue +78 -0
  7. package/components/lcb-advert/types.ts +3 -0
  8. package/components/lcb-banner-block/lcb-banner-block.vue +3 -4
  9. package/components/lcb-block/lcb-block.vue +11 -3
  10. package/components/lcb-block/types.ts +5 -1
  11. package/components/lcb-button/lcb-button.vue +32 -0
  12. package/components/lcb-button/types.ts +8 -0
  13. package/components/lcb-calendar-search/lcb-calendar-search.vue +3 -2
  14. package/components/lcb-city-select/components/lcb-city-letter/index.vue +4 -1
  15. package/components/lcb-city-select/components/lcb-city-list/index.vue +6 -1
  16. package/components/lcb-city-select/lcb-city-select.vue +24 -8
  17. package/components/lcb-gap/lcb-gap.vue +15 -7
  18. package/components/lcb-gap/types.ts +4 -2
  19. package/components/lcb-grid/lcb-grid.vue +56 -20
  20. package/components/lcb-grid/types.ts +8 -0
  21. package/components/lcb-home-search/lcb-home-search.vue +44 -20
  22. package/components/lcb-img-nav/lcb-img-nav.vue +51 -30
  23. package/components/lcb-img-nav/types.ts +16 -0
  24. package/components/lcb-list/components/FilterList/index.vue +26 -21
  25. package/components/lcb-list/components/FilterList/type.ts +1 -1
  26. package/components/lcb-list/components/FilterView/index.vue +121 -0
  27. package/components/lcb-list/components/FilterView/type.ts +8 -0
  28. package/components/lcb-list/hooks/useSelect.ts +2 -0
  29. package/components/lcb-list/lcb-list.vue +57 -138
  30. package/components/lcb-list/types.ts +1 -0
  31. package/components/lcb-nav/lcb-nav.vue +22 -9
  32. package/components/lcb-notice/api/index.ts +21 -0
  33. package/components/lcb-notice/lcb-notice.vue +66 -50
  34. package/components/lcb-notice/types.ts +11 -26
  35. package/components/lcb-product/lcb-product.vue +114 -4
  36. package/components/lcb-product/types.ts +3 -0
  37. package/components/lcb-product-item/components/ItemValue.vue +14 -25
  38. package/components/lcb-product-item/lcb-product-item.vue +13 -7
  39. package/components/lcb-rich-text/lcb-rich-text.vue +22 -0
  40. package/components/lcb-rich-text/types.ts +5 -0
  41. package/components/lcb-text/lcb-text.vue +20 -0
  42. package/components/lcb-text/types.ts +5 -0
  43. package/components/lcb-title/lcb-title.vue +33 -6
  44. package/components/lcb-title/types.ts +17 -3
  45. package/components/lcb-user-order/lcb-user-order.vue +48 -61
  46. package/components/lcb-user-order/types.ts +5 -48
  47. package/components/lcb-user-top/Nums/index.vue +3 -2
  48. package/components/lcb-user-top/lcb-user-top.vue +40 -26
  49. package/components/lcb-vip/api/index.ts +35 -0
  50. package/components/lcb-vip/components/InfoDialog/index.vue +65 -0
  51. package/components/lcb-vip/lcb-vip.vue +96 -0
  52. package/components/lcb-vip/types.ts +8 -0
  53. package/constants.ts +2 -0
  54. package/global.d.ts +5 -0
  55. package/iconfonts/index.css +24 -3
  56. package/index.ts +5 -1
  57. package/package.json +18 -13
  58. package/types/{components/lcb-user-top/api/index.d.ts → api/user.d.ts} +2 -1
  59. package/types/components/lcb-action-view/lcb-action-view.vue.d.ts +2 -22
  60. package/types/components/lcb-action-view/types.d.ts +21 -2
  61. package/types/components/lcb-advert/lcb-advert.vue.d.ts +28 -0
  62. package/types/components/lcb-advert/types.d.ts +3 -0
  63. package/types/components/lcb-area-picker/lcb-area-picker.vue.d.ts +1 -1
  64. package/types/components/lcb-banner-block/lcb-banner-block.vue.d.ts +0 -9
  65. package/types/components/lcb-block/lcb-block.vue.d.ts +4 -0
  66. package/types/components/lcb-block/types.d.ts +5 -0
  67. package/types/components/lcb-button/lcb-button.vue.d.ts +42 -0
  68. package/types/components/lcb-button/types.d.ts +7 -0
  69. package/types/components/lcb-calendar-search/lcb-calendar-search.vue.d.ts +6 -4
  70. package/types/components/lcb-gap/types.d.ts +3 -2
  71. package/types/components/lcb-grid/lcb-grid.vue.d.ts +13 -4
  72. package/types/components/lcb-grid/types.d.ts +8 -0
  73. package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +4 -1
  74. package/types/components/lcb-img-nav/lcb-img-nav.vue.d.ts +21 -2
  75. package/types/components/lcb-img-nav/types.d.ts +15 -0
  76. package/types/components/lcb-list/components/FilterList/index.vue.d.ts +12 -4
  77. package/types/components/lcb-list/components/FilterList/type.d.ts +1 -1
  78. package/types/components/lcb-list/components/FilterView/index.vue.d.ts +36 -0
  79. package/types/components/lcb-list/components/FilterView/type.d.ts +7 -0
  80. package/types/components/lcb-list/lcb-list.vue.d.ts +2 -1
  81. package/types/components/lcb-list/types.d.ts +1 -0
  82. package/types/components/lcb-nav/lcb-nav.vue.d.ts +0 -3
  83. package/types/components/lcb-notice/api/index.d.ts +19 -0
  84. package/types/components/lcb-notice/lcb-notice.vue.d.ts +25 -19
  85. package/types/components/lcb-notice/types.d.ts +11 -24
  86. package/types/components/lcb-product/lcb-product.vue.d.ts +3 -0
  87. package/types/components/lcb-product/types.d.ts +3 -0
  88. package/types/components/lcb-product-item/lcb-product-item.vue.d.ts +2 -2
  89. package/types/components/{lcb-notice/Item/index.vue.d.ts → lcb-rich-text/lcb-rich-text.vue.d.ts} +4 -16
  90. package/types/components/lcb-rich-text/types.d.ts +4 -0
  91. package/types/components/lcb-swiper/lcb-swiper.vue.d.ts +2 -2
  92. package/types/components/lcb-text/lcb-text.vue.d.ts +42 -0
  93. package/types/components/lcb-text/types.d.ts +4 -0
  94. package/types/components/lcb-title/lcb-title.vue.d.ts +27 -1
  95. package/types/components/lcb-title/types.d.ts +15 -3
  96. package/types/components/lcb-user-order/types.d.ts +5 -35
  97. package/types/components/lcb-user-top/Nums/index.vue.d.ts +6 -2
  98. package/types/components/lcb-vip/api/index.d.ts +34 -0
  99. package/types/components/lcb-vip/components/InfoDialog/index.vue.d.ts +38 -0
  100. package/types/components/lcb-vip/lcb-vip.vue.d.ts +68 -0
  101. package/types/components/lcb-vip/types.d.ts +8 -0
  102. package/types/constants.d.ts +2 -0
  103. package/types/index.d.ts +6 -0
  104. package/types/utils/auth.d.ts +2 -0
  105. package/types/utils/transform.d.ts +5 -1
  106. package/types/utils/utils.d.ts +2 -0
  107. package/utils/auth.ts +19 -0
  108. package/utils/transform.ts +13 -2
  109. package/utils/utils.ts +6 -1
  110. package/components/lcb-notice/Item/index.vue +0 -112
  111. package/types/components/lcb-list/components/FilterList/mockData.d.ts +0 -63
@@ -3,7 +3,7 @@
3
3
  class="customNavigation"
4
4
  :class="{
5
5
  immersiveTop: topStyle === 2,
6
- fixed,
6
+ fixed: topStyle === 1,
7
7
  }"
8
8
  :style="{
9
9
  paddingTop,
@@ -49,7 +49,7 @@
49
49
  <template v-else-if="back">
50
50
  <wd-icon
51
51
  class-prefix="lcb"
52
- name="zuo_left"
52
+ :name="isLastPage() ? 'shouye_home-two' : 'zuo_left'"
53
53
  @click="toBack"
54
54
  :color="contentColor"
55
55
  size="24px"
@@ -72,14 +72,15 @@
72
72
  <Search v-if="styleGroup === 2 && titleLocation === 'center'" :back="back" />
73
73
  <Title v-bind="titleProps" v-else-if="styleGroup === 2 || titleLocation === 'center'" />
74
74
  </view>
75
- <!-- </template> -->
76
75
  </view>
77
76
  </view>
77
+ <!-- 常规默认底部弹一个高度的gap -->
78
+ <lcb-gap v-if="topStyle === 1" height="44px" safe-area-top />
78
79
  </template>
79
80
 
80
81
  <script setup lang="ts">
81
82
  import { addUnit } from '@tplc/wot/components/common/util'
82
- import { computed, ref } from 'vue'
83
+ import { computed, inject } from 'vue'
83
84
  import { ICapsule, NavProps } from './types'
84
85
  import Title from './Title/index.vue'
85
86
  import Search from './Search/index.vue'
@@ -103,6 +104,7 @@ const iconMap = {
103
104
  home: 'shouye_home1',
104
105
  }
105
106
  const [scrollTop] = usePageScroll()
107
+ const injectScrollTop = inject('page-scroll-top', { value: 0 })
106
108
  const props = withDefaults(defineProps<NavProps>(), {
107
109
  styleGroup: 1,
108
110
  titleLocation: 'center',
@@ -114,7 +116,6 @@ const props = withDefaults(defineProps<NavProps>(), {
114
116
  backColor: '#ffffff',
115
117
  contentColor: '#000000',
116
118
  logoImg: '',
117
- fixed: false,
118
119
  back: false,
119
120
  capsuleMode: 'light',
120
121
  immersionMode: 1,
@@ -123,12 +124,18 @@ const props = withDefaults(defineProps<NavProps>(), {
123
124
  const navbarBgColor = computed(() => {
124
125
  return props.backgroundType === 'color' ? props.backColor : ''
125
126
  })
126
-
127
+ // 判断是否是最后一个页面
128
+ const isLastPage = () => {
129
+ const pages = getCurrentPages()
130
+ return pages.length === 1
131
+ }
127
132
  // 透明度
128
133
  const navbarBgOpacity = computed(() => {
129
134
  const { topStyle, immersionMode } = props
130
135
  if (topStyle === 2) {
131
- return immersionMode === 1 ? scrollTop.value / ((statusBarHeight || 0) + 44) : 0
136
+ return immersionMode === 1
137
+ ? (scrollTop.value || injectScrollTop.value) / ((statusBarHeight || 0) + 44)
138
+ : 0
132
139
  }
133
140
  return 1
134
141
  })
@@ -189,7 +196,7 @@ const onCapsule = ({ action }: ICapsule) => {
189
196
  break
190
197
  case 'setting':
191
198
  uni.navigateTo({
192
- url: '/pages/setting/index',
199
+ url: '/pages/mine/setting',
193
200
  })
194
201
  break
195
202
 
@@ -202,7 +209,13 @@ const onCapsule = ({ action }: ICapsule) => {
202
209
  }
203
210
 
204
211
  const toBack = () => {
205
- uni.navigateBack()
212
+ if (isLastPage()) {
213
+ uni.switchTab({
214
+ url: '/pages/index/index',
215
+ })
216
+ } else {
217
+ uni.navigateBack()
218
+ }
206
219
  }
207
220
  </script>
208
221
  <style lang="scss" scoped>
@@ -0,0 +1,21 @@
1
+ export interface AdvertItem {
2
+ adContent: string
3
+ advertId: string
4
+ closeTime: number
5
+ closeType: string
6
+ createDate: string
7
+ jumpType: number
8
+ lastModifyDate: string
9
+ pageType: string
10
+ type: number
11
+ title?: string
12
+ weightSort: string
13
+ }
14
+ /** 获取公告 */
15
+ export const getAdvertList = (data: {
16
+ pageType: string
17
+ /** 1: 文字 2: 图片 */
18
+ type: 1 | 2
19
+ }) => {
20
+ return uni.$lcb.http.post<AdvertItem[]>('/advert/list', data)
21
+ }
@@ -1,32 +1,49 @@
1
1
  <template>
2
- <lcb-block v-bind="$props" custom-class="border-solid border-1">
3
- <swiper
4
- class="swiper"
5
- circular
6
- :autoplay="true"
7
- :disableTouch="true"
8
- :interval="interval"
9
- :vertical="direction == 'up'"
10
- @change="onSwiperChange"
2
+ <lcb-block v-bind="$props" custom-class="border-solid border-1" v-if="adverts.length">
3
+ <wd-notice-bar
4
+ :text="textArray"
5
+ backgroundColor="transparent"
6
+ :color="color"
7
+ :direction="direction"
8
+ :speed="speed"
9
+ @click="handleClick"
10
+ custom-class="!p-0 !rounded-none"
11
11
  >
12
- <swiper-item v-for="(item, idx) in items" :key="item.id">
13
- <Item
14
- :idx="idx"
15
- :current="current"
16
- :lens="items?.length"
17
- :iconType="iconType"
18
- :item="item"
19
- :textSpeed="textSpeed"
20
- :textColor="textColor"
21
- />
22
- </swiper-item>
23
- </swiper>
12
+ <template #prefix v-if="iconType !== -1 && icon">
13
+ <view class="mr-12rpx">
14
+ <image
15
+ :src="icon"
16
+ class="h-auto"
17
+ mode="widthFix"
18
+ v-if="iconType === 1"
19
+ :style="{
20
+ width: transformValueUnit(iconSize),
21
+ }"
22
+ />
23
+ <wd-icon :name="icon" :size="transformValueUnit(iconSize)" class-prefix="lcb" v-else />
24
+ </view>
25
+ </template>
26
+ <template #suffix v-if="rightArrow">
27
+ <wd-icon name="arrow-right" size="32rpx" />
28
+ </template>
29
+ </wd-notice-bar>
24
30
  </lcb-block>
31
+ <wd-popup v-model="popup.show" position="bottom" custom-class="!bg-transparent" closable>
32
+ <view class="text-#333 px-3 pb-3 box-border bg-#fff rounded-t-20rpx">
33
+ <view class="py-3 text-center font-500 text-4">{{ popup.item.title || '公告' }}</view>
34
+ <view class="min-h-30vh max-h-50vh overflow-y-auto text-28rpx">
35
+ {{ popup.item.adContent }}
36
+ </view>
37
+ </view>
38
+ </wd-popup>
25
39
  </template>
26
40
 
27
41
  <script setup lang="ts">
28
42
  import { LcbNoticeBarProps } from './types'
29
- import Item from './Item/index.vue'
43
+ import { inject, watch, ref, computed } from 'vue'
44
+ import { AdvertItem, getAdvertList } from './api'
45
+ import { PAGE_TYPE_PROVIDE_KEY } from '../../constants'
46
+ import { transformValueUnit } from '../../utils/transform'
30
47
 
31
48
  defineOptions({
32
49
  name: 'LcbNotice',
@@ -36,37 +53,36 @@ defineOptions({
36
53
  styleIsolation: 'shared',
37
54
  },
38
55
  })
39
-
56
+ const adverts = ref<AdvertItem[]>([])
40
57
  const props = withDefaults(defineProps<LcbNoticeBarProps>(), {
41
- textSpeed: 1,
58
+ speed: 50,
42
59
  borderColor: 'transparent',
60
+ direction: 'vertical',
61
+ backgroundColor: '#fff',
62
+ paddingVertical: 16,
63
+ rightArrow: true,
64
+ color: '#333',
65
+ iconSize: 40,
43
66
  })
44
- console.log(props, 'props')
45
-
46
- function getTime(text: string | undefined) {
47
- const len = text?.length || 0
48
- // console.log('props.textSpeed', len, props.textSpeed)
49
- return len > 25 ? ((50 - len) / 10) * props.textSpeed * 1000 + 3000 : 3000
50
- }
51
- // const params = ref<number>(0)
52
- // const model = defineModel<number>()
53
- const current = defineModel({ type: Number, default: 0 })
54
- const interval = defineModel('interval', { type: Number, default: 3000 })
55
- function onSwiperChange(item: any) {
56
- // console.log('current.value', current.value)
57
- current.value = item?.detail?.current
58
- interval.value = getTime(props.items?.[current.value]?.noticeContent)
59
- // console.log('onSwiperChange item', item)
60
- // console.log('interval.value', interval.value)
67
+ const popup = ref({
68
+ show: false,
69
+ item: {} as AdvertItem,
70
+ })
71
+ const pageType = inject(PAGE_TYPE_PROVIDE_KEY, props.pageType) as string
72
+ const getData = async () => {
73
+ const { data } = await getAdvertList({
74
+ type: 1,
75
+ pageType,
76
+ })
77
+ adverts.value = data
61
78
  }
79
+ watch(() => pageType, getData, { immediate: true })
62
80
 
63
- // function onSetInterval(val: number) {
64
- // interval.value = val;
65
- // }
66
- </script>
67
-
68
- <style lang="scss" scoped>
69
- .swiper {
70
- height: 72rpx;
81
+ const textArray = computed(() => adverts.value.map((item) => item.adContent))
82
+ const handleClick = (data: { text: string; index: number }) => {
83
+ popup.value = {
84
+ show: true,
85
+ item: adverts.value[data.index],
86
+ }
71
87
  }
72
- </style>
88
+ </script>
@@ -1,30 +1,15 @@
1
- import { LcbActionViewProps } from '../../components/lcb-action-view/types'
2
- interface NoticeItem {
3
- id?: number
4
- noticeContent?: string
5
- icon?: string
6
- link?: LcbActionViewProps
7
- }
1
+ import { NoticeBarScrollDirection } from '@tplc/wot/types/components/wd-notice-bar/types'
2
+ import { LcbBlockProps } from '../lcb-block/types'
8
3
 
9
- export interface LcbNoticeBarProps {
10
- // Define the component's prop types here
11
- items?: Partial<NoticeItem>[]
4
+ export interface LcbNoticeBarProps extends LcbBlockProps {
12
5
  vertical?: boolean
13
- iconType?: number
14
- direction?: string
15
- textSpeed?: number
16
- textColor?: string
17
- borderColor?: string
18
- }
19
-
20
- export interface NoticeBarItemProps {
21
- idx?: number
22
- current?: number
23
- text?: string
24
- lens?: number
25
- iconType?: number
26
- item?: NoticeItem
27
- textSpeed?: number
6
+ /** -1 无 0 图标 1 自定义 */
7
+ iconType?: -1 | 0 | 1
8
+ direction?: NoticeBarScrollDirection
9
+ speed?: number
28
10
  textColor?: string
29
- // setInterval?: Function
11
+ pageType?: string
12
+ rightArrow?: boolean
13
+ icon?: string
14
+ iconSize?: number
30
15
  }
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, useAttrs } from 'vue'
3
+ import UWaterfall from 'uview-plus/components/u-waterfall/u-waterfall.vue'
3
4
  import { LcbProductProps } from './types'
4
5
 
5
6
  const attrs = useAttrs()
@@ -26,11 +27,20 @@ defineSlots<{
26
27
  <template>
27
28
  <lcb-block v-bind="$props">
28
29
  <view class="flex flex-col gap-2 p-2" v-if="listType === 'list'">
29
- <view v-for="(item, index) in items" :key="`${item?.productId}:${index}`">
30
+ <lcb-action-view
31
+ v-for="(item, index) in items"
32
+ :key="`${item?.productId}:${index}`"
33
+ v-bind="item.link"
34
+ >
30
35
  <slot name="item" :item="item">
31
36
  <lcb-product-item
32
37
  v-bind="{ ...item, ...attrs }"
33
- :imageStyle="{ width: `${imageWidthPercent}%` }"
38
+ :imageStyle="{
39
+ width: imageWidth ?? `${imageWidthPercent}%`,
40
+ height: imageHeight ? `${imageHeight}rpx` : undefined,
41
+ borderRadius: imageRadius ? `${imageRadius}rpx` : undefined,
42
+ ...(attrs?.imageStyle ?? {}),
43
+ }"
34
44
  >
35
45
  <!-- <template #itemTopSection>
36
46
  <view class="min-w-10 min-h-10 bg-red-500/50"></view>
@@ -59,7 +69,7 @@ defineSlots<{
59
69
  </template> -->
60
70
  </lcb-product-item>
61
71
  </slot>
62
- </view>
72
+ </lcb-action-view>
63
73
  </view>
64
74
 
65
75
  <view class="flex p-1 flex-wrap" v-if="listType === 'grid'">
@@ -71,7 +81,10 @@ defineSlots<{
71
81
  v-bind="{ ...item, ...attrs }"
72
82
  layoutType="vertical"
73
83
  className="!h-full"
74
- :imageStyle="{ height: `${imageHeightPercent}%` }"
84
+ :imageStyle="{
85
+ height: imageHeight ?? `${imageHeightPercent}%`,
86
+ ...(attrs?.imageStyle ?? {}),
87
+ }"
75
88
  >
76
89
  <!-- <template #itemTopSection>
77
90
  <view class="min-w-10 min-h-10 bg-red-500/50"></view>
@@ -92,6 +105,103 @@ defineSlots<{
92
105
  </view>
93
106
  </view>
94
107
 
108
+ <u-waterfall :modelValue="items" v-if="listType === 'waterfall'" class="flex gap-3 p-3">
109
+ <template #left="{ leftList: list }">
110
+ <view class="flex flex-col gap-3">
111
+ <view
112
+ v-for="(item, index) in list"
113
+ :key="`${item?.productId}:${index}`"
114
+ class="rounded overflow-hidden"
115
+ >
116
+ <slot name="item" :item="item">
117
+ <lcb-product-item
118
+ v-bind="{ ...item, ...attrs }"
119
+ layoutType="vertical"
120
+ tag-overflow-wrap
121
+ :title-line-clamp="2"
122
+ >
123
+ <template #image="{ value }">
124
+ <image :src="value" class="w-full" mode="widthFix" />
125
+ </template>
126
+ <!-- <template #itemTopSection>
127
+ <view class="min-w-10 min-h-10 bg-red-500/50"></view>
128
+ </template>
129
+ <template #itemBottomSection>
130
+ <view class="min-w-10 min-h-10 bg-yellow-500/50"></view>
131
+ </template>
132
+ <template #itemLeftSection>
133
+ <view class="min-w-10 min-h-10 bg-blue-500/50"></view>
134
+ </template>
135
+ <template #itemRightSection>
136
+ <view class="min-w-10 min-h-10 bg-green-500/50"></view>
137
+ </template> -->
138
+
139
+ <!-- <template #imageSection>
140
+ <view class="min-w-5 min-h-5 bg-yellow-400 right-1 top-1 absolute z-10"></view>
141
+ </template>
142
+
143
+ <template #itemSection>
144
+ <view class="min-w-10 min-h-10 bg-blue-500/50 right-0 top-0 absolute z-10"></view>
145
+ </template>
146
+ <template #contentSection>
147
+ <view
148
+ class="min-w-15 min-h-15 bg-gray-500/20 right-10 top-10 absolute z-10 rounded-full"
149
+ ></view>
150
+ </template> -->
151
+ </lcb-product-item>
152
+ </slot>
153
+ </view>
154
+ </view>
155
+ </template>
156
+ <template #right="{ rightList: list }">
157
+ <view class="flex flex-col gap-3">
158
+ <view
159
+ v-for="(item, index) in list"
160
+ :key="`${item?.productId}:${index}`"
161
+ class="rounded overflow-hidden"
162
+ >
163
+ <slot name="item" :item="item">
164
+ <lcb-product-item
165
+ v-bind="{ ...item, ...attrs }"
166
+ layoutType="vertical"
167
+ tag-overflow-wrap
168
+ :title-line-clamp="2"
169
+ >
170
+ <template #image="{ value }">
171
+ <image :src="value" class="w-full" mode="widthFix" />
172
+ </template>
173
+ <!-- <template #itemTopSection>
174
+ <view class="min-w-10 min-h-10 bg-red-500/50"></view>
175
+ </template>
176
+ <template #itemBottomSection>
177
+ <view class="min-w-10 min-h-10 bg-yellow-500/50"></view>
178
+ </template>
179
+ <template #itemLeftSection>
180
+ <view class="min-w-10 min-h-10 bg-blue-500/50"></view>
181
+ </template>
182
+ <template #itemRightSection>
183
+ <view class="min-w-10 min-h-10 bg-green-500/50"></view>
184
+ </template> -->
185
+
186
+ <!-- <template #imageSection>
187
+ <view class="min-w-5 min-h-5 bg-yellow-400 right-1 top-1 absolute z-10"></view>
188
+ </template>
189
+
190
+ <template #itemSection>
191
+ <view class="min-w-10 min-h-10 bg-blue-500/50 right-0 top-0 absolute z-10"></view>
192
+ </template>
193
+ <template #contentSection>
194
+ <view
195
+ class="min-w-15 min-h-15 bg-gray-500/20 right-10 top-10 absolute z-10 rounded-full"
196
+ ></view>
197
+ </template> -->
198
+ </lcb-product-item>
199
+ </slot>
200
+ </view>
201
+ </view>
202
+ </template>
203
+ </u-waterfall>
204
+
95
205
  <scroll-view v-if="listType == 'horizontal'" scroll-x>
96
206
  <view class="p-2 flex gap-2 whitespace-nowrap overflow-auto flex-nowrap">
97
207
  <view
@@ -3,6 +3,9 @@ export interface LcbProductProps {
3
3
  listType?: 'list' | 'horizontal' | 'grid' | 'waterfall' // 1列表 2 左右滑动 3一行两个 4瀑布流
4
4
  imageWidthPercent?: number
5
5
  imageHeightPercent?: number
6
+ imageWidth?: number
7
+ imageHeight?: number
8
+ imageRadius?: number
6
9
  itemHeight?: number // 列表项高度
7
10
  items?: Record<string, any>[]
8
11
  }
@@ -1,7 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import { inject, computed, useAttrs } from 'vue'
3
3
  import { isArray } from '@tplc/wot/components/common/util'
4
-
4
+ defineOptions({
5
+ name: 'LcbProductItemView',
6
+ options: {
7
+ addGlobalClass: true,
8
+ virtualHost: true,
9
+ styleIsolation: 'shared',
10
+ },
11
+ })
5
12
  // const attrs = useAttrs()
6
13
 
7
14
  const itemProps: any = inject('lcb-product-item-props')
@@ -49,7 +56,7 @@ const value = computed(() => {
49
56
  >
50
57
  <!-- 图片 -->
51
58
  <slot :value="value" v-if="prop === 'image'" name="image">
52
- <view :value="value" :class="className" :style="style">
59
+ <view :class="className" :style="style">
53
60
  <image :src="value" class="w-full h-full" mode="aspectFill" />
54
61
  <slot></slot>
55
62
  </view>
@@ -79,7 +86,6 @@ const value = computed(() => {
79
86
  <view
80
87
  :class="className"
81
88
  :style="style"
82
- :value="value"
83
89
  class="text-22rpx text-gray-500 text-ellipsis line-clamp-1"
84
90
  >
85
91
  <view>{{ value }}</view>
@@ -91,7 +97,6 @@ const value = computed(() => {
91
97
  <view
92
98
  :class="className"
93
99
  :style="style"
94
- :value="value"
95
100
  class="text-gray-500 text-22rpx flex gap-3rpx items-center"
96
101
  >
97
102
  <wd-icon name="location" size="32rpx"></wd-icon>
@@ -104,7 +109,6 @@ const value = computed(() => {
104
109
  <view
105
110
  :class="className"
106
111
  :style="style"
107
- :value="value"
108
112
  class="text-gray-500 text-22rpx flex gap-3rpx items-center"
109
113
  >
110
114
  <wd-icon name="location" size="32rpx"></wd-icon>
@@ -145,12 +149,7 @@ const value = computed(() => {
145
149
 
146
150
  <!-- 价格单位 -->
147
151
  <slot :value="value" v-if="prop === 'priceUnit'" name="priceUnit">
148
- <view
149
- :class="className"
150
- :style="style"
151
- :value="value"
152
- class="text-red-500 font-bold text-22rpx"
153
- >
152
+ <view :class="className" :style="style" class="text-red-500 font-bold text-22rpx">
154
153
  <view>{{ value }}</view>
155
154
  </view>
156
155
  </slot>
@@ -169,38 +168,28 @@ const value = computed(() => {
169
168
 
170
169
  <!-- 价格后缀 -->
171
170
  <slot :value="value" v-if="prop === 'priceSuffix'" name="priceSuffix">
172
- <view :class="className" :style="style" :value="value" class="text-22rpx">
171
+ <view :class="className" :style="style" class="text-22rpx">
173
172
  <view>{{ value }}</view>
174
173
  </view>
175
174
  </slot>
176
175
 
177
176
  <!-- 原始价格单位 -->
178
177
  <slot :value="value" v-if="prop === 'originPriceUnit'" name="originPriceUnit">
179
- <view
180
- :class="className"
181
- :style="style"
182
- :value="value"
183
- class="text-gray-500 font-bold text-19rpx"
184
- >
178
+ <view :class="className" :style="style" class="text-gray-500 font-bold text-19rpx">
185
179
  <view>{{ value }}</view>
186
180
  </view>
187
181
  </slot>
188
182
 
189
183
  <!-- 原始价格 -->
190
184
  <slot :value="value" v-if="prop === 'originPrice'" name="originPrice">
191
- <view
192
- :class="className"
193
- :style="style"
194
- :value="value"
195
- class="text-gray-500 font-bold text-20rpx"
196
- >
185
+ <view :class="className" :style="style" class="text-gray-500 font-bold text-20rpx">
197
186
  <view>{{ value }}</view>
198
187
  </view>
199
188
  </slot>
200
189
 
201
190
  <!-- 原始价格后缀 -->
202
191
  <slot :value="value" v-if="prop === 'originPriceSuffix'" name="originPriceSuffix">
203
- <view :class="className" :style="style" :value="value" class="text-gray-500 text-20rpx">
192
+ <view :class="className" :style="style" class="text-gray-500 text-20rpx">
204
193
  <view>{{ value }}</view>
205
194
  </view>
206
195
  </slot>
@@ -2,9 +2,6 @@
2
2
  import { computed, provide, useAttrs } from 'vue'
3
3
  import { LcbProductItemProps } from './types'
4
4
  import ItemValue from './components/ItemValue.vue'
5
-
6
- const isNumber = (value: any) => typeof value === 'number'
7
-
8
5
  defineOptions({
9
6
  name: 'LcbProductItem',
10
7
  options: {
@@ -13,6 +10,7 @@ defineOptions({
13
10
  styleIsolation: 'shared',
14
11
  },
15
12
  })
13
+ const isNumber = (value: any) => typeof value === 'number'
16
14
 
17
15
  const props = withDefaults(defineProps<LcbProductItemProps>(), {
18
16
  layoutType: 'horizontal',
@@ -139,7 +137,9 @@ defineSlots<{
139
137
  <template #title="{ value }"><slot name="title" :value="value" /></template>
140
138
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
141
139
  <template #price="{ value }"><slot name="price" :value="value" /></template>
142
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
140
+ <template #priceUnit="{ value }">
141
+ <slot name="priceUnit" :value="value" />
142
+ </template>
143
143
  <template #priceSuffix="{ value }">
144
144
  <slot name="priceSuffix" :value="value" />
145
145
  </template>
@@ -169,7 +169,9 @@ defineSlots<{
169
169
  <template #title="{ value }"><slot name="title" :value="value" /></template>
170
170
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
171
171
  <template #price="{ value }"><slot name="price" :value="value" /></template>
172
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
172
+ <template #priceUnit="{ value }">
173
+ <slot name="priceUnit" :value="value" />
174
+ </template>
173
175
  <template #priceSuffix="{ value }">
174
176
  <slot name="priceSuffix" :value="value" />
175
177
  </template>
@@ -256,7 +258,9 @@ defineSlots<{
256
258
  <template #title="{ value }"><slot name="title" :value="value" /></template>
257
259
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
258
260
  <template #price="{ value }"><slot name="price" :value="value" /></template>
259
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
261
+ <template #priceUnit="{ value }">
262
+ <slot name="priceUnit" :value="value" />
263
+ </template>
260
264
  <template #priceSuffix="{ value }">
261
265
  <slot name="priceSuffix" :value="value" />
262
266
  </template>
@@ -286,7 +290,9 @@ defineSlots<{
286
290
  <template #title="{ value }"><slot name="title" :value="value" /></template>
287
291
  <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
288
292
  <template #price="{ value }"><slot name="price" :value="value" /></template>
289
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
293
+ <template #priceUnit="{ value }">
294
+ <slot name="priceUnit" :value="value" />
295
+ </template>
290
296
  <template #priceSuffix="{ value }">
291
297
  <slot name="priceSuffix" :value="value" />
292
298
  </template>
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <lcb-block v-bind="$props">
3
+ <mp-html :content="content" />
4
+ </lcb-block>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { LcbRichTextProps } from './types'
9
+ import mpHtml from 'mp-html/src/uni-app/components/mp-html/mp-html.vue'
10
+ defineOptions({
11
+ name: 'LcbRichText',
12
+ options: {
13
+ addGlobalClass: true,
14
+ virtualHost: true,
15
+ styleIsolation: 'shared',
16
+ },
17
+ })
18
+ const props = withDefaults(defineProps<LcbRichTextProps>(), {})
19
+ console.log('props', props)
20
+ </script>
21
+
22
+ <style lang="scss" scoped></style>
@@ -0,0 +1,5 @@
1
+ import { LcbBlockProps } from '../lcb-block/types'
2
+
3
+ export interface LcbRichTextProps extends LcbBlockProps {
4
+ content?: string
5
+ }