소스 검색

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	components/default/RightBar.vue
ouxq 8 년 전
부모
커밋
a3369020de
4개의 변경된 파일32개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 0
      components/common/buyOrCar/buyComponent.vue
  2. 26 6
      components/default/RightBar.vue
  3. 4 4
      components/store/CommodityList.vue
  4. 1 1
      nuxt.config.js

+ 1 - 0
components/common/buyOrCar/buyComponent.vue

@@ -20,6 +20,7 @@
           })
         } else {
           if (this.item) {
+            console.log(this.item)
             // this.$emit('buyAction', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])
             if (isBuy) {
               // this.$store.dispatch('user/getBuyInfo', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])

+ 26 - 6
components/default/RightBar.vue

@@ -3,10 +3,10 @@
     <div class="right-bar">
       <ul class="right-bar-center">
         <li class="right-bar-item" @mouseenter="loadCarCount()">
-          <a href="/user#/cart" class="title" target="_blank">
+          <a @click="goCart" class="title" target="_blank">
             <i class="iconfont icon-shopping-cart icon-xlg"></i>
           </a>
-          <div class="sidebar-menu"><a href="/user#/cart" title="我的购物车" target="_blank">我的购物车<em><span>(<span v-text="cartCount.count || 0"></span>)</span></em></a></div>
+          <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">
@@ -29,11 +29,11 @@
           </div>
         </li>
         <li class="right-bar-item contact-menu">
-          <a href="javascript:void(0)" class="title" @click="goWebChat">
+          <a href="javascript:void(0)" class="title" @click="goWebChat" @mouseenter="getChatCount">
             <i class="fa fa-comments-o" aria-hidden="true" style="font-size: 18px;color: #FFFFFF;">
             </i>
           </a>
-          <div class="sidebar-menu" title="优软互联"><a @click="goWebChat">优软互联</a><em><!-- ngIf: userInfo --></em></div>
+          <div class="sidebar-menu" title="优软互联"><a @click="goWebChat">优软互联<span v-if="user.logged">({{chatCount}})</span></a></div>
         </li>
       </ul>
       <ul class="right-bar-bottom">
@@ -86,7 +86,8 @@
         dialogImageUrl: '',
         page: 1,
         count: 3,
-        currentPage: 1
+        currentPage: 1,
+        chatCount: -1
       }
     },
     created () {
@@ -156,8 +157,19 @@
         this.$store.dispatch('user/deleteHistory', {id: id})
         this.$store.dispatch('user/loadHistory')
       },
+      goCart: 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#/cart'
+        }
+      },
       goWebChat: function () {
-        if (!this.$store.state.option.user.logged) {
+        if (!this.user.logged) {
           this.$http.get('/login/page').then(response => {
             if (response.data) {
               this.$router.push('/auth/login')
@@ -186,6 +198,14 @@
               console.log(err)
             })
         }
+      },
+      getChatCount: function () {
+        if (this.user.logged) {
+          axios.get('http://im.ubtob.com/api/chat/message', {params: {enUU: this.enterprise.uu, operate: 'count_unread', phone: this.user.data.userTel}})
+            .then(response => {
+              this.chatCount = response.data.count
+            })
+        }
       }
     }
   }

+ 4 - 4
components/store/CommodityList.vue

@@ -97,7 +97,7 @@
                 </div>
                 <div class="col-xs-4 txt-info">
                   <p class="grey f16">暂无器件信息</p>
-                  <i class="iconfont">&#xe610;</i>&nbsp;<a @click="goBack()">返回上一页</a>
+                  <i class="iconfont">&#xe610;</i>&nbsp;<a href="/">返回首页</a>
                 </div>
               </div>
             </td>
@@ -197,10 +197,10 @@ export default {
     handleCurrentChange (page) {
       this.pageParams.page = page
       this.pageCommodity(this.pageParams, this.ids, this.searchCode)
-    },
-    goBack () {
-      this.$router.back(-1)
     }
+//    goBack () {
+//      this.$router.back(-1)
+//    }
   }
 }
 </script>

+ 1 - 1
nuxt.config.js

@@ -109,5 +109,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/platform-b2c**']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/platform-b2c**', '/store**']
 }