|
@@ -5,7 +5,7 @@
|
|
|
<div class="logo"><img src="../../assets/img/antiques-logo.png" alt=""></div>
|
|
|
<div class="search-con">
|
|
|
<img src="../../assets/img/search-bg.png" alt="">
|
|
|
- <input class="text" :placeholder="placeholder" v-model="keyword" @focus="placeholder= ''" @blur="placeholder='搜索文物名称'" type="text" />
|
|
|
+ <input @keydown.enter="getSearch" class="text" :placeholder="placeholder" v-model="keyword" @focus="placeholder= ''" @blur="placeholder='搜索文物名称'" type="text" />
|
|
|
<button class="search" @click="getSearch()"></button>
|
|
|
</div>
|
|
|
<ul class="classify">
|
|
@@ -60,7 +60,6 @@
|
|
|
<template v-else>
|
|
|
<div class="no-result">
|
|
|
<img src="../../assets/img/nothing.png" alt />
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -113,9 +112,17 @@ export default {
|
|
|
this.list = temp.slice((this.currentPage-1)*8,this.currentPage*8);
|
|
|
this.total = temp.length
|
|
|
},
|
|
|
+
|
|
|
+ getClassifyList(){
|
|
|
+ let res = this.classsifyData
|
|
|
+ this.$store.commit('getList',res);
|
|
|
+ this.list = res.slice((this.currentPage-1)*8,this.currentPage*8);
|
|
|
+ this.total = res.length;
|
|
|
+ },
|
|
|
getClassify(name,i) {
|
|
|
this.activeIdx = i;
|
|
|
this.currentPage = 1;
|
|
|
+ this.keyword = ''
|
|
|
if(name=='全部文物'){
|
|
|
this.list = this.ALL.slice((this.currentPage-1)*8,this.currentPage*8);
|
|
|
this.total = this.ALL.length;
|
|
@@ -160,7 +167,6 @@ export default {
|
|
|
method: "get",
|
|
|
url: `data.json`
|
|
|
});
|
|
|
- console.log(res.list)
|
|
|
this.ALL = res.list;
|
|
|
this.show = true;
|
|
|
this.$store.commit('getList',res.list);
|
|
@@ -173,11 +179,9 @@ export default {
|
|
|
/* total() {
|
|
|
this.total = this.list.length;
|
|
|
}, */
|
|
|
- "$route.query": function(newVal) {
|
|
|
- this.getList(newVal)
|
|
|
- },
|
|
|
+
|
|
|
currentPage(){
|
|
|
- this.getList()
|
|
|
+ this.getClassifyList()
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|