|
@@ -30,18 +30,18 @@ const useSearch = defineStore({
|
|
|
},
|
|
},
|
|
|
async setSearchLis(data) {
|
|
async setSearchLis(data) {
|
|
|
this.q = data
|
|
this.q = data
|
|
|
- console.log('5555', this.page);
|
|
|
|
|
|
|
+ // console.log('5555', this.page);
|
|
|
|
|
|
|
|
if (this.searchText.length > 0) {
|
|
if (this.searchText.length > 0) {
|
|
|
this.page = 1
|
|
this.page = 1
|
|
|
- await getGameList({ type: this.type, tag_id: this.tag_id, page: this.page, pagesize: this.pagesize, q: this.q }).then(res => {
|
|
|
|
|
|
|
+ await getGameList({ type: this.type, tag_id: this.tag_id, page: this.page, pagesize: this.pagesize, keywords: this.q }).then(res => {
|
|
|
if (res.data.code === 200 && res.data.data) {
|
|
if (res.data.code === 200 && res.data.data) {
|
|
|
// console.log('res', res);
|
|
// console.log('res', res);
|
|
|
this.prefix = res.data.data.prefix
|
|
this.prefix = res.data.data.prefix
|
|
|
this.total = res.data.data.total
|
|
this.total = res.data.data.total
|
|
|
this.searchLis = []
|
|
this.searchLis = []
|
|
|
this.searchLis = this.searchLis.concat(res.data.data.lists.filter(item => item.screen_name.includes(this.q)))
|
|
this.searchLis = this.searchLis.concat(res.data.data.lists.filter(item => item.screen_name.includes(this.q)))
|
|
|
- console.log('this.searchLis', this.searchLis);
|
|
|
|
|
|
|
+ // console.log('this.searchLis', this.searchLis);
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
Message.error(err.data.msg)
|
|
Message.error(err.data.msg)
|
|
@@ -49,14 +49,14 @@ const useSearch = defineStore({
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
// console.log(222);
|
|
// console.log(222);
|
|
|
- await getGameList({ type: this.type, tag_id: this.tag_id, page: this.page, pagesize: this.pagesize, q: this.q }).then(res => {
|
|
|
|
|
|
|
+ await getGameList({ type: this.type, tag_id: this.tag_id, page: this.page, pagesize: this.pagesize, keywords: this.q }).then(res => {
|
|
|
if (res.data.code === 200 && res.data.data) {
|
|
if (res.data.code === 200 && res.data.data) {
|
|
|
- console.log('res', res);
|
|
|
|
|
|
|
+ // console.log('res', res);
|
|
|
this.prefix = res.data.data.prefix
|
|
this.prefix = res.data.data.prefix
|
|
|
this.total = res.data.data.total
|
|
this.total = res.data.data.total
|
|
|
- if(this.isClean) this.searchLis = []
|
|
|
|
|
|
|
+ if(this.isClean) this.searchLis = []
|
|
|
this.searchLis = this.searchLis.concat(res.data.data.lists)
|
|
this.searchLis = this.searchLis.concat(res.data.data.lists)
|
|
|
- console.log('searchLis====>', this.searchLis);
|
|
|
|
|
|
|
+ // console.log('searchLis====>', this.searchLis);
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
Message.error(err.data.msg)
|
|
Message.error(err.data.msg)
|