mh-two-thousand-and-two
2024-03-25 b8c93990f3fa5e50a8aca16bdc9c2758168aa0fd
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
<template>
    <view>
        <!-- 顶部 -->
        <headNav />
        <!-- 搜索 -->
        <view class="" style="margin: 20rpx 0;">
            <luanqing-search class="search_bar" @onSearch="onSearch"></luanqing-search>
        </view>
        <view class="flex flex-center">
            热门搜索:
            <ul class="flex" style="margin-right: 10rpx;">
                <li v-for="item in hot" :key="item.id" @tap="HotClick(item.id)" style="margin: 0 10rpx;"
                    :style="{color:item.bgColor==true?'#5879a4':'#000'}">
                    {{item.name}}
                </li>
            </ul>
        </view>
        <uni-row class="demo-uni-row" style="padding: 0 30rpx; ">
            <uni-col :span="5" >
                <view class="demo-uni-col dark" style="padding: 20rpx;border: 2px solid #e0e0e0;">
                    <h3 style="padding-left: 20rpx;">{{profession.title}}</h3>
                    <ul style="margin-top: 10rpx;">
                        <!-- background-color: #d6e3f4;border-radius: 60rpx; -->
                        <li class="flex" :style="{'background':profession.index === index ?  '#d6e3f4' :'','borderRadius': profession.index === index ?  '60rpx' :''}" v-for="(item,index) in profession.list"  :key="index" style="padding:0 20rpx;">
                            <view class="">{{item.name}}</view>
                            <view class="">{{item.number}}</view>
                        </li>
                    </ul>
                    <view class="flex flex-center">
                        <view class="" style="font-size: 25rpx;color: #C1D3EA;">收起 ^</view>
                        <!-- <view class="">更多</view> -->
                    </view>
                </view>
            </uni-col>
            <uni-col :span="19" style="padding-left: 20rpx;">
                <view class="demo-uni-col light" style="border: 1px solid #000;">
                    bbb
                </view>
            </uni-col>
        </uni-row>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                // 热门搜索
                hot: [{
                    id: 1,
                    name: '李时珍',
                    bgColor: false
                }, {
                    id: 2,
                    name: '李时珍2',
                    bgColor: false
                }, {
                    id: 3,
                    name: '李时珍3',
                    bgColor: false
                }, ],
                // 职业
                
                profession: {
                    title: '职业',
                    index:0,
                    list: [{
                            name: '全部',
                            id: 1,
                            number:829
                        },
                        {
                            name: '医家',
                            id: 2,
                            number:90
                        }, {
                            name: '世医',
                            id: 3,
                            number:81
                        }, {
                            name: '宫廷医',
                            id: 4,
                            number:83
                        },
                    ]
                }
            }
        },
        methods: {
            onSearch(val) {
                console.log(val);
            },
            // 热门搜索
            HotClick(id) {
                this.hot.forEach(item => {
                    if (item.id === id) {
                        console.log(item.id === id);
                        item.bgColor = true
                    } else {
                        console.log(item.id === id);
                        item.bgColor = false
                    }
                })
 
            },
        }
    }
</script>
 
<style>
    * {
        box-sizing: border-box;
    }
</style>