|
@@ -1,10 +1,16 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
+ <!-- 吸顶搜索框 -->
|
|
|
+ <view class="sticky" v-if="flag">
|
|
|
+ <input type="text" placeholder="请输入搜索内容">
|
|
|
+ </view>
|
|
|
<!-- 轮播图 -->
|
|
|
<view class="slideshow">
|
|
|
<view class="wrap">
|
|
|
- <u-search color="black" search-icon-color="#fff" placeholder-color="#fff" bg-color="#8a7170"
|
|
|
- placeholder="请输入搜索内容" :show-action="false" input-align="center"></u-search>
|
|
|
+ <view class="search-box">
|
|
|
+ <u-search color="black" search-icon-color="#fff" placeholder-color="#fff" bg-color="#8a7170"
|
|
|
+ placeholder="请输入搜索内容" :show-action="false" input-align="center"></u-search>
|
|
|
+ </view>
|
|
|
<u-swiper mode="none" :list="list" :title="true" height="422"></u-swiper>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -103,6 +109,8 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ flag:false,
|
|
|
+ scrollTop:"",
|
|
|
list: [{
|
|
|
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
|
|
|
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
|
|
@@ -120,8 +128,22 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
- }
|
|
|
+ onPageScroll(e) {
|
|
|
+ this.scrollTop = e.scrollTop;
|
|
|
+ console.log(this.scrollTop);
|
|
|
+ if(this.scrollTop>=200){
|
|
|
+ this.flag=true;
|
|
|
+ } else{
|
|
|
+ this.flag=false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -129,20 +151,31 @@
|
|
|
page{
|
|
|
padding-bottom: 50px;
|
|
|
}
|
|
|
- .u-search {
|
|
|
- position: absolute;
|
|
|
- top: 14px;
|
|
|
- left: 20px;
|
|
|
- right: 20px;
|
|
|
- line-height: 32px;
|
|
|
- border-radius: 8px;
|
|
|
- color: #ffffff !important;
|
|
|
- opacity: 0.4;
|
|
|
- z-index: 99;
|
|
|
-
|
|
|
+ .sticky{
|
|
|
+ width: 100%;
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ z-index: 100;
|
|
|
+ border-bottom:1px solid #fff ;
|
|
|
+ padding: 16rpx 40rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ uni-input{
|
|
|
+ background-color: #E8E8E8;
|
|
|
+ height: 32px;
|
|
|
+ line-height: 32px;
|
|
|
+ border-radius: 8px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- /deep/.uni-input-placeholder {
|
|
|
+ .u-search {
|
|
|
+
|
|
|
+
|
|
|
+/deep/.uni-input-placeholder {
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
@@ -150,6 +183,19 @@
|
|
|
color: #ffffff !important;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+ }
|
|
|
+.search-box{
|
|
|
+ width: 100%;
|
|
|
+ background-color:#4F3C27;
|
|
|
+ padding: 16rpx 40rpx;
|
|
|
+ position: absolute;
|
|
|
+ line-height: 32px;
|
|
|
+ color: #ffffff !important;
|
|
|
+ opacity: 0.4;
|
|
|
+ z-index: 999;
|
|
|
+ opacity: 0.4;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// 公告
|
|
|
.notice {
|