pujiaming пре 2 година
родитељ
комит
21ba06366f

+ 6 - 6
.env.development

@@ -1,8 +1,8 @@
 VITE_ENV = 'development',
-VITE_PROJECT_NAME = 朱雀游戏中心
-# VITE_PROJECT_NAME = 游戏中心
-# VITE_API_HOST = http://gm.coolpad.nkfzs.com/api/web
-VITE_API_HOST = http://gm.rose.nei.nkfzs.com/api/web
+# VITE_PROJECT_NAME = 朱雀游戏中心
+VITE_PROJECT_NAME = 游戏中心
+VITE_API_HOST = http://gm.coolpad.nkfzs.com/api/web
+# VITE_API_HOST = http://gm.rose.nei.nkfzs.com/api/web
 # VITE_API_HOST = http://gm.nkfzs.com/api/web
-VITE_LOGO: 'QingQue'
-# VITE_LOGO: 'KuPai'
+# VITE_LOGO: 'QingQue'
+VITE_LOGO: 'KuPai'

+ 21 - 5
src/components/layout/header.vue

@@ -3,13 +3,14 @@
     <div class="wrap">
       <div class="left-part">
         <img v-if="user.isQingQue" class="logo" src="http://gm.nkfzs.com/favicon.ico" alt="游戏中心"/>
-        <img v-else class="logo" :src="getAssetsFile('default_logo.png')" alt="游戏中心"/>
+        <img v-else class="logo logo2"  :src="getAssetsFile('default_logo.png')" alt="游戏中心"/>
         {{ user.projectName }}
       </div>
       <div class="menu">
         <el-menu
           :default-active="route.path"
           class="el-menu-wrapper"
+          active-text-color="#909399"
           :ellipsis="false"
           router
           mode="horizontal"
@@ -46,7 +47,7 @@
 
         <el-dropdown v-else trigger="click" >
           <span class="el-dropdown-link">
-            {{user.profile.user_name?user.profile.user_name:user.profile.mobile }}
+            {{user.profile.user_name?user.profile.user_name:(user.profile.mobile?user.profile.mobile:'请设置') }}
             <img :src="getAssetsFile('gamer.png')" />
           </span>
           <template #dropdown>
@@ -54,7 +55,7 @@
               <el-dropdown-item class="clearfix" @click="toSetting">
                 账号设置
               </el-dropdown-item>
-              <el-dropdown-item class="clearfix" @click="logOut">
+              <el-dropdown-item class="clearfix" @click="logOut('pc')">
                 退出登录
               </el-dropdown-item>
             </el-dropdown-menu>
@@ -194,13 +195,15 @@ onMounted(() => {
 })
 
 // 退出登录
-const logOut = () => {
+const logOut = (pla:'pc'|'') => {
   // console.log(22);
   show.value = false
   user.menuPath = oriMenu
   sessionStorage.removeItem('token')
   user.isLogin = false
-  router.push({ path: '/login' })
+  if (pla !== 'pc') {
+    router.push({ path: '/login' })
+  }
 }
 const toSetting = () => {
   show.value = false
@@ -378,6 +381,7 @@ const submitForm = async(formEl: FormInstance | undefined) => {
             sessionStorage.setItem('account', loginForm.account)
             localStorage.setItem('from', '1')
             user.isLogin = true
+            loginFormVisible.value = false
             await user.getUserProfile()
             // 跳转我的游戏页面
             setTimeout(() => {
@@ -404,6 +408,7 @@ const submitForm = async(formEl: FormInstance | undefined) => {
             sessionStorage.setItem('account', loginForm.account)
             localStorage.setItem('from', '2')
             user.isLogin = true
+            loginFormVisible.value = false
             await user.getUserProfile()
             setTimeout(() => {
               router.push({ path: '/my_game', query: { account: loginForm.account }})
@@ -441,6 +446,16 @@ const submitForm = async(formEl: FormInstance | undefined) => {
             align-items: center;
             font-family: 'zihunchaoji';
             white-space: nowrap;
+            .logo{
+              width: 1.6rem;
+              height: 1.6rem;
+              display: block;
+              margin-right: 0.25rem;
+            }
+            .logo2{
+              width: 1.25rem;
+              height: 1.25rem;
+            }
         }
         .menu{
             padding: 0 5rem 0 1rem;
@@ -469,6 +484,7 @@ const submitForm = async(formEl: FormInstance | undefined) => {
             // border-radius: 50%;
             display: flex;
             align-items: center;
+            justify-content: space-around;
             >img{
               width: 2rem;
               height: 2rem;

+ 1 - 1
src/components/vantList.vue

@@ -56,7 +56,7 @@ const onLoad = async(flag?:any, pa?:any) => {
       finished.value = true
     }
     total.value = res.data.total || 0
-    list.value = list.value.concat(res.data.data ? res.data.data.lists : [])
+    list.value = list.value.concat(res.data.data.lists ? res.data.data.lists : [])
     // list.value = [...list.value, ...(res.data.data ? res.data.data : [])]
     console.log('list', list.value)
     if (!list.value.length) emit('noData')

+ 158 - 6
src/global.scss

@@ -142,15 +142,23 @@
                     }
                 }
                 .hot-item{
+                   
                     .game_tag{
                         margin-right: 0.5rem;
                         font-size: .6rem;
                     }
                     .detail{
                         max-width: 100%;
+                        width: 17rem!important;
                     }
                 }
             }
+            .search_cont{
+                .game-poster{
+                    display: none;
+                }
+            }
+            
         }
     }
     
@@ -197,6 +205,149 @@
             width: 100%;
             .left-part{
                 font-size: 22px;
+                .logo{
+                    width: 32px!important;
+                    height: 32px!important;
+                    display: block;
+                    margin-right: 5px!important;
+                  }
+                  .logo2{
+                    width: 24px!important;
+                    height: 24px!important;
+                  }
+            }
+            .menu{
+                display: none;
+            }
+            .search-wrap{
+                display: none;
+            }
+            .mini-menu{
+                display: block!important;
+                padding-right: 15px;
+            }
+            .user{
+                display: none;
+            }
+            
+        }
+    }
+    .header-hidden{
+        height: 60px!important;
+    }
+    #main{
+        .main-wrap{
+            width: 100%;
+            margin: 0;
+            padding: 0;
+            display: block;
+            .left-list, .right-action{
+                display: none;
+            }
+            .mob-page{
+                display: block!important;
+            }
+            .cate-list{
+                .cate-tag, .divide{
+                    display: none;
+                }
+                .drop-tag{
+                    display: block!important;
+                }
+                .hot-item{
+                    height: 120px;
+                    width: 100%;
+                    .game-logo{
+                        display: none;
+                    }
+                    flex-direction: row-reverse;
+                    justify-content: space-between;
+                    --van-button-small-padding:15px;
+                    .game-poster{
+                        width: 25vw;
+                        height: 75px;
+                        border-radius: var(--logo-radius);
+                        margin-right: 5px;
+                    }
+                    margin-bottom: 0;
+                    .down-btn{
+                        display: block!important;
+                    }
+                    .detail{
+                        width: 150px;
+                        
+                    }
+                    .game_tag{
+                        margin-right: 2px;
+                        font-size: 10px;
+                    }
+                }
+            }
+            .bg{
+                display: none;
+            }
+            .mob-login{
+                display: flex!important;
+            }
+            .rest-list{
+                display: none;
+            }
+            .mob-list{
+                display: block!important;
+                min-height: calc(100vh - 60px)
+            }
+            .settings{
+                display: none;
+            }
+            .mob-setting{
+                display: block!important;
+            }
+            .mine{
+                .pcbt, .game-poster{
+                    display: none;
+                }
+                .detail{
+                    width: 170px;
+                }
+                .right{
+                    display: flex!important;
+                }
+            }
+            .search_cont{
+                .search_key{
+                    display: block!important;
+                }
+                .pcbt, .game-poster{
+                    display: none;
+                }
+                .right{
+                    display: flex!important;
+                }
+                .hot-item{
+                    height: 96px;
+                    width: 100%;
+                    box-sizing: border-box;
+                    .game-logo{
+                        margin-right: 10px;
+                    }
+                    .detail{
+                        width: 170px;
+                    }
+                }
+            }
+            
+        }
+    }
+}
+@media screen and (max-width:350px) {
+    #header{
+        height: 60px;
+        background-color: #eaedfc;
+        .wrap{
+            padding:0 10px;
+            width: 100%;
+            .left-part{
+                font-size: 22px;
             }
             .menu{
                 display: none;
@@ -232,6 +383,9 @@
             }
             .mob-page{
                 display: block!important;
+                .game-card{
+                    display: none;
+                }
             }
             .cate-list{
                 .cate-tag, .divide{
@@ -242,14 +396,15 @@
                 }
                 .hot-item{
                     height: 120px;
+                    width: 100%;
                     .game-logo{
                         display: none;
                     }
                     flex-direction: row-reverse;
-                    justify-content: flex-end;
+                    justify-content: space-between;
                     --van-button-small-padding:15px;
                     .game-poster{
-                        width: 133px;
+                        width: 25vw;
                         height: 75px;
                         border-radius: var(--logo-radius);
                         margin-right: 5px;
@@ -259,7 +414,7 @@
                         display: block!important;
                     }
                     .detail{
-                        width: 150px;
+                        width: 150px!important;
                         
                     }
                     .game_tag{
@@ -321,6 +476,3 @@
         }
     }
 }
-@media screen and (max-width:350px) {
-   
-}

+ 1 - 1
src/store/user.ts

@@ -28,7 +28,7 @@ export const user = defineStore('user', {
     },
     async getUserProfile() {
       // from 2 手机登录   1密码登录
-      await userProfile({ from: parseInt(sessionStorage.getItem('from') as string) }).then((res) => {
+      await userProfile({ from: parseInt(localStorage.getItem('from') as string) }).then((res) => {
         console.log(res)
         this.setProfile(res.data.data)
         this.menuPath = [

+ 6 - 0
src/views/category.vue

@@ -257,10 +257,16 @@ const posterErrorFun = (event:any) => {
       height: 6rem;
       border-radius: .2rem;
       background-color: #f7f7f7;
+      display: block;
+      flex-grow: 0;
+      flex-shrink: 0;
     }
     .game-poster{
       width: 12.1rem;
       height: 7rem;
+      display: block;
+      flex-grow: 0;
+      flex-shrink: 0;
     }
     .detail{
       width: 30rem;

+ 1 - 1
src/views/home.vue

@@ -58,7 +58,7 @@
         <div>个人中心</div>
       </div>
       <el-divider />
-      <div v-if="hasToken" class="money">
+      <div v-if="user.isLogin" class="money">
         <el-card shadow="hover" @click="router.push('/coin_type2')">
           <div class="service">
             <el-icon><wallet /></el-icon>

+ 2 - 2
src/views/login.vue

@@ -89,7 +89,7 @@
                 :rules="[{ required: true, message: '请填写密码' }]" />
             </van-cell-group>
             <div style="margin: 16px;margin-top: 30px;">
-              <van-button round block color="linear-gradient(to right,#1989FA, #00B0FF)" native-type="submit">
+              <van-button round block color="linear-gradient(to right,#909399, #85ABBD)" native-type="submit">
                 登录
               </van-button>
             </div>
@@ -116,7 +116,7 @@
                 :rules="[{ required: true, message: '请填写手机号' }]" />
             </van-cell-group>
             <div style="margin: 16px;margin-top: 30px;">
-              <van-button round block color="linear-gradient(to right,#1989FA, #00B0FF)" :disabled="!can_send || loginForm.account.length!==11" @click="getCaptcha">
+              <van-button round block color="linear-gradient(to right,#909399, #85ABBD)" :disabled="!can_send || loginForm.account.length!==11" @click="getCaptcha">
                 {{ smsMessage }}
               </van-button>
             </div>

+ 3 - 3
src/views/mine.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="mine">
-    <ul v-if="token">
+    <ul v-if="user.isLogin">
       <li class="hot-item" v-for="(item,index) in mineGame" :key="index">
         <img :src="prefix + item.logopic" class="game-logo" :onerror="logoErrorFun" alt=""/>
         <div class="detail">
           <div class="top">
             <span class="game_title ellip">{{ item.screen_name }}</span>
-            <el-tag  type="success">{{ (item.game_score / 10) > 5 ? '5.0' : (item.game_score /
+            <el-tag size="small"  type="success">{{ (item.game_score / 10) > 5 ? '5.0' : (item.game_score /
               10).toFixed(1)
             }}</el-tag>
           </div>
@@ -23,7 +23,7 @@
         <img :src="prefix + item.screenshot" class="game-poster" :onerror="posterErrorFun" alt=""/>
       </li>
     </ul>
-    <div v-if="!token" :style="{ height: viewWidth + 'px' }" class="df fdc aic jcc">
+    <div v-if="!user.isLogin" :style="{ height: viewWidth + 'px' }" class="df fdc aic jcc">
       <el-empty description="您还未登录!登录后可查询数据!">
         <el-button style="color:#fff" color="#909399" @click="goLogin">去登录 &gt;&gt;</el-button>
       </el-empty>

+ 1 - 1
src/views/search.vue

@@ -29,7 +29,7 @@
           </el-button>
         </div>
         <div class="right">
-          <van-button size="small" type="success" :disabled="item.download_url === '' ? true : false"  round  @click="downGame(item.download_url)">下载</van-button>
+          <van-button size="small" color="#909399" type="success" :disabled="item.download_url === '' ? true : false"  round  @click="downGame(item.download_url)">下载</van-button>
         </div>
         <img :src="search.prefix + item.screenshot" class="game-poster" :onerror="posterErrorFun" alt=""/>
       </li>