linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template>
    <view class="caption flex a-i-c j-c-s-b">
        <view class="flex a-i-c">
            <view class="line" :style="{backgroundColor:bgColor}"></view>
            <text class=" fw" :style="{fontSize:fontSize}">{{title}}</text>
        </view>
        <view class="caption-right" v-if="isLink" @click="navTo()">
            <text class="f-26 c-99">更多</text>
            <u-icon name="arrow-right" color="#999" size="14"></u-icon>
        </view>
 
    </view>
</template>
 
<script>
    export default {
        name: "captionRow",
        props: {
            title: String, //左侧标题
            isLink: { //是否展示右侧箭头并开启点击反馈
                type: Boolean,
                default: false
            },
            url: String, //点击后跳转的URL地址
            fontSize: {
                type: String,
                default: '32rpx'
            },
            bgColor: {
                type: String,
                default: '#017BFC'
            }
        },
        methods: {
            navTo() {
                uni.navigateTo({
                    url: this.url
                })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .caption {
        width: 100%;
        padding: 30rpx 0 0;
 
        .line {
            width: 6rpx;
            height: 28rpx;
            // background-color: #017BFC;
            margin-right: 14rpx;
        }
 
        .caption-right {
            width: 120rpx;
            display: flex;
            justify-content: flex-end;
            align-items: center;
        }
    }
</style>