@tplc/business 0.0.58 → 0.0.60
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.
- package/CHANGELOG.md +28 -0
- package/action.d.ts +1 -0
- package/components/lcb-block/lcb-block.vue +9 -2
- package/components/lcb-block/types.ts +2 -1
- package/components/lcb-home-search/lcb-home-search.vue +36 -15
- package/components/lcb-img-nav/lcb-img-nav.vue +19 -4
- package/components/lcb-img-nav/types.ts +3 -0
- package/components/lcb-nav/lcb-nav.vue +13 -3
- package/components/lcb-product/lcb-product.vue +10 -2
- package/components/lcb-product/types.ts +3 -0
- package/components/lcb-vip/api/index.ts +33 -0
- package/components/lcb-vip/components/InfoDialog/index.vue +57 -0
- package/components/lcb-vip/lcb-vip.vue +93 -0
- package/components/lcb-vip/types.ts +8 -0
- package/global.d.ts +1 -0
- package/index.ts +5 -1
- package/package.json +3 -2
- package/types/components/lcb-block/lcb-block.vue.d.ts +2 -0
- package/types/components/lcb-block/types.d.ts +2 -0
- package/types/components/lcb-img-nav/lcb-img-nav.vue.d.ts +15 -2
- package/types/components/lcb-img-nav/types.d.ts +3 -0
- package/types/components/lcb-product/lcb-product.vue.d.ts +3 -0
- package/types/components/lcb-product/types.d.ts +3 -0
- package/types/components/lcb-vip/api/index.d.ts +32 -0
- package/types/components/lcb-vip/components/InfoDialog/index.vue.d.ts +36 -0
- package/types/components/lcb-vip/lcb-vip.vue.d.ts +68 -0
- package/types/components/lcb-vip/types.d.ts +8 -0
- package/types/index.d.ts +6 -0
- package/types/utils/transform.d.ts +4 -0
- package/utils/transform.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
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.60](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.59...v0.0.60) (2024-11-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* add wd-qr-code ([83196b5](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/83196b5294a8936b33eafe312cf203a3de531a8c))
|
|
11
|
+
* 暂时提交qrcode ([6139d1f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6139d1f5f551a992277ffca11a09758cab9d2a2c))
|
|
12
|
+
|
|
13
|
+
### [0.0.59](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.58...v0.0.59) (2024-11-19)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
17
|
+
|
|
18
|
+
* swiper link ([afe011e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/afe011ed46292fc24a54afd2c0724aa8ccad4cf4))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
22
|
+
|
|
23
|
+
* **release:** 0.1.24 ([6fdf148](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6fdf148486f0b0ebdaf6670e5ed087dd9a070ce2))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### ✨ Features | 新功能
|
|
27
|
+
|
|
28
|
+
* back home ([10a9148](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/10a91481426fe3a687401c54e593e06ab50560b3))
|
|
29
|
+
* lcb product item 支持横向布局时图片高度和圆角配置 ([020c710](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/020c710a96bc18540f80771dcf3bdc49eb268475))
|
|
30
|
+
* 更新版本 ([bc1cb63](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/bc1cb63756e802aa43e365944b859e84eef7e70a))
|
|
31
|
+
* 透明度 ([b7eb9aa](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b7eb9aa884d41db903cea4abe32cc84b71038ccb))
|
|
32
|
+
|
|
5
33
|
### [0.0.58](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.55...v0.0.58) (2024-11-06)
|
|
6
34
|
|
|
7
35
|
|
package/action.d.ts
CHANGED
|
@@ -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>
|
|
@@ -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
|
|
19
|
-
|
|
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
|
|
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
|
|
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: '#
|
|
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
|
-
|
|
148
|
-
}
|
|
149
|
-
&-right {
|
|
150
|
-
|
|
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
|
|
55
|
+
:src="item[urlKey]"
|
|
55
56
|
/>
|
|
56
57
|
</view>
|
|
57
|
-
<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;
|
|
@@ -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
|
|
@@ -201,7 +205,13 @@ const onCapsule = ({ action }: ICapsule) => {
|
|
|
201
205
|
}
|
|
202
206
|
|
|
203
207
|
const toBack = () => {
|
|
204
|
-
|
|
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="{
|
|
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="{
|
|
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
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LcbActionViewProps } from '../../lcb-action-view/types'
|
|
2
|
+
import { ActionView } from '../../../action'
|
|
3
|
+
|
|
4
|
+
export interface CurrentRightsDetail {
|
|
5
|
+
coverImg: string
|
|
6
|
+
effectiveDate: string
|
|
7
|
+
sumPoint: number
|
|
8
|
+
upgradeTips: string
|
|
9
|
+
usePoint: number
|
|
10
|
+
usedPoint: number
|
|
11
|
+
userLevelName: string
|
|
12
|
+
userLevelRightsList: UserLevelRightsList[]
|
|
13
|
+
waitPoint: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface UserLevelRightsList extends ActionView {
|
|
17
|
+
categoryId: string
|
|
18
|
+
categoryName: string
|
|
19
|
+
categoryTags: string
|
|
20
|
+
icon: string
|
|
21
|
+
userRightsConfigId: string
|
|
22
|
+
userRightsContent: string
|
|
23
|
+
userRightsSubTitle: string
|
|
24
|
+
userRightsTitle: string
|
|
25
|
+
link: LcbActionViewProps
|
|
26
|
+
userRightsType: string
|
|
27
|
+
weightSort: string
|
|
28
|
+
qrCode: string
|
|
29
|
+
qrCodeTips: string
|
|
30
|
+
otherConfig: string
|
|
31
|
+
}
|
|
32
|
+
export const currentRightsDetail = () =>
|
|
33
|
+
uni.$lcb.http.post<CurrentRightsDetail>('/userLevel/currentRightsDetail')
|
|
@@ -0,0 +1,57 @@
|
|
|
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-qr-code
|
|
7
|
+
custom-class="!mt-2.5"
|
|
8
|
+
:size="170"
|
|
9
|
+
canvasId="qrCode"
|
|
10
|
+
:value="data.qrCode"
|
|
11
|
+
v-if="data.qrCode"
|
|
12
|
+
/>
|
|
13
|
+
<view class="text-3 text-#969696 mt-1" v-if="data.qrCodeTips">{{ data.qrCodeTips }}</view>
|
|
14
|
+
<wd-button
|
|
15
|
+
type="primary"
|
|
16
|
+
plain
|
|
17
|
+
custom-class="!rounded-10rpx !mt-4 "
|
|
18
|
+
@click="onDrawdown"
|
|
19
|
+
v-if="['voucher', 'cashVoucher'].includes(data.userRightsType)"
|
|
20
|
+
>
|
|
21
|
+
{{ translate('领取') }}
|
|
22
|
+
</wd-button>
|
|
23
|
+
</view>
|
|
24
|
+
</wd-popup>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { useTranslate } from '@tplc/wot'
|
|
29
|
+
import { UserLevelRightsList } from '../../api'
|
|
30
|
+
import mpHtml from 'mp-html/src/uni-app/components/mp-html/mp-html.vue'
|
|
31
|
+
import { watch, ref } from 'vue'
|
|
32
|
+
const { translate } = useTranslate()
|
|
33
|
+
const show = ref(false)
|
|
34
|
+
const props = defineProps<{
|
|
35
|
+
data?: UserLevelRightsList
|
|
36
|
+
}>()
|
|
37
|
+
watch(
|
|
38
|
+
() => props.data,
|
|
39
|
+
(val) => {
|
|
40
|
+
if (val) show.value = true
|
|
41
|
+
},
|
|
42
|
+
)
|
|
43
|
+
const onDrawdown = () => {
|
|
44
|
+
uni.navigateTo({
|
|
45
|
+
url: `/pages/drawdown/drawdown?from=vip&id=${props.data?.userRightsConfigId}`,
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
<style lang="scss" scoped>
|
|
50
|
+
.pop-view {
|
|
51
|
+
width: 606rpx;
|
|
52
|
+
padding: 40rpx;
|
|
53
|
+
color: #000000;
|
|
54
|
+
background: #ffffff;
|
|
55
|
+
border-radius: 40rpx;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lcb-block v-bind="$props" v-if="info">
|
|
3
|
+
<view
|
|
4
|
+
class="text-3"
|
|
5
|
+
:style="{
|
|
6
|
+
color: config.value.textColor || '#000',
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<view class="relative">
|
|
10
|
+
<wd-img
|
|
11
|
+
:src="getJsonStrFirstUrl(info.coverImg)"
|
|
12
|
+
width="100%"
|
|
13
|
+
:height="transformValueUnit(cardHeight)"
|
|
14
|
+
/>
|
|
15
|
+
<view class="absolute w-20 text-center leading-6 top-0 left-0">
|
|
16
|
+
{{ info.effectiveDate }}
|
|
17
|
+
</view>
|
|
18
|
+
<view
|
|
19
|
+
class="absolute leading-4.5 top-156rpx left-4 flex items-center gap-0.5"
|
|
20
|
+
@click="$lcb.navigateTo('/pages-subs/vip/points')"
|
|
21
|
+
>
|
|
22
|
+
<view>{{ translate('消费积分') }} {{ info.sumPoint }}</view>
|
|
23
|
+
<wd-icon classPrefix="lcb" name="xiangyou" size="24rpx" />
|
|
24
|
+
</view>
|
|
25
|
+
<view
|
|
26
|
+
class="absolute text-2.5 w-662rpx leading-8 bottom-2.5 left-2.5 flex items-center gap-0.5"
|
|
27
|
+
@click="$lcb.navigateTo('/pages-subs/vip/upgrade-guide')"
|
|
28
|
+
>
|
|
29
|
+
<view class="flex-1 truncate">
|
|
30
|
+
{{ info.upgradeTips }}
|
|
31
|
+
</view>
|
|
32
|
+
<view>{{ translate('攻略') }}</view>
|
|
33
|
+
<wd-icon classPrefix="lcb" name="xiangyou" size="24rpx" />
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
<lcb-img-nav
|
|
37
|
+
:items="info.userLevelRightsList"
|
|
38
|
+
:styleGroup="2"
|
|
39
|
+
:pictureDistribution="itemNum"
|
|
40
|
+
:iconType="1"
|
|
41
|
+
:iconSize="itemIconSize"
|
|
42
|
+
:color="itemTextColor"
|
|
43
|
+
:iconTextMargin="24"
|
|
44
|
+
:textSize="itemTextSize"
|
|
45
|
+
urlKey="icon"
|
|
46
|
+
titleKey="userRightsTitle"
|
|
47
|
+
@click="onItemClick"
|
|
48
|
+
/>
|
|
49
|
+
<InfoDialog :data="current" />
|
|
50
|
+
</view>
|
|
51
|
+
</lcb-block>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup lang="ts">
|
|
55
|
+
import { LcbVipProps } from './types'
|
|
56
|
+
import { getJsonStrFirstUrl, transformValueUnit } from '../../utils/transform'
|
|
57
|
+
import { computed, onMounted, ref } from 'vue'
|
|
58
|
+
import { CurrentRightsDetail, currentRightsDetail, UserLevelRightsList } from './api'
|
|
59
|
+
import { useTranslate } from '@tplc/wot'
|
|
60
|
+
import { $lcb } from '../../index'
|
|
61
|
+
import InfoDialog from './components/InfoDialog/index.vue'
|
|
62
|
+
const { translate } = useTranslate()
|
|
63
|
+
defineOptions({
|
|
64
|
+
name: 'LcbVip',
|
|
65
|
+
options: {
|
|
66
|
+
addGlobalClass: true,
|
|
67
|
+
virtualHost: true,
|
|
68
|
+
styleIsolation: 'shared',
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
withDefaults(defineProps<LcbVipProps>(), {
|
|
72
|
+
cardHeight: 340,
|
|
73
|
+
itemIconSize: 84,
|
|
74
|
+
itemNum: 5,
|
|
75
|
+
itemTextColor: '#fff',
|
|
76
|
+
itemTextSize: 24,
|
|
77
|
+
})
|
|
78
|
+
const info = ref<CurrentRightsDetail>()
|
|
79
|
+
const current = ref<UserLevelRightsList>()
|
|
80
|
+
const onItemClick = (item: UserLevelRightsList) => {
|
|
81
|
+
current.value = item
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
onMounted(async () => {
|
|
85
|
+
const { data } = await currentRightsDetail()
|
|
86
|
+
info.value = data
|
|
87
|
+
})
|
|
88
|
+
const config = computed(() => {
|
|
89
|
+
return JSON.parse(current?.value?.otherConfig || '{}')
|
|
90
|
+
})
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style lang="scss" scoped></style>
|
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 = {
|
|
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.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"业务组件"
|
|
6
6
|
],
|
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"vue": ">=3.2.47",
|
|
14
|
-
"@tplc/wot": "0.1.
|
|
14
|
+
"@tplc/wot": "0.1.25"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=18",
|
|
18
18
|
"pnpm": ">=7.30"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"mp-html": "^2.5.0",
|
|
21
22
|
"qs": "6.5.3",
|
|
22
23
|
"uview-plus": "^3.3.9"
|
|
23
24
|
},
|
|
@@ -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
|
>
|
|
@@ -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
|
>
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
otherConfig: string
|
|
29
|
+
}
|
|
30
|
+
export declare const currentRightsDetail: () => Promise<
|
|
31
|
+
import('../../../action').IResData<CurrentRightsDetail>
|
|
32
|
+
>
|
|
@@ -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
|
+
}
|
package/types/index.d.ts
ADDED
package/utils/transform.ts
CHANGED
|
@@ -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
|
+
}
|