|
@@ -10,9 +10,16 @@
|
|
|
<view class="input-view">
|
|
|
<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
|
|
|
<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词"
|
|
|
- @confirm="confirm" @focus="focus" />
|
|
|
+ @confirm="confirm" @focus="isTag = true" @blur="isTag = false" />
|
|
|
</view>
|
|
|
</uni-nav-bar>
|
|
|
+ <view v-if="isTag" class="tagMask" :style="{'height': makerHeigth + 'px', 'top': statusBarH + customBarH + 'px' }">
|
|
|
+ <uni-card title="热门标签">
|
|
|
+ <view class="cardBox">
|
|
|
+ <uni-tag class="tag" v-for="(item, index) in tagList" :key="index" :text="item.name"/>
|
|
|
+ </view>
|
|
|
+ </uni-card>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -20,13 +27,30 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ isTag: false,
|
|
|
statusBarH: 0,
|
|
|
customBarH: 0,
|
|
|
+ screenHeight: 0,
|
|
|
+ makerHeigth: 0,
|
|
|
index: 0,
|
|
|
array: [
|
|
|
{ name: '文章', code: 0 },
|
|
|
{ name: '期刊', code: 1 }
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ tagList: [
|
|
|
+ { name: '标签1', code: '1' },
|
|
|
+ { name: '标签2', code: '2' },
|
|
|
+ { name: '标签3', code: '3' },
|
|
|
+ { name: '标签10', code: '4' },
|
|
|
+ { name: '标签20', code: '5' },
|
|
|
+ { name: '标签30', code: '6' },
|
|
|
+ { name: '标签13', code: '7' },
|
|
|
+ { name: '标签25', code: '8' },
|
|
|
+ { name: '标签39', code: '9' },
|
|
|
+ { name: '标签17', code: '10' },
|
|
|
+ { name: '标签25', code: '11' },
|
|
|
+ { name: '标签34', code: '12' }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -38,17 +62,16 @@
|
|
|
// 搜索
|
|
|
confirm(e) {
|
|
|
console.log('搜索');
|
|
|
- },
|
|
|
- // 聚焦
|
|
|
- focus(e) {
|
|
|
- console.log('聚焦');
|
|
|
+ this.isTag = false;
|
|
|
}
|
|
|
},
|
|
|
// 获取状态栏和导航条高度
|
|
|
created() {
|
|
|
const app = getApp()
|
|
|
- this.statusBarH = app.globalData.statusBarH
|
|
|
- this.customBarH = app.globalData.customBarH - this.statusBarH
|
|
|
+ this.statusBarH = app.globalData.statusBarH;
|
|
|
+ this.customBarH = app.globalData.customBarH - this.statusBarH;
|
|
|
+ this.screenHeight = app.globalData.screenHeight;
|
|
|
+ this.makerHeigth = this.screenHeight - app.globalData.customBarH;
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -101,4 +124,19 @@ $nav-height: 30px;
|
|
|
font-size: 12px;
|
|
|
background-color: #f8f8f8;
|
|
|
}
|
|
|
+ .tagMask {
|
|
|
+ width: 100vw;
|
|
|
+ // height: 100vh;
|
|
|
+ background: #fff;
|
|
|
+ position: fixed;
|
|
|
+ // top: 0;
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+ .cardBox {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .tag {
|
|
|
+ margin: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|