Переглянути джерело

Merge branch 'master' of ssh://10.10.101.21/source/mall-web-ssr into HEAD

# Conflicts:
#	components/default/RightBar.vue
yangc 8 роки тому
батько
коміт
51bac66605

+ 70 - 15
components/default/RightBar.vue

@@ -2,19 +2,17 @@
   <div>
     <div class="right-bar">
       <ul class="right-bar-center">
-        <li class="right-bar-item">
+        <li class="right-bar-item" @mouseenter="loadCarCount()">
           <a @click="goCart" class="title" target="_blank">
             <i class="iconfont icon-shopping-cart icon-xlg"></i>
           </a>
           <div class="sidebar-menu"><a @click="goCart" title="我的购物车" target="_blank">我的购物车<em><span>(<span v-text="cartCount.count || 0"></span>)</span></em></a></div>
         </li>
         <li class="right-bar-item">
-          <el-button type="text" @click="dialogVisible = true">
-          <a class="title">
+          <a @click="dialogVisible = true" class="title">
             <i class="iconfont icon-liuyan icon-xlg"></i>
+            <div class="sidebar-menu"><a title="留言板" target="_blank">留言板</a></div>
           </a>
-          <div class="sidebar-menu"><a title="留言板" target="_blank">留言板</a></div>
-          </el-button>
         </li>
         <li class="right-bar-item contact-menu">
           <a href="http://wpa.qq.com/msgrd?v=3&uin=3432892085&site=www.ubtoc.com&menu=yes" target="_blank" class="title">
@@ -37,7 +35,7 @@
         </li>
       </ul>
       <ul class="right-bar-bottom">
-        <li class="right-bar-item">
+        <li class="right-bar-item" @mouseenter="loadHistorys()">
           <a href="http://www.usoftmall.com/user#/browsingHistory" class="title" target="_blank">
             <i class="iconfont icon-zuji icon-xlg"></i>
           </a>
@@ -115,12 +113,6 @@
         return {}
       }
     },
-    mounted () {
-      this.$nextTick(() => {
-        this.loadHistorys()
-        this.loadCarCount()
-      })
-    },
     methods: {
       listenPage: function (p) {
         this.page = p
@@ -135,10 +127,18 @@
         })
       },
       loadHistorys () {
-        this.$store.dispatch('user/loadHistory')
+        if (this.user.logged) {
+          if (!this.history.length) {
+            this.$store.dispatch('user/loadHistory')
+          }
+        }
       },
       loadCarCount () {
-        this.$store.dispatch('user/CarCount')
+        if (this.user.logged) {
+          if (!this.cartCount.count) {
+            this.$store.dispatch('user/CarCount')
+          }
+        }
       },
       toTop () {
         scrollTo('body', 300)
@@ -148,7 +148,7 @@
       },
       deleteHistory (item, id) {
         this.$store.dispatch('user/deleteHistory', {id: id})
-        this.loadHistorys()
+        this.$store.dispatch('user/loadHistory')
       },
       goCart: function () {
         if (!this.user.logged) {
@@ -204,6 +204,61 @@
   }
 </script>
 <style lang="scss" scoped>
+  /*查看*/
+  #image-box .x-floating-wrap {
+    position: fixed;
+    z-index: 99998;
+    background: #000;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    opacity: 0.5;
+  }
+  #image-box .x-floating {
+    position: fixed;
+    z-index: 99999;
+    top: 60px;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    text-align: center;
+    vertical-align: middle;
+  }
+  #image-box .x-floating img {
+    margin: auto auto;
+    max-width: 100%;
+    max-height: 80%;
+    -webkit-user-select: none;
+    -moz-user-select: none;
+    -ms-user-select: none;
+    user-select: none
+  }
+
+  #image-box .x-close-wrap {
+    position: fixed;
+    top: 0;
+    right: 0;
+    z-index: 100000;
+    width: 120px;
+    height: 120px;
+    margin: -60px -60px 0 0;
+    border-radius: 100%;
+    background: #000;
+    opacity: .3
+  }
+
+  #image-box .x-close-wrap a {
+    position: absolute;
+    left: 25px;
+    bottom: 25px;
+    font-size: 42px;
+    color: #fff
+  }
+  #image-box .x-close-wrap:hover {
+    opacity: .7
+  }
+
   a[disabled] {
     cursor: not-allowed;
   }

+ 4 - 3
components/product/component/ComponentDetail.vue

@@ -40,8 +40,7 @@
               <div class="message-body"><a :href="list.attach" v-if="list.attach">规格书</a><span v-if="!list.attach">暂无规格书</span></div>
             </div>
             <div class="form-group">
-             <!-- <button class="btn btn-default btn-stroe">加入收藏</button>-->
-              <el-button type="text" v-if="!isShow && collectList" @click="collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</el-button>
+               <button type="text" v-if="!isShow && collectList" @click="collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</button>
                <button class="btn btn-default btn-stroe" v-if="isShow && collectList" disabled="disabled">已收藏</button>
             </div>
           </div>
@@ -111,7 +110,9 @@
     },
     methods: {
       loadCollectList () {
-        this.$store.dispatch('product/saveStores')
+        if (this.user.logged) {
+          this.$store.dispatch('product/saveStores')
+        }
       },
       collect (id) {
         if (this.user.logged) {

+ 6 - 1
components/store/CommodityInfo.vue

@@ -175,6 +175,9 @@ export default {
     calculate () {
       this.fragment.total = this.fragment.price * this.fragment.num
       return Math.ceil(this.fragment.total * Math.pow(10, 2)) / Math.pow(10, 2)
+    },
+    user () {
+      return this.$store.state.option.user
     }
   },
   mounted () {
@@ -184,7 +187,9 @@ export default {
   },
   methods: {
     loadSaveHistory () {
-      this.$store.dispatch('shop/saveHistory', {id: this.commodity.batchCode})
+      if (this.user.logged) {
+        this.$store.dispatch('shop/saveHistory', {id: this.commodity.batchCode})
+      }
     },
     changeCurrency () {
       if (this.fragment.currency === 'RMB') {

+ 4 - 2
components/store/common/StoreHeader.vue

@@ -15,7 +15,7 @@
                 </div>
                 <div class="icon-style">
                   <!--<button class="btn btn-xs btn-danger btn-nav" v-if="!isFocus"><span class="watch">关注</span></button>-->
-                  <span v-if="!isFocus"><el-button type="text" @click="focus(storeInfo.id, storeInfo.storeName)" class="btn btn-xs btn-danger btn-nav"><span class="watch">关注</span></el-button></span>
+                  <span v-if="!isFocus"><button type="text" @click="focus(storeInfo.id, storeInfo.storeName)" class="btn btn-xs btn-danger btn-nav"><span class="watch">关注</span></button></span>
                   <span v-if="isFocus" ><button class="btn btn-xs btn-default btn-nav" style="width:50px"><span>已关注</span></button></span>
                   <span v-if="storeInfo.type == 'ORIGINAL_FACTORY'">&nbsp;<img src="/images/store/icon/icon-factory.png"/></span>
                   <span v-else-if="storeInfo.type == 'AGENCY'">&nbsp;<img src="/images/store/icon/icon-agent.png"/></span>
@@ -98,7 +98,9 @@ export default {
   },
   methods: {
     loadFocusList () {
-      this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
+      if (this.user.logged) {
+        this.$store.dispatch('shop/StoreFocusList', {id: this.storeInfo.id})
+      }
     },
     closeDropDown () {
       this.isOpen = false