Commit aa911f30 authored by Damon's avatar Damon

feat: 搜索缺省页

parent c25fd006
<template>
<view class="search">
<view class="u-flex search">
<u-navbar
back-icon-color="#333333"
background="transparent"
......@@ -19,7 +19,9 @@
@custom="search"
@search="search"
></u-search>
</view>
<view v-show="lists.length > 0">
<view class="title"
>共找到含有<text>“{{ keyword }}”</text>相关试题<text>10</text>道</view
>
......@@ -76,6 +78,15 @@
</u-collapse>
</view>
</view>
<view class="u-flex default" v-show="lists.length === 0">
<view>
<image :src="defaultImg" />
</view>
<view class="no-result">
当前暂无搜索结果
</view>
</view>
</view>
</template>
......@@ -92,7 +103,8 @@ export default {
itemStyle: {
background: '#fff',
padding: '0rpx 20rpx',
margin: '20rpx 0',
margin: '10rpx 0',
'border-radius': '30rpx 30rpx 0 0'
},
titleType: ['单选题', '判断题', '多选题'],
keyword: '',
......@@ -202,7 +214,11 @@ export default {
onLoad(e) {
this.keyword = e ? decodeURIComponent(e.keyword) : ''
},
computed: {},
computed: {
defaultImg() {
return process.uniEnv.qn_base_url + 'no-search.png'
},
},
methods: {
itemChange(e) {
this.arrIndex = e.show ? e.index : null
......@@ -234,17 +250,24 @@ export default {
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%);
background-size: 100% 520rpx;
background-repeat: no-repeat;
padding: 0 20rpx;
.search-bar {
width: 100%;
padding: 0 20rpx;
}
.title {
width: 100%;
color: #191c27;
font-size: 32rpx;
font-weight: bold;
margin-top: 30rpx;
padding: 0 20rpx;
text {
color: #2953ff;
}
}
.result {
margin-top: 30rpx;
width: 100%;
.head {
width: 100%;
height: 60rpx;
......@@ -292,7 +315,7 @@ export default {
}
}
.opera {
padding: 20rpx 0;
padding: 30rpx 0;
justify-content: space-between;
color: #5a6073;
font-size: 28rpx;
......@@ -312,5 +335,14 @@ export default {
}
}
}
.default {
flex-flow: column;
flex: 1;
justify-content: center;
.no-result {
color: #9EA5BB;
font-size: 28rpx;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment