Browse Source

跳转移动端

skyblued 2 years ago
parent
commit
ba537f02f5
3 changed files with 7 additions and 6 deletions
  1. 2 2
      index.html
  2. 4 3
      src/components/banner/index.tsx
  3. 1 1
      src/components/col-header/index.css

+ 2 - 2
index.html

@@ -35,8 +35,8 @@
     <meta name="msapplication-tap-highlight" content="no" />
     <title>酷乐秀</title>
     <script>
-      if(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(navigator.userAgent)){
-        if (/(localhost)/ig.test(location.origin)) {
+      if(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(navigator.userAgent) || window.innerWidth < 1000){
+        if (/(localhost|192)/ig.test(location.origin)) {
           location.href = 'https://dev.colexiu.com/mobile'
         } else {
           location.href = location.origin + '/mobile'

+ 4 - 3
src/components/banner/index.tsx

@@ -55,11 +55,12 @@ export default defineComponent({
     }
     onMounted(() => {
       getBannerList()
-      window.onresize = () => {
+      // window.onresize = () => {
+        // console.log(state.swiper)
         // state.swiper.updateSize()
-        window.location.reload()
+        // window.location.reload()
 
-      }
+      // }
     })
     return () => (
       <>

+ 1 - 1
src/components/col-header/index.css

@@ -174,7 +174,7 @@
   font-size: 20px;
   font-weight: 600;
   display: inline-block;
-
+  white-space: nowrap;
 }
 
 .navWrap {