pujiaming 2 éve
szülő
commit
4d50abaf91
3 módosított fájl, 25 hozzáadás és 10 törlés
  1. 2 2
      .env.development
  2. 2 1
      src/views/home.vue
  3. 21 7
      src/views/mine.vue

+ 2 - 2
.env.development

@@ -2,7 +2,7 @@ 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_API_HOST = http://gm.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'

+ 2 - 1
src/views/home.vue

@@ -402,7 +402,8 @@ const downGame = (url: string, disabled:boolean) => {
             position: absolute;
             right: 5px;
             bottom: 5px;
-            width: 46px;
+            // width: 46px;
+            text-align: center;
             height: 46px;
           }
         }

+ 21 - 7
src/views/mine.vue

@@ -91,17 +91,17 @@
 </template>
 
 <script setup lang="ts">
-import { onMounted, ref, reactive, inject } from 'vue'
+import { onMounted, ref, reactive, inject, computed } from 'vue'
 import { getMineGame, getGiftHttp, receiveGiftHttp } from '@/api/index'
 import { useStore } from '@/store/index'
-import { useRoute } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import Message from '@/utils/Message'
 import local from '@/utils/local'
 import { bytesChange } from '@/utils/bytesFormatter'
 import { Download } from '@element-plus/icons-vue'
 
 const { user } = useStore()
-// const router = useRouter()
+const router = useRouter()
 const img:any = inject('img')
 const route = useRoute()
 // const header = useStore('header')
@@ -155,10 +155,24 @@ const loadMore = () => {
   params.page += 1
   getMyGame(params)
 }
-
+const platform = computed(() => {
+  var u = navigator.userAgent
+  return {
+    mobile: !!u.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端
+    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端
+    android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, // android终端
+    iPhone: u.indexOf('iPhone') > -1, // 是否为iPhone或者QQHD浏览器
+    iPad: u.indexOf('iPad') > -1, // 是否iPad
+    webApp: u.indexOf('Safari') === -1, // 是否web应该程序,没有头部与底部
+    weixin: u.indexOf('MicroMessenger') > -1 // 是否微信
+  }
+})
 const goLogin = () => {
-  // router.push({ path: '/login' })
-  user.loginFormVisible = true
+  if (platform.value.mobile) {
+    router.push({ path: '/login' })
+  } else {
+    user.loginFormVisible = true
+  }
   local.remove('headerPath')
 }
 const giftData = ref<any[]>([])
@@ -185,7 +199,7 @@ const showGifts2 = async(row:any) => {
 const receiveGift = async(id:number) => {
   await receiveGiftHttp({ id }).then((res) => {
     console.log(res)
-    Message.error(res.data.msg)
+    Message.success(res.data.msg)
     dialogVisible.value = false
   }).catch((error) => {
     console.log(error)