Commit aa911f30 authored by Damon's avatar Damon

feat: 搜索缺省页

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