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

@ -2,9 +2,13 @@
<view :class="[{oh: !per}]"> <view :class="[{oh: !per}]">
<view class="page"> <view class="page">
<!-- <view class="bg"></view> --> <!-- <view class="bg"></view> -->
<view class="search-wrap" :style="{paddingRight: menuBtnInfo.width + 8 + 'px', paddingTop: menuBtnInfo.top + 'px'}"> <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> <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" /> <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>
<view class="banner"> <view class="banner">
@ -116,6 +120,7 @@
scrollLeft: 0, scrollLeft: 0,
headerTop: 0, headerTop: 0,
menuBtnInfo: {}, menuBtnInfo: {},
expand: false
} }
}, },
// //
@ -246,6 +251,16 @@
this.hots = data.records this.hots = data.records
}).catch(e => {}) }).catch(e => {})
}, },
// keyword
showSearch() {
this.expand = true
},
// keyword
clearKeyword() {
this.expand = false
this.keyword = ''
this.initList()
},
// //
bannerChange(e) { bannerChange(e) {
this.curBanner = e.detail.current; this.curBanner = e.detail.current;
@ -279,11 +294,6 @@
} }
} }
}, },
// keyword
clearKeyword() {
this.keyword = ''
this.initList()
},
// //
toDetail(item) { toDetail(item) {
@ -355,13 +365,42 @@
/deep/.search-wrap { /deep/.search-wrap {
padding-bottom: 30rpx; padding-bottom: 30rpx;
background-color: $uni-primary; background-color: $uni-primary;
.platform {
display: inline-flex;
align-items: center;
}
.logo { .logo {
width: 70rpx; width: 70rpx;
margin: 0 10rpx 0 10rpx; 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 { .uni-searchbar {
padding: 0 10rpx !important; padding: 0 10rpx !important;
} }
&.expand {
.icon, .name {
display: none;
}
.search-bar {
flex: 1;
display: block;
width: auto;
height: auto;
}
}
} }
.banner { .banner {
position: relative; position: relative;

Loading…
Cancel
Save