<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>
|