更新代码
This commit is contained in:
parent
4ec188968d
commit
caea0aeb6c
|
|
@ -44,7 +44,7 @@
|
||||||
"path" : "pages/index/search/index",
|
"path" : "pages/index/search/index",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : ""
|
"navigationBarTitleText" : "搜索"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,84 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
|
<u-sticky :enable="true">
|
||||||
|
<view class="search-box">
|
||||||
|
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" :focus="true" :show-action="true"
|
||||||
|
:animation="true" action-text="取消" @custom="goBack()" @search="doSearch(false)"></u-search>
|
||||||
|
</view>
|
||||||
|
</u-sticky>
|
||||||
|
</view>
|
||||||
|
<view class="search-keyword">
|
||||||
|
<view class="keyword-block" v-if="datas.hotKeywordList.length !=0">
|
||||||
|
<view class="keyword-list-header">
|
||||||
|
<view>热搜</view>
|
||||||
|
</view>
|
||||||
|
<view class="keyword" v-if="forbid==''">
|
||||||
|
<view v-for="(keyword,index) in datas.hotKeywordList" @tap="doSearchs(keyword)" :key="index"
|
||||||
|
v-if="keyword">
|
||||||
|
{{keyword}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="hide-hot-tis" v-else>
|
||||||
|
<view>当前搜热已隐藏</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import {
|
||||||
data() {
|
reactive
|
||||||
return {
|
} from 'vue';
|
||||||
|
import {
|
||||||
}
|
onShow
|
||||||
},
|
} from '@dcloudio/uni-app'
|
||||||
methods: {
|
let datas = reactive({
|
||||||
|
hotKeywordList: [], //热搜
|
||||||
|
})
|
||||||
|
onShow(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
function getList() {
|
||||||
|
if (uni.getStorageSync('moreSearch')) {
|
||||||
|
datas.hotKeywordList = (uni.getStorageSync('moreSearch')).split(',')
|
||||||
|
} else {
|
||||||
|
datas.hotKeywordList = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style scoped lang="scss">
|
||||||
|
.search-box {
|
||||||
|
width: 100%;
|
||||||
|
/* background-color: rgb(242, 242, 242); */
|
||||||
|
padding: 15upx 2.5%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
// position: sticky;
|
||||||
|
// top: 0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-keyword {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyword-block {
|
||||||
|
padding: 10upx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyword-block .keyword-list-header {
|
||||||
|
width: 94%;
|
||||||
|
padding: 10upx 3%;
|
||||||
|
font-size: 27upx;
|
||||||
|
color: #333;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyword-block .keyword-list-header image {
|
||||||
|
width: 40upx;
|
||||||
|
height: 40upx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue