You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

283 lines
8.2 KiB

4 years ago
<template>
<view class="content">
<!--nav bar-->
<view class="navbar">
<view class="navbar-fixed">
<!-- statusHeight 状态栏的高度 蓝色区块-->
<view class="statusHeight" :style="{ height: statusBarHeight + 'px' }"></view>
<!-- navcontent tabbar导航栏高度 绿色区块-->
<view class="navcontent" :style="{ height: navBarHeight + 'px' }">
<view class="iconfont icon-arrow-left-bold"></view>
<view class="input-view">
<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm">
</view>
</view>
</view>
<!-- 占位盒子 它的高度=状态栏高度+导航栏高度-->
<view class="placeholder" :style="{ height: navBarHeight + statusBarHeight + 'px', background: 'red' }"></view>
<view class="termBox">
<view class="termOuter">
<view class="termCol cur">综合排序<text class="iconfont icon-arrowbottom"></text></view>
<view class="termCol">距离最近<text class="iconfont icon-arrowbottom"></text></view>
<view class="termCol">优质商户<text class="iconfont icon-arrowbottom"></text></view>
<view class="termCol">筛选<text class="iconfont icon-filter"></text></view>
</view>
</view>
<view class="shopContent">
<scroll-view scroll-y class="scroll-y-item">
<!--为您推荐-->
<view class="introBox hasMenu">
<view class="intro_column" @tap="gotoDetail">
<view class="imgOuter"><image mode="aspectFill" src="../../static/rishang.png"></image><view class="i_intro">推荐</view></view>
<view class="columnInfo">
<view class="title">孕育邦孕妈妈摄影体验</view>
<view class="discuss">
<view class="starBox">
<image mode="heightFix" src="../../static/icon_detail_star_pre@2x.png"></image>
<image mode="heightFix" src="../../static/icon_detail_star_pre@2x.png"></image>
<image mode="heightFix" src="../../static/icon_detail_star_pre@2x.png"></image>
<image mode="heightFix" src="../../static/icon_detail_star_nor@2x.png"></image>
<image mode="heightFix" src="../../static/icon_detail_star_nor@2x.png"></image>
</view>
</view>
<view class="subInfo">2020/12/11 14:00</view>
<view class="subInfo">苏州·园区星海街188号园区星海街188号苏州·园区星海街188号园区星海街188号</view>
<view class="menu"><text class="hui"></text>时光印记孕妈妈摄影体验套餐</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<!--nav end-->
</view>
</template>
<script>
export default {
data() {
return {
statusBarHeight:20,//状态栏的高度系统默认20px
menuBarHeight:32,//微信胶囊的高度
navBarHeight:44,//uniapp 默认的高度是44这里默认高度也就是H5导航栏的高度 根据公式计算的高度不是固定值44
}
},
onLoad(){
//获取系统信息 具体信息请转至 https://uniapp.dcloud.io/api/system/info
let res = uni.getSystemInfoSync();
console.log('状态栏的高度', res.statusBarHeight);
this.statusBarHeight = res.statusBarHeight;
// #ifdef MP-WEIXIN
//获取胶囊位置信息
let menuBottonInfo = uni.getMenuButtonBoundingClientRect();
//微信胶囊的高度
this.menuBarHeight = menuBottonInfo.height;
// 胶囊底部 - 状态栏 + 胶囊顶部 - 状态栏 = 导航栏的高度(胶囊距离顶部的距离+胶囊距离底部距离+胶囊自身的高度)
this.navBarHeight = menuBottonInfo.bottom - res.statusBarHeight + (menuBottonInfo.top - res.statusBarHeight);
// #endif
},
methods: {
}
}
</script>
<style>
page{
height:100%;
display:flex
}
</style>
<style lang="scss" scoped>
.navbar {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
.navbar-fixed {
position: fixed;
top: 0;
left: 0;
z-index: 99;
width: 100%;
background-color: #fff;
.statusHeight {
background-color: #fff;
}
.navcontent {
background-color: #fff;
display: flex;
justify-content: flex-start;
align-items: center;
align-content: center;
.iconfont{
margin:0 20rpx;
font-size:40rpx;
color:#333;
}
}
}
.shopContent {
box-sizing: border-box;
height: 100%;
flex: 1;
overflow: hidden;
}
.scroll-y-item {
height: 100%;
}
}
.input-view {
line-height: 64rpx;
width: 450rpx;
height: 64rpx;
background: #EEEEEE;
border-radius: 32rpx;
font-size: 28rpx;
color:#333;
box-sizing: border-box;
position: relative;
.nav-bar-input{
position: absolute;
width:100%;
height:100%;
top:0;
left:0;
padding: 0 30rpx;
box-sizing: border-box;
}
}
.introBox{
width:710rpx;
margin:20rpx auto 0 auto;
border-radius: 16rpx;
background: #fff;
padding:0 24rpx;
box-sizing: border-box;
}
.introBox .intro_column:last-child{border-bottom:none;}
.intro_column{
display: flex;
justify-content: flex-start;
padding:20rpx 0;
border-bottom:2rpx solid #EAEAEA;
.imgOuter{
width: 200rpx;
height:160rpx;
position: relative;
image{width:200rpx;height:160rpx;border-radius:5rpx;}
.i_intro{position: absolute;top:0;left:0;width: 68rpx;height: 32rpx;background: #FF578A;border-radius: 5rpx 0px 18rpx 5rpx;font-size: 22rpx;font-weight: 400;color: #FFFFFF;line-height: 32rpx;text-align: center;}
}
.columnInfo{
width:360rpx;
margin-left:22rpx;
.discuss{margin:13rpx 0!important;}
.menu{
font-size:24rpx;
color:#333;
margin-top:20rpx;
.hui{margin-right:8rpx;display: inline-block;width: 30rpx;height: 30rpx;background: #FF753E;border-radius: 2rpx;font-size:22rpx;color: #FFFFFF;text-align: center;line-height:30rpx;}
}
.title{
width:100%;
font-size:30rpx;
font-weight:bold;
color:#333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tags text{
height: 28rpx;
background: rgba(255,177,62,0.1);
border-radius: 4rpx;
line-height:28rpx;
font-size:20rpx;
padding: 0 10rpx;
margin-right:10rpx;
color:#FF753E;
}
.subInfo{
width:100%;
font-size:24rpx;
color:#999;
font-weight:400;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-top:5rpx;
.font_red{margin-left:10rpx;}
}
.price{
display: flex;
justify-content: flex-start;
align-items: center;
align-content: center;
margin-top:8rpx;
text{margin-right:10rpx;}
.shareMoney{
height: 28rpx;
border:2rpx solid #FF578A;
border-radius: 4rpx;
line-height:28rpx;
font-size:20rpx;
margin-right:10rpx;
padding-right:10rpx;
color:#FF578A;
display: flex;
flex-direction: flex-start;
text{background: #FF578A;color:#fff;padding: 0 10rpx;}
}
.free{
height: 28rpx;
background: #FF753E;
border-radius: 4rpx;
line-height:28rpx;
font-size:20rpx;
padding: 0 10rpx;
margin-right:10rpx;
color:#fff;
}
}
}
}
.termBox{
width: 750rpx;
height: 100rpx;
background:#fff;
.termOuter{
display: flex;
align-items: center;
align-content: center;
justify-content: flex-start;
.termCol{
width:27%;
text-align:center;
font-size: 28rpx;
font-weight: 400;
color: #333333;
padding-top:36rpx;
.iconfont{font-size: 24rpx;color: #666666;line-height:28rpx;margin-left:8rpx;}
}
.termCol.cur{
color:#FF578A;
.iconfont{color: #FF578A;}
}
.termCol:last-child{width:19%;}
}
}
.discuss{
display: flex;justify-content: flex-start;margin:25rpx 0;position: relative;align-items: center;align-content: center;
.dis_l{font-size:28rpx;color:#333;font-weight: 500;padding-top:5rpx;margin-right: 32rpx;}
.starBox{
display: flex;
justify-content: flex-start;
image{display: block;width:26rpx;height:26rpx;margin-right:8rpx;}
}
}
</style>