lzq %!s(int64=6) %!d(string=hai) anos
pai
achega
43fad310fb
Modificáronse 2 ficheiros con 28 adicións e 10 borrados
  1. 7 4
      src/components/Banner.vue
  2. 21 6
      src/components/Top.vue

+ 7 - 4
src/components/Banner.vue

@@ -4,7 +4,7 @@
       <el-carousel indicator-position="none" arrow="never">
         <el-carousel-item v-for="item in 3" :key="item">
           <div class="wrap">
-            <button class="ask-for">申请经纪商</button>
+            <button class="ask-for" @click="goApply()">申请经纪商</button>
           </div>
         </el-carousel-item>
       </el-carousel>
@@ -12,7 +12,7 @@
         <LoginWindow></LoginWindow>
       </div>
       <div :class="{'black-line':true,'fix-bottom':scrolled}">
-        <button class="line-button">申请经纪商</button>
+        <button class="line-button" @click="goApply()">申请经纪商</button>
         <span class="phoneNum">热线电话:+86 173 5471 8363</span>
       </div>
 
@@ -38,8 +38,11 @@ export default {
       }else{
         this.scrolled = false;
       }
-    }
-  },
+    },
+    goApply: function () {
+          this.$router.push('/apply')
+        }
+      },
   mounted () {
     window.addEventListener('scroll', this.handleScroll)
   }

+ 21 - 6
src/components/Top.vue

@@ -31,7 +31,8 @@ export default {
       src1: '../../static/images/mainLogo.png',
       src2: '../../static/images/logo2.png',
       index: true,
-      apply: false
+      apply: false,
+      username:''
     }
   },
   computed: {
@@ -45,13 +46,22 @@ export default {
   },
   methods: {
     goApply: function (route) {
-      this.$router.push('/' + route)
       if (route == 'apply') {
-        this.apply = true
-        this.index = false
-        this.topchange = 'toptwo'
-        this.scrolled = true
+        if(this.logined){
+          this.$router.push('/' + route)
+          this.apply = true
+          this.index = false
+          this.topchange = 'toptwo'
+          this.scrolled = true
+        }else{
+          this.$notify({
+            title: '提示',
+            message: '请先登录',
+            type: 'warning'
+          })
+        }
       } else {
+        this.$router.push('/' + route)
         this.apply = false
         this.index = true
       }
@@ -86,6 +96,11 @@ export default {
       this.apply = false
       this.index = true
     }
+  },
+  computed:{
+    logined(){
+      return this.$store.state.logined
+    }
   }
 }
 </script>