|
|
@@ -1,17 +1,34 @@
|
|
|
<template>
|
|
|
<div class="result-title text-muted">
|
|
|
- 搜索"<span class="text-inverse" >{{keyword}}</span>",为您找到
|
|
|
- <span class="text-num" v-text="good_list.total"></span> 个相关产品:
|
|
|
+ 搜索"<span class="text-inverse" >{{keyword}}</span>"<span v-if="status != 1">暂无结果</span>
|
|
|
+ <span v-if="status != 3">,为您找到
|
|
|
+ <span class="text-num" v-text="good_list.total"></span> 个<span v-if="status == 2">相关</span>产品</span>:
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
export default{
|
|
|
- props: ['keyword'],
|
|
|
+ props: ['keyword', 'page'],
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ status: 1
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: {
|
|
|
good_lists () {
|
|
|
return this.$store.state.searchData.searchList.lists
|
|
|
},
|
|
|
good_list () {
|
|
|
+ if (this.page === 1) {
|
|
|
+ if (this.good_lists.data.components && this.good_lists.data.components.length > 0) {
|
|
|
+ if (this.keyword === this.good_lists.data.components[0].code) {
|
|
|
+ this.status = 1
|
|
|
+ } else {
|
|
|
+ this.status = 2
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.status = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
return this.good_lists.data
|
|
|
}
|
|
|
}
|