222
schangxiang@126.com
2025-09-24 68941a04cb2320daa22ba0d5ac79a4447c29998d
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
<template>
    <view class="content">
        <!-- 顶部标题 -->
        <view class="title">{{title}}</view>
        <view class="detail">
            <view v-for="(item,index) in typeArr" :key="item.code" class="item" :class="activeIndex == index? 'active' : ''">
                {{item.title}}
            </view>
        </view>
    </view>
</template>
<script>
    export default {
        props: {
            title: {type: String,required: true},
            typeArr: {type: Array,required: true},
            status: {type: Number,required: true}
        },
        data() {
            return {
                
            }
        },
        computed: {
            activeIndex: {
                get() {
                    return this.status - 1
                }
            }
        }
        // watch: {
        //     activeIndex(val) {
        //         this.$emit("update:status", this.typeArr[val].code)
        //     }
        // }
    }
</script>
 
<style scoped lang="scss">
    .content {
        width: 96%;
        margin: 18rpx auto;
        .title {
            border-left: 6rpx solid #F18202;
            padding-left: 10rpx;
            box-sizing: border-box;
            font-size: 36rpx;
            margin-bottom: 10rpx;
        }
        .detail {
            box-sizing: border-box;
            width: 100%;
            display: flex;
            justify-content: space-around;
            box-sizing: border-box;
            .item {
                width: 30%;
                text-align: center;
                height: 80rpx;
                line-height: 80rpx;
                font-size: 40rpx;
                color: #000;
                background: #fff;
                border-radius: 10rpx;
            }
            .active {
                color: #fff;
                background: #F18202;
            }
        }
    }
</style>