Explorar o código

游戏搜索传参修改

zhangxing %!s(int64=3) %!d(string=hai) anos
pai
achega
ab2a189a0c

+ 0 - 1
README.md

@@ -1 +0,0 @@
-# Vue 3 + TypeScript + Vite

+ 5 - 0
index.html

@@ -21,6 +21,11 @@
       min-height: 100vh;
       margin: 0 auto;
     }
+
+    .el-message {
+      min-width: 200px !important;
+      border-radius: 5px !important;
+    }
   </style>
 </head>
 

+ 7 - 7
src/store/search.ts

@@ -30,18 +30,18 @@ const useSearch = defineStore({
         },
         async setSearchLis(data) {
             this.q = data
-            console.log('5555', this.page);
+            // console.log('5555', this.page);
 
             if (this.searchText.length > 0) {
                 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) {
                         // console.log('res', res);
                         this.prefix = res.data.data.prefix
                         this.total = res.data.data.total
                         this.searchLis = []
                         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 => {
                     Message.error(err.data.msg)
@@ -49,14 +49,14 @@ const useSearch = defineStore({
             }
             else {
                 // 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) {
-                        console.log('res', res);
+                        // console.log('res', res);
                         this.prefix = res.data.data.prefix
                         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)
-                        console.log('searchLis====>', this.searchLis);
+                        // console.log('searchLis====>', this.searchLis);
                     }
                 }).catch(err => {
                     Message.error(err.data.msg)

+ 2 - 2
src/utils/Message.ts

@@ -2,9 +2,9 @@ import { ElMessage } from 'element-plus'
 
 export default ({
   success(msgInfo: any) {
-    return ElMessage.success({ message: msgInfo, ...{ duration: 1800, grouping: true }})
+    return ElMessage.success({ message: msgInfo, ...{ duration: 1800, grouping: true, center: true }})
   },
   error(msgInfo: any) {
-    return ElMessage.error({ message: msgInfo, ...{ duration: 1800, grouping: true }})
+    return ElMessage.error({ message: msgInfo, ...{ duration: 1800, grouping: true, center: true }})
   }
 })

+ 1 - 1
src/view/m_views/index/index.vue

@@ -118,7 +118,7 @@ const downGame = (url: string) => {
     box-sizing: border-box;
     padding: 15px;
     // background: radial-gradient(circle at 0 -10%,#dcf4f7,rgba(220,244,247,0) 50%),radial-gradient(circle at 100% 10%,#e8ebfc,rgba(232,235,252,0) 50%);
-    background: radial-gradient(circle at 0 -20%, #ed8c0f, rgba(255, 255, 255, .6) 25%), radial-gradient(circle at 100% 10%, #eabf85, rgba(255, 255, 255, .6) 30%);
+    background: radial-gradient(circle at 0 -20%, #ed8c0f, rgba(255, 255, 255, .6) 25%), radial-gradient(circle at 100% 10%, #eabf85, rgba(255, 255, 255, .6) 50%);
 
     .top_nav {
         margin-bottom: 10px;

+ 1 - 1
src/view/p_views/search/index.vue

@@ -34,7 +34,7 @@ const loadMore = () => {
     search.setClean(false)
 }
 
-watch(() => loadMore, (v,i) => {}, {deep: true, immediate:true})
+// watch(() => loadMore, (v,i) => {}, {deep: true, immediate:true})
 
 </script>