@tplc/business 0.0.57 → 0.0.59

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 (33) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/action.d.ts +1 -0
  3. package/components/lcb-block/lcb-block.vue +9 -2
  4. package/components/lcb-block/types.ts +2 -1
  5. package/components/lcb-home-search/lcb-home-search.vue +36 -15
  6. package/components/lcb-img-nav/lcb-img-nav.vue +19 -4
  7. package/components/lcb-img-nav/types.ts +3 -0
  8. package/components/lcb-nav/lcb-nav.vue +14 -4
  9. package/components/lcb-product/lcb-product.vue +10 -2
  10. package/components/lcb-product/types.ts +3 -0
  11. package/components/lcb-user-order/lcb-user-order.vue +48 -61
  12. package/components/lcb-user-order/types.ts +5 -48
  13. package/components/lcb-vip/api/index.ts +33 -0
  14. package/components/lcb-vip/components/InfoDialog/index.vue +51 -0
  15. package/components/lcb-vip/lcb-vip.vue +85 -0
  16. package/components/lcb-vip/types.ts +8 -0
  17. package/global.d.ts +1 -0
  18. package/index.ts +5 -1
  19. package/package.json +2 -2
  20. package/types/components/lcb-block/lcb-block.vue.d.ts +2 -0
  21. package/types/components/lcb-block/types.d.ts +2 -0
  22. package/types/components/lcb-img-nav/lcb-img-nav.vue.d.ts +15 -2
  23. package/types/components/lcb-img-nav/types.d.ts +3 -0
  24. package/types/components/lcb-product/lcb-product.vue.d.ts +3 -0
  25. package/types/components/lcb-product/types.d.ts +3 -0
  26. package/types/components/lcb-user-order/types.d.ts +5 -35
  27. package/types/components/lcb-vip/api/index.d.ts +31 -0
  28. package/types/components/lcb-vip/components/InfoDialog/index.vue.d.ts +36 -0
  29. package/types/components/lcb-vip/lcb-vip.vue.d.ts +68 -0
  30. package/types/components/lcb-vip/types.d.ts +8 -0
  31. package/types/index.d.ts +6 -0
  32. package/types/utils/transform.d.ts +4 -0
  33. package/utils/transform.ts +11 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
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.59](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.58...v0.0.59) (2024-11-19)
6
+
7
+
8
+ ### 🐛 Bug Fixes | Bug 修复
9
+
10
+ * swiper link ([afe011e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/afe011ed46292fc24a54afd2c0724aa8ccad4cf4))
11
+
12
+
13
+ ### 🚀 Chore | 构建/工程依赖/工具
14
+
15
+ * **release:** 0.1.24 ([6fdf148](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6fdf148486f0b0ebdaf6670e5ed087dd9a070ce2))
16
+
17
+
18
+ ### ✨ Features | 新功能
19
+
20
+ * back home ([10a9148](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/10a91481426fe3a687401c54e593e06ab50560b3))
21
+ * lcb product item 支持横向布局时图片高度和圆角配置 ([020c710](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/020c710a96bc18540f80771dcf3bdc49eb268475))
22
+ * 更新版本 ([bc1cb63](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/bc1cb63756e802aa43e365944b859e84eef7e70a))
23
+ * 透明度 ([b7eb9aa](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b7eb9aa884d41db903cea4abe32cc84b71038ccb))
24
+
25
+ ### [0.0.58](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.55...v0.0.58) (2024-11-06)
26
+
27
+
28
+ ### 🚀 Chore | 构建/工程依赖/工具
29
+
30
+ * **release:** 0.0.56 ([4b3f70b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4b3f70bab6b9ff6dcf5a6d356a8f864f386098f9))
31
+ * **release:** 0.0.57 ([b4f53b9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b4f53b98b178a4b09821553e1bac961f17a4bf62))
32
+
33
+
34
+ ### ✨ Features | 新功能
35
+
36
+ * banner兼容圆角 ([57bc054](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/57bc0542bf1e38188d6d00caff5b0c9209f5b2da))
37
+ * mine/search ([e8d34fc](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e8d34fc0182fe71de8d9abedb323ff49ee68720d))
38
+ * shadow ([d2de6bf](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d2de6bf135619c73db1a6a1cc027b1ba94002228))
39
+ * version 0.0.56 ([3a13a45](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3a13a4574d37d9f1b53b42c36ce5601498d6f2c6))
40
+ * 丰富grid ([e306107](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e306107d2964146f047862b5c3e7e5f8a368ae81))
41
+ * 晚上布局 ([d33d983](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d33d983b87e56e63633c3233b3608ca1c3006956))
42
+ * 暂定提交 ([c0a390b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/c0a390bc08031181cd63f4c44e88229f7e737b2d))
43
+
5
44
  ### [0.0.57](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.56...v0.0.57) (2024-11-03)
6
45
 
7
46
 
package/action.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface LcbGlobal {
28
28
  hideLoadingToast?: boolean,
29
29
  ): Promise<IResData<T>>
30
30
  }
31
+ navigateTo: (url: string) => void
31
32
  loadingStore?: () => {
32
33
  changeLoading: (path: string, loading: boolean) => void
33
34
  }
@@ -7,7 +7,7 @@
7
7
  padding: `${transformValueUnit(paddingTop || paddingVertical || 0)} ${transformValueUnit(paddingRight || paddingHorizontal || 0)} ${transformValueUnit(paddingBottom || paddingVertical || 0)} ${transformValueUnit(paddingLeft || paddingHorizontal || 0)}`,
8
8
  borderRadius: transformValueUnit(radius),
9
9
  color,
10
- backgroundColor,
10
+ backgroundColor: innerBackgroundColor,
11
11
  backgroundImage: backgroundImage ? `url('${backgroundImage}')` : '',
12
12
  backgroundRepeat,
13
13
  backgroundPosition,
@@ -27,6 +27,7 @@
27
27
  <script setup lang="ts">
28
28
  import { LcbBlockInnerProps } from './types'
29
29
  import { transformValueUnit } from '../../utils/transform'
30
+ import { computed } from 'vue'
30
31
  defineOptions({
31
32
  name: 'LcbBlock',
32
33
  options: {
@@ -36,9 +37,15 @@ defineOptions({
36
37
  },
37
38
  })
38
39
 
39
- withDefaults(defineProps<LcbBlockInnerProps>(), {
40
+ const props = withDefaults(defineProps<LcbBlockInnerProps>(), {
40
41
  backgroundSize: '100% 100%',
41
42
  backgroundRepeat: 'no-repeat',
42
43
  backgroundPosition: `top center`,
44
+ opacity: 1,
45
+ })
46
+ // 透明度+颜色
47
+ const innerBackgroundColor = computed(() => {
48
+ if (!props.backgroundColor) return ''
49
+ return props.backgroundColor + Math.floor(props.opacity * 255).toString(16)
43
50
  })
44
51
  </script>
@@ -17,7 +17,8 @@ export interface LcbBlockProps {
17
17
  shadowSize?: number
18
18
  /** 模糊大小 */
19
19
  blurSize?: number
20
-
20
+ /** 透明度 */
21
+ opacity?: number
21
22
  paddingTop?: number
22
23
  paddingBottom?: number
23
24
  paddingLeft?: number
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <lcb-block v-bind="$props">
2
+ <lcb-block v-bind="$props" backgroundColor="">
3
3
  <view class="flex w-full search-view overflow-hidden">
4
4
  <view
5
5
  v-for="(item, index) in tabs"
@@ -11,12 +11,23 @@
11
11
  'active-left': index === current - 1,
12
12
  'active-right': index === current + 1,
13
13
  }"
14
+ :style="{
15
+ backgroundColor:
16
+ current === index
17
+ ? `rgba(255,255,255,${opacity ?? 1})`
18
+ : `rgba(245,246,249,${opacity ?? 1})`,
19
+ }"
14
20
  >
15
21
  {{ item }}
16
22
  </view>
17
23
  </view>
18
- <view class="box-border px-3 leading-none">
19
- <view class="flex items-center justify-center mt-3 text-#333 gap-16rpx">
24
+ <view
25
+ class="box-border px-3 leading-none pt-3"
26
+ :style="{
27
+ backgroundColor: `rgba(255,255, 255, ${opacity})`,
28
+ }"
29
+ >
30
+ <view class="flex items-center justify-center text-#333 gap-16rpx">
20
31
  <lcb-city-select :location="userLocation" v-model="addressCity">
21
32
  <view class="flex items-center gap-16rpx">
22
33
  <view class="text-30rpx font-bold max-w-13 truncate">
@@ -30,7 +41,12 @@
30
41
  </view>
31
42
  </lcb-city-select>
32
43
 
33
- <view class="h-42rpx w-1px bg-#F1F1F1"></view>
44
+ <view
45
+ class="h-42rpx w-1px"
46
+ :style="{
47
+ backgroundColor: `rgba(241,241, 241, ${opacity})`,
48
+ }"
49
+ ></view>
34
50
  <view class="text-#999 text-28rpx">{{ placeholder }}</view>
35
51
  <view class="flex-1"></view>
36
52
  <view class="justify-center flex flex-col items-center" @click="getLocation">
@@ -46,7 +62,12 @@
46
62
  </view>
47
63
  </view>
48
64
  </view>
49
- <view class="w-full h-1px bg-#F1F1F1 mt-26rpx mb-44rpx"></view>
65
+ <view
66
+ class="w-full h-1px mt-26rpx mb-44rpx"
67
+ :style="{
68
+ backgroundColor: `rgba(241,241, 241, ${opacity})`,
69
+ }"
70
+ ></view>
50
71
  <lcb-calendar v-model="dayRange">
51
72
  <view class="flex items-center">
52
73
  <view class="title">{{ dayjs(dayRange[0]).format('MM月DD日') }}</view>
@@ -105,7 +126,7 @@ defineOptions({
105
126
 
106
127
  withDefaults(defineProps<LcbHomeSearch>(), {
107
128
  marginHorizontal: 24,
108
- backgroundColor: '#fff',
129
+ backgroundColor: '#ffffff',
109
130
  radius: 16,
110
131
  placeholder: '位置|酒店|关键词',
111
132
  btnText: '搜索酒店',
@@ -128,27 +149,27 @@ const getDayName = (time: number) => {
128
149
  </script>
129
150
  <style lang="scss" scoped>
130
151
  .search-view {
131
- border-radius: 16rpx;
152
+ // border-radius: 16rpx;
153
+ border-top-left-radius: 16rpx;
154
+ border-top-right-radius: 16rpx;
132
155
  .search-tab {
133
156
  flex: 1;
134
157
  text-align: center;
135
158
  font-size: 30rpx;
136
159
  padding: 24rpx 0;
137
160
  color: #999;
138
- background-color: #f5f6f9;
139
161
  }
140
162
  .active {
141
- background-color: #fff;
142
163
  color: #000;
143
164
  font-weight: bold;
144
165
  border-top-left-radius: 16rpx;
145
166
  border-top-right-radius: 16rpx;
146
- &-left {
147
- border-bottom-right-radius: 16rpx;
148
- }
149
- &-right {
150
- border-bottom-left-radius: 16rpx;
151
- }
167
+ // &-left {
168
+ // border-bottom-right-radius: 16rpx;
169
+ // }
170
+ // &-right {
171
+ // border-bottom-left-radius: 16rpx;
172
+ // }
152
173
  }
153
174
  }
154
175
 
@@ -29,6 +29,7 @@
29
29
  :key="item.title"
30
30
  v-bind="item.link"
31
31
  custom-class="!flex flex-col justify-center items-center item"
32
+ @click="onItemClick(item)"
32
33
  >
33
34
  <view
34
35
  class="overflow-hidden"
@@ -51,10 +52,17 @@
51
52
  height: iconSize + 'rpx',
52
53
  width: iconSize + 'rpx',
53
54
  }"
54
- :src="item.url"
55
+ :src="item[urlKey]"
55
56
  />
56
57
  </view>
57
- <view class="title">{{ item.title }}</view>
58
+ <view
59
+ class="title"
60
+ :style="{
61
+ fontSize: transformValueUnit(textSize),
62
+ }"
63
+ >
64
+ {{ item[titleKey] }}
65
+ </view>
58
66
  <wd-icon v-if="styleGroup === 3" name="chevron-right" size="22"></wd-icon>
59
67
  </lcb-action-view>
60
68
  </view>
@@ -62,8 +70,13 @@
62
70
  </template>
63
71
 
64
72
  <script lang="ts" setup>
73
+ import { ActionView } from '../../action'
74
+ import { transformValueUnit } from '../../utils/transform'
65
75
  import { LcbImgNavProps } from './types'
66
-
76
+ const emits = defineEmits(['click'])
77
+ const onItemClick = (item: ActionView) => {
78
+ emits('click', item)
79
+ }
67
80
  defineOptions({
68
81
  name: 'LcbImgNav',
69
82
  options: {
@@ -82,6 +95,9 @@ withDefaults(defineProps<LcbImgNavProps>(), {
82
95
  paddingHorizontal: 0,
83
96
  iconTextMargin: 4,
84
97
  pictureDistribution: 4,
98
+ textSize: 28,
99
+ urlKey: 'url',
100
+ titleKey: 'title',
85
101
  })
86
102
  </script>
87
103
 
@@ -118,7 +134,6 @@ withDefaults(defineProps<LcbImgNavProps>(), {
118
134
  .title {
119
135
  width: 68px;
120
136
  overflow: hidden;
121
- font-size: 28rpx;
122
137
  line-height: 1;
123
138
  text-align: center;
124
139
  letter-spacing: 0;
@@ -30,4 +30,7 @@ export interface LcbImgNavProps extends LcbBlockProps {
30
30
  fontSize?: number
31
31
  color?: string
32
32
  titlePadding?: number
33
+ textSize?: number
34
+ urlKey?: string
35
+ titleKey?: string
33
36
  }
@@ -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"
@@ -122,7 +122,11 @@ const props = withDefaults(defineProps<NavProps>(), {
122
122
  const navbarBgColor = computed(() => {
123
123
  return props.backgroundType === 'color' ? props.backColor : ''
124
124
  })
125
-
125
+ // 判断是否是最后一个页面
126
+ const isLastPage = () => {
127
+ const pages = getCurrentPages()
128
+ return pages.length === 1
129
+ }
126
130
  // 透明度
127
131
  const navbarBgOpacity = computed(() => {
128
132
  const { topStyle, immersionMode } = props
@@ -188,7 +192,7 @@ const onCapsule = ({ action }: ICapsule) => {
188
192
  break
189
193
  case 'setting':
190
194
  uni.navigateTo({
191
- url: '/pages/setting/index',
195
+ url: '/pages/mine/setting',
192
196
  })
193
197
  break
194
198
 
@@ -201,7 +205,13 @@ const onCapsule = ({ action }: ICapsule) => {
201
205
  }
202
206
 
203
207
  const toBack = () => {
204
- uni.navigateBack()
208
+ if (isLastPage()) {
209
+ uni.switchTab({
210
+ url: '/pages/index/index',
211
+ })
212
+ } else {
213
+ uni.navigateBack()
214
+ }
205
215
  }
206
216
  </script>
207
217
  <style lang="scss" scoped>
@@ -31,7 +31,12 @@ defineSlots<{
31
31
  <slot name="item" :item="item">
32
32
  <lcb-product-item
33
33
  v-bind="{ ...item, ...attrs }"
34
- :imageStyle="{ width: `${imageWidthPercent}%` }"
34
+ :imageStyle="{
35
+ width: imageWidth ?? `${imageWidthPercent}%`,
36
+ height: imageHeight ? `${imageHeight}rpx` : undefined,
37
+ borderRadius: imageRadius ? `${imageRadius}rpx` : undefined,
38
+ ...(attrs?.imageStyle ?? {}),
39
+ }"
35
40
  >
36
41
  <!-- <template #itemTopSection>
37
42
  <view class="min-w-10 min-h-10 bg-red-500/50"></view>
@@ -72,7 +77,10 @@ defineSlots<{
72
77
  v-bind="{ ...item, ...attrs }"
73
78
  layoutType="vertical"
74
79
  className="!h-full"
75
- :imageStyle="{ height: `${imageHeightPercent}%` }"
80
+ :imageStyle="{
81
+ height: imageHeight ?? `${imageHeightPercent}%`,
82
+ ...(attrs?.imageStyle ?? {}),
83
+ }"
76
84
  >
77
85
  <!-- <template #itemTopSection>
78
86
  <view class="min-w-10 min-h-10 bg-red-500/50"></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,60 +1,55 @@
1
1
  <template>
2
- <lcb-block v-bind="$props" customClass="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
- >
2
+ <lcb-block v-bind="$props">
3
+ <view class="flex justify-between">
9
4
  <view
10
- class="position-relative"
11
- :style="{
12
- height: transformValueUnit(iconSize),
13
- width: transformValueUnit(iconSize),
14
- }"
15
- @click="onClick"
5
+ class="flex flex-col flex-justify-center items-center"
6
+ @click="onClick(item)"
7
+ v-for="item in items"
8
+ :key="item.iconTitle"
16
9
  >
17
- <view v-if="item.iconType === 0">
18
- <wd-icon
19
- class-prefix="lcb"
20
- v-bind="{
21
- name: item.iconName || '',
22
- size: transformValueUnit(iconSize),
23
- color: iconColor,
24
- }"
25
- />
26
- </view>
27
10
  <view
28
- v-if="item.iconType === 1"
29
- class="bg-no-repeat bg-contain"
11
+ class="position-relative"
30
12
  :style="{
31
13
  height: transformValueUnit(iconSize),
32
14
  width: transformValueUnit(iconSize),
33
- color: iconColor,
34
- backgroundImage: `url('${item.iconUpload}')`,
35
15
  }"
36
- />
16
+ >
17
+ <wd-badge :modelValue="dataInfo[item.countKey || ''] || 0" :max="99">
18
+ <wd-icon
19
+ v-if="item.iconType === 0"
20
+ class-prefix="lcb"
21
+ v-bind="{
22
+ name: item.iconName || '',
23
+ size: transformValueUnit(iconSize),
24
+ color: iconColor,
25
+ }"
26
+ />
27
+
28
+ <wd-img
29
+ v-if="item.iconType === 1"
30
+ :height="transformValueUnit(iconSize)"
31
+ :width="transformValueUnit(iconSize)"
32
+ :src="item.iconUpload"
33
+ />
34
+ </wd-badge>
35
+ </view>
37
36
  <view
38
- v-if="item.id < 5"
39
- class="pos-absolute bg-#f23d3d pos-top-0 pos-right-0 w-8px h-8px rounded-4px"
40
- />
41
- </view>
42
- <view
43
- class="flex flex-justify-between text-center"
44
- :style="{
45
- color: textColor,
46
- fontSize: transformValueUnit(textSize),
47
- marginTop: transformValueUnit((textSize || 0) / 3),
48
- }"
49
- >
50
- {{ item.iconTitle }}
37
+ class="flex flex-justify-between text-center"
38
+ :style="{
39
+ color: textColor,
40
+ fontSize: transformValueUnit(textSize),
41
+ marginTop: transformValueUnit((textSize || 0) / 3),
42
+ }"
43
+ >
44
+ {{ item.iconTitle }}
45
+ </view>
51
46
  </view>
52
47
  </view>
53
48
  </lcb-block>
54
49
  </template>
55
50
 
56
51
  <script setup lang="ts">
57
- import { computed } from 'vue'
52
+ import { ref, watch } from 'vue'
58
53
  import { LcbUserOrderProps, IIconList } from './types'
59
54
  import { transformValueUnit } from '../../utils/transform'
60
55
  defineOptions({
@@ -65,7 +60,7 @@ defineOptions({
65
60
  styleIsolation: 'shared',
66
61
  },
67
62
  })
68
- const onClick = (item: any) => {
63
+ const onClick = (item: IIconList) => {
69
64
  uni.navigateTo({
70
65
  url: `/pages/order/index?status=${item.status}`,
71
66
  })
@@ -75,25 +70,17 @@ const props = withDefaults(defineProps<LcbUserOrderProps>(), {
75
70
  paddingHorizontal: 0,
76
71
  blurSize: 5,
77
72
  })
78
- const statusNumbers = ['0', '1', '4', '2', '3', '5', '']
79
- const iconList = computed(() => {
80
- const list: IIconList[] = []
81
- for (let i = 0; i < statusNumbers.length; i++) {
82
- const item = statusNumbers[i]
83
- const isShow = props['iconShow' + item]
84
- if (isShow !== false) {
85
- list.push({
86
- id: i,
87
- iconType: props['iconType' + item],
88
- iconTitle: props['iconTitle' + item],
89
- iconName: props['iconName' + item],
90
- iconUpload: props['iconUpload' + item],
91
- status: item,
92
- })
73
+ const dataInfo = ref<Record<string, any>>({})
74
+ watch(
75
+ () => props.dataUrl,
76
+ async (url) => {
77
+ if (url) {
78
+ const { data } = await uni.$lcb.http.post(url)
79
+ dataInfo.value = data as Record<string, any>
93
80
  }
94
- }
95
- return list as IIconList[]
96
- })
81
+ },
82
+ { immediate: true },
83
+ )
97
84
  </script>
98
85
 
99
86
  <style lang="scss" scoped></style>
@@ -1,23 +1,17 @@
1
1
  export interface IIconList {
2
- id: number
3
- iconType: number
2
+ iconType: 0 | 1
4
3
  iconTitle?: string
5
4
  iconName?: string
6
5
  iconUpload?: string
7
- status?: any
6
+ status?: string
7
+ countKey?: string
8
8
  }
9
9
 
10
10
  export interface LcbUserOrderProps {
11
- // Define the component's prop types here
11
+ dataUrl?: string
12
12
  marginTop?: number
13
13
  marginBottom?: number
14
14
  marginHorizontal?: number
15
- // marginLeft?: number
16
- // marginRight?: number
17
- // paddingTop?: number
18
- // paddingBottom?: number
19
- // paddingLeft?: number
20
- // paddingRight?: number
21
15
  paddingVertical?: number
22
16
  paddingHorizontal?: number
23
17
  backgroundColor?: string
@@ -30,42 +24,5 @@ export interface LcbUserOrderProps {
30
24
  shadowColor?: string
31
25
  shadowSize?: number
32
26
  blurSize?: number
33
-
34
- iconTitle0?: string
35
- iconType0?: 0 | 1
36
- iconName0?: string
37
- iconUpload0?: string
38
-
39
- iconTitle1?: string
40
- iconType1?: 0 | 1
41
- iconName1?: string
42
- iconUpload1?: string
43
- iconShow1?: boolean
44
-
45
- iconTitle2?: string
46
- iconType2?: 0 | 1
47
- iconName2?: string
48
- iconUpload2?: string
49
- iconShow2?: boolean
50
-
51
- iconTitle3?: string
52
- iconType3?: 0 | 1
53
- iconName3?: string
54
- iconUpload3?: string
55
- iconShow3?: boolean
56
-
57
- iconTitle4?: string
58
- iconType4?: 0 | 1
59
- iconName4?: string
60
- iconUpload4?: string
61
- iconShow4?: boolean
62
-
63
- iconTitle5?: string
64
- iconType5?: 0 | 1
65
- iconName5?: string
66
- iconUpload5?: string
67
- iconTitle?: string
68
- iconType?: 0 | 1
69
- iconName?: string
70
- iconUpload?: string
27
+ items: IIconList[]
71
28
  }
@@ -0,0 +1,33 @@
1
+ import { $lcb } from 'index'
2
+ import { LcbActionViewProps } from '../../lcb-action-view/types'
3
+ import { ActionView } from '../../../action'
4
+
5
+ export interface CurrentRightsDetail {
6
+ coverImg: string
7
+ effectiveDate: string
8
+ sumPoint: number
9
+ upgradeTips: string
10
+ usePoint: number
11
+ usedPoint: number
12
+ userLevelName: string
13
+ userLevelRightsList: UserLevelRightsList[]
14
+ waitPoint: number
15
+ }
16
+
17
+ export interface UserLevelRightsList extends ActionView {
18
+ categoryId: string
19
+ categoryName: string
20
+ categoryTags: string
21
+ icon: string
22
+ userRightsConfigId: string
23
+ userRightsContent: string
24
+ userRightsSubTitle: string
25
+ userRightsTitle: string
26
+ link: LcbActionViewProps
27
+ userRightsType: string
28
+ weightSort: string
29
+ qrCode: string
30
+ qrCodeTips: string
31
+ }
32
+ export const currentRightsDetail = () =>
33
+ $lcb.http.post<CurrentRightsDetail>('/userLevel/currentRightsDetail')
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <wd-popup v-model="show" custom-style="background:transparent" @close="show = false" closable>
3
+ <view class="pop-view flex justify-center flex-col items-center" v-if="data">
4
+ <view class="text-4 mb-4">{{ data.userRightsTitle }}</view>
5
+ <mp-html :content="data.userRightsContent" v-if="data.userRightsContent" />
6
+ <wd-img :src="data.qrCode" class="mt-2.5" width="340rpx" height="340rpx" v-if="data.qrCode" />
7
+ <view class="text-3 text-#969696 mt-1" v-if="data.qrCodeTips">{{ data.qrCodeTips }}</view>
8
+ <wd-button
9
+ type="primary"
10
+ plain
11
+ custom-class="!rounded-10rpx !mt-4 "
12
+ @click="onDrawdown"
13
+ v-if="['voucher', 'cashVoucher'].includes(data.userRightsType)"
14
+ >
15
+ {{ translate('领取') }}
16
+ </wd-button>
17
+ </view>
18
+ </wd-popup>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { useTranslate } from '@tplc/wot'
23
+ import { UserLevelRightsList } from '../../api'
24
+ import mpHtml from 'mp-html/src/uni-app/components/mp-html/mp-html.vue'
25
+ import { ref, watch } from 'vue'
26
+ const { translate } = useTranslate()
27
+ const show = ref(false)
28
+ const props = defineProps<{
29
+ data?: UserLevelRightsList
30
+ }>()
31
+ watch(
32
+ () => props.data,
33
+ (val) => {
34
+ if (val) show.value = true
35
+ },
36
+ )
37
+ const onDrawdown = () => {
38
+ uni.navigateTo({
39
+ url: `/pages/drawdown/drawdown?from=vip&id=${props.data?.userRightsConfigId}`,
40
+ })
41
+ }
42
+ </script>
43
+ <style lang="scss" scoped>
44
+ .pop-view {
45
+ width: 606rpx;
46
+ background: #ffffff;
47
+ border-radius: 40rpx;
48
+ padding: 40rpx;
49
+ color: #000000;
50
+ }
51
+ </style>
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <lcb-block v-bind="$props" v-if="info">
3
+ <view class="text-3">
4
+ <view class="relative">
5
+ <wd-img
6
+ :src="getJsonStrFirstUrl(info.coverImg)"
7
+ width="100%"
8
+ :height="transformValueUnit(cardHeight)"
9
+ />
10
+ <view class="absolute w-20 text-center leading-6 top-0 left-0">
11
+ {{ info.effectiveDate }}
12
+ </view>
13
+ <view
14
+ class="absolute leading-4.5 top-156rpx left-4 flex items-center gap-0.5"
15
+ @click="$lcb.navigateTo('/pages-subs/vip/points')"
16
+ >
17
+ <view>{{ translate('消费积分') }} {{ info.sumPoint }}</view>
18
+ <wd-icon classPrefix="lcb" name="xiangyou" size="24rpx" color="#000" />
19
+ </view>
20
+ <view
21
+ class="absolute text-2.5 w-662rpx leading-8 bottom-2.5 left-2.5 flex items-center gap-0.5"
22
+ @click="$lcb.navigateTo('/pages-subs/vip/upgrade-guide')"
23
+ >
24
+ <view class="flex-1 truncate">
25
+ {{ info.upgradeTips }}
26
+ </view>
27
+ <view>{{ translate('攻略') }}</view>
28
+ <wd-icon classPrefix="lcb" name="xiangyou" size="24rpx" color="#000" />
29
+ </view>
30
+ </view>
31
+ <lcb-img-nav
32
+ :items="info.userLevelRightsList"
33
+ :styleGroup="2"
34
+ :pictureDistribution="itemNum"
35
+ :iconType="1"
36
+ :iconSize="itemIconSize"
37
+ :color="itemTextColor"
38
+ :iconTextMargin="24"
39
+ :textSize="itemTextSize"
40
+ urlKey="icon"
41
+ titleKey="userRightsTitle"
42
+ @click="onItemClick"
43
+ />
44
+ <InfoDialog :data="current" />
45
+ </view>
46
+ </lcb-block>
47
+ </template>
48
+
49
+ <script setup lang="ts">
50
+ import { LcbVipProps } from './types'
51
+ import { getJsonStrFirstUrl, transformValueUnit } from '../../utils/transform'
52
+ import { onMounted, ref } from 'vue'
53
+ import { CurrentRightsDetail, currentRightsDetail, UserLevelRightsList } from './api'
54
+ import { useTranslate } from '@tplc/wot'
55
+ import { $lcb } from 'index'
56
+ import InfoDialog from './components/InfoDialog/index.vue'
57
+ const { translate } = useTranslate()
58
+ defineOptions({
59
+ name: 'LcbVip',
60
+ options: {
61
+ addGlobalClass: true,
62
+ virtualHost: true,
63
+ styleIsolation: 'shared',
64
+ },
65
+ })
66
+ withDefaults(defineProps<LcbVipProps>(), {
67
+ cardHeight: 340,
68
+ itemIconSize: 84,
69
+ itemNum: 5,
70
+ itemTextColor: '#fff',
71
+ itemTextSize: 24,
72
+ })
73
+ const info = ref<CurrentRightsDetail>()
74
+ const current = ref<UserLevelRightsList>()
75
+ const onItemClick = (item: UserLevelRightsList) => {
76
+ current.value = item
77
+ }
78
+
79
+ onMounted(async () => {
80
+ const { data } = await currentRightsDetail()
81
+ info.value = data
82
+ })
83
+ </script>
84
+
85
+ <style lang="scss" scoped></style>
@@ -0,0 +1,8 @@
1
+ import { LcbBlockProps } from './../lcb-block/types'
2
+ export interface LcbVipProps extends LcbBlockProps {
3
+ cardHeight: number
4
+ itemNum: 3 | 4 | 5
5
+ itemIconSize: number
6
+ itemTextColor: string
7
+ itemTextSize: number
8
+ }
package/global.d.ts CHANGED
@@ -29,6 +29,7 @@ declare module 'vue' {
29
29
  'lcb-user-order': (typeof import('./types/components/lcb-user-order/lcb-user-order.vue'))['default']
30
30
  'lcb-user-top': (typeof import('./types/components/lcb-user-top/lcb-user-top.vue'))['default']
31
31
  'lcb-video': (typeof import('./types/components/lcb-video/lcb-video.vue'))['default']
32
+ 'lcb-vip': (typeof import('./types/components/lcb-vip/lcb-vip.vue'))['default']
32
33
  }
33
34
  }
34
35
 
package/index.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { LcbGlobal } from './action'
2
2
 
3
- export const $lcb: LcbGlobal = {} as LcbGlobal
3
+ export const $lcb: LcbGlobal = {
4
+ navigateTo: (url) => {
5
+ uni.navigateTo({ url })
6
+ },
7
+ } as LcbGlobal
4
8
  uni.$lcb = $lcb
5
9
  // #ifdef H5
6
10
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
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.23"
14
+ "@tplc/wot": "0.1.25"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">=18",
@@ -9,6 +9,7 @@ declare const __VLS_component: import('vue').DefineComponent<
9
9
  backgroundSize: string
10
10
  backgroundRepeat: string
11
11
  backgroundPosition: string
12
+ opacity: number
12
13
  }
13
14
  >,
14
15
  {},
@@ -28,6 +29,7 @@ declare const __VLS_component: import('vue').DefineComponent<
28
29
  backgroundSize: string
29
30
  backgroundRepeat: string
30
31
  backgroundPosition: string
32
+ opacity: number
31
33
  }
32
34
  >
33
35
  >
@@ -17,6 +17,8 @@ export interface LcbBlockProps {
17
17
  shadowSize?: number
18
18
  /** 模糊大小 */
19
19
  blurSize?: number
20
+ /** 透明度 */
21
+ opacity?: number
20
22
  paddingTop?: number
21
23
  paddingBottom?: number
22
24
  paddingLeft?: number
@@ -11,6 +11,9 @@ declare const _default: import('vue').DefineComponent<
11
11
  paddingHorizontal: number
12
12
  iconTextMargin: number
13
13
  pictureDistribution: number
14
+ textSize: number
15
+ urlKey: string
16
+ titleKey: string
14
17
  }
15
18
  >,
16
19
  {},
@@ -19,7 +22,9 @@ declare const _default: import('vue').DefineComponent<
19
22
  {},
20
23
  import('vue').ComponentOptionsMixin,
21
24
  import('vue').ComponentOptionsMixin,
22
- {},
25
+ {
26
+ click: (...args: any[]) => void
27
+ },
23
28
  string,
24
29
  import('vue').PublicProps,
25
30
  Readonly<
@@ -35,10 +40,15 @@ declare const _default: import('vue').DefineComponent<
35
40
  paddingHorizontal: number
36
41
  iconTextMargin: number
37
42
  pictureDistribution: number
43
+ textSize: number
44
+ urlKey: string
45
+ titleKey: string
38
46
  }
39
47
  >
40
48
  >
41
- >,
49
+ > & {
50
+ onClick?: ((...args: any[]) => any) | undefined
51
+ },
42
52
  {
43
53
  paddingHorizontal: number
44
54
  paddingVertical: number
@@ -48,6 +58,9 @@ declare const _default: import('vue').DefineComponent<
48
58
  pictureDistribution: 3 | 4 | 5
49
59
  iconRadius: number
50
60
  iconTextMargin: number
61
+ textSize: number
62
+ urlKey: string
63
+ titleKey: string
51
64
  },
52
65
  {}
53
66
  >
@@ -27,4 +27,7 @@ export interface LcbImgNavProps extends LcbBlockProps {
27
27
  fontSize?: number
28
28
  color?: string
29
29
  titlePadding?: number
30
+ textSize?: number
31
+ urlKey?: string
32
+ titleKey?: string
30
33
  }
@@ -21,10 +21,13 @@ declare const __VLS_component: import('vue').DefineComponent<
21
21
  >
22
22
  >,
23
23
  {
24
+ imageRadius: number
24
25
  items: Record<string, any>[]
26
+ imageWidth: number
25
27
  listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
26
28
  imageWidthPercent: number
27
29
  imageHeightPercent: number
30
+ imageHeight: number
28
31
  itemHeight: number
29
32
  },
30
33
  {}
@@ -2,6 +2,9 @@ export interface LcbProductProps {
2
2
  listType?: 'list' | 'horizontal' | 'grid' | 'waterfall'
3
3
  imageWidthPercent?: number
4
4
  imageHeightPercent?: number
5
+ imageWidth?: number
6
+ imageHeight?: number
7
+ imageRadius?: number
5
8
  itemHeight?: number
6
9
  items?: Record<string, any>[]
7
10
  }
@@ -1,12 +1,13 @@
1
1
  export interface IIconList {
2
- id: number
3
- iconType: number
2
+ iconType: 0 | 1
4
3
  iconTitle?: string
5
4
  iconName?: string
6
5
  iconUpload?: string
7
- status?: any
6
+ status?: string
7
+ countKey?: string
8
8
  }
9
9
  export interface LcbUserOrderProps {
10
+ dataUrl?: string
10
11
  marginTop?: number
11
12
  marginBottom?: number
12
13
  marginHorizontal?: number
@@ -22,36 +23,5 @@ export interface LcbUserOrderProps {
22
23
  shadowColor?: string
23
24
  shadowSize?: number
24
25
  blurSize?: number
25
- iconTitle0?: string
26
- iconType0?: 0 | 1
27
- iconName0?: string
28
- iconUpload0?: string
29
- iconTitle1?: string
30
- iconType1?: 0 | 1
31
- iconName1?: string
32
- iconUpload1?: string
33
- iconShow1?: boolean
34
- iconTitle2?: string
35
- iconType2?: 0 | 1
36
- iconName2?: string
37
- iconUpload2?: string
38
- iconShow2?: boolean
39
- iconTitle3?: string
40
- iconType3?: 0 | 1
41
- iconName3?: string
42
- iconUpload3?: string
43
- iconShow3?: boolean
44
- iconTitle4?: string
45
- iconType4?: 0 | 1
46
- iconName4?: string
47
- iconUpload4?: string
48
- iconShow4?: boolean
49
- iconTitle5?: string
50
- iconType5?: 0 | 1
51
- iconName5?: string
52
- iconUpload5?: string
53
- iconTitle?: string
54
- iconType?: 0 | 1
55
- iconName?: string
56
- iconUpload?: string
26
+ items: IIconList[]
57
27
  }
@@ -0,0 +1,31 @@
1
+ import { LcbActionViewProps } from '../../lcb-action-view/types'
2
+ import { ActionView } from '../../../action'
3
+ export interface CurrentRightsDetail {
4
+ coverImg: string
5
+ effectiveDate: string
6
+ sumPoint: number
7
+ upgradeTips: string
8
+ usePoint: number
9
+ usedPoint: number
10
+ userLevelName: string
11
+ userLevelRightsList: UserLevelRightsList[]
12
+ waitPoint: number
13
+ }
14
+ export interface UserLevelRightsList extends ActionView {
15
+ categoryId: string
16
+ categoryName: string
17
+ categoryTags: string
18
+ icon: string
19
+ userRightsConfigId: string
20
+ userRightsContent: string
21
+ userRightsSubTitle: string
22
+ userRightsTitle: string
23
+ link: LcbActionViewProps
24
+ userRightsType: string
25
+ weightSort: string
26
+ qrCode: string
27
+ qrCodeTips: string
28
+ }
29
+ export declare const currentRightsDetail: () => Promise<
30
+ import('../../../action').IResData<CurrentRightsDetail>
31
+ >
@@ -0,0 +1,36 @@
1
+ import { UserLevelRightsList } from '../../api'
2
+ declare const _default: import('vue').DefineComponent<
3
+ __VLS_TypePropsToOption<{
4
+ data?: UserLevelRightsList
5
+ }>,
6
+ {},
7
+ unknown,
8
+ {},
9
+ {},
10
+ import('vue').ComponentOptionsMixin,
11
+ import('vue').ComponentOptionsMixin,
12
+ {},
13
+ string,
14
+ import('vue').PublicProps,
15
+ Readonly<
16
+ import('vue').ExtractPropTypes<
17
+ __VLS_TypePropsToOption<{
18
+ data?: UserLevelRightsList
19
+ }>
20
+ >
21
+ >,
22
+ {},
23
+ {}
24
+ >
25
+ export default _default
26
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
27
+ type __VLS_TypePropsToOption<T> = {
28
+ [K in keyof T]-?: {} extends Pick<T, K>
29
+ ? {
30
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
31
+ }
32
+ : {
33
+ type: import('vue').PropType<T[K]>
34
+ required: true
35
+ }
36
+ }
@@ -0,0 +1,68 @@
1
+ import { LcbVipProps } from './types'
2
+ declare const _default: import('vue').DefineComponent<
3
+ __VLS_WithDefaults<
4
+ __VLS_TypePropsToOption<LcbVipProps>,
5
+ {
6
+ cardHeight: number
7
+ itemIconSize: number
8
+ itemNum: number
9
+ itemTextColor: string
10
+ itemTextSize: number
11
+ }
12
+ >,
13
+ {},
14
+ unknown,
15
+ {},
16
+ {},
17
+ import('vue').ComponentOptionsMixin,
18
+ import('vue').ComponentOptionsMixin,
19
+ {},
20
+ string,
21
+ import('vue').PublicProps,
22
+ Readonly<
23
+ import('vue').ExtractPropTypes<
24
+ __VLS_WithDefaults<
25
+ __VLS_TypePropsToOption<LcbVipProps>,
26
+ {
27
+ cardHeight: number
28
+ itemIconSize: number
29
+ itemNum: number
30
+ itemTextColor: string
31
+ itemTextSize: number
32
+ }
33
+ >
34
+ >
35
+ >,
36
+ {
37
+ cardHeight: number
38
+ itemNum: 3 | 4 | 5
39
+ itemIconSize: number
40
+ itemTextColor: string
41
+ itemTextSize: number
42
+ },
43
+ {}
44
+ >
45
+ export default _default
46
+ type __VLS_WithDefaults<P, D> = {
47
+ [K in keyof Pick<P, keyof P>]: K extends keyof D
48
+ ? __VLS_Prettify<
49
+ P[K] & {
50
+ default: D[K]
51
+ }
52
+ >
53
+ : P[K]
54
+ }
55
+ type __VLS_Prettify<T> = {
56
+ [K in keyof T]: T[K]
57
+ } & {}
58
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
59
+ type __VLS_TypePropsToOption<T> = {
60
+ [K in keyof T]-?: {} extends Pick<T, K>
61
+ ? {
62
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
63
+ }
64
+ : {
65
+ type: import('vue').PropType<T[K]>
66
+ required: true
67
+ }
68
+ }
@@ -0,0 +1,8 @@
1
+ import { LcbBlockProps } from './../lcb-block/types'
2
+ export interface LcbVipProps extends LcbBlockProps {
3
+ cardHeight: number
4
+ itemNum: 3 | 4 | 5
5
+ itemIconSize: number
6
+ itemTextColor: string
7
+ itemTextSize: number
8
+ }
@@ -0,0 +1,6 @@
1
+ import { LcbGlobal } from './action'
2
+ export declare const $lcb: LcbGlobal
3
+ declare const _default: {
4
+ install: (Vue: any) => void
5
+ }
6
+ export default _default
@@ -1 +1,5 @@
1
1
  export declare const transformValueUnit: (value?: number, uni?: string) => string
2
+ /** 获取json字符串第一个url */
3
+ export declare const getJsonStrFirstUrl: (jsonStr?: string) => any
4
+ /** 获取json字符串列表 */
5
+ export declare const getJsonStrList: (jsonStr?: string) => any
@@ -1,3 +1,14 @@
1
1
  export const transformValueUnit = (value?: number, uni = 'rpx') => {
2
2
  return typeof value === 'number' ? value + uni : '0rpx'
3
3
  }
4
+
5
+ /** 获取json字符串第一个url */
6
+ export const getJsonStrFirstUrl = (jsonStr = '[]') => {
7
+ const json = JSON.parse(jsonStr)
8
+ return json[0]
9
+ }
10
+
11
+ /** 获取json字符串列表 */
12
+ export const getJsonStrList = (jsonStr = '[]') => {
13
+ return JSON.parse(jsonStr)
14
+ }