doum
2 小时以前 b05fea19990632b2ec6320cbfaab2bddc87006c0
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<template>
    <view class="container">
        <!-- 头部 -->
        <view class="container_h">
            <view class="container_head" :style="{height: navHeight + 'px', marginTop: statusbarHeight + 'px'}">
                <view class="container_head_address" @click="go">
                    <image src="@/static/icon/ar_back_dark@2x.png" mode="widthFix"></image>
                </view>
            </view>
        </view>
        <!-- 搜索部分 -->
        <view class="container_b">
            <view class="container_b_img">
                <image src="@/static/icon/img_baike@2x.png" mode="widthFix"></image>
                <view class="container_b_img_box">
                    <view :style="{width: '100%', height: navHeight + statusbarHeight + 'px'}"></view>
                    <text>咖啡百科</text>
                    <view class="container_b_img_box_input">
                        <image src="@/static/icon/ic_search@2x.png" mode="widthFix"></image>
                        <input type="text" placeholder="输入关键词" placeholder-style="color: #CCCCCC; font-size: 28rpx; font-weight: 500;" />
                    </view>
                </view>
            </view>
        </view>
        <!-- 列表内容部分 -->
        <view class="container_c">
            <view class="container_c_cate">
                <view class="container_c_cate_item" v-for="(item, index) in list" :key="index" @click="i = index">
                    <image :src="i === index ? item.activeImgUrl : item.imgurl" mode="widthFix"></image>
                    <text :style="{ color: i === index ? '#D20A0A;' : '' }">{{item.name}}</text>
                </view>
            </view>
            <view class="container_c_list">
                <view class="container_c_list_item" @click="toDetails">
                    <image src="@/static/images/ic_xiaweiyi@2x.png" mode="widthFix"></image>
                    <text>夏威夷</text>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import { mapState } from 'vuex'
    export default {
        data() {
            return {
                i: 0,
                list: [
                    {
                        name: '咖啡产地',
                        imgurl: require('@/static/icon/ic_chan2di@2x.png'),
                        activeImgUrl: require('@/static/icon/ic_chandi@2x.png')
                    },
                    {
                        name: '咖啡品种',
                        imgurl: require('@/static/icon/ic_pinzhong@2x.png'),
                        activeImgUrl: require('@/static/icon/ic_pinzhong_sel@2x.png')
                    },
                    {
                        name: '处理方式',
                        imgurl: require('@/static/icon/ic_chuli@2x.png'),
                        activeImgUrl: require('@/static/icon/ic_chuli_sel@2x.png')
                    },
                    {
                        name: '萃取方式',
                        imgurl: require('@/static/icon/ic_cuiqu@2x.png'),
                        activeImgUrl: require('@/static/icon/ic_cuiqu_sel@2x.png')
                    },
                    {
                        name: '哇咖菜单',
                        imgurl: require('@/static/icon/ic_caidan@2x.png'),
                        activeImgUrl: require('@/static/icon/ic_caidan_sel@2x.png')
                    }
                ]
            }
        },
        computed: {
            ...mapState(['statusbarHeight', 'navHeight'])
        },
        methods: {
            toDetails() {
                uni.navigateTo({
                    url: `/pages/details/index?title=咖啡百科`
                });
            },
            go() {
                uni.navigateBack({
                    delta: 1
                });
            }
        }
    }
</script>
 
<style>
    page {
        background-color: #ffffff !important;
    }
</style>
 
<style lang="scss" scoped>
    .container {
        width: 100%;
        .container_h {
            width: 100%;
            height: auto;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 9;
            .container_head {
                width: 100%;
                padding: 0 32rpx;
                box-sizing: border-box;
                display: flex;
                align-items: center;
                justify-content: flex-start;
                .container_head_address {
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    image {
                        width: 16rpx;
                        height: 30rpx;
                    }
                }
            }
        }
        .container_b {
            width: 100%;
            .container_b_img {
                width: 100%;
                height: 500rpx;
                position: relative;
                image {
                    width: 100%;
                    height: 100%;
                }
                .container_b_img_box {
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex-direction: column;
                    text {
                        font-size: 60rpx;
                        font-family: PingFang SC-Semibold, PingFang SC;
                        font-weight: 600;
                        color: #FFFFFF;
                        margin-top: 10rpx;
                    }
                    .container_b_img_box_input {
                        width: 686rpx;
                        height: 68rpx;
                        background: #FFFFFF;
                        border-radius: 48rpx;
                        margin-top: 90rpx;
                        display: flex;
                        align-items: center;
                        padding: 0 28rpx;
                        box-sizing: border-box;
                        image {
                            width: 32rpx;
                            height: 32rpx;
                            flex-shrink: 0;
                            margin-right: 12rpx;
                        }
                        input {
                            flex: 1;
                            height: 100%;
                            font-size: 28rpx;
                            color: black;
                        }
                    }
                }
            }
        }
        .container_c {
            width: 100%;
            padding: 32rpx;
            box-sizing: border-box;
            background-color: #FFFFFF;
            position: relative;
            top: -30rpx;
            border-radius: 32rpx 32rpx 0rpx 0rpx;
            .container_c_cate {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                .container_c_cate_item {
                    flex: 1;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    image {
                        width: 40rpx;
                        height: 40rpx;
                    }
                    text {
                        font-size: 28rpx;
                        font-family: PingFang SC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #333333;
                        margin-top: 28rpx;
                    }
                }
            }
            .container_c_list {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                flex-wrap: wrap;
                margin-top: 52rpx;
                .container_c_list_item {
                    width: 324rpx;
                    height: 136rpx;
                    border-radius: 10rpx;
                    position: relative;
                    margin-bottom: 36rpx;
                    overflow: hidden;
                    image {
                        width: 100%;
                        height: 100%;
                    }
                    text {
                        position: absolute;
                        top: 50%;
                        left: 50%;
                        transform: translate(-50%, -50%);
                        font-size: 36rpx;
                        font-family: PingFang SC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #FFFFFF;
                    }
                }
            }
        }
    }
</style>