@tplc/business 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/components/lcb-banner/lcb-banner.vue +57 -0
  2. package/components/lcb-banner/types.ts +50 -0
  3. package/components/lcb-banner-block/lcb-banner-block.vue +70 -0
  4. package/components/lcb-banner-block/types.ts +13 -0
  5. package/components/lcb-block/lcb-block.vue +38 -0
  6. package/components/lcb-block/types.ts +17 -0
  7. package/components/lcb-grid/lcb-grid.vue +38 -0
  8. package/components/lcb-grid/types.ts +8 -0
  9. package/components/lcb-home-search/lcb-home-search.vue +85 -0
  10. package/components/lcb-img-nav/lcb-img-nav.vue +5 -37
  11. package/components/lcb-img-nav/types.ts +32 -0
  12. package/components/lcb-nav/lcb-nav-search.vue +59 -0
  13. package/components/lcb-nav/lcb-nav-title.vue +48 -0
  14. package/components/lcb-nav/lcb-nav.vue +177 -164
  15. package/components/lcb-nav/types.ts +45 -0
  16. package/components/lcb-swiper/lcb-swiper.vue +95 -0
  17. package/components/lcb-title/lcb-title.vue +37 -0
  18. package/components/lcb-title/types.ts +5 -0
  19. package/global.d.ts +12 -0
  20. package/package.json +4 -4
  21. package/tsconfig.dts.json +9 -0
  22. package/types/components/lcb-banner/lcb-banner.vue.d.ts +63 -0
  23. package/types/components/lcb-banner/types.d.ts +47 -0
  24. package/types/components/lcb-banner-block/lcb-banner-block.vue.d.ts +58 -0
  25. package/types/components/lcb-banner-block/types.d.ts +13 -0
  26. package/types/components/lcb-block/lcb-block.vue.d.ts +54 -0
  27. package/types/components/lcb-block/types.d.ts +17 -0
  28. package/types/components/lcb-grid/lcb-grid.vue.d.ts +62 -0
  29. package/types/components/lcb-grid/types.d.ts +8 -0
  30. package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +35 -0
  31. package/types/components/lcb-img-nav/lcb-img-nav.vue.d.ts +80 -85
  32. package/types/components/lcb-img-nav/types.d.ts +31 -0
  33. package/types/components/lcb-nav/lcb-nav-search.vue.d.ts +44 -0
  34. package/types/components/lcb-nav/lcb-nav-title.vue.d.ts +28 -0
  35. package/types/components/lcb-nav/lcb-nav.vue.d.ts +92 -87
  36. package/types/components/lcb-nav/types.d.ts +42 -0
  37. package/types/components/lcb-swiper/lcb-swiper.vue.d.ts +118 -0
  38. package/types/components/lcb-title/lcb-title.vue.d.ts +62 -0
  39. package/types/components/lcb-title/types.d.ts +5 -0
  40. package/types/utils/transform.d.ts +1 -0
  41. package/utils/transform.ts +3 -0
  42. package/types/index.d.ts +0 -0
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <LcbBlock :marginTop :marginBottom>
3
+ <wd-swiper
4
+ value-key="url"
5
+ v-bind="{
6
+ list: items,
7
+ loop,
8
+ height: transformValueUnit(height),
9
+ radius: transformValueUnit(radius),
10
+ autoplay: Boolean(interval),
11
+ direction,
12
+ itemPadding,
13
+ imageRadius: transformValueUnit(imageRadius),
14
+ indicatorPosition,
15
+ displayMultipleItems,
16
+ customNextImageClass,
17
+ interval,
18
+ indicator: indicator ? { type: indicator } : false,
19
+ ...supplementProps,
20
+ }"
21
+ />
22
+ </LcbBlock>
23
+ </template>
24
+
25
+ <script setup lang="ts">
26
+ import { computed } from 'vue'
27
+ import { LcbBannerProps } from './types'
28
+ import LcbBlock from '../lcb-block/lcb-block.vue'
29
+ import { transformValueUnit } from '../../utils/transform'
30
+ defineOptions({
31
+ name: 'LcbBanner',
32
+ options: {
33
+ addGlobalClass: true,
34
+ virtualHost: true,
35
+ styleIsolation: 'shared',
36
+ },
37
+ })
38
+ const props = withDefaults(defineProps<LcbBannerProps>(), {
39
+ styleGroup: 1,
40
+ radius: 0,
41
+ slidingStyle: 1,
42
+ })
43
+ const supplementProps = computed(() => {
44
+ if (props.styleGroup === 2) {
45
+ return {
46
+ nextMargin: transformValueUnit(props.previousMargin ?? 24),
47
+ previousMargin: transformValueUnit(props.previousMargin ?? 24),
48
+ itemPadding: `0px ${transformValueUnit(props.itemPadding ?? 10)}`,
49
+ imageRadius: transformValueUnit(props.imageRadius ?? 12),
50
+ customPrevImageHeight: props.slidingStyle === 2 ? (props.height ?? 24) * 0.8 : undefined,
51
+ customNextImageHeight: props.slidingStyle === 2 ? (props.height ?? 24) * 0.8 : undefined,
52
+ } as any
53
+ }
54
+ return {}
55
+ })
56
+ </script>
57
+ <style lang="scss" scoped></style>
@@ -0,0 +1,50 @@
1
+ import { ActionView } from 'global'
2
+
3
+ export interface LcbBannerProps {
4
+ items?: Partial<ActionView>[]
5
+ imageWidth?: number
6
+ /** 风格 1.平铺 2.卡片 */
7
+ styleGroup?: 1 | 2
8
+ autoplay?: boolean
9
+ /** 滚动方向 默认 horizontal */
10
+ direction?: 'horizontal' | 'vertical'
11
+ /** 同时显示的滑块数量 默认 1 */
12
+ displayMultipleItems?: number
13
+ /** 滑动时长 300ms */
14
+ duration?: number
15
+ /** 轮播图高度 默认192 */
16
+ height?: number
17
+ /** 轮播间隔时间 5000ms */
18
+ interval?: number
19
+ /** 是否循环播放 默认 true */
20
+ loop?: boolean
21
+ /** 后边间距 */
22
+ nextMargin?: number
23
+ /** 前边间距 */
24
+ previousMargin?: number
25
+ /** 指示器位置 bottom */
26
+ indicatorPosition?:
27
+ | 'left'
28
+ | 'top-left'
29
+ | 'top'
30
+ | 'top-right'
31
+ | 'bottom-left'
32
+ | 'bottom'
33
+ | 'bottom-right'
34
+ | 'right'
35
+ /** 边距是否应用到第一个、最后一个元素 */
36
+ snapToEdge?: boolean
37
+ // 图片之间距离
38
+ itemPadding?: number
39
+ /** 图片圆角 */
40
+ imageRadius?: number
41
+ // 整个banner圆角
42
+ radius?: number
43
+ customPrevImageClass?: string
44
+ customNextImageClass?: string
45
+ indicator?: 'dots' | 'dots-bar' | 'fraction'
46
+ /** 滑动样式 1平面 2立体 */
47
+ slidingStyle?: 1 | 2
48
+ marginTop?: number
49
+ marginBottom?: number
50
+ }
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <LcbBlock
3
+ :radius
4
+ :marginTop
5
+ :marginBottom
6
+ :backgroundColor
7
+ card
8
+ :marginLeft="12"
9
+ :marginRight="12"
10
+ :paddingBottom="styleGroup === 2 ? 0 : 24"
11
+ >
12
+ <view
13
+ class="py-2 px-3 text-3.5 text-#333 flex justify-between items-center"
14
+ v-if="styleGroup === 1"
15
+ >
16
+ <view class="flex-1 flex items-center">
17
+ <wd-icon name="github-filled" size="30" />
18
+ <view class="ml-3">
19
+ <view class="text-#333 text-lg">{{ title }}</view>
20
+ <view class="text-#999 text-sm">即刻成为开成尊享会员</view>
21
+ </view>
22
+ </view>
23
+ <wd-icon name="arrow-right1" size="24" />
24
+ </view>
25
+ <lcb-banner
26
+ v-bind="bannerProps"
27
+ :items="items"
28
+ :height="height"
29
+ :interval="styleGroup === 1 ? undefined : 2000"
30
+ />
31
+ <view
32
+ class="py-2 px-3 text-3.5 text-#333 flex justify-between items-center"
33
+ v-if="styleGroup === 2"
34
+ >
35
+ <view>{{ title }}</view>
36
+ <wd-icon name="arrow-right1" size="24" />
37
+ </view>
38
+ </LcbBlock>
39
+ </template>
40
+
41
+ <script setup lang="ts">
42
+ import lcbBanner from '../lcb-banner/lcb-banner.vue'
43
+ import { LcbBannerListProps } from './types'
44
+ import LcbBlock from '../lcb-block/lcb-block.vue'
45
+ import { computed } from 'vue'
46
+ import { LcbBannerProps } from 'components/lcb-banner/types'
47
+ defineOptions({
48
+ name: 'LcbBannerList',
49
+ options: {
50
+ addGlobalClass: true,
51
+ virtualHost: true,
52
+ styleIsolation: 'shared',
53
+ },
54
+ })
55
+ const props = withDefaults(defineProps<LcbBannerListProps>(), {
56
+ borderRadius: 12,
57
+ backgroundColor: '#ffffff',
58
+ })
59
+ const bannerProps = computed(() => {
60
+ if (props.styleGroup === 1) {
61
+ return {
62
+ styleGroup: 2,
63
+ displayMultipleItems: 2,
64
+ previousMargin: 32,
65
+ } as LcbBannerProps
66
+ } else {
67
+ return {} as LcbBannerProps
68
+ }
69
+ })
70
+ </script>
@@ -0,0 +1,13 @@
1
+ import { LcbBlockProps } from 'components/lcb-block/types'
2
+ import { ActionView } from 'global'
3
+ export interface LcbBannerListProps extends LcbBlockProps {
4
+ items?: Partial<ActionView>[]
5
+ /** 风格 1.顶部title 2.底部title */
6
+ styleGroup?: 1 | 2
7
+ /** 轮播图高度 默认192 */
8
+ height?: number
9
+ title: string
10
+ hint?: string
11
+ rightIcon?: string
12
+ leftIcon?: string
13
+ }
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <view
3
+ :style="{
4
+ marginTop: transformValueUnit(marginTop),
5
+ marginBottom: transformValueUnit(marginBottom),
6
+ marginLeft: transformValueUnit(marginLeft),
7
+ marginRight: transformValueUnit(marginRight),
8
+ padding: `
9
+ ${transformValueUnit(paddingTop || 0)}
10
+ ${transformValueUnit(paddingRight || 0)}
11
+ ${transformValueUnit(paddingBottom || 0)}
12
+ ${transformValueUnit(paddingLeft || 0)}
13
+ `,
14
+ borderRadius: transformValueUnit(radius),
15
+ color,
16
+ backgroundColor,
17
+ fontSize: transformValueUnit(fontSize),
18
+ }"
19
+ :class="{
20
+ card,
21
+ }"
22
+ class="box-border overflow-hidden"
23
+ >
24
+ <slot />
25
+ </view>
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import { LcbBlockProps } from './types'
30
+ import { transformValueUnit } from '../../utils/transform'
31
+
32
+ withDefaults(defineProps<LcbBlockProps>(), {})
33
+ </script>
34
+ <style lang="scss" scoped>
35
+ .card {
36
+ box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.1);
37
+ }
38
+ </style>
@@ -0,0 +1,17 @@
1
+ export interface LcbBlockProps {
2
+ marginTop?: number
3
+ marginBottom?: number
4
+ backgroundColor?: string
5
+ paddingTop?: number
6
+ paddingBottom?: number
7
+ color?: string
8
+ fontSize?: number
9
+ bold?: boolean
10
+ radius?: number
11
+ customClass?: string
12
+ card?: boolean
13
+ paddingLeft?: number
14
+ paddingRight?: number
15
+ marginLeft?: number
16
+ marginRight?: number
17
+ }
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <LcbBlock :marginTop :marginBottom :marginLeft="12" :marginRight="12">
3
+ <view
4
+ class="grid gap-2"
5
+ :style="{
6
+ 'grid-template-columns': `repeat(${cols}, minmax(0, 1fr))`,
7
+ }"
8
+ >
9
+ <wd-img
10
+ v-for="(item, index) in items"
11
+ :key="index"
12
+ :src="item.url"
13
+ :height="height"
14
+ :radius="radius"
15
+ mode="aspectFill"
16
+ />
17
+ </view>
18
+ </LcbBlock>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { LcbGridProps } from './types'
23
+ import LcbBlock from '../lcb-block/lcb-block.vue'
24
+ defineOptions({
25
+ name: 'Lcbtitle',
26
+ options: {
27
+ addGlobalClass: true,
28
+ virtualHost: true,
29
+ styleIsolation: 'shared',
30
+ },
31
+ })
32
+ withDefaults(defineProps<LcbGridProps>(), {
33
+ height: 100,
34
+ cols: 2,
35
+ radius: 8,
36
+ })
37
+ </script>
38
+ <style lang="scss" scoped></style>
@@ -0,0 +1,8 @@
1
+ import { LcbBlockProps } from '../lcb-block/types'
2
+ import { ActionView } from 'global'
3
+ export interface LcbGridProps extends LcbBlockProps {
4
+ items?: Partial<ActionView>[]
5
+ height?: number
6
+ cols?: number
7
+ gap?: number
8
+ }
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <lcb-block
3
+ :marginLeft="12"
4
+ :marginRight="12"
5
+ :radius="12"
6
+ backgroundColor="#fff"
7
+ :marginTop="-(marginTop || 0)"
8
+ >
9
+ <view class="flex w-full bg-#F5F6F9">
10
+ <view
11
+ v-for="(item, index) in tabs"
12
+ :key="item"
13
+ class="search-tab"
14
+ @click="current = index"
15
+ :class="{
16
+ active: current === index,
17
+ }"
18
+ >
19
+ {{ item }}
20
+ </view>
21
+ </view>
22
+ <view class="box-border px-3">
23
+ <view class="flex items-center justify-center mt-3 text-#333 gap-2">
24
+ <view class="text-4">义乌</view>
25
+ <wd-icon name="chevron-down-circle" size="22px"></wd-icon>
26
+ <view class="h-24px w-1rpx bg-#f4f4f4"></view>
27
+ <view class="text-#999 text-4">位置|酒店|关键词</view>
28
+ <view class="flex-1"></view>
29
+ <view class="justify-center flex flex-col items-center">
30
+ <view><wd-icon name="play-circle-stroke" size="22px"></wd-icon></view>
31
+ <view>当前位置</view>
32
+ </view>
33
+ </view>
34
+ <view class="w-full h-1rpx bg-#f4f4f4 my-3"></view>
35
+ <view class="flex items-center">
36
+ <view class="title">6月12日</view>
37
+ <view class="hint ml-1">今天入住</view>
38
+ <view class="title mx-2">——</view>
39
+ <view class="title">6月13日</view>
40
+ <view class="hint ml-1 flex-1">明天离店</view>
41
+ <view class="tag">共1晚</view>
42
+ </view>
43
+ <wd-button type="primary" customClass="!w-full my-5" size="large">搜索酒店</wd-button>
44
+ <view></view>
45
+ </view>
46
+ </lcb-block>
47
+ </template>
48
+
49
+ <script setup lang="ts">
50
+ import { ref } from 'vue'
51
+ import LcbBlock from '../lcb-block/lcb-block.vue'
52
+ defineProps<{ marginTop?: number }>()
53
+ const tabs = ['全部', '酒店', '民宿']
54
+ const current = ref(0)
55
+ </script>
56
+ <style lang="scss" scoped>
57
+ .search-tab {
58
+ flex: 1;
59
+ text-align: center;
60
+ font-size: 32rpx;
61
+ padding: 16rpx 0;
62
+ color: #999;
63
+ }
64
+ .active {
65
+ background-color: #fff;
66
+ color: #333;
67
+ font-weight: bold;
68
+ }
69
+ .title {
70
+ font-weight: 600;
71
+ font-size: 30rpx;
72
+ color: #333;
73
+ }
74
+ .hint {
75
+ font-size: 26rpx;
76
+ color: #999;
77
+ }
78
+ .tag {
79
+ padding: 4rpx 20rpx;
80
+ font-size: 24rpx;
81
+ color: #999;
82
+ background-color: #f1f1f1;
83
+ border-radius: 24rpx;
84
+ }
85
+ </style>
@@ -20,7 +20,7 @@
20
20
  borderRadius: (iconType === 1 ? iconRadius : 0) + 'rpx',
21
21
  color: iconColor,
22
22
  marginBottom: iconTextMargin + 'rpx',
23
- backgroundImage: iconType === 1 ? 'url(' + item.img + ')' : '',
23
+ backgroundImage: iconType === 1 ? 'url(' + item.url + ')' : '',
24
24
  backgroundSize: '100% 100%',
25
25
  }"
26
26
  :class="{
@@ -37,6 +37,8 @@
37
37
  </template>
38
38
 
39
39
  <script lang="ts" setup>
40
+ import { LcbImgNavProps } from './types'
41
+
40
42
  defineOptions({
41
43
  name: 'LcbImgNav',
42
44
  options: {
@@ -45,42 +47,8 @@ defineOptions({
45
47
  styleIsolation: 'shared',
46
48
  },
47
49
  })
48
- interface LcbImgNavProps {
49
- /** 模式 1.单行 2.多行 */
50
- styleGroup?: 1 | 2
51
- /** 文字颜色 #212121 */
52
- textColor?: string
53
- /** 背景颜色 #ffffff */
54
- bgColor?: string
55
- /** 背景图片 */
56
- bgImg?: string
57
- /** 图标颜色 #212121 */
58
- iconColor?: string
59
- /** 图标类型 0.系统 1.自定义 */
60
- iconType?: 0 | 1
61
- /** 数据内容 */
62
- items?: {
63
- title: string
64
- icon?: string
65
- link: string
66
- img?: string
67
- }[]
68
- /** 上边距 */
69
- topMargin?: 0 | 24 | 36
70
- /** 下边距 */
71
- bottomMargin?: 0 | 24 | 36
72
- /** 排布方式每行几个 */
73
- pictureDistribution?: 3 | 4 | 5
74
- /** 左右间距 */
75
- leftRightMargin?: number
76
- /** 图标尺寸 0.小40px 2.大50px */
77
- iconSize?: number
78
- /** 图标圆角 默认 0 */
79
- iconRadius?: number
80
- /** 文字与图标距离 */
81
- iconTextMargin?: number
82
- }
83
- const props = withDefaults(defineProps<LcbImgNavProps>(), {
50
+
51
+ withDefaults(defineProps<LcbImgNavProps>(), {
84
52
  bgColor: '#ffffff',
85
53
  textColor: '#212121',
86
54
  iconColor: '#212121',
@@ -0,0 +1,32 @@
1
+ import { ActionView } from 'global'
2
+
3
+ export interface LcbImgNavProps {
4
+ /** 模式 1.单行 2.多行 */
5
+ styleGroup?: 1 | 2
6
+ /** 文字颜色 #212121 */
7
+ textColor?: string
8
+ /** 背景颜色 #ffffff */
9
+ bgColor?: string
10
+ /** 背景图片 */
11
+ bgImg?: string
12
+ /** 图标颜色 #212121 */
13
+ iconColor?: string
14
+ /** 图标类型 0.系统 1.自定义 */
15
+ iconType?: 0 | 1
16
+ /** 数据内容 */
17
+ items?: ActionView[]
18
+ /** 上边距 */
19
+ topMargin?: 0 | 24 | 36
20
+ /** 下边距 */
21
+ bottomMargin?: 0 | 24 | 36
22
+ /** 排布方式每行几个 */
23
+ pictureDistribution?: 3 | 4 | 5
24
+ /** 左右间距 */
25
+ leftRightMargin?: number
26
+ /** 图标尺寸 0.小40px 2.大50px */
27
+ iconSize?: number
28
+ /** 图标圆角 默认 0 */
29
+ iconRadius?: number
30
+ /** 文字与图标距离 */
31
+ iconTextMargin?: number
32
+ }
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <view
3
+ :class="{
4
+ center_mod: !left,
5
+ 'pl-7': back && !left,
6
+ 'pr-80px': hasCapsule,
7
+ }"
8
+ >
9
+ <view class="search-input">
10
+ <wd-icon name="search" color="#a1a1a1" />
11
+ <view class="search-text" v-if="!left">{{ searchText }}</view>
12
+ </view>
13
+ </view>
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ const hasCapsule = Boolean(uni.getMenuButtonBoundingClientRect)
18
+
19
+ defineProps({
20
+ searchText: {
21
+ type: String,
22
+ default: '搜索',
23
+ },
24
+ left: {
25
+ type: Boolean,
26
+ },
27
+ back: {
28
+ type: Boolean,
29
+ },
30
+ })
31
+ </script>
32
+ <style lang="scss" scoped>
33
+ .center_mod {
34
+ flex: 1 1;
35
+ }
36
+ .search-input {
37
+ display: flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ width: 100%;
41
+ height: 64rpx;
42
+ padding: 0 20rpx;
43
+ box-sizing: border-box;
44
+ font-size: 26rpx;
45
+ font-weight: 400;
46
+ color: #a1a1a1;
47
+ background: #f5f5f5;
48
+ border-radius: 32rpx;
49
+
50
+ .search-text {
51
+ flex: 1 1;
52
+ margin-left: 12rpx;
53
+ overflow: hidden;
54
+ text-align: left;
55
+ text-overflow: ellipsis;
56
+ white-space: nowrap;
57
+ }
58
+ }
59
+ </style>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <view class="titleContainer" v-if="titleMode === 'text'">
3
+ <view class="images mr-2" v-if="logoImg">
4
+ <img :src="logoImg" />
5
+ </view>
6
+ <view class="title">{{ title }}</view>
7
+ </view>
8
+ <view class="images" v-else>
9
+ <img :src="typographyTextBackground" />
10
+ </view>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { NavTitleProps } from './types'
15
+
16
+ defineProps<NavTitleProps>()
17
+ </script>
18
+ <style lang="scss" scoped>
19
+ .titleContainer {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+
24
+ .title {
25
+ max-width: 300rpx;
26
+ overflow: hidden;
27
+ font-size: 32rpx;
28
+ text-overflow: ellipsis;
29
+ white-space: nowrap;
30
+ }
31
+ }
32
+ .images {
33
+ width: auto;
34
+ max-width: 320rpx !important;
35
+ height: 100%;
36
+ overflow: hidden;
37
+
38
+ img {
39
+ min-width: 50rpx;
40
+ height: 50rpx;
41
+ border-radius: 100%;
42
+ -o-object-fit: cover;
43
+ object-fit: cover;
44
+ -o-object-position: center;
45
+ object-position: center;
46
+ }
47
+ }
48
+ </style>