Browse Source

搜索页面无搜索词时显示全部数据

zhangxing 3 years ago
parent
commit
17111ab097
6 changed files with 2412 additions and 2355 deletions
  1. 119 119
      src/components/MobCateList.vue
  2. 65 65
      src/components/MobList.vue
  3. 128 126
      src/view/m_views/mine/index.vue
  4. 106 100
      src/view/m_views/search/index.vue
  5. 50 51
      src/view/p_views/search/index.vue
  6. 1944 1894
      yarn.lock

+ 119 - 119
src/components/MobCateList.vue

@@ -1,120 +1,120 @@
-<template>
-    <div v-if="(props.gameLis?.length > 0)" class="game_lis">
-        <div class="list_cont df aic jcsb" v-for="(item, index) in props.gameLis" :key="index"
-            :class="{ lastStyle: index === props.gameLis.length - 1 }">
-            <div class="df aic" style="width:80%">
-                <img :src="props.prefix + item.logopic">
-                <div class="game_list df jcsb aic">
-                    <div class=" df fdc" style="width:100%">
-                        <p class="title df aic" style="width:70%">
-                            <span class="title_name elli">{{ item.screen_name }}</span>
-                            <span class="score">{{ (item.game_score / 10) > 5 ? '5.0' : (item.game_score /
-                                    10).toFixed(1)
-                            }}</span>
-                        </p>
-                        <p class="info elli" style="width:70%">{{ item.sketch || '暂无简介' }}</p>
-                        <div class="df fw">
-                            <van-button plain size="mini" class="game_tag" round
-                                v-for="tag in item.tags"><span
-                                    v-for="subTag in props.tagArr.filter(v => { return v.id === tag })">{{ subTag.name
-                                    }}</span>
-                            </van-button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <van-button round :disabled="item.download_url === '' ? true : false" @click="downGame(item.download_url)"
-                color="#ed8c0f" class="downMB">
-                下载
-            </van-button>
-        </div>
-        <!-- <div class="more df aic jcc" style="padding-bottom: 10px;background-color: transparent;" v-if="props.total >= 10">
-            <van-button class="df aic jcc" style="height: 35px;" @click="props.more">更多</van-button>
-        </div> -->
-    </div>
-    <!-- <div v-else>
-        <div class="df aic jcc" style="color: #666;height: 200px;font-size: 22px;">暂无数据</div>
-    </div> -->
-</template>
-
-<script setup lang="ts">
-const props: any = defineProps({
-    gameLis: Array<any>,
-    tagArr: Array<any | undefined>,
-    prefix: String,
-    rank: Boolean,
-    more: Function,
-    total: Number
-})
-const downGame = (url: string) => {
-    // 下载游戏
-    window.open(url)
-    // window.location.href = url;
-}
-</script>
-
-<style scoped lang="scss">
-.game_lis {
-    padding: 10px 15px;
-    box-sizing: border-box;
-}
-
-.list_cont {
-    box-sizing: border-box;
-    margin: 20px 0;
-    border-bottom: 1px solid #eee;
-    padding: 0;
-    padding-bottom: 15px;
-
-    img {
-        width: 90px;
-        height: 80px;
-        margin-right: 20px;
-    }
-
-    .game_list {
-        width: 90%;
-
-        .title {
-            font-size: 18px;
-            color: #323232;
-
-            .title_name {
-                display: inline-block;
-                margin-right: 10px;
-            }
-
-            .score {
-                color: #ed8c0f;
-            }
-        }
-
-        .info {
-            color: rgba(0, 0, 0, .6);
-            margin: 5px 0;
-            font-size: 14px;
-        }
-
-        .game_tag {
-            // margin-right: 3px;
-            color: #ed8c0f;
-            border-color: #ed8c0f;
-            transform: scale(.8);
-            // padding: 2px 3px;
-        }
-    }
-
-    .downMB {
-        width: 60px;
-        height: 30px;
-        color: #fff;
-        border-color: #ed8c0f;
-    }
-}
-
-.lastStyle {
-    border: none !important;
-    padding-bottom: 0 !important;
-    margin-bottom: 10px !important;
-}
+<template>
+    <div v-if="(props.gameLis?.length > 0)" class="game_lis">
+        <div class="list_cont df aic jcsb" v-for="(item, index) in props.gameLis" :key="index"
+            :class="{ lastStyle: index === props.gameLis.length - 1 }">
+            <div class="df aic" style="width:80%">
+                <img :src="props.prefix + item.logopic">
+                <div class="game_list df jcsb aic">
+                    <div class=" df fdc" style="width:100%">
+                        <p class="title df aic" style="width:80%">
+                            <span class="title_name elli">{{ item.screen_name }}</span>
+                            <span class="score">{{ (item.game_score / 10) > 5 ? '5.0' : (item.game_score /
+                                    10).toFixed(1)
+                            }}</span>
+                        </p>
+                        <p class="info elli" style="width:80%">{{ item.sketch || '暂无简介' }}</p>
+                        <div class="df fw">
+                            <van-button plain size="mini" class="game_tag" round
+                                v-for="tag in item.tags"><span
+                                    v-for="subTag in props.tagArr.filter(v => { return v.id === tag })">{{ subTag.name
+                                    }}</span>
+                            </van-button>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <van-button round :disabled="item.download_url === '' ? true : false" @click="downGame(item.download_url)"
+                color="#ed8c0f" class="downMB">
+                下载
+            </van-button>
+        </div>
+        <!-- <div class="more df aic jcc" style="padding-bottom: 10px;background-color: transparent;" v-if="props.total >= 10">
+            <van-button class="df aic jcc" style="height: 35px;" @click="props.more">更多</van-button>
+        </div> -->
+    </div>
+    <!-- <div v-else>
+        <div class="df aic jcc" style="color: #666;height: 200px;font-size: 22px;">暂无数据</div>
+    </div> -->
+</template>
+
+<script setup lang="ts">
+const props: any = defineProps({
+    gameLis: Array<any>,
+    tagArr: Array<any | undefined>,
+    prefix: String,
+    rank: Boolean,
+    more: Function,
+    total: Number
+})
+const downGame = (url: string) => {
+    // 下载游戏
+    window.open(url)
+    // window.location.href = url;
+}
+</script>
+
+<style scoped lang="scss">
+.game_lis {
+    padding: 10px 15px;
+    box-sizing: border-box;
+}
+
+.list_cont {
+    box-sizing: border-box;
+    margin: 20px 0;
+    border-bottom: 1px solid #eee;
+    padding: 0;
+    padding-bottom: 15px;
+
+    img {
+        width: 80px !important;
+        height: 80px !important;
+        margin-right: 20px;
+    }
+
+    .game_list {
+        width: 90%;
+
+        .title {
+            font-size: 18px;
+            color: #323232;
+
+            .title_name {
+                display: inline-block;
+                margin-right: 10px;
+            }
+
+            .score {
+                color: #ed8c0f;
+            }
+        }
+
+        .info {
+            color: rgba(0, 0, 0, .6);
+            margin: 5px 0;
+            font-size: 14px;
+        }
+
+        .game_tag {
+            // margin-right: 3px;
+            color: #ed8c0f;
+            border-color: #ed8c0f;
+            transform: scale(.8);
+            // padding: 2px 3px;
+        }
+    }
+
+    .downMB {
+        width: 60px;
+        height: 30px;
+        color: #fff;
+        border-color: #ed8c0f;
+    }
+}
+
+.lastStyle {
+    border: none !important;
+    padding-bottom: 0 !important;
+    margin-bottom: 10px !important;
+}
 </style>

+ 65 - 65
src/components/MobList.vue

@@ -1,66 +1,66 @@
-<template>
-    <div class="list df aic jcsb" v-for="item in props.gameLis" :key="item.game_id">
-        <div class="df aic" style="width:70%">
-            <img :src="props.prefix + item.logopic">
-            <div class="right_cont" style="width:73%">
-                <p class="title elli">{{ item.screen_name }}</p>
-                <p class="info elli">{{ item.sketch || '暂无简介' }}</p>
-                <p class="down_msg">下载 | <span style="color: #ed8c0f;">{{ bytesChange(item.size) }}</span></p>
-            </div>
-        </div>
-        <van-button :disabled="item.download_url === '' ? true : false"  round color="#ed8c0f" @click="downGame(item.download_url)">下载</van-button>
-    </div>
-</template>
-
-<script setup lang="ts">
-import { bytesChange } from '@/utils/bytesFormatter'
-
-const props: any = defineProps({
-    gameLis: Array,
-    prefix: String
-})
-
-const downGame = (url: string) => {
-    // 下载游戏
-    window.open(url)
-    // window.location.href = url;
-}
-</script>
-
-<style lang="scss" scoped>
-.list {
-    height: 100px;
-    margin-bottom: 0;
-    // padding: 20px 15px 15px;
-
-    img {
-        width: 80px;
-        height: 80px;
-        // background-color: #a00;
-        border-radius: 20px;
-        margin-right: 20px;
-    }
-
-    .right_cont {
-        color: #666;
-
-        .title {
-            font-size: 18px;
-            // font-weight: 600;
-            color: #323332;
-
-        }
-
-        .info {
-            font-size: 14px;
-            margin: 5px 0;
-        }
-
-    }
-}
-
-.van-button {
-    width: 60px;
-    height: 30px;
-}
+<template>
+    <div class="list df aic jcsb" v-for="item in props.gameLis" :key="item.game_id">
+        <div class="df aic" style="width:70%">
+            <img :src="props.prefix + item.logopic">
+            <div class="right_cont" style="width:73%">
+                <p class="title elli">{{ item.screen_name }}</p>
+                <p class="info elli">{{ item.sketch || '暂无简介' }}</p>
+                <p class="down_msg">下载 | <span style="color: #ed8c0f;">{{ bytesChange(item.size) }}</span></p>
+            </div>
+        </div>
+        <van-button :disabled="item.download_url === '' ? true : false"  round color="#ed8c0f" @click="downGame(item.download_url)">下载</van-button>
+    </div>
+</template>
+
+<script setup lang="ts">
+import { bytesChange } from '@/utils/bytesFormatter'
+
+const props: any = defineProps({
+    gameLis: Array,
+    prefix: String
+})
+
+const downGame = (url: string) => {
+    // 下载游戏
+    window.open(url)
+    // window.location.href = url;
+}
+</script>
+
+<style lang="scss" scoped>
+.list {
+    height: 100px;
+    margin-bottom: 0;
+    // padding: 20px 15px 15px;
+
+    img {
+        width: 80px !important;
+        height: 80px !important;
+        // background-color: #a00;
+        border-radius: 20px;
+        margin-right: 20px;
+    }
+
+    .right_cont {
+        color: #666;
+
+        .title {
+            font-size: 18px;
+            // font-weight: 600;
+            color: #323332;
+
+        }
+
+        .info {
+            font-size: 14px;
+            margin: 5px 0;
+        }
+
+    }
+}
+
+.van-button {
+    width: 60px;
+    height: 30px;
+}
 </style>

+ 128 - 126
src/view/m_views/mine/index.vue

@@ -1,127 +1,129 @@
-<template>
-    <m_header></m_header>
-    <div v-if="token">
-        <div v-if="mineGame.length > 0">
-            <div style="padding:15px">
-                <MobList :gameLis="mineGame" :prefix="prefix"></MobList>
-            </div>
-            <div style="padding: 10px;background-color: #f7f7f7;" class="df aic jcc"
-                v-if="params.page * params.pagesize <= mineGame.length">
-                <el-button class="df aic jcc" plain @click="loadMore">更多</el-button>
-            </div>
-            <div v-else>
-                <div class="df aic jcc" style="color: #999;height: 100px;font-size: 16px;">----- 没有更多数据了 -----
-                </div>
-            </div>
-        </div>
-        <van-empty v-else description="No Data" />
-    </div>
-    <div v-else :style="{ height: viewWidth + 'px' }" class="df fdc aic jcc">
-        <van-empty>
-            <van-button color="#ed8c0f" @click="goLogin">去登录 &gt;&gt;</van-button>
-        </van-empty>
-    </div>
-
-    <van-back-top style="background-color: #ed8c0f;" />
-    <!-- <m_footer></m_footer> -->
-</template>
-
-<script setup lang="ts">
-import { onMounted, ref, reactive } from 'vue'
-import { getMineGame } from '@/api/index'
-import { useRouter, useRoute } from 'vue-router'
-import Message from '@/utils/Message'
-import MobList from '@/components/MobList.vue';
-
-const router = useRouter()
-const route = useRoute()
-
-const mineGame: any = ref([])
-const prefix = ref<string>('')
-const total = ref<number>(0)
-const isLoading = ref<boolean>(true)
-const viewWidth = ref<number>(document.documentElement.clientHeight - 100)
-const userAccount = ref<string | null>(localStorage.getItem('account'))
-const token = ref<string | null>(localStorage.getItem('token'))
-
-interface params {
-    page: number,
-    pagesize: number,
-    account: string | null
-}
-const params = reactive<params>({
-    page: 1,
-    pagesize: 10,
-    account: userAccount.value
-})
-
-onMounted(() => {
-    // 进入页面刷新一次
-    if (token.value) {
-        if (route.query.account || userAccount.value) {
-            // if (location.href.indexOf("#reloaded") === -1) {
-            //     location.href = location.href + "#reloaded";
-            //     location.reload();
-            // }
-            getMyGame(params)
-        } else {
-            userAccount.value = ''
-        }
-    }
-})
-
-const getMyGame = async (params) => {
-    // console.log('params', params);
-    await getMineGame(params).then(res => {
-        // console.log('res========>', res);
-        if (res.data.code === 200 && res.data.data) {
-            mineGame.value = mineGame.value.concat(res.data.data.lists)
-            prefix.value = res.data.data.prefix
-            total.value = res.data.data.total
-            isLoading.value = false
-        }
-    }).catch(err => {
-        Message.error(err.data)
-    })
-}
-
-// 加载更多
-const loadMore = () => {
-    params.page += 1
-    getMyGame(params)
-}
-
-const goLogin = () => {
-    router.push({ path: 'm_login' })
-}
-
-</script>
-
-<style scoped lang="scss">
-.game_list {
-    box-sizing: border-box;
-    padding: 20px;
-    background-color: #fff;
-    margin: 0 auto 20px;
-
-    h3 {
-        font-size: 22px;
-        font-weight: normal;
-        height: 30px;
-    }
-}
-
-.more {
-    margin: 20px auto 0;
-    height: 60px;
-    background-color: #f7f7f7;
-
-    .el-button {
-        width: 100px;
-        height: 40px;
-        background-color: transparent;
-        color: #323332;
-        border: 1px solid #c7c7c7;
-    }
-}
+<template>
+    <m_header></m_header>
+    <div v-if="token">
+        <div v-if="mineGame.length > 0">
+            <div style="padding:15px">
+                <MobList :gameLis="mineGame" :prefix="prefix"></MobList>
+            </div>
+            <div style="padding: 10px;background-color: #f7f7f7;" class="df aic jcc"
+                v-if="params.page * params.pagesize <= mineGame.length">
+                <el-button class="df aic jcc" plain @click="loadMore">更多</el-button>
+            </div>
+            <div v-else>
+                <div class="df aic jcc" style="color: #999;height: 100px;font-size: 16px;">----- 没有更多数据了 -----
+                </div>
+            </div>
+        </div>
+        <van-empty v-else description="No Data" />
+    </div>
+    <div v-else :style="{ height: viewWidth + 'px' }" class="df fdc aic jcc">
+        <van-empty>
+            <van-button color="#ed8c0f" @click="goLogin">去登录 &gt;&gt;</van-button>
+        </van-empty>
+    </div>
+
+    <van-back-top style="background-color: #ed8c0f;" />
+    <!-- <m_footer></m_footer> -->
+</template>
+
+<script setup lang="ts">
+import { onMounted, ref, reactive } from 'vue'
+import { getMineGame } from '@/api/index'
+import { useRouter, useRoute } from 'vue-router'
+import Message from '@/utils/Message'
+import MobList from '@/components/MobList.vue';
+
+const router = useRouter()
+const route = useRoute()
+
+const mineGame: any = ref([])
+const prefix = ref<string>('')
+const total = ref<number>(0)
+const isLoading = ref<boolean>(true)
+const viewWidth = ref<number>(document.documentElement.clientHeight - 100)
+const userAccount = ref<string | null>(localStorage.getItem('account'))
+const token = ref<string | null>(localStorage.getItem('token'))
+
+interface params {
+    page: number,
+    pagesize: number,
+    account: string | null
+}
+const params = reactive<params>({
+    page: 1,
+    pagesize: 10,
+    account: userAccount.value
+})
+
+onMounted(() => {
+    // 进入页面刷新一次
+    if (token.value) {
+        if (route.query.account || userAccount.value) {
+            // if (location.href.indexOf("#reloaded") === -1) {
+            //     location.href = location.href + "#reloaded";
+            //     location.reload();
+            // }
+            getMyGame(params)
+        } else {
+            userAccount.value = ''
+        }
+    }
+})
+
+const getMyGame = async (params) => {
+    // console.log('params', params);
+    await getMineGame(params).then(res => {
+        // console.log('res========>', res);
+        if (res.data.code === 200 && res.data.data) {
+            mineGame.value = mineGame.value.concat(res.data.data.lists)
+            prefix.value = res.data.data.prefix
+            total.value = res.data.data.total
+            isLoading.value = false
+        }
+    }).catch(err => {
+        // Message.error(err.data)
+        console.log(err.data);
+        
+    })
+}
+
+// 加载更多
+const loadMore = () => {
+    params.page += 1
+    getMyGame(params)
+}
+
+const goLogin = () => {
+    router.push({ path: 'm_login' })
+}
+
+</script>
+
+<style scoped lang="scss">
+.game_list {
+    box-sizing: border-box;
+    padding: 20px;
+    background-color: #fff;
+    margin: 0 auto 20px;
+
+    h3 {
+        font-size: 22px;
+        font-weight: normal;
+        height: 30px;
+    }
+}
+
+.more {
+    margin: 20px auto 0;
+    height: 60px;
+    background-color: #f7f7f7;
+
+    .el-button {
+        width: 100px;
+        height: 40px;
+        background-color: transparent;
+        color: #323332;
+        border: 1px solid #c7c7c7;
+    }
+}
 </style>

+ 106 - 100
src/view/m_views/search/index.vue

@@ -1,101 +1,107 @@
-<template>
-    <div class="search_cont">
-        <van-search class="search_key" v-model="searchText" placeholder="请输入游戏关键词" shape="round" clearable
-            @search="onSearch" @clear="onClear">
-            <template #left>
-                <van-icon name="arrow-left" @click="onCancel" size="large" style="margin-right: 10px;" />
-            </template>
-        </van-search>
-
-        <div v-if="list.length > 0" style="padding: 0 10px;">
-            <MobList :gameLis="list" :prefix="prefix"></MobList>
-            <div style="margin: 10px;" class="more df aic jcc" v-if="params.page * params.pagesize <= list.length">
-                <el-button class="df aic jcc" plain @click="loadMore">更多</el-button>
-            </div>
-            <div v-else>
-                <div class="df aic jcc" style="color: #999;height: 100px;font-size: 16px;">----- 没有更多数据了 -----</div>
-            </div>
-        </div>
-        <van-empty v-else description="No Data" />
-    </div>
-</template>
-
-<script setup lang="ts">
-import { ref, reactive, watch } from 'vue';
-import MobList from '@/components/MobList.vue';
-import { getGameList } from '@/api/index'
-import Message from '@/utils/Message'
-import { useRouter } from 'vue-router';
-
-const router = useRouter()
-const searchText = ref<string>('')
-const list: any = ref([])
-const prefix = ref<string>('')
-const total = ref<number>(0)
-
-interface IParams {
-    type: number,
-    tag_id: number,
-    page: number,
-    pagesize: number
-}
-const params = reactive<IParams>({
-    type: 0,
-    tag_id: 0,
-    page: 1,
-    pagesize: 10
-})
-
-const onSearch = async () => {
-    console.log('测试输入框的字符',searchText.value.length );
-    
-    await getGameList(params).then(res => {
-        if (res.data.code === 200 && res.data.data) {
-            prefix.value = res.data.data.prefix
-            total.value = res.data.data.total
-            if (searchText.value.length === 0) {
-                list.value = list.value.concat(res.data.data.lists)
-                console.log('list===>', list.value);
-                
-            }else{
-            params.pagesize = total.value
-                getGameList(params).then(resp => {
-                if (resp.data.code === 200 && resp.data.data) {
-                    list.value = resp.data.data.lists.filter(item => {
-                        return item.screen_name.indexOf(searchText.value) > -1
-                    })
-                }
-            })
-            }
-            
-        }
-    }).catch(err => {
-        Message.error(err.data)
-    })
-}
-
-const onCancel = () => {
-    router.go(-1)
-}
-
-const onClear = () => {
-    list.value = []
-}
-
-// 加载更多
-const loadMore = () => {
-    params.page += 1
-}
-
-watch(params, (nval,oval) => { onSearch() }, {deep:true})
-</script>
-
-<style scoped lang="scss">
-.search_cont {
-    padding: 5px;
-
-    .search_key {
-        margin-bottom: 10px;
-    }
-}
+<template>
+    <div class="search_cont">
+        <van-search class="search_key" v-model="searchText" placeholder="请输入游戏关键词" shape="round" clearable
+            @search="onSearch" @clear="onClear">
+            <template #left>
+                <van-icon name="arrow-left" @click="onCancel" size="large" style="margin-right: 10px;" />
+            </template>
+        </van-search>
+
+        <div v-if="list.length > 0" style="padding: 0 10px;">
+            <MobList :gameLis="list" :prefix="prefix"></MobList>
+            <div style="margin: 10px;" class="more df aic jcc" v-if="params.page * params.pagesize <= list.length">
+                <el-button class="df aic jcc" plain @click="loadMore">更多</el-button>
+            </div>
+            <div v-else>
+                <div class="df aic jcc" style="color: #999;height: 100px;font-size: 16px;">----- 没有更多数据了 -----</div>
+            </div>
+        </div>
+        <van-empty v-else description="No Data" />
+    </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, watch, onMounted } from 'vue';
+import MobList from '@/components/MobList.vue';
+import { getGameList } from '@/api/index'
+import Message from '@/utils/Message'
+import { useRouter } from 'vue-router';
+
+const router = useRouter()
+const searchText = ref<string>('')
+const list: any = ref([])
+const prefix = ref<string>('')
+const total = ref<number>(0)
+
+interface IParams {
+    type: number,
+    tag_id: number,
+    page: number,
+    pagesize: number
+}
+const params = reactive<IParams>({
+    type: 0,
+    tag_id: 0,
+    page: 1,
+    pagesize: 10
+})
+
+onMounted(() => { getSearchLis(params) })
+
+const getSearchLis = async (params) => {
+    await getGameList(params).then(res => {
+        if (res.data.code === 200 && res.data.data) {
+            prefix.value = res.data.data.prefix
+            total.value = res.data.data.total
+            if (searchText.value.length < 1) {
+                list.value = list.value.concat(res.data.data.lists)
+                console.log('list===>', list.value);
+
+            } else {
+                params.pagesize = total.value
+                getGameList(params).then(resp => {
+                    if (resp.data.code === 200 && resp.data.data) {
+                        list.value = resp.data.data.lists.filter(item => {
+                            return item.screen_name.indexOf(searchText.value) > -1
+                        })
+                    }
+                })
+            }
+
+        }
+    }).catch(err => {
+        Message.error(err.data)
+    })
+}
+
+const onSearch = () => {
+    params.page = 1
+    list.value = []
+    getSearchLis(params)
+}
+
+const onCancel = () => {
+    router.go(-1)
+}
+
+const onClear = () => {
+    list.value = []
+}
+
+// 加载更多
+const loadMore = () => {
+    params.page += 1
+}
+
+// watch(searchText, (nval, oval) => { getSearchLis(params) }, { deep: true })
+</script>
+
+<style scoped lang="scss">
+.search_cont {
+    padding: 5px;
+
+    .search_key {
+        margin-bottom: 10px;
+    }
+}
 </style>

+ 50 - 51
src/view/p_views/search/index.vue

@@ -1,52 +1,51 @@
-<template>
-    <!-- <loading v-if="search.getLoading" :style="{ height: viewWidth + 'px' }" /> -->
-    <div class="w1000">
-        <!-- <el-button @click="loadMore">page加加</el-button> -->
-        <div class="game_list" v-if="search.searchLis.length > 0">
-            <IndexList :list="search.searchLis" :prefix="search.getPrefix"></IndexList>
-            <div class="more df aic jcc" v-if="search.getPage * search.getPagesize <= search.getTotal">
-                <el-button class="df aic jcc" @click="loadMore">更多</el-button>
-            </div>
-            <div v-else>
-                <div class="df aic jcc" style="color: #999;height: 100px;font-size: 18px;">----- 没有更多数据了 -----</div>
-            </div>
-        </div>
-        <el-empty v-else></el-empty>
-    </div>
-</template>
-
-<script setup lang="ts">
-import { ref, watch } from 'vue'
-import { useRoute } from 'vue-router'
-import IndexList from '@/components/IndexList.vue'
-import { useStore } from '@/store'
-
-const search = useStore('search')
-const route = useRoute()
-
-if(route.query.screen_name){
-    search.setSearchLis(route.query.screen_name)
-}
-
-// 加载更多
-const loadMore = () => {
-    search.setSearchPage()
-    search.setClean(false)
-}
-
-// watch(() => loadMore, (v,i) => {}, {deep: true, immediate:true})
-
-</script>
-
-<style scoped>
-.game_list {
-    box-sizing: border-box;
-    padding: 20px;
-    background-color: #fff;
-    margin: 15px auto 20px;
-}
-.list_cont .list img{
-    width: 0;
-    height: 0;
-}
+<template>
+    <!-- <loading v-if="search.getLoading" :style="{ height: viewWidth + 'px' }" /> -->
+    <div class="w1000">
+        <!-- <el-button @click="loadMore">page加加</el-button> -->
+        <div class="game_list" v-if="search.searchLis.length > 0">
+            <IndexList :list="search.searchLis" :prefix="search.getPrefix"></IndexList>
+            <div class="more df aic jcc" v-if="search.getPage * search.getPagesize <= search.getTotal">
+                <el-button class="df aic jcc" @click="loadMore">更多</el-button>
+            </div>
+            <div v-else>
+                <div class="df aic jcc" style="color: #999;height: 100px;font-size: 18px;">----- 没有更多数据了 -----</div>
+            </div>
+        </div>
+        <el-empty v-else></el-empty>
+    </div>
+</template>
+
+<script setup lang="ts">
+import { ref, watch } from 'vue'
+import { useRoute } from 'vue-router'
+import IndexList from '@/components/IndexList.vue'
+import { useStore } from '@/store'
+
+const search = useStore('search')
+const route = useRoute()
+
+search.setSearchLis(route.query.screen_name)
+
+// 加载更多
+const loadMore = () => {
+    search.setSearchPage()
+    search.setClean(false)
+}
+
+// watch(() => loadMore, (v,i) => {}, {deep: true, immediate:true})
+
+</script>
+
+<style scoped>
+.game_list {
+    box-sizing: border-box;
+    padding: 20px;
+    background-color: #fff;
+    margin: 15px auto 20px;
+}
+
+.list_cont .list img {
+    width: 0;
+    height: 0;
+}
 </style>

File diff suppressed because it is too large
+ 1944 - 1894
yarn.lock