doum
14 分钟以前 437d7c45481176d4766152cae26cf841a8bd458f
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<template>
    <view class="box">
        <scroll-view class="box_list" scroll-x>
            <view class="box_list_item">
                <image src="@/static/images/huodong_ic_all@2x.png" mode="widthFix"></image>
                <text>查看全部</text>
            </view>
            <view class="box_list_item">
                <image class="active" src="@/static/uni.png" mode="widthFix"></image>
                <text>行业简讯</text>
            </view>
            <view class="box_list_item">
                <image src="@/static/uni.png" mode="widthFix"></image>
                <text>原创文章</text>
            </view>
        </scroll-view>
        <view class="box_cate">
            <view class="box_cate_box">
                <view class="box_cate_item" v-for="(item, index) in cate" :key="index" @click="i = index">
                    <text :class="i === index ? 'activeColor' : ''">{{item.name}}</text>
                    <view class="active" v-show="i === index"></view>
                </view>
            </view>
        </view>
        <view class="box_list1">
            <shopitem @jump="jump" />
            <shopitem @jump="jump" />
            <shopitem @jump="jump" />
        </view>
    </view>
</template>
 
<script>
    import shopitem from '@/components/ShopItem/index.vue'
    export default {
        data() {
            return {
                i: 0,
                cate: [
                    {
                        name: '最新'
                    },
                    {
                        name: '最热'
                    }
                ]
            }
        },
        components: { shopitem },
        methods: {
            jump() {
                uni.navigateTo({
                    url: '/pages/shopDetails/index'
                });
            }
        }
        
    }
</script>
 
<style lang="scss" scoped>
    .box {
        width: 100%;
        padding: 32rpx;
        box-sizing: border-box;
        .box_list {
            width: 100%;
            white-space: nowrap;
            .box_list_item {
                width: 120rpx;
                display: inline-flex;
                flex-direction: column;
                align-items: center;
                margin-left: 68rpx;
                &:first-child {
                    margin-left: 0 !important;
                }
                .active {
                    box-sizing: border-box;
                    border: 3rpx solid #D20A0A;
                }
                image {
                    width: 120rpx;
                    height: 120rpx;
                    border-radius: 50%;
                }
                text {
                    font-size: 24rpx;
                    font-family: PingFang SC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #666666; 
                    margin-top: 18rpx;
                }
            }
        }
        .box_cate {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 38rpx;
            .box_cate_box {
                width: 300rpx;
                display: flex;
                align-items: center;
                .box_cate_item {
                    flex: 1;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex-direction: column;
                    .activeColor {
                        font-size: 32rpx;
                        font-family: PingFang SC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #333333;
                    }
                    .active {
                        width: 40rpx;
                        height: 4rpx;
                        background: #D20A0A;
                        border-radius: 12rpx;
                        margin-top: 8rpx;
                    }
                    text {
                        font-size: 28rpx;
                        font-family: PingFang SC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #666666;
                    }
                }
            }
        }
        .box_list1 {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            margin-top: 24rpx;
        }
    }
</style>