@tplc/business 0.0.20 → 0.0.22

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 (39) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/action.d.ts +2 -1
  3. package/components/lcb-action-view/lcb-action-view.vue +5 -2
  4. package/components/lcb-action-view/types.ts +3 -2
  5. package/components/lcb-banner/lcb-banner.vue +1 -0
  6. package/components/lcb-banner-block/lcb-banner-block.vue +11 -11
  7. package/components/lcb-banner-block/types.ts +1 -1
  8. package/components/lcb-block/lcb-block.vue +1 -0
  9. package/components/lcb-grid/lcb-grid.vue +10 -8
  10. package/components/lcb-grid/types.ts +1 -1
  11. package/components/lcb-home-search/lcb-home-search.vue +18 -10
  12. package/components/lcb-home-search/types.ts +2 -1
  13. package/components/lcb-image/lcb-image.vue +11 -8
  14. package/components/lcb-image/types.ts +1 -1
  15. package/components/lcb-img-nav/lcb-img-nav.vue +13 -11
  16. package/components/lcb-nav/lcb-nav.vue +42 -14
  17. package/components/lcb-nav/types.ts +1 -2
  18. package/components/lcb-notice-bar/Item/index.vue +85 -0
  19. package/components/lcb-notice-bar/lcb-notice-bar.vue +63 -0
  20. package/components/lcb-notice-bar/types.ts +19 -0
  21. package/components/lcb-user-order/lcb-user-order.vue +30 -47
  22. package/components/lcb-user-order/types.ts +1 -0
  23. package/components/lcb-video/lcb-video.vue +2 -2
  24. package/global.d.ts +1 -0
  25. package/package.json +2 -2
  26. package/types/components/lcb-action-view/types.d.ts +3 -2
  27. package/types/components/lcb-banner-block/types.d.ts +1 -1
  28. package/types/components/lcb-grid/types.d.ts +1 -1
  29. package/types/components/lcb-home-search/lcb-home-search.vue.d.ts +3 -0
  30. package/types/components/lcb-home-search/types.d.ts +2 -1
  31. package/types/components/lcb-image/lcb-image.vue.d.ts +0 -1
  32. package/types/components/lcb-image/types.d.ts +1 -1
  33. package/types/components/lcb-nav/Search/index.vue.d.ts +1 -1
  34. package/types/components/lcb-nav/lcb-nav.vue.d.ts +1 -1
  35. package/types/components/lcb-nav/types.d.ts +1 -2
  36. package/types/components/lcb-notice-bar/Item/index.vue.d.ts +28 -0
  37. package/types/components/lcb-notice-bar/lcb-notice-bar.vue.d.ts +56 -0
  38. package/types/components/lcb-notice-bar/types.d.ts +15 -0
  39. package/types/components/lcb-user-order/types.d.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.22](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.21...v0.0.22) (2024-09-24)
6
+
7
+ ### [0.0.21](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.7...v0.0.21) (2024-09-24)
8
+
9
+
10
+ ### ✨ Features | 新功能
11
+
12
+ * banner grid 新增链接 ([06ea3f9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/06ea3f9203a04867ee71b01239f046d242f4ee3a))
13
+ * banner 新增click ([e95fc15](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e95fc15c6620ad5de70854a572eab5b3800cbf3c))
14
+ * home-search支持点击 ([726fe69](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/726fe6974f0f5c83a92ddcf4c5f4d471e9bcfe28))
15
+ * navImg 跳转 ([27e9d65](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/27e9d659770441e72e996a565820a98fdc8c48d0))
16
+ * update version ([6aeee95](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6aeee95a18ab4a1091253c6b2a8bec76e3a63886))
17
+ * 图片间隙 ([ce3501b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ce3501be567230d88e09abc5166941edc5c45ec0))
18
+ * 支持nav action ([1ad0c00](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1ad0c001b8ecaa35041131ee3c3359f6b715c962))
19
+ * 调整customClass ([74e83ce](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/74e83ce404fb3ccc73e0fb6c7065511e417d7470))
20
+ * 调整swiper布局 ([faa2e24](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/faa2e244ed4e2929b91249b41256d6ab9055082a))
21
+ * 跳转jumpType ([1a89c12](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1a89c12457388ed7875b4ce990c959e8e997407e))
22
+
5
23
  ### [0.0.20](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.19...v0.0.20) (2024-09-22)
6
24
 
7
25
  ### 0.0.19 (2024-09-22)
package/action.d.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import { LcbActionViewProps } from './components/lcb-action-view/types'
1
2
  export interface ActionView {
2
3
  title: string
3
4
  icon?: string
4
- link: string
5
+ link: LcbActionViewProps
5
6
  url?: string
6
7
  mode: number
7
8
  hotSpot?: {
@@ -4,6 +4,7 @@
4
4
  class="lcb-action-btn"
5
5
  :open-type="openType"
6
6
  @getphonenumber="getPhoneNumber"
7
+ :class="customClass"
7
8
  >
8
9
  <slot />
9
10
  </button>
@@ -22,10 +23,10 @@ defineOptions({
22
23
  })
23
24
  const props = defineProps<LcbActionViewProps>()
24
25
  const openType = computed(() => {
25
- return { 88: 'getPhoneNumber', 12: 'contact' }[props.jumpType]
26
+ return { 88: 'getPhoneNumber', 12: 'contact' }[props.jumpType || '']
26
27
  })
27
28
  const onActionClick = () => {
28
- const { jumpAppid, jumpPageUrl: url, jumpType, phoneNumber } = props
29
+ const { jumpAppid, jumpUrl: url, jumpType, phoneNumber } = props
29
30
  /**
30
31
  * 跳转类型 1: 网页 2: 小程序内页 10: 跳转小程序 11: 跳转半屏小程序 12: 小程序客服
31
32
  * 13: 退出登录 14: 小程序弹框 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
@@ -138,6 +139,8 @@ const getPhoneNumber = (e) => {
138
139
  color: inherit;
139
140
  font-size: inherit;
140
141
  display: inline-block;
142
+ line-height: normal;
143
+ border-radius: inherit;
141
144
  &::after {
142
145
  border: none;
143
146
  }
@@ -4,10 +4,11 @@ export interface LcbActionViewProps {
4
4
  * 13: 退出登录 14: 小程序弹框 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
5
5
  * 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话 88: 授权手机号
6
6
  */
7
- jumpType: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
7
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
8
8
  /** 跳转路径 */
9
- jumpPageUrl?: string
9
+ jumpUrl?: string
10
10
  /** 小程序appid */
11
11
  jumpAppid?: string
12
12
  phoneNumber?: string
13
+ customClass?: string
13
14
  }
@@ -3,6 +3,7 @@
3
3
  <lcb-block v-bind="$props">
4
4
  <wd-swiper
5
5
  value-key="url"
6
+ action
6
7
  v-bind="{
7
8
  list: items,
8
9
  loop,
@@ -12,17 +12,17 @@
12
12
  <wd-icon class-prefix="iconfont" name="a-xingzhuang97" size="24rpx" color="#666666" />
13
13
  </view>
14
14
  <scroll-view scroll-x class="w-full whitespace-nowrap pb-24rpx">
15
- <img
16
- v-for="(item, index) in items"
17
- :key="index"
18
- :src="item.url"
19
- class="inline-block"
20
- :style="{
21
- height: transformValueUnit(height),
22
- width: transformValueUnit(imgWidth),
23
- marginRight: transformValueUnit(itemPadding),
24
- }"
25
- />
15
+ <lcb-action-view v-for="(item, index) in items" :key="index" v-bind="item.link">
16
+ <img
17
+ :src="item.url"
18
+ class="block"
19
+ :style="{
20
+ height: transformValueUnit(height),
21
+ width: transformValueUnit(imgWidth),
22
+ marginRight: transformValueUnit(itemPadding),
23
+ }"
24
+ />
25
+ </lcb-action-view>
26
26
  </scroll-view>
27
27
  </view>
28
28
  <view v-if="styleGroup === 2">
@@ -1,7 +1,7 @@
1
1
  import { LcbBlockProps } from '../lcb-block/types'
2
2
  import { ActionView } from 'action'
3
3
  export interface LcbBannerListProps extends LcbBlockProps {
4
- items?: Partial<ActionView>[]
4
+ items?: ActionView[]
5
5
  /** 风格 1.顶部title 2.底部title */
6
6
  styleGroup?: 1 | 2
7
7
  /** 轮播图高度 默认192 */
@@ -17,6 +17,7 @@
17
17
  shadowColor && shadowSize ? `0px 0px ${blurSize}px ${shadowSize}px ${shadowColor}` : '',
18
18
  }"
19
19
  class="box-border overflow-hidden relative"
20
+ :class="customClass"
20
21
  >
21
22
  <slot />
22
23
  </view>
@@ -6,14 +6,16 @@
6
6
  'grid-template-columns': `repeat(${cols}, minmax(0, 1fr))`,
7
7
  }"
8
8
  >
9
- <wd-img
10
- v-for="(item, index) in items"
11
- :key="index"
12
- :src="item.url"
13
- :height="transformValueUnit(height)"
14
- :radius="transformValueUnit(radius)"
15
- mode="aspectFill"
16
- />
9
+ <lcb-action-view v-for="(item, index) in items" :key="index" v-bind="item.link">
10
+ <wd-img
11
+ :src="item.url"
12
+ :height="transformValueUnit(height)"
13
+ :radius="transformValueUnit(radius)"
14
+ mode="aspectFill"
15
+ width="100%"
16
+ custom-class="!block"
17
+ />
18
+ </lcb-action-view>
17
19
  </view>
18
20
  </lcb-block>
19
21
  </template>
@@ -1,7 +1,7 @@
1
1
  import { LcbBlockProps } from '../lcb-block/types'
2
2
  import { ActionView } from 'action'
3
3
  export interface LcbGridProps extends LcbBlockProps {
4
- items?: Partial<ActionView>[]
4
+ items?: ActionView[]
5
5
  height?: number
6
6
  cols?: number
7
7
  gap?: number
@@ -37,35 +37,42 @@
37
37
  </view>
38
38
  <view class="w-full h-1px bg-#F1F1F1 mt-26rpx mb-44rpx"></view>
39
39
  <view class="flex items-center">
40
- <view class="title">612日</view>
40
+ <view class="title">{{ dayRange[0].format('MMDD日') }}</view>
41
41
  <view class="hint ml-1">今天入住</view>
42
- <view class="title mx-2">——</view>
43
- <view class="title">613日</view>
42
+ <view class="title mx-1">——</view>
43
+ <view class="title">{{ dayRange[1].format('MMDD日') }}</view>
44
44
  <view class="hint ml-1 flex-1">明天离店</view>
45
- <view class="tag">共1晚</view>
45
+ <view class="tag">共{{ nightCount }}晚</view>
46
46
  </view>
47
- <wd-button type="primary" customClass="!w-full my-42rpx" size="large">搜索酒店</wd-button>
47
+ <wd-button type="primary" customClass="!w-full my-42rpx" size="large">
48
+ {{ btnText }}
49
+ </wd-button>
48
50
  <view
49
51
  class="px-50rpx flex justify-between items-center mb-42rpx text-#000 text-28rpx"
50
52
  v-if="items?.length"
51
53
  >
52
- <view
54
+ <lcb-action-view
53
55
  v-for="item in items"
54
56
  :key="item.title"
55
- class="flex justify-center items-center gap-16rpx"
57
+ v-bind="item.link"
58
+ customClass="!flex justify-center items-center gap-16rpx"
56
59
  >
57
60
  <img :src="item.url" class="w-36rpx h-36rpx" />
58
61
  {{ item.title }}
59
- </view>
62
+ </lcb-action-view>
60
63
  </view>
61
64
  </view>
62
65
  </lcb-block>
63
66
  </template>
64
67
 
65
68
  <script setup lang="ts">
66
- import { ref } from 'vue'
69
+ import { computed, ref } from 'vue'
67
70
  import { LcbHomeSearch } from './types'
68
-
71
+ import dayjs from 'dayjs'
72
+ const dayRange = ref([dayjs(), dayjs().add(1, 'day')])
73
+ const nightCount = computed(() => {
74
+ return dayRange.value[1].diff(dayRange.value[0], 'day')
75
+ })
69
76
  defineOptions({
70
77
  name: 'LcbHomeSearch',
71
78
  options: {
@@ -80,6 +87,7 @@ withDefaults(defineProps<LcbHomeSearch>(), {
80
87
  backgroundColor: '#fff',
81
88
  radius: 16,
82
89
  placeholder: '位置|酒店|关键词',
90
+ btnText: '搜索酒店',
83
91
  })
84
92
  const tabs = ['全部', '酒店', '民宿']
85
93
  const current = ref(0)
@@ -3,5 +3,6 @@ import { LcbBlockProps } from '../lcb-block/types'
3
3
 
4
4
  export interface LcbHomeSearch extends LcbBlockProps {
5
5
  placeholder?: string
6
- items?: Partial<ActionView>[]
6
+ items?: ActionView[]
7
+ btnText?: string
7
8
  }
@@ -3,13 +3,15 @@
3
3
  <view v-if="!items?.length" class="flex justify-center items-center bg-light color-gray overflow-hidden" :style="{
4
4
  height: transformValueUnit(400),
5
5
  borderRadius: transformValueUnit(imageRadius),
6
+ marginTop: transformValueUnit(-(floatUp || 0)),
6
7
  }"><wd-icon name="image" size="50px"></wd-icon></view>
7
8
 
8
9
  <view v-if="styleGroup != 3" :class="styleGroup == 2 ? 'flex' : ''" :style="{
9
10
  marginLeft: transformValueUnit(marginHorizontal),
10
11
  marginRight: transformValueUnit(marginHorizontal),
11
- marginTop: transformValueUnit(marginTop),
12
- marginBottom: transformValueUnit(marginBottom),
12
+ marginTop: transformValueUnit(-(floatUp || 0)),
13
+ // marginTop: transformValueUnit(marginTop),
14
+ // marginBottom: transformValueUnit(marginBottom),
13
15
  }">
14
16
  <!-- <view v-for="(item, index) in items" :key="index" :class="styleGroup == 2 ? 'flex-1 relative' : 'relative'" :style="{
15
17
  marginTop: transformValueUnit(styleGroup == 1 && index > 0 ? imageMargin : 0),
@@ -33,8 +35,9 @@
33
35
  <scroll-view v-if="styleGroup == 3" scroll-x class="w-full whitespace-nowrap" :style="{
34
36
  marginLeft: transformValueUnit(marginHorizontal),
35
37
  marginRight: transformValueUnit(marginHorizontal),
36
- marginTop: transformValueUnit(marginTop),
37
- marginBottom: transformValueUnit(marginBottom),
38
+ marginTop: transformValueUnit(-(floatUp || 0)),
39
+ // marginTop: transformValueUnit(marginTop),
40
+ // marginBottom: transformValueUnit(marginBottom),
38
41
  }">
39
42
  <view class="flex shrink-0">
40
43
  <Image v-bind="imageProps" />
@@ -78,10 +81,10 @@ const imageProps = computed(() => {
78
81
  }
79
82
  })
80
83
 
81
- const iconItems = computed(() => {
82
- console.log('props.items', props.items)
83
- return props.items;
84
- })
84
+ // const iconItems = computed(() => {
85
+ // console.log('props.items', props.items)
86
+ // return props.items;
87
+ // })
85
88
 
86
89
  </script>
87
90
 
@@ -10,6 +10,6 @@ export interface LcbImageProps {
10
10
  marginHorizontal?: number
11
11
  imageMargin?: number
12
12
  imageSize?: number
13
- marginTop?: number
13
+ floatUp?: number
14
14
  marginBottom?: number
15
15
  }
@@ -6,10 +6,11 @@
6
6
  }"
7
7
  :class="[styleGroup === 2 ? 'mutil' : 'single']"
8
8
  >
9
- <view
9
+ <lcb-action-view
10
10
  v-for="item in items"
11
11
  :key="item.title"
12
- class="flex flex-col justify-center items-center"
12
+ v-bind="item.link"
13
+ custom-class="!flex flex-col justify-center items-center"
13
14
  >
14
15
  <view
15
16
  class="overflow-hidden"
@@ -17,14 +18,15 @@
17
18
  marginBottom: iconTextMargin + 'rpx',
18
19
  }"
19
20
  >
20
- <div v-if="iconType === 0" class="flex justify-center items-center">
21
- <wd-icon
22
- class-prefix="iconfont"
23
- :name="item.icon!"
24
- :size="iconSize + 'rpx'"
25
- :color="iconColor"
26
- />
27
- </div>
21
+ <!-- <div v-if="iconType === 0" class="flex justify-center items-center"> -->
22
+ <wd-icon
23
+ v-if="iconType === 0"
24
+ class-prefix="iconfont"
25
+ :name="item.icon!"
26
+ :size="iconSize + 'rpx'"
27
+ :color="iconColor"
28
+ />
29
+ <!-- </div> -->
28
30
  <img
29
31
  v-else
30
32
  class="block"
@@ -37,7 +39,7 @@
37
39
  />
38
40
  </view>
39
41
  <view class="title">{{ item.title }}</view>
40
- </view>
42
+ </lcb-action-view>
41
43
  </view>
42
44
  </lcb-block>
43
45
  </template>
@@ -38,10 +38,15 @@
38
38
  class="h-full flex items-center"
39
39
  @click="onCapsule(item)"
40
40
  v-for="item in capsuleList"
41
- :key="item.icon"
41
+ :key="item.action"
42
42
  :class="[capsuleList.length === 1 ? 'px-2' : 'px-2.5']"
43
43
  >
44
- <wd-icon class-prefix="iconfont" :name="item.icon" size="36rpx" :color="contentColor" />
44
+ <wd-icon
45
+ class-prefix="iconfont"
46
+ :name="iconMap[item.action]"
47
+ size="36rpx"
48
+ :color="contentColor"
49
+ />
45
50
  </view>
46
51
  </view>
47
52
  <template v-else-if="back">
@@ -88,7 +93,6 @@ import Title from './Title/index.vue'
88
93
  import Search from './Search/index.vue'
89
94
  import { onPageScroll } from '@dcloudio/uni-app'
90
95
 
91
- const { statusBarHeight } = uni.getSystemInfoSync()
92
96
  defineOptions({
93
97
  name: 'LcbNav',
94
98
  options: {
@@ -97,6 +101,15 @@ defineOptions({
97
101
  styleIsolation: 'shared',
98
102
  },
99
103
  })
104
+ const { statusBarHeight } = uni.getSystemInfoSync()
105
+ const iconMap = {
106
+ back: 'dingdanliebiao',
107
+ search: 'a-xingzhuang23kaobei',
108
+ scanCode: 'a-xingzhuang106',
109
+ translate: 'a-xingzhuang22',
110
+ setting: 'shezhi',
111
+ home: 'tingshi',
112
+ }
100
113
  const scrollTop = ref(0)
101
114
  const props = withDefaults(defineProps<NavProps>(), {
102
115
  styleGroup: 1,
@@ -147,26 +160,41 @@ const capsuleList = computed(() => {
147
160
  if (props.back) {
148
161
  list.push({
149
162
  icon: 'chevron-left',
150
- action: 'link',
163
+ action: 'back',
151
164
  })
152
165
  }
153
166
 
154
167
  return [...list, ...(props.capsules || [])] as ICapsule[]
155
168
  })
156
- const onCapsule = ({ action = 'link', link }: ICapsule) => {
169
+ const onCapsule = ({ action }: ICapsule) => {
157
170
  switch (action) {
158
- case 'link':
159
- if (link) {
160
- uni.navigateTo({
161
- url: link,
162
- })
163
- } else {
164
- toBack()
165
- }
171
+ case 'back':
172
+ toBack()
173
+ break
174
+ case 'search':
175
+ uni.navigateTo({
176
+ url: '/pages/search/index',
177
+ })
166
178
  break
179
+ case 'scanCode':
180
+ uni.scanCode({
181
+ success: (res) => {
182
+ console.log(res)
183
+ },
184
+ })
185
+ break
186
+ case 'translate':
187
+ toBack()
188
+ break
189
+ case 'setting':
190
+ uni.navigateTo({
191
+ url: '/pages/setting/index',
192
+ })
193
+ break
194
+
167
195
  case 'home':
168
196
  uni.switchTab({
169
- url: '/pages/home/index',
197
+ url: '/pages/index/index',
170
198
  })
171
199
  break
172
200
  }
@@ -1,7 +1,6 @@
1
1
  export interface ICapsule {
2
2
  icon: string
3
- action?: 'translate' | 'scanCode' | 'link' | 'home'
4
- link?: string
3
+ action: 'translate' | 'scanCode' | 'search' | 'home' | 'setting' | 'back'
5
4
  }
6
5
 
7
6
  export interface NavTitleProps {
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <view class="flex">
3
+ <view class="flex-1 noticeBar relative overflow-hidden">
4
+ <view
5
+ :class="`absolute left0 top0 noticeItem flex overflow-hidden${lens == 1 ? ' infinite' : ''}${showAni ? ' animation' : ''}`"
6
+ :style="{
7
+ animationDuration: getTime(text),
8
+ }"
9
+ >
10
+ {{ text }}
11
+ </view>
12
+ </view>
13
+ </view>
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ import { NoticeBarItemProps } from '../types'
18
+ import { computed } from 'vue'
19
+ defineOptions({
20
+ name: 'NoticeBarItem',
21
+ options: {
22
+ addGlobalClass: true,
23
+ virtualHost: true,
24
+ styleIsolation: 'shared',
25
+ },
26
+ })
27
+ const props = defineProps<NoticeBarItemProps>()
28
+ // const { proxy } = getCurrentInstance() as any
29
+ const showAni = computed(() => {
30
+ // const query = uni.createSelectorQuery().in(proxy)
31
+ // query.select('.noticeBar').boundingClientRect()
32
+ // query.exec((res) => {
33
+ // console.log(res)
34
+ // })
35
+ return props.current === props.idx && (props.text?.length || 0) > 25
36
+ })
37
+
38
+ function getTime(text: string | undefined) {
39
+ const len = text?.length || 0
40
+ return `${(50 - len) / 10 + 3}s`
41
+ }
42
+ </script>
43
+ <style lang="scss" scoped>
44
+ .noticeBar {
45
+ height: 72rpx;
46
+ }
47
+
48
+ .noticeItem {
49
+ height: 72rpx;
50
+ line-height: 72rpx;
51
+ transform: translateZ(0.5px);
52
+ line-clamp: 1;
53
+ white-space: nowrap;
54
+ text-overflow: ellipsis;
55
+ word-break: break-all;
56
+ animation-delay: 0.5s;
57
+ animation-direction: normal;
58
+ animation-duration: 3s;
59
+ animation-fill-mode: forwards;
60
+ animation-play-state: running;
61
+ animation-range-end: normal;
62
+ animation-range-start: normal;
63
+ animation-timeline: auto;
64
+ animation-timing-function: linear;
65
+ }
66
+
67
+ .infinite {
68
+ animation-iteration-count: infinite;
69
+ }
70
+
71
+ .animation {
72
+ animation-name: change;
73
+ // animation-duration: 5s;
74
+ }
75
+
76
+ @keyframes change {
77
+ 0% {
78
+ transform: translate(0%);
79
+ }
80
+
81
+ 100% {
82
+ transform: translate(-60%);
83
+ }
84
+ }
85
+ </style>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <lcb-block v-bind="$props">
3
+ <swiper class="swiper" circular :autoplay="true" :disableTouch="true" :interval="interval" :vertical="vertical"
4
+ @change="onSwiperChange">
5
+ <swiper-item v-for="item in items" :key="item.id">
6
+ <Item :idx="0" :current="current" :text="item.text" :lens="items?.length" />
7
+ </swiper-item>
8
+ <!-- <swiper-item>
9
+ <Item :idx="1" :current="current" text="请填写公告111" @setInterval="onSetInterval" />
10
+ </swiper-item>
11
+ <swiper-item>
12
+ <Item :idx="2" :current="current" text="请填写公告222" @setInterval="onSetInterval" />
13
+ </swiper-item> -->
14
+ </swiper>
15
+ </lcb-block>
16
+ </template>
17
+
18
+ <script setup lang="ts">
19
+ import { ref } from 'vue'
20
+ import { LcbNoticeBarProps } from './types'
21
+ import Item from './Item/index.vue'
22
+
23
+ defineOptions({
24
+ name: 'LcbNoticeBar',
25
+ options: {
26
+ addGlobalClass: true,
27
+ virtualHost: true,
28
+ styleIsolation: 'shared',
29
+ },
30
+ })
31
+
32
+ const props = withDefaults(defineProps<LcbNoticeBarProps>(), {
33
+
34
+ })
35
+
36
+ function getTime(text: string | undefined) {
37
+ const len = text?.length || 0;
38
+ return len > 25 ? (50 - len) / 10 * 1200 + 3000 : 3000;
39
+ }
40
+ // const params = ref<number>(0)
41
+ // const model = defineModel<number>()
42
+ const current = defineModel({ type: Number, default: 0 })
43
+ const interval = defineModel('interval', { type: Number, default: 3000 })
44
+ function onSwiperChange(item: any) {
45
+ // console.log('current.value', current.value)
46
+ current.value = item?.detail?.current;
47
+ interval.value = getTime(props.items?.[current.value]?.text);
48
+ // console.log('onSwiperChange item', item)
49
+ // console.log('interval.value', interval.value)
50
+ }
51
+
52
+
53
+ // function onSetInterval(val: number) {
54
+ // interval.value = val;
55
+ // }
56
+
57
+ </script>
58
+
59
+ <style lang="scss" scoped>
60
+ .swiper {
61
+ height: 72rpx;
62
+ }
63
+ </style>
@@ -0,0 +1,19 @@
1
+ // import { ActionView } from 'action'
2
+ interface NoticeItem {
3
+ id?: number
4
+ text?: string
5
+ }
6
+
7
+ export interface LcbNoticeBarProps {
8
+ // Define the component's prop types here
9
+ items?: Partial<NoticeItem>[]
10
+ vertical?: boolean
11
+ }
12
+
13
+ export interface NoticeBarItemProps {
14
+ idx?: number
15
+ current?: number
16
+ text?: string
17
+ lens?: number
18
+ // setInterval?: Function
19
+ }
@@ -1,51 +1,31 @@
1
1
  <template>
2
- <lcb-block v-bind="$props" class="flex flex-justify-between">
3
- <view
4
- class="flex flex-col flex-justify-center items-center"
5
- @click="onClick(item)"
6
- v-for="item in iconList"
7
- :key="item.id"
8
- >
9
- <view
10
- class="position-relative"
11
- :style="{
12
- height: transformValueUnit(iconSize),
13
- width: transformValueUnit(iconSize),
14
- }"
15
- >
2
+ <lcb-block v-bind="$props" customClass="flex flex-justify-between">
3
+ <view class="flex flex-col flex-justify-center items-center" @click="onClick(item)" v-for="item in iconList"
4
+ :key="item.id">
5
+ <view class="position-relative" :style="{
6
+ height: transformValueUnit(iconSize),
7
+ width: transformValueUnit(iconSize),
8
+ }" @click="onClick">
16
9
  <view v-if="item.iconType === 0">
17
- <wd-icon
18
- class-prefix="iconfont"
19
- v-bind="{
20
- name: item.iconName || '',
21
- size: transformValueUnit(iconSize),
22
- color: iconColor,
23
- }"
24
- />
25
- </view>
26
- <view
27
- v-if="item.iconType === 1"
28
- class="bg-no-repeat bg-contain"
29
- :style="{
30
- height: transformValueUnit(iconSize),
31
- width: transformValueUnit(iconSize),
10
+ <wd-icon class-prefix="iconfont" v-bind="{
11
+ name: item.iconName || '',
12
+ size: transformValueUnit(iconSize),
32
13
  color: iconColor,
33
- backgroundImage: `url('${item.iconUpload}')`,
34
- }"
35
- />
36
- <view
37
- v-if="item.id < 5"
38
- class="pos-absolute bg-#f23d3d pos-top-0 pos-right-0 w-8px h-8px rounded-4px"
39
- />
14
+ }" />
15
+ </view>
16
+ <view v-if="item.iconType === 1" class="bg-no-repeat bg-contain" :style="{
17
+ height: transformValueUnit(iconSize),
18
+ width: transformValueUnit(iconSize),
19
+ color: iconColor,
20
+ backgroundImage: `url('${item.iconUpload}')`,
21
+ }" />
22
+ <view v-if="item.id < 5" class="pos-absolute bg-#f23d3d pos-top-0 pos-right-0 w-8px h-8px rounded-4px" />
40
23
  </view>
41
- <view
42
- class="flex flex-justify-between text-center"
43
- :style="{
44
- color: textColor,
45
- fontSize: transformValueUnit(textSize),
46
- marginTop: transformValueUnit((textSize || 0) / 3),
47
- }"
48
- >
24
+ <view class="flex flex-justify-between text-center" :style="{
25
+ color: textColor,
26
+ fontSize: transformValueUnit(textSize),
27
+ marginTop: transformValueUnit((textSize || 0) / 3),
28
+ }">
49
29
  {{ item.iconTitle }}
50
30
  </view>
51
31
  </view>
@@ -64,7 +44,11 @@ defineOptions({
64
44
  styleIsolation: 'shared',
65
45
  },
66
46
  })
67
- const onClick = (item: any) => {}
47
+ const onClick = (item: any) => {
48
+ uni.navigateTo({
49
+ url: `/pages/order/index?status=${item.status}`,
50
+ })
51
+ }
68
52
  const props = withDefaults(defineProps<LcbUserOrderProps>(), {
69
53
  paddingVertical: 0,
70
54
  paddingHorizontal: 0,
@@ -76,7 +60,6 @@ const iconList = computed(() => {
76
60
  for (let i = 0; i < statusNumbers.length; i++) {
77
61
  const item = statusNumbers[i]
78
62
  const isShow = props['iconShow' + item]
79
- console.log('isShow', isShow)
80
63
  if (isShow !== false) {
81
64
  list.push({
82
65
  id: i,
@@ -84,10 +67,10 @@ const iconList = computed(() => {
84
67
  iconTitle: props['iconTitle' + item],
85
68
  iconName: props['iconName' + item],
86
69
  iconUpload: props['iconUpload' + item],
70
+ status: item,
87
71
  })
88
72
  }
89
73
  }
90
- console.log('list', list, props)
91
74
  return list as IIconList[]
92
75
  })
93
76
  </script>
@@ -4,6 +4,7 @@ export interface IIconList {
4
4
  iconTitle?: string
5
5
  iconName?: string
6
6
  iconUpload?: string
7
+ status?: any
7
8
  }
8
9
 
9
10
  export interface LcbUserOrderProps {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <lcb-block v-bind="{
3
- marginTop,
4
- marginBottom,
3
+ // marginTop,
4
+ // marginBottom,
5
5
  marginLeft: marginHorizontal,
6
6
  marginRight: marginHorizontal,
7
7
  }">
package/global.d.ts CHANGED
@@ -12,6 +12,7 @@ declare module 'vue' {
12
12
  'lcb-image': (typeof import('./types/components/lcb-image/lcb-image.vue'))['default']
13
13
  'lcb-img-nav': (typeof import('./types/components/lcb-img-nav/lcb-img-nav.vue'))['default']
14
14
  'lcb-nav': (typeof import('./types/components/lcb-nav/lcb-nav.vue'))['default']
15
+ 'lcb-notice-bar': (typeof import('./types/components/lcb-notice-bar/lcb-notice-bar.vue'))['default']
15
16
  'lcb-swiper': (typeof import('./types/components/lcb-swiper/lcb-swiper.vue'))['default']
16
17
  'lcb-title': (typeof import('./types/components/lcb-title/lcb-title.vue'))['default']
17
18
  'lcb-user-order': (typeof import('./types/components/lcb-user-order/lcb-user-order.vue'))['default']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "peerDependencies": {
13
13
  "vue": ">=3.2.47",
14
- "@tplc/wot": "0.1.6"
14
+ "@tplc/wot": "0.1.7"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">=18",
@@ -4,10 +4,11 @@ export interface LcbActionViewProps {
4
4
  * 13: 退出登录 14: 小程序弹框 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
5
5
  * 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话 88: 授权手机号
6
6
  */
7
- jumpType: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
7
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
8
8
  /** 跳转路径 */
9
- jumpPageUrl?: string
9
+ jumpUrl?: string
10
10
  /** 小程序appid */
11
11
  jumpAppid?: string
12
12
  phoneNumber?: string
13
+ customClass?: string
13
14
  }
@@ -1,7 +1,7 @@
1
1
  import { LcbBlockProps } from '../lcb-block/types'
2
2
  import { ActionView } from 'action'
3
3
  export interface LcbBannerListProps extends LcbBlockProps {
4
- items?: Partial<ActionView>[]
4
+ items?: ActionView[]
5
5
  /** 风格 1.顶部title 2.底部title */
6
6
  styleGroup?: 1 | 2
7
7
  /** 轮播图高度 默认192 */
@@ -1,7 +1,7 @@
1
1
  import { LcbBlockProps } from '../lcb-block/types'
2
2
  import { ActionView } from 'action'
3
3
  export interface LcbGridProps extends LcbBlockProps {
4
- items?: Partial<ActionView>[]
4
+ items?: ActionView[]
5
5
  height?: number
6
6
  cols?: number
7
7
  gap?: number
@@ -7,6 +7,7 @@ declare const _default: import('vue').DefineComponent<
7
7
  backgroundColor: string
8
8
  radius: number
9
9
  placeholder: string
10
+ btnText: string
10
11
  }
11
12
  >,
12
13
  {},
@@ -27,6 +28,7 @@ declare const _default: import('vue').DefineComponent<
27
28
  backgroundColor: string
28
29
  radius: number
29
30
  placeholder: string
31
+ btnText: string
30
32
  }
31
33
  >
32
34
  >
@@ -36,6 +38,7 @@ declare const _default: import('vue').DefineComponent<
36
38
  backgroundColor: string
37
39
  radius: number
38
40
  placeholder: string
41
+ btnText: string
39
42
  },
40
43
  {}
41
44
  >
@@ -2,5 +2,6 @@ import { ActionView } from 'action'
2
2
  import { LcbBlockProps } from '../lcb-block/types'
3
3
  export interface LcbHomeSearch extends LcbBlockProps {
4
4
  placeholder?: string
5
- items?: Partial<ActionView>[]
5
+ items?: ActionView[]
6
+ btnText?: string
6
7
  }
@@ -38,7 +38,6 @@ declare const _default: import('vue').DefineComponent<
38
38
  {
39
39
  marginHorizontal: number
40
40
  styleGroup: number
41
- marginTop: number
42
41
  imageMargin: number
43
42
  imageSize: number
44
43
  marginBottom: number
@@ -8,6 +8,6 @@ export interface LcbImageProps {
8
8
  marginHorizontal?: number
9
9
  imageMargin?: number
10
10
  imageSize?: number
11
- marginTop?: number
11
+ floatUp?: number
12
12
  marginBottom?: number
13
13
  }
@@ -36,8 +36,8 @@ declare const _default: import('vue').DefineComponent<
36
36
  >,
37
37
  {
38
38
  left: boolean
39
- searchText: string
40
39
  back: boolean
40
+ searchText: string
41
41
  },
42
42
  {}
43
43
  >
@@ -55,13 +55,13 @@ declare const _default: import('vue').DefineComponent<
55
55
  fixed: boolean
56
56
  title: string
57
57
  styleGroup: 1 | 2 | 3 | 4
58
+ back: boolean
58
59
  topStyle: 1 | 2
59
60
  immersionMode: 1 | 2
60
61
  colorMode: 'custom' | 'default'
61
62
  backColor: string
62
63
  backgroundType: 'img' | 'color'
63
64
  contentColor: string
64
- back: boolean
65
65
  capsuleMode: 'light' | 'dark'
66
66
  titleMode: 'text' | 'img'
67
67
  logoImg: string
@@ -1,7 +1,6 @@
1
1
  export interface ICapsule {
2
2
  icon: string
3
- action?: 'translate' | 'scanCode' | 'link' | 'home'
4
- link?: string
3
+ action: 'translate' | 'scanCode' | 'search' | 'home' | 'setting' | 'back'
5
4
  }
6
5
  export interface NavTitleProps {
7
6
  /** 模式 */
@@ -0,0 +1,28 @@
1
+ import { NoticeBarItemProps } from '../types'
2
+ declare const _default: import('vue').DefineComponent<
3
+ __VLS_TypePropsToOption<NoticeBarItemProps>,
4
+ {},
5
+ unknown,
6
+ {},
7
+ {},
8
+ import('vue').ComponentOptionsMixin,
9
+ import('vue').ComponentOptionsMixin,
10
+ {},
11
+ string,
12
+ import('vue').PublicProps,
13
+ Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<NoticeBarItemProps>>>,
14
+ {},
15
+ {}
16
+ >
17
+ export default _default
18
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
19
+ type __VLS_TypePropsToOption<T> = {
20
+ [K in keyof T]-?: {} extends Pick<T, K>
21
+ ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
23
+ }
24
+ : {
25
+ type: import('vue').PropType<T[K]>
26
+ required: true
27
+ }
28
+ }
@@ -0,0 +1,56 @@
1
+ import { LcbNoticeBarProps } from './types'
2
+ declare let __VLS_typeProps: LcbNoticeBarProps
3
+ declare const interval: import('vue').ModelRef<number, string>
4
+ type __VLS_PublicProps = {
5
+ modelValue?: any
6
+ interval?: NonNullable<(typeof interval)['value']>
7
+ } & typeof __VLS_typeProps
8
+ declare const _default: import('vue').DefineComponent<
9
+ __VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {}>,
10
+ {},
11
+ unknown,
12
+ {},
13
+ {},
14
+ import('vue').ComponentOptionsMixin,
15
+ import('vue').ComponentOptionsMixin,
16
+ {
17
+ 'update:modelValue': (modelValue: any) => void
18
+ 'update:interval': (interval: number) => void
19
+ },
20
+ string,
21
+ import('vue').PublicProps,
22
+ Readonly<
23
+ import('vue').ExtractPropTypes<
24
+ __VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {}>
25
+ >
26
+ > & {
27
+ 'onUpdate:modelValue'?: ((modelValue: any) => any) | undefined
28
+ 'onUpdate:interval'?: ((interval: number) => any) | undefined
29
+ },
30
+ {},
31
+ {}
32
+ >
33
+ export default _default
34
+ type __VLS_WithDefaults<P, D> = {
35
+ [K in keyof Pick<P, keyof P>]: K extends keyof D
36
+ ? __VLS_Prettify<
37
+ P[K] & {
38
+ default: D[K]
39
+ }
40
+ >
41
+ : P[K]
42
+ }
43
+ type __VLS_Prettify<T> = {
44
+ [K in keyof T]: T[K]
45
+ } & {}
46
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
47
+ type __VLS_TypePropsToOption<T> = {
48
+ [K in keyof T]-?: {} extends Pick<T, K>
49
+ ? {
50
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
51
+ }
52
+ : {
53
+ type: import('vue').PropType<T[K]>
54
+ required: true
55
+ }
56
+ }
@@ -0,0 +1,15 @@
1
+ interface NoticeItem {
2
+ id?: number
3
+ text?: string
4
+ }
5
+ export interface LcbNoticeBarProps {
6
+ items?: Partial<NoticeItem>[]
7
+ vertical?: boolean
8
+ }
9
+ export interface NoticeBarItemProps {
10
+ idx?: number
11
+ current?: number
12
+ text?: string
13
+ lens?: number
14
+ }
15
+ export {}
@@ -4,6 +4,7 @@ export interface IIconList {
4
4
  iconTitle?: string
5
5
  iconName?: string
6
6
  iconUpload?: string
7
+ status?: any
7
8
  }
8
9
  export interface LcbUserOrderProps {
9
10
  marginTop?: number