zhaojs
2023-04-27 0ae224b305087a8d1be405445d06621a07f78bbd
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<template>
    <view class="content">
        
        <view class="mix-list-cell" :class="border" @click="eventClick" hover-class="cell-hover"  :hover-stay-time="50">
            <text
                v-if="icon"
                class="cell-icon yticon"
                :style="[{
                    color: iconColor,
                }]"
                :class="icon"
            ></text>
            <text class="cell-tit clamp">{{title}}</text>
            <text v-if="tips" class="cell-tip">{{tips}}</text>
            <text class="cell-more yticon"
                :class="typeList[navigateType]"
            ></text>
        </view>
 
    </view>
</template>
 
<script>
    /**
     *  简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
     *  比如加入image, iconSize可控等
     */
    export default {
        data() {
            return {
                typeList: {
                    left: 'icon-zuo',
                    right: 'icon-you',
                    up: 'icon-shang',
                    down: 'icon-xia'
                },
            }
        },
        props: {
            icon: {
                type: String,
                default: ''
            },
            title: {
                type: String,
                default: '标题'
            },
            tips: {
                type: String,
                default: ''
            },
            navigateType: {
                type: String,
                default: 'right'
            },
            border: {
                type: String,
                default: 'b-b'
            },
            hoverClass: {
                type: String,
                default: 'cell-hover'
            },
            iconColor: {
                type: String,
                default: '#333'
            }
        },
        methods: {
            eventClick(){
                this.$emit('eventClick');
            }
        },
    }
</script>
 
<style lang='scss'>
 
    .icon .mix-list-cell.b-b:after{
        left: 90upx;
    }
    .mix-list-cell{
        display:flex;
        align-items:baseline;
        padding: 20upx $page-row-spacing;
        line-height:60upx;
        position:relative;
        
        &.cell-hover{
            background:#fafafa;
        }
        &.b-b:after{
            left: 30upx;
        }
 
        .cell-icon{
            align-self:center;
            width:56upx;
            max-height:60upx;
            font-size:38upx;
        }
        .cell-more{
            align-self: center;
            font-size:30upx;
            color:$font-color-base;
            margin-left:$uni-spacing-row-sm;
        }
        .cell-tit{
            flex: 1;
            font-size: $font-base;
            color: $font-color-dark;
            margin-right:10upx;
        }
        .cell-tip{
            font-size: $font-sm+2upx;
            color: $font-color-light;
        }
    }
</style>