Browse Source

浏览历史登录判断,首页分类样式调整

yangc 8 years ago
parent
commit
ba990b4f86
2 changed files with 20 additions and 4 deletions
  1. 14 3
      components/default/RightBar.vue
  2. 6 1
      components/home/KindCategory.vue

+ 14 - 3
components/default/RightBar.vue

@@ -36,13 +36,13 @@
       </ul>
       <ul class="right-bar-bottom">
         <li class="right-bar-item" @mouseenter="loadHistorys()">
-          <a href="http://www.usoftmall.com/user#/browsingHistory" class="title" target="_blank">
+          <a @click="goHistory" class="title" target="_blank">
             <i class="iconfont icon-zuji icon-xlg"></i>
           </a>
-          <div class="sidebar-menu" v-if="!user.logged"><a href="/user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
+          <div class="sidebar-menu" v-if="!user.logged"><a @click="goHistory" title="浏览记录" target="_blank">浏览记录</a></div>
           <div class="sidebar-menu" v-if="user.logged && listMe(history).length == 0"><a href="/user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
           <div class="foot-record sidebar-menu" v-if="user.logged && listMe(history).length > 0">
-            <h3><a href="">浏览历史</a></h3>
+            <h3><a>浏览历史</a></h3>
             <dl>
               <dd v-for="item in listMe(history)">
                   <a :href="'/store/' + item.storeid + '/' + item.batchCode" :title="item.code" v-text="item.code" v-if="item.status== 1"></a>
@@ -150,6 +150,17 @@
         this.$store.dispatch('user/deleteHistory', {id: id})
         this.$store.dispatch('user/loadHistory')
       },
+      goHistory: function () {
+        if (!this.user.logged) {
+          this.$http.get('/login/page').then(response => {
+            if (response.data) {
+              this.$router.push('/auth/login')
+            }
+          })
+        } else {
+          window.location.href = '/user#/browsingHistory'
+        }
+      },
       goCart: function () {
         if (!this.user.logged) {
           this.$http.get('/login/page').then(response => {

+ 6 - 1
components/home/KindCategory.vue

@@ -139,7 +139,12 @@
         height: 477px;
         font-size: 12px;
         overflow-y: auto;
-
+        a {
+            color: #000;
+        }
+        a:hover {
+         color: #ff0006;
+        }
         .kind-children-item-wrap {
           height: 100%;
           width: 100%;