<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="toSelectCity">
|
<image class="a" src="@/static/icon/home_ic_city@2x.png" mode="widthFix"></image>
|
<text>合肥市</text>
|
<image class="b" src="@/static/icon/home_ar_city@2x.png" mode="widthFix"></image>
|
</view>
|
</view>
|
</view>
|
<!-- 轮播 -->
|
<view class="container_banner">
|
<uni-swiper-dot :info="info" :current="current" field="content" mode="round">
|
<swiper class="swiper-box" @change="change">
|
<swiper-item v-for="(item, index) in 3" :key="index">
|
<view class="swiper-item">
|
<image src="@/static/images/home_banner.png" mode="aspectFill"></image>
|
</view>
|
</swiper-item>
|
</swiper>
|
</uni-swiper-dot>
|
</view>
|
<!-- 主体内容 -->
|
<view class="container_nav">
|
<!-- 导航 -->
|
<view class="container_nav_list">
|
<view class="container_nav_list_item" @click="jumpEncyclopedia">
|
<image src="@/static/icon/home_ic_baike@2x.png" mode="widthFix"></image>
|
<text>百科</text>
|
</view>
|
<view class="container_nav_list_item">
|
<image src="@/static/icon/home_ic_dingyue@2x.png" mode="widthFix"></image>
|
<text>订阅</text>
|
</view>
|
<view class="container_nav_list_item">
|
<image src="@/static/icon/home_ic_shangcheng@2x.png" mode="widthFix"></image>
|
<text>商城</text>
|
</view>
|
<view class="container_nav_list_item">
|
<image src="@/static/icon/home_ic_tandian@2x.png" mode="widthFix"></image>
|
<text>探店</text>
|
</view>
|
<view class="container_nav_list_item">
|
<image src="@/static/icon/Group 658@2x.png" mode="widthFix"></image>
|
<text>活动</text>
|
</view>
|
</view>
|
<!-- 推荐店铺 -->
|
<view class="container_nav_recommend">
|
<view class="label">
|
<text>推荐店铺</text>
|
<view class="label_right" @click="toStores">
|
<text>更多 ></text>
|
</view>
|
</view>
|
<view class="recommend">
|
<view class="recommend_left" @click="toStore">
|
<image src="@/static/uni.png"></image>
|
<view class="recommend_left_text">
|
<text>珈琲光景</text>
|
</view>
|
</view>
|
<view class="recommend_right">
|
<view class="recommend_right_item">
|
<image src="@/static/uni.png" mode="widthFix"></image>
|
<view class="recommend_right_item_wz">
|
<text>旺达</text>
|
</view>
|
</view>
|
<view class="recommend_right_item">
|
<image src="@/static/uni.png" mode="widthFix"></image>
|
<view class="recommend_right_item_wz">
|
<text>漫猫咖啡</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<!-- 发现趣事 -->
|
<view class="container_nav_fun">
|
<view class="label">
|
<text>发现趣事</text>
|
</view>
|
<view class="fun_list">
|
<view class="fun_list_item" @click="toShopDetails">
|
<view class="fun_list_item_img">
|
<image src="@/static/uni.png" mode="heightFix"></image>
|
</view>
|
<view class="fun_list_item_info">
|
<view class="fun_list_item_info_top">
|
<text>飞盘之后,新中产又被围炉煮茶割韭菜?飞盘之后,新中产又</text>
|
</view>
|
<view class="fun_list_item_info_bottom">
|
<view class="fun_list_item_info_bottom_left">
|
<image src="@/static/logo.png" mode="widthFix"></image>
|
<text>林之秋</text>
|
</view>
|
<view class="fun_list_item_info_bottom_right">
|
<image src="@/static/icon/home_ic_shoucang@2x.png" mode="widthFix"></image>
|
<text>389</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
data() {
|
return {
|
info: [{
|
content: '内容 A'
|
}, {
|
content: '内容 B'
|
}, {
|
content: '内容 C'
|
}],
|
current: 0
|
}
|
},
|
computed: {
|
...mapState(['statusbarHeight', 'navHeight'])
|
},
|
methods: {
|
change(e) {
|
this.current = e.detail.current;
|
},
|
toSelectCity() {
|
uni.navigateTo({
|
url: '/pages/selectCity/index'
|
});
|
},
|
jumpEncyclopedia() {
|
uni.navigateTo({
|
url: '/pages/coffeeEncyclopedia/index'
|
});
|
},
|
toStores() {
|
uni.navigateTo({
|
url: '/pages/recommendedStores/index'
|
});
|
},
|
toStore() {
|
uni.navigateTo({
|
url: '/pages/storeDetails/index'
|
});
|
},
|
toShopDetails() {
|
uni.navigateTo({
|
url: '/pages/shopDetails/index'
|
});
|
}
|
},
|
onReachBottom(){
|
console.log('触底加载更多')
|
}
|
}
|
</script>
|
|
<style>
|
page {
|
background-color: #F5F5F5 !important;
|
}
|
</style>
|
|
<style lang="scss" scoped>
|
.container {
|
width: 100%;
|
background-color: #F5F5F5;
|
.container_h {
|
width: 100%;
|
height: auto;
|
// background-color: #ffffff;
|
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;
|
background-color: rgba(0, 0, 0, 0);
|
.container_head_address {
|
display: flex;
|
align-items: center;
|
justify-content: flex-start;
|
.a {
|
width: 22rpx;
|
height: 26rpx;
|
}
|
.b {
|
width: 16rpx;
|
height: 8rpx;
|
}
|
text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: rgba(255,255,255,0.7);
|
margin: 0 8rpx;
|
}
|
}
|
}
|
}
|
.container_banner /deep/ {
|
width: 100%;
|
height: 606rpx;
|
.uni-swiper__warp {
|
width: 100%;
|
height: 100%;
|
}
|
.swiper-box {
|
width: 100%;
|
height: 100%;
|
.swiper-item {
|
width: 100%;
|
height: 100%;
|
image {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
}
|
}
|
.container_nav {
|
width: 100%;
|
box-sizing: border-box;
|
position: relative;
|
top: -120rpx;
|
left: 0;
|
padding: 0 32rpx;
|
.container_nav_list {
|
width: 100%;
|
height: 160rpx;
|
box-sizing: border-box;
|
background-color: #ffffff;
|
border-radius: 16rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.container_nav_list_item {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
image {
|
width: 60rpx !important;
|
height: 60rpx !important;
|
margin-bottom: 20rpx;
|
}
|
text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #333333;
|
}
|
}
|
}
|
.container_nav_recommend {
|
margin-top: 44rpx;
|
width: 100%;
|
.label {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-bottom: 24rpx;
|
text {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
.label_right {
|
display: flex;
|
align-items: center;
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
}
|
}
|
}
|
.recommend {
|
width: 100%;
|
height: 368rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.recommend_left {
|
width: 336rpx;
|
height: 100%;
|
overflow: hidden;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
position: relative;
|
border-radius: 10rpx;
|
image {
|
height: 100%;
|
}
|
.recommend_left_text {
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
width: 100%;
|
height: 56rpx;
|
line-height: 56rpx;
|
padding: 0 24rpx;
|
box-sizing: border-box;
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
background: rgba(0,0,0,0.3);
|
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
text {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #FFFFFF;
|
}
|
}
|
}
|
.recommend_right {
|
width: 328rpx;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
flex-direction: column;
|
.recommend_right_item {
|
width: 100%;
|
height: 172rpx;
|
position: relative;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
overflow: hidden;
|
border-radius: 10rpx;
|
image {
|
width: 100%;
|
}
|
.recommend_right_item_wz {
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
width: 100%;
|
height: 56rpx;
|
line-height: 56rpx;
|
padding: 0 24rpx;
|
box-sizing: border-box;
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
background: rgba(0,0,0,0.3);
|
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
text {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #FFFFFF;
|
}
|
}
|
}
|
}
|
}
|
}
|
.container_nav_fun {
|
width: 100%;
|
margin-top: 44rpx;
|
.label {
|
width: 100%;
|
text {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
}
|
.fun_list {
|
width: 100%;
|
margin-top: 24rpx;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
.fun_list_item {
|
width: 332rpx;
|
height: 580rpx;
|
border-radius: 20rpx;
|
background-color: white;
|
overflow: hidden;
|
.fun_list_item_img {
|
width: 100%;
|
height: 420rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
overflow: hidden;
|
image {
|
height: 100%;
|
}
|
}
|
.fun_list_item_info {
|
width: 100%;
|
padding: 16rpx 12rpx 24rpx 12rpx;
|
box-sizing: border-box;
|
display: flex;
|
flex-direction: column;
|
.fun_list_item_info_top {
|
width: 100%;
|
-webkit-line-clamp: 2;
|
display: -webkit-box;
|
-webkit-box-orient: vertical;
|
text-overflow: ellipsis;
|
overflow: hidden;
|
text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #333333;
|
}
|
}
|
.fun_list_item_info_bottom {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 15rpx;
|
.fun_list_item_info_bottom_left {
|
display: flex;
|
align-items: center;
|
image {
|
width: 32rpx;
|
height: 32rpx;
|
border-radius: 50%;
|
margin-right: 6rpx;
|
}
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #999999;
|
}
|
}
|
.fun_list_item_info_bottom_right {
|
display: flex;
|
align-items: center;
|
image {
|
width: 24rpx;
|
height: 24rpx;
|
margin-right: 6rpx;
|
}
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #999999;
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|