master V0.0.1
yujialong 6 months ago
parent b7eefb55ee
commit 965fc99474
  1. 55
      pages/index/index.vue

@ -2,9 +2,13 @@
<view :class="[{oh: !per}]">
<view class="page">
<!-- <view class="bg"></view> -->
<view class="search-wrap" :style="{paddingRight: menuBtnInfo.width + 8 + 'px', paddingTop: menuBtnInfo.top + 'px'}">
<image class="logo" src="http://124.71.79.122/images/logo2.png" mode="widthFix"></image>
<uni-search-bar class="search" radius="30" placeholder="请输入" v-model="keyword" clearButton="auto" cancelButton="none" @confirm="initList" />
<view :class="['search-wrap', {expand}]" :style="{paddingRight: menuBtnInfo.width + 8 + 'px', paddingTop: menuBtnInfo.top + 'px'}">
<view class="platform">
<image class="logo" src="http://124.71.79.122/images/logo2.png" mode="widthFix"></image>
<text class="name">幼教产业B2B产业平台</text>
</view>
<uni-icons class="icon" type="search" size="22" color="#fff" @click="showSearch"></uni-icons>
<uni-search-bar class="search-bar" ref="searchBar" radius="30" placeholder="请输入" :focus="expand" v-model="keyword" clearButton="auto" cancelButton="none" @confirm="initList" @clear="clearKeyword" />
</view>
<view class="banner">
@ -116,6 +120,7 @@
scrollLeft: 0,
headerTop: 0,
menuBtnInfo: {},
expand: false
}
},
//
@ -246,6 +251,16 @@
this.hots = data.records
}).catch(e => {})
},
// keyword
showSearch() {
this.expand = true
},
// keyword
clearKeyword() {
this.expand = false
this.keyword = ''
this.initList()
},
//
bannerChange(e) {
this.curBanner = e.detail.current;
@ -279,11 +294,6 @@
}
}
},
// keyword
clearKeyword() {
this.keyword = ''
this.initList()
},
//
toDetail(item) {
@ -355,13 +365,42 @@
/deep/.search-wrap {
padding-bottom: 30rpx;
background-color: $uni-primary;
.platform {
display: inline-flex;
align-items: center;
}
.logo {
width: 70rpx;
margin: 0 10rpx 0 10rpx;
}
.name {
font-size: 28rpx;
color: #fff;
}
.icon {
margin-right: 20rpx;
}
.search-bar {
display: none;
width: 0;
height: 0;
transition: .5s;
overflow: hidden;
}
.uni-searchbar {
padding: 0 10rpx !important;
}
&.expand {
.icon, .name {
display: none;
}
.search-bar {
flex: 1;
display: block;
width: auto;
height: auto;
}
}
}
.banner {
position: relative;

Loading…
Cancel
Save