瀏覽代碼

Merge branch 'master' into feature-orderSearch-0818

# Conflicts:
#	assets/scss/common.scss
#	components/common/upload/upload.vue
#	components/default/Header.vue
#	components/main/Search.vue
#	components/search/GoodList.vue
#	components/searchStore/SearchTitle.vue
#	components/searchStore/StoreContent.vue
#	components/store/CommodityList.vue
#	nuxt.config.js
#	pages/register-saler/index.vue
wangdy 8 年之前
父節點
當前提交
6511027090
共有 79 個文件被更改,包括 1240 次插入682 次删除
  1. 1 1
      Dockerfile
  2. 9 0
      app.html
  3. 242 0
      assets/scss/activity.css
  4. 20 7
      assets/scss/common.scss
  5. 6 3
      components/common/buyOrCar/buyComponent.vue
  6. 0 119
      components/common/image-upload/imageUpload.vue
  7. 40 6
      components/common/page/pageComponent.vue
  8. 6 6
      components/default/Footer.vue
  9. 34 12
      components/default/Header.vue
  10. 20 38
      components/default/MessageBoard.vue
  11. 12 22
      components/default/RightBar.vue
  12. 7 1
      components/home/Carousel.vue
  13. 3 0
      components/home/KindCategory.vue
  14. 2 0
      components/home/News.vue
  15. 8 3
      components/home/Partner.vue
  16. 4 4
      components/home/floor/Floor.vue
  17. 19 28
      components/home/floor/FloorBar.vue
  18. 5 5
      components/main/Search.vue
  19. 28 19
      components/main/count/Box.vue
  20. 93 27
      components/main/count/Item.vue
  21. 61 18
      components/product/ComponentGoods.vue
  22. 1 0
      components/product/brand/BrandComponent.vue
  23. 37 14
      components/product/component/ComponentDetail.vue
  24. 62 17
      components/product/component/StoreInfo.vue
  25. 1 1
      components/provider/ExcellentSuppliers.vue
  26. 18 2
      components/provider/NewStore.vue
  27. 3 3
      components/provider/Suppliers.vue
  28. 68 49
      components/search/GoodList.vue
  29. 2 2
      components/search/Kind.vue
  30. 11 11
      components/searchStore/SearchTitle.vue
  31. 7 3
      components/searchStore/StoreContent.vue
  32. 84 15
      components/store/CommodityInfo.vue
  33. 45 10
      components/store/CommodityList.vue
  34. 35 7
      components/store/RecommendProduct.vue
  35. 15 6
      components/store/common/StoreHeader.vue
  36. 29 22
      layouts/error.vue
  37. 5 1
      middleware/authenticated.js
  38. 4 3
      nuxt.config.js
  39. 131 0
      pages/activity/business.vue
  40. 0 56
      pages/auth/login.vue
  41. 0 34
      pages/auth/logout.vue
  42. 23 9
      pages/help/home.vue
  43. 0 1
      pages/news/index.vue
  44. 0 56
      pages/platform-b2c/login/proxy.vue
  45. 0 34
      pages/platform-b2c/logout/proxy.vue
  46. 1 1
      pages/product/kind/_id.vue
  47. 1 1
      pages/provider/list.vue
  48. 1 1
      pages/store/_uuid/_batchCode.vue
  49. 2 2
      plugins/axios.js
  50. 16 0
      post.sh
  51. 0 1
      run.sh
  52. 二進制
      static/images/404.png
  53. 二進制
      static/images/activity/business-banner.jpg
  54. 二進制
      static/images/activity/business.png
  55. 二進制
      static/images/activity/style01.jpg
  56. 二進制
      static/images/activity/style02.jpg
  57. 二進制
      static/images/activity/style03.jpg
  58. 二進制
      static/images/activity/style04.jpg
  59. 二進制
      static/images/activity/style05.jpg
  60. 二進制
      static/images/activity/style06.jpg
  61. 二進制
      static/images/activity/style07.jpg
  62. 二進制
      static/images/activity/style08.jpg
  63. 二進制
      static/images/all/count_bg.png
  64. 二進制
      static/images/partners/8.jpg
  65. 二進制
      static/images/zhongqiu/zq1.png
  66. 二進制
      static/images/zhongqiu/zq10.png
  67. 二進制
      static/images/zhongqiu/zq11.png
  68. 二進制
      static/images/zhongqiu/zq12.png
  69. 二進制
      static/images/zhongqiu/zq13.png
  70. 二進制
      static/images/zhongqiu/zq2.png
  71. 二進制
      static/images/zhongqiu/zq3.png
  72. 二進制
      static/images/zhongqiu/zq4.png
  73. 二進制
      static/images/zhongqiu/zq5.png
  74. 二進制
      static/images/zhongqiu/zq6.png
  75. 二進制
      static/images/zhongqiu/zq7.png
  76. 二進制
      static/images/zhongqiu/zq8.png
  77. 二進制
      static/images/zhongqiu/zq9.png
  78. 2 1
      store/index.js
  79. 16 0
      store/shop.js

+ 1 - 1
Dockerfile

@@ -8,6 +8,6 @@ COPY . /app
 RUN chmod +x run.sh
 
 RUN cnpm install
-#RUN npm run build
+RUN npm run build
 
 CMD [ "/app/run.sh" ]

+ 9 - 0
app.html

@@ -8,6 +8,7 @@
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css"/>
   {{ HEAD }}
   <script>
+    var _hmt = _hmt || [];
     (function (w, d) {
       if (/(MSIE)|(Trident)/.test(w.navigator.userAgent)) {
         var head = d.getElementsByTagName('head')[0]
@@ -20,8 +21,16 @@
         appendScript('https://cdn.bootcss.com/html5shiv/r29/html5.min.js')
         appendScript('https://cdn.bootcss.com/js-polyfills/0.1.33/polyfill.min.js')
       }
+      var hm = d.createElement("script");
+      hm.src = "https://hm.baidu.com/hm.js?34793672f88552a77437f2cee7864118;"
+      var s = d.getElementsByTagName("script")[0];
+      s.parentNode.insertBefore(hm, s);
+      var cnzz_protocol = (("https:" == d.location.protocol) ? " https://" : " http://");
+      d.write(unescape("%3Cspan id='cnzz_stat_icon_1267002346'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1267002346%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));
     })(window, document)
   </script>
+  <script type="text/javascript">
+  </script>
 </head>
 <body {{ BODY_ATTRS }}>
 {{ APP }}

+ 242 - 0
assets/scss/activity.css

@@ -0,0 +1,242 @@
+/*招商注册*/
+ul,li{
+  list-style: none;
+}
+.business{
+  width: 100%;
+  margin: 0 auto;
+}
+.business .banner{
+  width: 100%;
+  height: 676px;
+  margin: 0 auto;
+  background: url("/images/activity/business-banner.jpg") no-repeat center;
+}
+@media screen and (max-width: 1366px) {
+  .business .banner{
+    height: 560px;
+    background-size: 100% 100%;
+  }
+}
+.business  .session{
+  width: 100%;
+  margin: 0 auto;
+}
+.business  .session .content{
+  width: 1190px;
+  margin: 0 auto;
+}
+.business .introduction{
+  margin-top: 75px;
+}
+.business h3{
+  text-align: center;
+  font-size: 30px;
+  margin: 0;
+}
+.business .introduction .text{
+  font-size: 16px;
+  color: #666;
+  line-height: 35px;
+  margin: 50px 130px 140px 130px;
+  /*opacity:0;
+  transform:scale(0);
+  transition:.5s 0.1s;*/
+}
+.business .introduction.active .text{
+  opacity:1 !important; transform:none !important;
+}
+.business .join{
+  text-align: center;
+  width: 100%;
+  margin: 0 auto;
+}
+.business .introduction .join{
+  margin-bottom: 45px;
+}
+.business .join a{
+  width: 154px;
+  height: 46px;
+  display: inline-block;
+  line-height: 46px;
+  text-align: center;
+  background: #f51f1f;
+  font-size: 18px;
+  border-radius: 25px;
+  color: #fff;
+}
+.business .join a:hover{
+  background: #d32526;
+}
+.business .advantage{
+  background: #6a99fa;
+  height: 630px;
+}
+.business .advantage h3{
+  color: #fff;
+  padding: 95px 0 95px 0;
+}
+.business .advantage .advantage-list{
+  width: 100%;
+  margin: 0 auto;
+  display: inline-block;
+}
+.business .advantage .advantage-list ul{
+  width: 100%;
+  margin: 0 auto;
+  display: inline-block;
+  height: 235px;
+}
+.business .advantage .advantage-list ul  li{
+  float: left;
+  width: 174px;
+  height: 206px;
+  border-radius: 10px;
+  background: #fff;
+  margin: 0 6px;
+  overflow: hidden;
+  position: relative;
+  /*opacity:0;
+  transform:scale(0);
+  transition:.5s 0.1s;*/
+}
+/*.business .advantage.active .advantage-list ul  li{
+    opacity:1 !important; transform:none !important;
+}*/
+.business .advantage .advantage-list ul  li:hover{
+  cursor: pointer;
+  width: 200px;
+  height: 233px;
+  margin: 0 10px;
+  top: -16px;
+  transition: top 1s ease-out;
+}
+.business .advantage .advantage-list ul  li:hover p.title{
+  background: #61d2f3;
+  height: 70px;
+  line-height: 70px;
+  color: #fff;
+  font-size: 18px;
+}
+.business .advantage .advantage-list ul  li:hover p:last-child{
+  color: #333;
+}
+.business .advantage .advantage-list ul  li p{
+  display: inline-block;
+  width: 100%;
+}
+.business .advantage .advantage-list ul  li p.title{
+  height: 58px;
+  line-height: 58px;
+  background: #e1eafc;
+  text-align: center;
+  font-size: 14px;
+  color: #666;
+}
+.business .advantage .advantage-list ul  li p:last-child{
+  padding: 16px 20px;
+  color: #999;
+  font-size: 14px;
+  line-height: 20px;
+}
+.business .advantage .join{
+  margin-top: 85px;
+}
+.business .style{
+  height: 700px;
+}
+.business .style h3{
+  padding-top: 80px;
+}
+.business .style .style-list{
+  width: 100%;
+  margin: 0 auto;
+  display: inline-block;
+  margin-top: 55px;
+}
+.business .style .style-list ul{
+  width: 96%;
+  margin: 0 auto;
+  display: inline-block;
+}
+.business .style .style-list ul li{
+  float: left;
+  width: 25%;
+  text-align: center;
+}
+.business .style .style-list ul li:hover img{
+  transform: scale(1.01);
+}
+/*.business .style .style-list ul li:hover p{
+    color: #5078cb;
+}*/
+.business .style .style-list ul li img{
+  width: 108px;
+  height: 108px;
+}
+.business .style .style-list ul li p{
+  font-size: 16px;
+  color: #333;
+  line-height: 70px;
+  margin-bottom: 20px;
+}
+.business .style .join{
+  margin-top: 15px;
+}
+.business  .join-us{
+  background: #64c7f2;
+  height: 630px;
+  margin-bottom: 40px;
+}
+.business  .join-us h3{
+  color: #fff;
+  padding-top: 55px;
+}
+.business  .join-us .content{
+  height: 660px;
+  background: url("/images/activity/business.png") no-repeat center;
+}
+.business  .join-us  .join-step{
+  width: 94%;
+  margin: 0 auto;
+  margin-top: 307px;
+  display: inline-block;
+}
+.business  .join-us  .join-step div{
+  float: left;
+  width: 28%;
+  text-align: center;
+}
+.business  .join-us  .join-step div:first-child{
+  margin-left: 125px;
+}
+.business  .join-us  .join-step div h5{
+  margin: 0;
+  line-height: 30px;
+  font-size: 18px;
+  color: #fff;
+}
+.business  .join-us  .join-step div p{
+  line-height: 20px;
+  font-size: 14px;
+  color: #fff;
+}
+.business  .join-us .join{
+  margin-top: 90px;
+}
+.business .join a:hover{
+  transform: scale(1.1);
+  transition: transform .2s ease-out;
+}
+/*
+.business .join{
+    animation:come_on 2s infinite;
+}
+@keyframes come_on {
+    0% {
+        transform: scale(1); }
+    50% {
+        transform: scale(1.04); }
+    100% {
+        transform: scale(1); }
+}*/

+ 20 - 7
assets/scss/common.scss

@@ -18,6 +18,11 @@
     background-color: rgba(95,95,95, .7);
   }
 }
+
+#cnzz_stat_icon_1267002346 {
+  display: none;
+}
+
 // common style
 .clearfix {
   &:before, &:after {
@@ -611,6 +616,21 @@ div.el-tree-node__content{
   position: relative;
   z-index: 10;
 }
+.componentDetail .el-dialog--tiny{
+  width: 320px !important;
+}
+.componentDetail .el-dialog__body{
+  padding: 14px !important;
+}
+
+a {
+  color: #2d8cf0;
+  background: 0 0;
+  text-decoration: none;
+  outline: 0;
+  cursor: pointer;
+  transition: color .2s ease;
+}
 .select-adder {
   background:url("../../static/images/all/xiala.png") right no-repeat #fff !important;
   background-position-x: 100% !important;
@@ -624,10 +644,3 @@ div.el-tree-node__content{
 .select-adder::-ms-expand {
   display: none;
 }
-.componentDetail .el-dialog--tiny{
-  width: 320px !important;
-}
-.componentDetail .el-dialog__body{
-  padding: 14px !important;
-}
-

+ 6 - 3
components/common/buyOrCar/buyComponent.vue

@@ -11,9 +11,9 @@
     methods: {
       buyNow: function (isBuy) {
         if (!this.$store.state.option.user.logged) {
-          this.$http.get('/login/page').then(response => {
+          this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
         } else {
@@ -52,6 +52,9 @@
                   }
                 }, err => {
                   console.log(err)
+                  if (this.item.minBuyQty > this.item.reserve) {
+                    this.$message.error('商品' + this.item.code + '的库存已经不满足起订量')
+                  }
                 })
             } else {
               // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
@@ -161,7 +164,7 @@
   }
 </script>
 
-<style>
+<style scoped>
   /* 物品列表按钮 */
   .btn-buy-now {
     background-color: #5078CB;

+ 0 - 119
components/common/image-upload/imageUpload.vue

@@ -1,119 +0,0 @@
-<template>
-  <div>
-    <el-upload
-      action = "/api/images"
-      :on-preview="handlePictureCardPreview"
-      :on-remove="handleRemove"
-      list-type="picture-card"
-      :on-success="uploadSuccess">
-      <img src="/images/messageBoard/msg_uploadPic.png" alt="">
-    </el-upload>
-    <el-dialog v-model="dialogVisible" size="tiny" id="preview">
-      <img :src="dialogImageUrl" width="100%" alt="">
-    </el-dialog>
-    <!--<div v-model="dialogVisible" size="tiny" id="preview">-->
-      <!--<img :src="dialogImageUrl" width="100%" alt="">-->
-    <!--</div>-->
-  </div>
-</template>
-<script>
-  export default {
-    data () {
-      return {
-        dialogImageUrl: '',
-        dialogVisible: false
-      }
-    },
-    methods: {
-      handleRemove (file, fileList) {
-        console.log(file)
-      },
-      handlePictureCardPreview (file) {
-        this.dialogImageUrl = file.url
-        this.dialogVisible = true
-        let preview = document.querySelector('.el-upload-list__item-preview')
-        preview.setAttribute('date-toggle', 'modal')
-        preview.setAttribute('date-target', '#preview')
-      },
-      uploadSuccess (response, file, fileList) {
-        this.$emit('fileAction', file.url)
-      }
-    }
-  }
-</script>
-<style>
-  input[type="file"] {
-    display: none;
-  }
-  .el-upload--picture-card {
-    position: relative;
-    width: 82px;
-    height: 70px;
-    line-height: 70px;
-    background: transparent;
-    cursor: pointer;
-    border-radius: 0;
-    box-sizing: border-box;
-    border: none;
-  }
-  .el-upload--picture-card:hover {
-    border-color: #ddd;
-    color: transparent;
-  }
-  .el-upload-list--picture-card {
-    margin: 0;
-    display: inline-block;
-    vertical-align: top;
-    height: 72px;
-  }
-  .el-upload-list--picture-card .el-upload-list__item {
-    margin: 0;
-    width: 82px;
-    height: 70px;
-    border: 1px solid #ccc;
-    border-radius: 0;
-    background: transparent;
-  }
-  .el-upload-list--picture-card .el-upload-list__item-thumbnail {
-    max-width: 82px;
-    max-height: 66px;
-  }
-  .el-upload-list__item.is-success .el-upload-list__item-status-label {
-    display: none;
-  }
-  [class*=" el-icon-"], [class^=el-icon-] {
-    font-size: 14px;
-  }
-  .el-icon-delete2 {
-    position: absolute;
-    top: 3px;
-    right: 3px;
-    /*top: 3px;*/
-    /*right: -30px;*/
-  }
-  /*.el-icon-view{*/
-    /*display: none;*/
-  /*}*/
-  /*.el-upload-list__item-preview{*/
-    /*display: none;*/
-  /*}*/
-  .el-upload-list__item-preview .el-icon-view {
-    margin-right: 7px;
-  }
-  .el-upload-list__item-preview:after{
-    content: '查看';
-    font-size: 14px;
-  }
-  .el-upload-list--picture-card .el-upload-list__item-actions{
-    position: absolute;
-    left: 0;
-    top: 0;
-    text-align: right;
-  }
-  .el-dialog--tiny {
-    width: 35%;
-  }
-  .v-modal{
-    z-index: 1983;
-  }
-</style>

+ 40 - 6
components/common/page/pageComponent.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="page-wrap" v-if="total/1.0/pageSize>1">
     <el-pagination
-      :current-page.sync="current"
+      :current-page.sync="currentPage"
       :page-size="pageSize"
       layout="prev, pager, next"
       :total="total"
@@ -10,7 +10,7 @@
     </el-pagination>
     <ul class="pagination" style="float:right;margin-left:20px;">
       <li>
-        <input type="text" class="page-number" v-model="nowPage">
+        <input type="number" class="page-number" @keyup.13="changePage" v-model="nowPage">
       </li>
       <li>
         <a class="page-a" @click="changePage">GO</a>
@@ -23,20 +23,30 @@
   export default {
     data () {
       return {
-        nowPage: this.current
+        nowPage: 1,
+        currentPage: 1
       }
     },
     watch: {
       current: function () {
-        this.nowPage = this.current
+        this.nowPage = Number(this.current)
+        this.currentPage = this.nowPage
       }
     },
     props: ['current', 'total', 'pageSize'],
     methods: {
       handleCurrentChange: function (changedPage) {
-        this.$emit('childEvent', changedPage)
+        if (this.nowPage !== this.currentPage) {
+          this.$emit('childEvent', changedPage)
+        }
       },
       changePage: function () {
+        let totalPage = Math.ceil(this.total / this.pageSize)
+        if (this.nowPage > totalPage) {
+          this.nowPage = totalPage
+        } else if (this.nowPage < 1) {
+          this.nowPage = 1
+        }
         this.$emit('childEvent', this.nowPage)
       }
     }
@@ -44,7 +54,7 @@
 </script>
 
 <style>
-  a {
+  .page-wrap a {
     color: #2d8cf0;
     background: 0 0;
     text-decoration: none;
@@ -52,8 +62,21 @@
     cursor: pointer;
     transition: color .2s ease;
   }
+  .el-pagination {
+    padding: 0;
+  }
   .el-pagination .btn-next, .el-pagination .btn-prev {
     color: #337ab7;
+    width: 33px;
+    height: 30px;
+  }
+  .el-pagination .btn-next {
+    border-top-right-radius: 4px;
+    border-bottom-right-radius: 4px;
+  }
+  .el-pagination .btn-prev {
+    border-top-left-radius: 4px;
+    border-bottom-left-radius: 4px;
   }
   .el-pager li{
     color: #337ab7;
@@ -61,6 +84,9 @@
     background-color: #fff;
     border: 1px solid #ddd;
     font-size: 10px;
+    width: 33px;
+    height: 30px;
+    border-right: none;
   }
   .el-pager li:not(.active):hover, .el-pagination button:hover {
     z-index: 3;
@@ -134,4 +160,12 @@
     display: inline-block;
     margin: 0;
   }
+  input.page-number {
+    -moz-appearance:textfield;
+  }
+  input.page-number::-webkit-inner-spin-button,
+  input.page-number::-webkit-outer-spin-button {
+    -webkit-appearance: none;
+    margin: 0;
+  }
 </style>

+ 6 - 6
components/default/Footer.vue

@@ -71,17 +71,17 @@
           url: 'http://www.usoftchina.com/usoft',
           title: '深圳市优软科技'
         }, {
-          url: 'http://www.fantem.com',
-          title: '丰唐物联技术(深圳)'
+          url: 'http://www.51cube.com',
+          title: '酷比魔方'
         }, {
-          url: 'http://www.hiways.com',
-          title: '深圳市海威思科技'
+          url: 'http://www.szsoling.com/home',
+          title: 'SOLING 索菱'
         }, {
           url: 'http://www.huashangweitai.com',
           title: '深圳市华商维泰显示科技'
         }, {
-          url: 'http://www.ufct.com.cn',
-          title: '联合创泰科技'
+          url: 'http://www.szmadigi.com',
+          title: '迈迪杰科技'
         }]
       }
     }

+ 34 - 12
components/default/Header.vue

@@ -16,18 +16,18 @@
               </div>
               <ul class="dropdown-menu">
                 <li class="menu-item-first">
-                  <span><i class="fa fa-map-marker"></i>&nbsp;{{ enterprise.enName }}</span>
+                  <span class="member-text" :title="enterprise.enName"><i class="fa fa-map-marker"></i>&nbsp;{{ enterprise.enName }}</span>
                   <a class="pull-right" @click="toggleEnterprises()" v-if="user.data.enterprises && user.data.enterprises.length > 0">
                     {{ showEnterprises ? '取消' : '切换' }}
                   </a>
                 </li>
                 <li class="menu-item"
                     v-for="en in user.data.enterprises"
-                    v-if="showEnterprises && en.enName!=enterprise.enName">
-                  <a @click="switchEnterprise(en)">{{ en.enName }}</a>
+                    v-if="showEnterprises && en.uu!=enterprise.uu">
+                  <a @click="switchEnterprise(en)" :title="en.enName">{{ en.enName }}</a>
                 </li>
                 <li class="menu-item"  v-if="showEnterprises && enterprise.uu">
-                  <a @click="switchEnterprise({uu: 0})">(<span v-text="user.data.userName"></span>)个人账户</a>
+                  <a @click="switchEnterprise({uu: 0})"><span v-text="user.data.userName"></span>(个人账户)</a>
                 </li>
               </ul>
             </div>
@@ -66,9 +66,9 @@
       enterprise () {
         let ens = this.user.data.enterprises
         if (ens && ens.length) {
-          return ens.find(item => item.current) || {enName: '(' + this.user.data.userName + ')' + '个人账户'}
+          return ens.find(item => item.current) || {enName: this.user.data.userName + '(个人账户)'}
         } else {
-          return {enName: '(' + this.user.data.userName + ')' + '个人账户'}
+          return {enName: this.user.data.userName + '(个人账户)'}
         }
       },
       url () {
@@ -77,13 +77,16 @@
     },
     methods: {
       logout () {
-        this.$router.push('/auth/logout')
+        this.$http.get('/logout/crossBefore').then(response => {
+          if (response.data) {
+            window.location.href = response.data.logoutUrl + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+          }
+        })
       },
       onLoginClick () {
-        this.$http.get('/login/page').then(response => {
+        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
-            window.location.href = response.data.content
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
         // TODO 待Account Center改版
@@ -91,7 +94,6 @@
       onRegisterClick () {
         this.$http.get('/register/page').then(response => {
           if (response.data) {
-        //    this.$router.push('/auth/login')
             window.location.href = response.data.content
           }
         })
@@ -151,6 +153,17 @@
   .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li span,.header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li a{
     font-size: 12px;
   }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item a{
+    width: 100%;
+    display: inline-block;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    height: 30px;
+  }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item{
+    height: 30px;
+  }
   .dropdown-menu>li>a{
     padding: 0;
     line-height: 30px;
@@ -164,6 +177,13 @@
     color: #1162a4 !important;
     line-height: inherit;
   }
+  .member-text{
+    width: 80%;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: inline-block;
+  }
   @import '~assets/scss/mixins';
   @import '~assets/scss/variables';
 
@@ -226,12 +246,14 @@
             }
 
             .dropdown-menu {
-              width: 220px;
+              min-width: 220px;
               margin-left: -1px;
               border: $border;
               border-top: none;
               padding: 1em;
               margin:0;
+              border: none;
+              border-radius: 0;
 
               .menu-item-first {
                 margin-bottom: 10px;

+ 20 - 38
components/messageBoard/MessageBoard.vue → components/default/MessageBoard.vue

@@ -55,24 +55,19 @@
           <p>&nbsp;&nbsp;&nbsp;添加图片:</p>
           <div class="img-warp">
             <div class="img-item">
-              <image-upload @fileAction="listenFile">
-              </image-upload>
+              <upload @uploadAction="listenUpload($event, 0)"/>
             </div>
             <div class="img-item">
-              <image-upload @fileAction="listenFile">
-              </image-upload>
+              <upload @uploadAction="listenUpload($event, 1)"/>
             </div>
             <div class="img-item">
-              <image-upload @fileAction="listenFile">
-              </image-upload>
+              <upload @uploadAction="listenUpload($event, 2)"/>
             </div>
             <div class="img-item">
-              <image-upload @fileAction="listenFile">
-              </image-upload>
+              <upload @uploadAction="listenUpload($event, 3)"/>
             </div>
             <div class="img-item">
-              <image-upload @fileAction="listenFile">
-              </image-upload>
+              <upload @uploadAction="listenUpload($event, 4)"/>
             </div>
           </div>
           <p class="tip clearfix">提示:最多可上传五张图片,每张大小不超过500KB,仅支持JPG、PNG、GIF格式.</p>
@@ -129,7 +124,7 @@
   </div>
 </template>
 <script>
-  import ImageUpload from '~components/common/image-upload/imageUpload.vue'
+  import upload from '~components/common/upload/upload.vue'
   import Page from '~components/common/page/pageComponent.vue'
   export default {
     name: 'messageBoard',
@@ -141,19 +136,19 @@
           currentPage: 1,
           dialogVisible: false
         },
-        dialogImageUrl: [],
         showHistory: true,
         isOpen: true,
         isLogin: false,
         txtVal: 0,
         isMobile: true,
         isEmail: true,
-        messageBoard: {}
+        messageBoard: {},
+        dialogImageUrl: ['', '', '', '', '']
       }
     },
     components: {
-      ImageUpload,
-      Page
+      Page,
+      upload
     },
     computed: {
       messageBoardInfo () {
@@ -179,19 +174,13 @@
       }
     },
     methods: {
-      lookImg () {
-//        this.isHide = true
-        this.$emit('imgEvent', true)
+      listenUpload: function (url, index) {
+        this.dialogImageUrl[index] = url
       },
       listenPage (page) {
         this.pageParams.page = page
         this.$emit('pageEvent', page)
       },
-      listenFile (url) {
-        let obj = {}
-        obj.img = url
-        this.dialogImageUrl.push(obj)
-      },
       isOpendMessage () {
         this.$emit('openBoardEvent', false)
       },
@@ -224,8 +213,6 @@
           } else if (!this.messageBoard.userTel && !this.messageBoard.email) {
             this.$message.info('请填写任意一种联系方式')
           } else {
-            console.log(this.isMobile)
-            console.log(this.isEmail)
             if (this.isMobile === false) {
               this.$message.info('请输入正确的手机号码')
             } else if (this.isEmail === false) {
@@ -244,6 +231,7 @@
               this.isOpendMessage()
               this.$message.info('感谢您的宝贵意见')
               this.messageBoard = {}
+              this.dialogImageUrl = ['', '', '', '', '']
             }
           }
         } else {
@@ -265,6 +253,7 @@
             this.isOpendMessage()
             this.$message.info('感谢您的宝贵意见')
             this.messageBoard = {}
+            this.dialogImageUrl = ['', '', '', '', '']
           }
         }
       }
@@ -374,6 +363,7 @@
   .messageBoard .modal-body .form-message label{
     margin-right: 25px;
   }
+  /*查看图片*/
   .messageBoard .modal-body .form-message .img-warp{
     position: relative;
     overflow: hidden;
@@ -385,8 +375,9 @@
     position: relative;
     float: left;
     margin-right: 23px;
-    width: 84px;
+    width: 82px;
     height: 70px;
+    overflow: hidden;
     cursor:  pointer;
     border: #C9C9C9 1px solid;
     font-size: 14px;
@@ -394,21 +385,15 @@
   .messageBoard .modal-body .form-message div.img-item:last-child{
     margin-right: 0;
   }
-  .messageBoard .modal-body .form-message div.img-item input[type="file"]{
-    position: absolute;
-    top: 0;
-    left: -20px;
-    width: 84px;
-    height: 70px;
-    opacity: 0;
-  }
   .messageBoard .modal-body .form-message div.img-item img{
     display: inline-block;
     max-width: 80px;
-    max-height: 60px;
+    max-height: 78px;
     z-index: 10;
     margin-top: 4px;
   }
+  /*查看图片*/
+
   .messageBoard .modal-body .form-message p.tip{
     text-align: left;
     color: #999;
@@ -609,7 +594,4 @@
     display: inline-block;
     margin: 0;
   }
-  body,textarea,button.btn{
-    font-family: "MicrosoftYaHei Regual", "微软雅黑" !important;
-  }
 </style>

+ 12 - 22
components/default/RightBar.vue

@@ -73,23 +73,19 @@
 </template>
 <script>
   import { scrollTo } from '~utils/scroll'
-  import MessageBoard from '~components/messageBoard/MessageBoard.vue'
+  import MessageBoard from '~components/default/MessageBoard.vue'
   export default {
     name: 'right-bar',
     data () {
       return {
         historyLength: [],
         dialogVisible: false,
-        dialogImageUrl: '',
         page: 1,
         count: 3,
         currentPage: 1,
         chatCount: 0
       }
     },
-//    created () {
-//      this.$store.dispatch('getMessageBoardInformation', {page: 1, count: 3})
-//    },
     components: {
       MessageBoard
     },
@@ -149,35 +145,30 @@
         this.$store.dispatch('user/deleteHistory', {id: id})
         this.$store.dispatch('user/loadHistory')
       },
+      goLogin: function () {
+        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+          if (response.data) {
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+          }
+        })
+      },
       goHistory: function () {
         if (!this.user.logged) {
-          this.$http.get('/login/page').then(response => {
-            if (response.data) {
-              this.$router.push('/auth/login')
-            }
-          })
+          this.goLogin()
         } else {
           window.location.href = '/user#/browsingHistory'
         }
       },
       goCart: function () {
         if (!this.user.logged) {
-          this.$http.get('/login/page').then(response => {
-            if (response.data) {
-              this.$router.push('/auth/login')
-            }
-          })
+          this.goLogin()
         } else {
           window.location.href = '/user#/cart'
         }
       },
       goWebChat: function () {
         if (!this.user.logged) {
-          this.$http.get('/login/page').then(response => {
-            if (response.data) {
-              this.$router.push('/auth/login')
-            }
-          })
+          this.goLogin()
         } else {
           // 获得窗口的垂直位置
           let iTop = (window.screen.availHeight - 30 - 600) / 2
@@ -214,7 +205,6 @@
   }
 </script>
 <style lang="scss" scoped>
-  /*查看*/
   a[disabled] {
     cursor: not-allowed;
   }
@@ -230,7 +220,7 @@
     right: -100%;
     top: 0px;
     bottom: 0;
-    width: 120px;
+    width: 100px;
     line-height: 38px;
     height: 38px;
     color: #ffffff;

+ 7 - 1
components/home/Carousel.vue

@@ -6,9 +6,12 @@
         <div v-swiper:mySwiper="swiperOption">
           <div class="swiper-wrapper">
             <div class="swiper-slide" v-for="banner in banners.data">
-              <a :href="banner.hrefUrl" target="_blank">
+              <a :href="banner.hrefUrl" target="_blank" v-if="banner.hrefUrl">
                 <img :src="banner.pictureUrl"/>
               </a>
+              <span v-if="!banner.hrefUrl">
+                <img :src="banner.pictureUrl"/>
+              </span>
             </div>
             <div class="swiper-button-prev"><i class="iconfont icon-arrow-left"></i></div>
             <div class="swiper-button-next"><i class="iconfont icon-arrow-right"></i></div>
@@ -83,6 +86,9 @@
             display: block;
             height: $carousel_height;
           }
+          a[href='']:hover{
+            cursor: default;
+          }
         }
       }
     }

+ 3 - 0
components/home/KindCategory.vue

@@ -172,6 +172,9 @@
                 text-overflow: ellipsis;
                 white-space: nowrap;
               }
+              i{
+                font-size: 12px;
+              }
             }
 
             dd {

+ 2 - 0
components/home/News.vue

@@ -58,6 +58,8 @@
 <style lang="scss" scoped>
   .news {
     height: 280px;
+    width: 100%;
+    margin: 0 auto;
     background: url("/images/news/news-bg.jpg");
 
     .news-container {

+ 8 - 3
components/home/Partner.vue

@@ -18,8 +18,8 @@
     data () {
       return {
         partners: [{
-          href: 'http://www.fantem.com',
-          img: '/images/partners/1.jpg'
+          href: 'http://www.worldshine.net/',
+          img: '/images/partners/8.jpg'
         }, {
           href: 'http://www.tidal.cn/docc/default.html',
           img: '/images/partners/2.jpg'
@@ -30,7 +30,7 @@
           href: 'http://www.madigi.net',
           img: '/images/partners/4.jpg'
         }, {
-          href: 'http://www.51cube.com/ch/Default.asp',
+          href: 'http://www.51cube.com',
           img: '/images/partners/5.jpg'
         }, {
           href: 'http://www.szsoling.com/home',
@@ -62,6 +62,11 @@
         height: 61px;
         margin-right: 15px;
         border: $border;
+
+        img {
+          max-width: 155px;
+          max-height: 59px;
+        }
       }
     }
   }

+ 4 - 4
components/home/floor/Floor.vue

@@ -74,8 +74,8 @@
         }
       }
       &.medium {
-        width: 389px;
-        height: 199px;
+        width: 390px;
+        height: 200px;
 
         img {
           position: absolute;
@@ -116,8 +116,8 @@
         }
       }
       &.small {
-        width: 219px;
-        height: 199px;
+        width: 220px;
+        height: 200px;
 
         img {
           margin-top: 15px;

+ 19 - 28
components/home/floor/FloorBar.vue

@@ -1,5 +1,5 @@
 <template>
-  <ul class="floor-bar list-unstyled" :class="{hide: !visible}">
+  <ul class="floor-bar list-unstyled" :style="!visible?'opacity: 0;':'opacity: 1;'">
     <li v-for="(floor, index) in floors.data" :key="index" class="floor-bar-item">
       <a @click="jumpFloor(index)"
          :style="{backgroundColor: index==activeFloor?floor.items[1].backGroundColor:'#b7dfff'}">
@@ -28,39 +28,30 @@
     },
     methods: {
       onScroll () {
-        let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
-        let floors = document.querySelectorAll('.floor')
-        let barOffset = document.querySelector('.floor-bar').offsetTop
-       // console.log(floors[floors.length - 1].offsetTop)
-        if (floors[0].offsetTop === 0) {
-          this.visible = scrolled >= floors[0].offsetTop + this.floor_scrollTop - 285 && scrolled <= floors[floors.length - 1].offsetTop + this.floor_scrollTop
-          if (this.visible) {
-            for (let i = 0; i < floors.length; i++) {
-              if (barOffset >= floors[i].offsetTop + this.floor_scrollTop - scrolled + 60) {
-                this.activeFloor = i
+        if (window.location.pathname === '/') {
+          let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
+          let floors = document.querySelectorAll('.floor')
+          let barOffset = document.querySelector('.floor-bar').offsetTop
+          if (floors[0].offsetTop === 0) {
+            this.visible = scrolled >= floors[0].offsetTop + this.floor_scrollTop - barOffset && scrolled <= floors[floors.length - 1].offsetTop + floors[floors.length - 1].offsetHeight - barOffset - document.querySelector('.floor-bar').offsetHeight + this.floor_scrollTop
+            if (this.visible) {
+              for (let i = 0; i < floors.length; i++) {
+                if (barOffset >= floors[i].offsetTop + this.floor_scrollTop - scrolled + 60) {
+                  this.activeFloor = i
+                }
               }
             }
-          }
-        } else {
-          this.visible = scrolled >= floors[0].offsetTop - 285 && scrolled <= floors[floors.length - 1].offsetTop
-          if (this.visible) {
-            for (let i = 0; i < floors.length; i++) {
-              if (barOffset >= floors[i].offsetTop - scrolled + 60) {
-                this.activeFloor = i
+          } else {
+            this.visible = scrolled >= floors[0].offsetTop - barOffset + 40 && scrolled <= floors[floors.length - 1].offsetTop + floors[floors.length - 1].offsetHeight - barOffset - document.querySelector('.floor-bar').offsetHeight
+            if (this.visible) {
+              for (let i = 0; i < floors.length; i++) {
+                if (barOffset >= floors[i].offsetTop - scrolled + 60) {
+                  this.activeFloor = i
+                }
               }
             }
           }
         }
-    /*    let barOffset2 = 0
-        this.visible = (barOffset >= floors[0].offsetTop - scrolled &&
-          barOffset2 <= floors[floors.length - 1].offsetTop - scrolled + floors[floors.length - 1].clientHeight)
-        if (this.visible) {
-          for (let i = 0; i < floors.length; i++) {
-            if (barOffset >= floors[i].offsetTop - scrolled + 60) {
-              this.activeFloor = i
-            }
-          }
-        } */
       },
       jumpFloor (index) {
         if (this.visible) {

+ 5 - 5
components/main/Search.vue

@@ -70,8 +70,8 @@
             name: 'Vishay',
             url: '/product/brand/30327265e42a871be050007f01003d96'
           }, {
-            name: 'Panasonic Battery',
-            url: '/product/brand/30327265e4e7871be050007f01003d96'
+            name: 'Panasonic',
+            url: '/product/brand/30327265e47d871be050007f01003d96'
           }]
         }
       }
@@ -204,9 +204,9 @@
 
     .association {
       position: absolute;
-      left: 78px;
+      left: 69px;
       top: 100%;
-      right: 79px;
+      right: 81px;
       background: $white;
       border: $border;
       border-top-width: 0;
@@ -226,4 +226,4 @@
       }
     }
   }
-  </style>
+</style>

+ 28 - 19
components/main/count/Box.vue

@@ -23,8 +23,8 @@
           autoplay: 5000,
           speed: 500,
           direction: 'vertical',
-          slidesPerView: 2,
-          slidesPerGroup: 2
+          slidesPerView: 1,
+          slidesPerGroup: 1
         }
       }
     },
@@ -32,31 +32,40 @@
       counts () {
         return this.$store.state.product.common.counts
       }
-    },
-    mounted () {
-      this.$nextTick(() => {
-        this.loadCounts()
-        // 刷新统计信息
-        setInterval(() => {
-          this.loadCounts()
-        }, 30000)
-      })
-    },
-    methods: {
-      loadCounts () {
-        this.$store.dispatch('loadProductCounts', { _status: 'actived' })
-      }
     }
+//    mounted () {
+//      this.$nextTick(() => {
+//        this.loadCounts()
+//        // 刷新统计信息
+//        setInterval(() => {
+//          this.loadCounts()
+//        }, 30000)
+//      })
+//    },
+//    methods: {
+//      loadCounts () {
+//        this.$store.dispatch('loadProductCounts', { _status: 'actived' })
+//      }
+//    }
   }
 </script>
 <style lang="scss" scoped>
   .count-box {
     position: relative;
-    top: 15px;
+    top: 20px;
     float: right;
-    width: 300px;
-    height: 60px;
+    width: 210px;
+    height: 40px;
+    margin-right: 65px;
     overflow: hidden;
+    border-radius: 3px;
+    background: url("/images/all/count_bg.png") no-repeat;
+    /*background: #7299E8;*/
+  .swiper-slide{
+    width: 100%;
+    /*background: #83c5f8;*/
+    border-radius: 3px;
+  }
 
   .swiper-container {
     height: 100%;

+ 93 - 27
components/main/count/Item.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="count-item">
     <span class="title">{{ title }}</span>
-    <span v-for="num in nums" :class="num == ',' ? 'separator' : 'num'">{{ num }}</span>
+    <div class="count-content">
+      <span v-for="(num, index) in nums" :class="num == ',' ? 'separator' : nums.length - len > index ? 'zero num' : 'num'">{{ num }}</span>
+      <!-- <span v-if="nums.length < 7">个</span>
+       <span v-if="nums.length > 7">万</span>-->
+      <span v-text="isMore?'万':'个'" v-if="!isShow"></span>
+      <span v-if="isShow">亿</span>
+    </div>
   </div>
 </template>
 <script>
@@ -16,14 +22,41 @@
         type: String
       }
     },
+    data () {
+      return {
+        isMore: false,
+        isShow: false,
+        len: 0
+      }
+    },
     methods: {
       formatNumber (num) {
         let re = /(\d+)(\d{3})/
-        num = (Array(10 - String(num).length).join(0) + num)
+        if (num > 99999999) {
+          this.isShow = true
+          let str2 = num.toString()
+          num = Math.floor(num / 100000000)
+          if (parseInt(str2.charAt(str2.length - 8)) > 8) {
+            num = num + 1
+          }
+        }
+        if (num > 9999) {
+          this.isMore = true
+          let str = num.toString()
+          num = Math.floor(num / 10000)
+          if (parseInt(str.charAt(str.length - 4)) > 4) {
+            num = num + 1
+          }
+        }
+        let length = String(num).length
+        this.len = length > 3 ? length + 1 : length
+        num = (Array(7 - length).join(0) + num)
         while (re.test(num)) {
-          num = num.replace(re, '$1,$2')
+          num = num.replace(re, '$1$2')
         }
-        return num.split('')
+        num = num.split('')
+//        console.log(num)
+        return num
       }
     },
     computed: {
@@ -40,28 +73,61 @@
     text-align: center;
     line-height: 20px;
 
-    .title {
-      display: inline-block;
-      width: 60px;
-      float: left;
-      font-weight: bold;
-    }
-    .separator, .num {
-      display: inline-block;
-    }
-    .separator {
-      font-size: 12px;
-      color: $primary;
-      margin: 0 5px 0 -2px;
-    }
-    .num {
-      background: $primary;
-      width: 15px;
-      height: 20px;
-      margin-right: 10px;
-      text-align: center;
-      color: $white;
-      font-weight: bold;
-    }
+  .title {
+    display: inline-block;
+    width: 55px;
+    float: left;
+    font-weight: bold;
+    line-height: 40px;
+    color: #fff;
+    font-size: 14px;
+  }
+  .separator, .num {
+    display: inline-block;
+  }
+  .separator {
+    font-size: 12px;
+    color: #7299E8;
+    line-height: 38px !important;
+    margin: 0 5px 0 -5px;
+    width: 3px;
+  }
+  .count-content{
+    width: 150px;
+    /*background: #fff;*/
+    float: right;
+    height: 30px;
+    margin-top: 5px;
+    padding-left: 3px;
+    margin-right: 5px;
+  span{
+    float: left;
+    line-height: 24px;
+    font-weight: bold;
+  }
+  span.zero{
+    color: #9EBCF7;
+  }
+  span:first-child{
+    margin-left: 3px;
+  }
+  span:last-child{
+    line-height: 30px;
+    color: #7299E8;
+    margin-left: 2px;
+  }
+  }
+  .num {
+    background: #7299E8;
+    width: 18px;
+    height: 24px;
+    margin-right: 2px;
+    line-height: 24px;
+    text-align: center;
+    color: $white;
+    font-weight: bold;
+    border-radius: 2px;
+    margin-top: 3px;
+  }
   }
 </style>

+ 61 - 18
components/product/ComponentGoods.vue

@@ -25,30 +25,35 @@
         <td>
           <!--store/{{compGoods.storeId}}#/batchInfo/{{compGoods.batchCode}}-->
           <nuxt-link v-if="compGoods.batchCode" :to="`/store/${compGoods.storeId}/${compGoods.batchCode}`" target="_blank">
-            <img :src="compGoods.img || '/images/all/default.png'"/>
+            <img :src="compGoods.img?compGoods.img:compGoods.brand&&compGoods.brand.logoUrl?compGoods.brand.logoUrl:'/images/all/default.png'"/>
           </nuxt-link>
-          <img v-if="!compGoods.batchCode" :src="compGoods.img || '/images/all/default.png'"/>
+            <img v-if="!compGoods.batchCode" :src="compGoods.img?compGoods.img:compGoods.brand&&compGoods.brand.logoUrl?compGoods.brand.logoUrl:'/images/all/default.png'"/>
           <!--store/{{compGoods.storeId}}#/home-->
           <nuxt-link :to="'/store/' + compGoods.storeId" class="contact" :title="compGoods.storeName" target="_blank">{{compGoods.storeName}}</nuxt-link>
         </td>
         <td class="brand-code">
-          <div class="brand"><nuxt-link :to="`/product/brand/${compGoods.brand.uuid}/`" title="compGoods.brand.nameEn">{{compGoods.brand.nameEn}}</nuxt-link></div>
-          <div class="code"><nuxt-link :to="`/product/component/${compGoods.uuid}/`" :title="compGoods.code">{{compGoods.code}}</nuxt-link></div>
+          <div class="brand" v-if="compGoods.brand.nameEn"><nuxt-link :to="`/product/brand/${compGoods.brand.uuid}/`" title="compGoods.brand.nameEn">{{compGoods.brand.nameEn}}</nuxt-link></div>
+          <div class="brand" v-if="!compGoods.brand.nameEn">—</div>
+          <div class="code" v-if="compGoods.code"><nuxt-link :to="`/product/component/${compGoods.uuid}/`" :title="compGoods.code">{{compGoods.code}}</nuxt-link></div>
+          <div class="code" v-if="!compGoods.code">—</div>
         </td>
         <td>
-          <div class="package">{{compGoods.packaging || '暂无包装方式信息'}}</div>
-          <div class="date">{{compGoods.produceDate || '-'}}</div>
+          <div class="package" v-if="compGoods.packaging">{{compGoods.packaging}}</div>
+          <div v-if="!compGoods.produceDate && !compGoods.packaging">—</div>
+          <div class="date" v-if="compGoods.produceDate">{{compGoods.produceDate}}</div>
         </td>
         <td class="text-left">
-          <div class="goods">
-            库存:<span>{{compGoods.reserve || '暂无库存'}}</span>
+          <div class="goods" v-if="compGoods.reserve">
+            库存:<span>{{compGoods.reserve}}</span>
           </div>
-          <div class="from" v-if="compGoods.reserve > 0">
-            起拍:<span>{{compGoods.minBuyQty}}</span>
+          <div v-if="!compGoods.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
+          <div class="from" v-if="compGoods.reserve && compGoods.reserve > 0">
+            起拍:<span v-if="compGoods.minBuyQty">{{compGoods.minBuyQty}}</span>
           </div>
-          <div class="multiple" v-if="compGoods.reserve > 0">
+          <!--<div class="multiple" v-if="compGoods.reserve > 0">
             倍数:<span>{{compGoods.minPackQty}}</span>
-          </div>
+          </div>-->
+          <div class="can-div-sell" v-if="compGoods.reserve" v-text="compGoods.breakUp?'可拆卖':'不可拆卖'"></div>
         </td>
         <td>
           <div v-if="!compGoods.prices">
@@ -65,7 +70,7 @@
           </div>
           <div v-for="price in compGoods.prices">
             <!--| formateNumber : 6-->
-            <span>{{price.uSDPrice}}</span>
+            <span>{{price.uSDPrice | currency}}</span>
           </div>
         </td>
         <td>
@@ -74,7 +79,7 @@
           </div>
           <div v-for="price in compGoods.prices">
             <!--formateNumber : 6-->
-            <span>{{price.rMBPrice}}</span>
+            <span>{{price.rMBPrice | currency}}</span>
           </div>
         </td>
         <td>
@@ -138,6 +143,32 @@
         return goodsPage
       }
     },
+    filters: {
+      currency: function (num) {
+        if (typeof num === 'number') {
+          if (num <= 0.000001) {
+            num = 0.000001
+          } else {
+            if (num.toString().indexOf('.') === -1) {
+              num += '.00'
+            } else {
+              let inputStr = num.toString()
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
+              if (floatNum.length > 6) {
+                num = inputStr.substring(0, arr[0].length + 7)
+                if (Number(floatNum.charAt(6)) > 4) {
+                  num = (Number(num) * 1000000 + 1) / 1000000
+                }
+              } else if (floatNum.length === 1) {
+                num = num + '0'
+              }
+            }
+          }
+        }
+        return num
+      }
+    },
     methods: {
       addToCart: function (goods, buyNow) {
         return null
@@ -203,12 +234,11 @@
   .product-list tbody>tr {
     border: 1px solid #e8e8e8;
   }
-
   .product-list tbody>tr img {
     border: 1px solid #e8e8e8;
     margin: 10px 0 5px 0;
-    width: 36px;
-    height: 36px;
+    max-width: 36px;
+    max-height: 36px;
   }
   .product-list tbody>tr .contact{
     font-size: 14px;
@@ -223,10 +253,20 @@
 
   .product-list td {
     font-size: 12px;
-    color: #333;
+    /*color: #333;*/
     text-align: center;
     line-height: 20px;
   }
+  .product-list td a{
+    color: #337ab7;
+    max-width: 160px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: block;
+  }
+  .product-list td a:hover {
+    color: #23527c;
+  }
 
   /* 物品列表按钮 */
   .product-list .btn-buy-now {
@@ -263,6 +303,9 @@
   .product-list tbody tr td{
     padding: 10px 0;
   }
+  .product-list tbody tr td .can-div-sell {
+    color: #333;
+  }
   .search-record{
     width: 100%;
     margin: 0 auto;

+ 1 - 0
components/product/brand/BrandComponent.vue

@@ -86,6 +86,7 @@
       },
       async pageCmpGoods (params) {
 //      pageCmpGoods (params) {
+        params.filter.brandid = this.brand.id
         let { data } = await this.$http.get('/api/product/component/list', { params })
         this.$store.commit('brandComponent/GET_COMPONENT_SUCCESS', data)
 //        this.$http.get('/api/product/component/list', { params }).then(response => {

+ 37 - 14
components/product/component/ComponentDetail.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="componentDetail">
     <div class="container">
-      <div class="menu">
+      <!--<div class="menu">
         <component-menu/>
-      </div>
+      </div>-->
       <div class="detail">
         <div class="component-img">
-          <img :src="list.img || '/images/component/default.png'"/>
+          <img :src="list.img?list.img:list.brand&&list.brand.logoUrl?list.brand.logoUrl:'/images/component/default.png'"/>
         </div>
         <div class="component-message">
           <div class="message-code">
@@ -17,7 +17,7 @@
             <div class="form-group row" v-if="list.kind">
               <div class="message-item">类目</div>
               <div class="colon">:</div>
-              <div><a class="message-body blue" target="_blank" :href="`/product/kind/${list.brand.id}`">{{list.kind.nameCn}}</a></div>
+              <div><a class="message-body blue" target="_blank" :href="`/product/kind/${list.kindid}`">{{list.kind.nameCn}}</a></div>
             </div>
             <div class="form-group row" v-if="list.brand">
               <div class="message-item">品牌</div>
@@ -37,7 +37,7 @@
             <div class="form-group row">
               <div class="message-item">下载</div>
               <div class="colon">:</div>
-              <div class="message-body"><a :href="list.attach" v-if="list.attach">规格书</a><span v-if="!list.attach">暂无规格书</span></div>
+              <div class="message-body"><a @click="toAttach(list.attach)" v-if="list.attach">规格书</a><span v-if="!list.attach">暂无规格书</span></div>
             </div>
             <div class="form-group">
                <button type="text" v-if="!collectList" @click="collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</button>
@@ -63,7 +63,7 @@
   </div>
 </template>
 <script>
-  import { ComponentMenu } from '~components/product'
+//  import ComponentMenu from '~components/product/component/componentMenu.vue'
   export default {
     name: 'ComponentDetail',
     data () {
@@ -93,27 +93,38 @@
               return true
             }
           }
+        } else {
+          return false
         }
-   //     _this.isShow = false
-        return false
       }
     },
-    components: {
-      ComponentMenu
-    },
+//    components: {
+//      ComponentMenu
+//    },
     methods: {
       collect (id) {
         if (this.user.logged) {
           this.dialogVisible = true
           let kind = 2
           this.$store.dispatch('product/saveEntity', {componentid: id, kind: kind})
-          this.collectList = true
+//          this.collectList = true
         } else {
-          this.$http.get('/login/page').then(response => {
+          this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+            if (response.data) {
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+            }
+          })
+        }
+      },
+      toAttach: function (url) {
+        if (url === '1') {
+          this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
+        } else {
+          window.open(url)
         }
       }
     }
@@ -126,6 +137,18 @@
     color: #008B00;
     margin-top: 0;
   }
+  .focus button.focus-btn a{
+    color: #fff;
+    width: 100%;
+    height: 100%;
+    display: inline-block;
+  }
+  .focus button.focus-btn{
+    width: 138px;
+    height: 36px;
+    line-height: 36px;
+    padding: 0;
+  }
   .componentDetail .el-dialog__wrapper .focus-btn a{
     color: #fff;
   }

+ 62 - 17
components/product/component/StoreInfo.vue

@@ -4,7 +4,7 @@
       <div class="storeIns">
         <div class="sign">选择商家:</div>
         <div class="storeInList" v-for="storeIn in store">
-          <div class="choose" :class="{'storeIn-active' : storeIn.isSelected, 'storeIn' : !storeIn.isSelected}" @click="addStore(storeIn)">
+          <div class="choose" :class="{'storeIn-active' : storeIn.isSelected, 'storeIn' : !storeIn.isSelected}" @click="store.length==1?'':addStore(storeIn)">
             <a class="storeLogo">
               <img :src="storeIn.logoUrl || '/images/component/default.png'" :alt="storeIn.storeName" :title="storeIn.storeName">
             </a>
@@ -46,20 +46,32 @@
           </tr>
         </thead>
         <tbody class="text-center">
-          <tr style="cursor: pointer;" v-for="list in storeList.content">
-            <td><a :href="'/store/' + list.storeid + '/' + list.batchCode">{{list.code}}</a></td>
-            <td><a :href="'/store/' + list.storeid + '/' + list.batchCode">{{list.produceDate}}</a></td>
-            <td><a :href="'/store/' + list.storeid + '/' + list.batchCode">{{list.packaging || '暂无包装方式'}}</a></td>
+          <tr style="cursor: pointer;" v-for="list in storeList.content" @click="goProductDetail(list.storeid, list.batchCode)">
+            <td>
+              <a v-if="list.code">{{list.code}}</a>
+              <a v-if="!list.code">—</a>
+            </td>
+            <td>
+              <a v-if="list.produceDate">{{list.produceDate}}</a>
+              <a v-if="!list.produceDate">—</a>
+            </td>
+            <td>
+              <a v-if="list.packaging">{{list.packaging}}</a>
+              <a v-if="!list.packaging">—</a>
+            </td>
             <td style="text-align: left;padding-left: 25px;">
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
-                <div>
+              <a>
+                <div v-if="list.reserve">
                   <span>库存:</span>
                   <span>{{list.reserve}}</span>
                 </div>
-                <div>
+                <div v-if="!list.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
+                <div v-if="list.reserve && list.reserve>0">
                   <span>起拍:</span>
-                  <span>{{list.minBuyQty}}</span>
+                  <span v-if="list.minBuyQty">{{list.minBuyQty}}</span>
                 </div>
+                <div class="can-div-sell" v-text="list.breakUp?'可拆卖':'不可拆卖'"></div>
+
                 <!--<div>-->
                   <!--<span>倍数:</span>-->
                   <!--<span>{{list.minPackQty}}</span>-->
@@ -67,14 +79,15 @@
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-for="price in list.prices">
-                  <span>{{price.start}}</span>+
+                  <span v-if="list.prices">{{price.start}}</span>+
+                  <span v-if="!list.prices">—</span>
                 </div>
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-show="list.currencyName.indexOf('USD')==-1 || !list.prices">
                   <span>—</span>
                 </div>
@@ -84,7 +97,7 @@
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-show="list.currencyName.indexOf('RMB')==-1 || !list.prices">
                   <span>—</span>
                 </div>
@@ -94,13 +107,16 @@
               </a>
             </td>
             <td>
-              <a :href="'/store/' + list.storeid + '/' + list.batchCode">
+              <a>
                 <div v-show="list.b2cMinDelivery">
                   <span>交期:</span>
                   <span>{{list.b2cMinDelivery}}</span>
                   <span v-if="list.b2cMaxDelivery && list.b2cMaxDelivery !== list.b2cMinDelivery">-</span>
                   <span v-if="list.b2cMaxDelivery && list.b2cMaxDelivery !== list.b2cMinDelivery">{{list.b2cMaxDelivery}}</span>
                 </div>
+                <div v-if="!list.b2cMinDelivery">
+                  <span>—</span>
+                </div>
               </a>
             </td>
             <td>
@@ -143,8 +159,24 @@
     filters: {
       currency: function (num) {
         if (typeof num === 'number') {
-          if (num.toString().indexOf('.') === -1) {
-            num += '.00'
+          if (num <= 0.000001) {
+            num = 0.000001
+          } else {
+            if (num.toString().indexOf('.') === -1) {
+              num += '.00'
+            } else {
+              let inputStr = num.toString()
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
+              if (floatNum.length > 6) {
+                num = inputStr.substring(0, arr[0].length + 7)
+                if (Number(floatNum.charAt(6)) > 4) {
+                  num = (Number(num) * 1000000 + 1) / 1000000
+                }
+              } else if (floatNum.length === 1) {
+                num = num + '0'
+              }
+            }
           }
         }
         return num
@@ -216,6 +248,9 @@
           this.params.filter.ignoreStore = !this.params.filter.ignoreStore
         }
         this.$store.dispatch('loadComponentInformation', this.params)
+      },
+      goProductDetail: function (storeid, batchcode) {
+        window.location.href = '/store/' + storeid + '/' + batchcode
       }
     }
   }
@@ -251,6 +286,8 @@
   }
   .storeInfo .storeIn-active {
     width: 98px;
+    height: 49px;
+    line-height: 46px;
     float: left;
     border: 1px solid #5078cb;
     text-align: center;
@@ -262,9 +299,14 @@
     display: table-cell;
     height: 46px;
     width: 98px;
+    line-height: 46px;
     text-align: center;
     vertical-align: middle;
   }
+  .storeInList .choose a img{
+    max-width: 95px;
+    max-height: 46px;
+  }
   a.storeLogo>img,.storeIn-active a.storeLogo>img {
     max-width: 95px;
     max-height: 46px;
@@ -340,7 +382,6 @@
     border-right: #ddd 1px solid;
   }
   .storeInfo .table tbody td div{
-    text-align: center;
     margin-left: 10%;
   }
   .storeInfo .table tbody tr:hover{
@@ -349,4 +390,8 @@
   .storeInfo .table tbody tr:hover{
     background: #f5f5f5;
   }
+  .storeInfo .goodsList .can-div-sell {
+    text-align: left;
+    color: #333;
+  }
 </style>

+ 1 - 1
components/provider/ExcellentSuppliers.vue

@@ -2,7 +2,7 @@
   <div class="container marketing" style="padding-top: 25px;">
     <div class="head">
       <span class="title">优秀商家</span>
-      <a class="see-more" href="/provider/list" v-if="isShowMore">查看更多</a>
+      <nuxt-link class="see-more" :to="'/provider/list'" v-if="isShowMore">查看更多</nuxt-link>
     </div>
     <ul class="list-unstyled list-inline">
       <li class="store-box" v-for="(store, index) in stores" :class="{ 'margin-left-zero' : index % 5 == 0}" >

+ 18 - 2
components/provider/NewStore.vue

@@ -31,7 +31,7 @@
           已入驻商家<span>{{storeCount}}</span>家
         </div>
         <div>
-          <a href="/vendor#/store-apply"><button>立即入驻</button></a>
+          <a @click="goStoreApply()"><button>立即入驻</button></a>
         </div>
       </div>
     </div>
@@ -42,12 +42,28 @@
 export default {
   name: 'new-store',
   computed: {
+    user () {
+      return this.$store.state.option.user
+    },
     stores () {
       return this.$store.state.provider.storeCms.newStores.data ? this.$store.state.provider.storeCms.newStores.data.content : []
     },
     storeCount () {
       return this.$store.state.provider.storeCms.storeCount.data
     }
+  },
+  methods: {
+    goStoreApply: function () {
+      if (!this.user.logged) {
+        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+          if (response.data) {
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+          }
+        })
+      } else {
+        window.location.href = '/vendor#/store-apply'
+      }
+    }
   }
 }
 </script>
@@ -107,7 +123,7 @@ export default {
         height: 50px;
         display: inline-block;
         text-align: center;
-        line-height: 50px;
+        line-height: 45px;
         border: #e8e8e8 1px solid;
 
         img {

+ 3 - 3
components/provider/Suppliers.vue

@@ -6,7 +6,7 @@
         <td width="175"></td>
         <td width="auto"></td>
         <td width="200">
-          <div class="input-group">
+          <div class="input-group" style="display: table;">
             <input class="form-control" type="search" v-model="keyword" placeholder="请输入商家名称" @search="search()" />
             <span class="input-group-btn">
 							<button type="button" class="btn btn-default" @click="search()"><i class="iconfont">&#xe6fc;</i></button>
@@ -14,8 +14,8 @@
           </div>
         </td>
         <td width="150" style="vertical-align: middle"><span>入驻商家:</span><span class="text-message">{{stores ? stores.totalElements : 0}}</span><span>家</span></td>
-        <td width="150">
-          <a href="/vendor#/store-apply"><button class="btn btn-primary" style="margin-left: 6px;">立即入驻</button></a>
+        <td width="150" style="vertical-align: middle;">
+          <a href="/vendor#/store-apply" style="width: 100px; height: 30px; display: inline-block;"><button class="btn btn-primary" style="margin-left: 6px;">立即入驻</button></a>
         </td>
       </tr>
       </thead>

+ 68 - 49
components/search/GoodList.vue

@@ -27,13 +27,13 @@
               <option value="1">发货地</option>
             </select>
           </div>
-        </div>
-        <div class="off">
-          <a @click="list_open=!list_open">
-            <span v-text="list_open?'收起':'展开'"></span>
-            <i class="fa fa-angle-down" v-show="!list_open"></i>
-            <i class="fa fa-angle-up"v-show="list_open"></i>
-          </a>
+          <div class="off">
+            <a @click="list_open=!list_open">
+              <span v-text="list_open?'收起':'展开'"></span>
+              <i class="fa fa-angle-down" v-show="!list_open"></i>
+              <i class="fa fa-angle-up"v-show="list_open"></i>
+            </a>
+          </div>
         </div>
       </div>
       <div v-if="list_open">
@@ -46,48 +46,52 @@
             <th width="110">店铺名称</th>
             <th width="110">库存</th>
             <th width="90">阶梯</th>
-         <!--   <th width="90" v-if="!crname_click_flag.rmb_click_flag">香港交货</th>
-            <th width="110" v-if="!crname_click_flag.usd_click_flag">大陆交货<span style="font-size: 12px;">(含税)</span></th>-->
-            <th width="110">单价</th>
+            <th width="90" v-if="!crname_click_flag.rmb_click_flag">香港交货</th>
+            <th width="110" v-if="!crname_click_flag.usd_click_flag">大陆交货<span style="font-size: 12px;">(含税)</span></th>
             <th width="110">交期<span style="font-size: 12px;">(天)</span></th>
             <th width="100">操作</th>
           </tr>
           </thead>
           <tbody id="productList-content">
-          <tr v-for="item in good_list.components"
-              v-show="!(crname_click_flag.usd_click_flag && item.currencyName != 'USD') || !(crname_click_flag.rmb_click_flag && item.currencyName != 'RMB')">
+          <tr v-for="item in good_list.components">
             <td>
-              <nuxt-link :to="`/product/component/${item.uuid}`">
-                <img width="80px" height="80px" :src="item.img?item.img:'/images/component/default.png'">
+              <nuxt-link class="component-img-box" :to="item.batchCode?`/store/${item.storeId}/${item.batchCode}`:`/product/component/${item.uuid}`">
+      <!--          <img :src="item.img?item.img:item.brand&&item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">-->
+                <img :src="item.batchCode?item.img?item.img:'/images/component/default.png':item.brand&&item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">
               </nuxt-link>
             </td>
             <td class="brand-code">
-              <div class="brand"><nuxt-link :to="`/product/brand/${item.brand.uuid}`" class="text-num" v-text="item.brand.nameEn"></nuxt-link></div>
-              <div class="code"><nuxt-link :to="`/product/component/${item.uuid}`" class="f16 text-bold text-num" v-text="item.code"></nuxt-link></div>
-              <div class="brand"><nuxt-link :to="`/product/kind/${item.kindid}`" v-text="item.kind.nameCn">
-              </nuxt-link></div>
+              <div class="brand" v-if="item.brand.nameEn"><nuxt-link :to="`/product/brand/${item.brand.uuid}`" class="text-num" v-text="item.brand.nameEn"></nuxt-link></div>
+              <div class="brand" v-if="!item.brand.nameEn">—</div>
+              <div class="code"  v-if="item.code"><nuxt-link :to="`/product/component/${item.uuid}`" class="f16 text-bold text-num" v-text="item.code"></nuxt-link></div>
+              <div class="brand" v-if="!item.code">—</div>
+              <div class="brand"  v-if="item.kind.nameCn"><nuxt-link :to="`/product/kind/${item.kindid}`" v-text="item.kind.nameCn"></nuxt-link></div>
+              <div class="brand" v-if="!item.kind.nameCn">—</div>
             </td>
             <td>
-              <div class="package" v-text="item.packaging?item.packaging:'暂无包装方式信息'"></div>
+              <div class="package" v-text="item.packaging"></div>
               <div class="date" v-text="item.produceDate"></div>
+              <div v-if="!item.packaging && !item.produceDate">—</div>
             </td>
             <td>
-              <div>
+              <div v-if="item.storeName">
                 <nuxt-link :to="'/store/' + item.storeId" v-text="item.storeName">
                 </nuxt-link>
-                <span v-if="!item.storeName">—</span>
               </div>
+              <div v-if="!item.storeName">—</div>
             </td>
             <td class="text-left">
-              <div class="goods">
-                库存:<span v-text="item.reserve || '暂无库存'"></span>
+              <div class="goods"  v-if="item.reserve">
+                库存:<span v-text="item.reserve"></span>
               </div>
-              <div class="from" v-if="item.reserve > 0">
-                起拍:<span v-text="item.minBuyQty"></span>
+              <div v-if="!item.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
+              <div class="from" v-if="item.reserve && item.reserve > 0">
+                起拍:<span v-text="item.minBuyQty" v-if="item.minBuyQty"></span>
               </div>
-          <!--    <div class="multiple" v-if="item.reserve > 0">
+             <!-- <div class="multiple" v-if="item.reserve > 0">
                 倍数:<span v-text="item.minPackQty"></span>
               </div>-->
+              <div v-if="item.reserve" v-text="item.breakUp?'可拆卖':'不可拆卖'"></div>
             </td>
             <td>
               <div v-show="!item.prices">
@@ -97,24 +101,22 @@
                 <span v-text="price.start"></span> +
               </div>
             </td>
-            <td>
-              <div v-for="price in item.prices">
-                <span v-show="item.currencyName == 'USD'">$</span>
-                <span v-show="item.currencyName == 'RMB'">¥</span>
-                <span>{{price.uSDPrice || price.rMBPrice | currency}}</span>
-              </div>
-              <div v-show="!item.currencyName">
+            <td v-if="!crname_click_flag.rmb_click_flag">
+              <div v-show="!(item.currencyName == 'USD') || !item.prices">
                 <span>—</span>
               </div>
+              <div v-for="price in item.prices">
+                <span>{{price.uSDPrice | currency}}</span>
+              </div>
             </td>
-           <!-- <td v-if="!crname_click_flag.usd_click_flag">
+            <td v-if="!crname_click_flag.usd_click_flag">
               <div v-show="!(item.currencyName == 'RMB') || !item.prices">
                 <span>—</span>
               </div>
               <div v-for="price in item.prices">
                 <span>{{price.rMBPrice | currency}}</span>
               </div>
-            </td>-->
+            </td>
             <td>
               <div v-show="!item.b2cMinDelivery">
                 <span>—</span>
@@ -134,7 +136,7 @@
               </div>
             </td>
           </tr>
-          <tr v-if="!good_list.components || good_list.components.length == 'undefined' ||good_list.components.length == 0">
+          <tr v-if="good_list.components.length == 'undefined' ||good_list.components.length == 0">
             <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
               <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
             </td>
@@ -173,8 +175,24 @@
     filters: {
       currency: function (input) {
         if (typeof input === 'number') {
-          if (input.toString().indexOf('.') === -1) {
-            input = input + '.00'
+          if (input <= 0.000001) {
+            input = 0.000001
+          } else {
+            if (input.toString().indexOf('.') === -1) {
+              input = input + '.00'
+            } else {
+              let inputStr = input.toString()
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
+              if (floatNum.length > 6) {
+                input = inputStr.substring(0, arr[0].length + 7)
+                if (Number(floatNum.charAt(6)) > 4) {
+                  input = (Number(input) * 1000000 + 1) / 1000000
+                }
+              } else if (floatNum.length === 1) {
+                input = input + '0'
+              }
+            }
           }
         }
         return input
@@ -185,7 +203,6 @@
         return this.$store.state.searchData.searchList.lists
       },
       good_list () {
-        console.log(this.good_lists.data)
         return this.good_lists.data
       },
       total_count () {
@@ -404,11 +421,15 @@
     border: 1px solid #e8e8e8;
   }
 
+  .product-list tbody>tr .component-img-box {
+    width: 80px;
+    height: 80px;
+  }
   .product-list tbody>tr img {
     border: 1px solid #e8e8e8;
     margin: 10px 0 5px 0;
-    width: 80px;
-    height: 80px;
+    max-width: 80px;
+    max-height: 80px;
   }
   .product-list tbody>tr .contact{
     font-size: 14px;
@@ -522,23 +543,21 @@
     border: #5078cb 1px solid;
     color: #5078cb;
   }
-  .tab-filter .off{
-     float: right;
-     margin-right: 20px;
-    color: black;
+  .tab-filter .fr .off{
+    margin-left : 129px;
+    float: right;
   }
-  .tab-filter .off a:hover{
+  .tab-filter .fr .off a:hover{
     border: none;
     color: #5078cb;
   }
-  .tab-filter .off a{
+  .tab-filter .fr .off a{
     border: none;
     text-align: right;
     padding-left: 360px;
     background: none;
-    color: #333;
   }
-  .tab-filter .off a i{
+  .tab-filter .fr .off a i{
     font-size: 16px;
   }
   .tab-filter .fr .form-control{

+ 2 - 2
components/search/Kind.vue

@@ -326,7 +326,7 @@
         this.brand_open = !this.brand_open
       },
       getType: function (arr, obj) {
-        return !(JSON.stringify(arr).indexOf(JSON.stringify(obj)) === -1)
+        return !(JSON.stringify(arr).indexOf(obj.store_type) === -1)
       },
       click_kind: function (id, index) {
         this.kind_arr.push(id)
@@ -447,7 +447,7 @@
         return -1
       },
       crnameInArr: function (arr, obj) {
-        return (JSON.stringify(arr).indexOf(JSON.stringify(obj)) === -1)
+        return (JSON.stringify(arr).indexOf(obj.cr_name) === -1)
       }
     }
   }

+ 11 - 11
components/searchStore/SearchTitle.vue

@@ -10,9 +10,9 @@
     <div class="tab-filter" >
       <div class="fr">
         <div :class="activeType == 0?'active':''" @click="defaultSearch"><a >综合排序</a></div>
-        <div :class="activeType == 1?'active':''"><a >库存</a></div>
-        <div :class="activeType == 2?'active':''"><a >销量</a></div>
-        <div :class="activeType == 3?'active':''"><a >信用</a></div>
+        <!--<div :class="activeType == 1?'active':''"><a >库存</a></div>-->
+        <!--<div :class="activeType == 2?'active':''"><a >销量</a></div>-->
+        <!--<div :class="activeType == 3?'active':''"><a >信用</a></div>-->
         <div :class="activeType == 4?'active':''">
           <select @change="onSelectTypeChange" class="form-control select-type select-adder">
             <option value="">店铺类型</option>
@@ -22,15 +22,15 @@
             <!--<option value="">寄售</option>-->
           </select>
         </div>
-        <div class=""><a >所在地</a></div>
+        <!--<div class=""><a >所在地</a></div>-->
     </div>
-      <div class="off">
-        <a @click="showClick">
-          <span v-text="show?'收起':'展开'" style="margin-right: 10px;"></span>
-          <i v-show="!show" class="fa fa-angle-down"></i>
-          <i v-show="show" class="fa fa-angle-up"></i>
-        </a>
-      </div>
+      <!--<div class="off">-->
+        <!--<a @click="showClick">-->
+          <!--<span v-text="show?'收起':'展开'" style="margin-right: 10px;"></span>-->
+          <!--<i v-show="!show" class="fa fa-angle-down"></i>-->
+          <!--<i v-show="show" class="fa fa-angle-up"></i>-->
+        <!--</a>-->
+      <!--</div>-->
   </div>
   </div>
 </template>

+ 7 - 3
components/searchStore/StoreContent.vue

@@ -21,7 +21,7 @@
           <span>库存量:<span v-text="store.totalReserve"></span></span>
         </div>
         <div class="btn-content">
-          <a class="focus-store store-btn" @click="focusStore(store, index)" v-text="focusData[index] === 'true'?'已关注':'关注店铺'"></a>
+          <a class="focus-store store-btn" @click="focusStore(store, index)" v-text="focusData[index] === 'true'?'已关注':'关注店铺'" :class="{'is-focus': focusData[index] === 'true'}"></a>
           <a :href="'/store/' + store.uuid" target="_blank" class="enter-store store-btn">进入店铺</a>
         </div>
       </div>
@@ -97,7 +97,7 @@
         if (!this.user.logged) {
           this.$http.get('/login/page').then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
         } else {
@@ -124,7 +124,7 @@
         this.$emit('pageAction', page)
       },
       goStore: function (index, compIndex) {
-        window.open('/product/component/' + this.componentData[index].content[compIndex].uuid)
+        window.open('/store/' + this.componentData[index].content[compIndex].storeid + '/' + this.componentData[index].content[compIndex].batchCode)
       }
     }
   }
@@ -245,6 +245,10 @@
     background: #5078cb;
     border: 1px solid #5078cb;
   }
+  .btn-content .is-focus {
+    background: #999;
+    border: 1px solid #999;
+  }
   .btn-content .enter-store {
     background: #ff8522;
     border: 1px solid #ff8522;

+ 84 - 15
components/store/CommodityInfo.vue

@@ -27,7 +27,7 @@
               <span class="money">
                 <span v-if="fragment.currency == 'RMB'">¥</span>
                 <span v-if="fragment.currency == 'USD'">$</span>
-                <span v-text="fragment.price"></span>
+                <span>{{fragment.price | currency}}</span>
               </span>
             </div>
             <div class="com-info">
@@ -48,9 +48,10 @@
             <div class="com-info">
               <span class="name">库&nbsp;存</span>:<span v-text="commodity.reserve || 0"></span>
               (<span v-text="commodity.minBuyQty || 1"></span>个起订)
+              <span :class="commodity.breakUp?'div-sell can-div-sell':'div-sell not-div-sell'" v-text="commodity.breakUp?'可拆卖':'不可拆卖'" ></span>
             </div>
             <div class="com-info">
-              <span class="name">&nbsp;期</span>:
+              <span class="name">&nbsp;期</span>:
               <div class="delivery">
                 <span v-text="commodity.b2cMinDelivery || 0"></span>
                 <span v-if="commodity.b2cMaxDelivery && commodity.b2cMaxDelivery !== commodity.b2cMinDelivery">-</span>
@@ -78,17 +79,17 @@
               <div class="select">
                 <span v-if="fragment.currency == 'RMB'">¥</span>
                 <span v-if="fragment.currency == 'USD'">$</span>
-                <span>{{(fragment.price || 0)}}</span>
+                <span>{{(fragment.price || 0) | currency}}</span>
                 <span v-if="fragment.currency == 'RMB'" class="tax"> ( 含税 ) </span>
               </div>
               <span class="money">
                  <span v-if="fragment.currency == 'RMB'">¥</span>
                  <span v-if="fragment.currency == 'USD'">$</span>
-                 <span>{{(calculate || 0)}}</span>
+                 <span>{{(calculate || 0) | currency}}</span>
               </span>
             </div>
-            <div class="button" ng-controller="GoodsPickUpCtrl">
+            <div class="button">
               <button class="btn btn-default btn-primary" @click="buyNow(false, commodity)">加入购物车</button>
               <button class="btn btn-default btn-now" @click="buyNow(true, commodity)">立即购买</button>
             </div>
@@ -108,10 +109,10 @@
                       <span v-text="price.start"></span>+
                     </div>
                     <div class="price">
-                      <span v-if="price.rMBPrice" v-text="price.rMBPrice || 0"></span>
+                      <span v-if="price.rMBPrice">{{price.rMBPrice || 0 | currency}}</span>
                     </div>
                     <div class="price">
-                      <span v-if="price.uSDPrice" v-text="price.uSDPrice || 0"></span>
+                      <span v-if="price.uSDPrice">{{price.uSDPrice || 0 | currency}}</span>
                     </div>
                   </li>
                 </ul>
@@ -175,6 +176,32 @@ export default {
         canSub: true}
     }
   },
+  filters: {
+    currency: function (num) {
+      if (typeof num === 'number') {
+        if (num <= 0.000001) {
+          num = 0.000001
+        } else {
+          if (num.toString().indexOf('.') === -1) {
+            num += '.00'
+          } else {
+            let inputStr = num.toString()
+            let arr = inputStr.split('.')
+            let floatNum = arr[1]
+            if (floatNum.length > 6) {
+              num = inputStr.substring(0, arr[0].length + 7)
+              if (Number(floatNum.charAt(6)) > 4) {
+                num = (Number(num) * 1000000 + 1) / 1000000
+              }
+            } else if (floatNum.length === 1) {
+              num = num + '0'
+            }
+          }
+        }
+      }
+      return num
+    }
+  },
   computed: {
     storeInfo () {
       return this.$store.state.shop.storeInfo.store.data
@@ -214,9 +241,10 @@ export default {
       }
     },
     changeNum: function (newNum) {
-      let pack = this.commodity.minPackQty
+      let pack = this.commodity.perQty || this.commodity.minPackQty
       let buy = this.commodity.minBuyQty
       let reserve = this.commodity.reserve
+      newNum = parseInt(newNum)
       if (newNum < buy) {
         this.$message.error('该商品最少购买' + buy + '件')
         this.fragment.num = buy
@@ -256,27 +284,33 @@ export default {
           }
         }
       }
-      console.log(this.fragment)
     },
     subNum () {
-      let newNum = this.fragment.num - this.commodity.minPackQty
+      let pack = this.commodity.perQty || this.commodity.minPackQty
+      let newNum = this.fragment.num - pack
       this.changeNum(newNum)
       getFragment(this.commodity, this.fragment)
     },
     addNum () {
-      let newNum = this.fragment.num + this.commodity.minPackQty
+      let pack = this.commodity.perQty || this.commodity.minPackQty
+      let newNum = this.fragment.num + pack
       this.changeNum(newNum)
       getFragment(this.commodity, this.fragment)
     },
     inputNum () {
-      this.changeNum(this.fragment.num)
-      getFragment(this.commodity, this.fragment)
+      if ((/^[\d]*$/).test(this.fragment.num)) {
+        this.changeNum(this.fragment.num)
+        getFragment(this.commodity, this.fragment)
+      } else {
+        this.$message.error('请输入整数')
+        this.fragment.num = this.commodity.minBuyQty
+      }
     },
     buyNow: function (isBuy, item) {
       if (!this.$store.state.option.user.logged) {
-        this.$http.get('/login/page').then(response => {
+        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
       } else {
@@ -315,6 +349,9 @@ export default {
                 }
               }, err => {
                 console.log(err)
+                if (item.minBuyQty > item.reserve) {
+                  this.$message.error('商品' + item.code + '的库存已经不满足起订量')
+                }
               })
           } else {
             // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
@@ -607,4 +644,36 @@ export default {
 	#commodity-info-fragment{
 		margin-bottom: 20px;
 	}
+
+  .commodity-detail .content .com-info .div-sell {
+    font-size: 12px;
+    height: 16px;
+    line-height: 16px;
+    color: #fff;
+    padding: 0 5px;
+    display: inline-block;
+    position: relative;
+  }
+  .commodity-detail .content .com-info .can-div-sell {
+    background: #5078cb;
+  }
+  .commodity-detail .content .com-info .not-div-sell {
+    background: #fc8200;
+  }
+  .commodity-detail .content .com-info .can-div-sell:before {
+    content: '';
+    position: absolute;
+    left: -8px;
+    top: 10px;
+    border-left: 8px solid transparent;
+    border-bottom: 6px solid #5078cb;
+  }
+  .commodity-detail .content .com-info .not-div-sell:before {
+    content: '';
+    position: absolute;
+    left: -8px;
+    top: 10px;
+    border-left: 8px solid transparent;
+    border-bottom: 6px solid #fc8200;
+  }
 </style>

+ 45 - 10
components/store/CommodityList.vue

@@ -49,23 +49,28 @@
               </a>
             </td>
             <td class="brand-code">
-              <div class="brand" v-text="commodity.brandNameEn"></div>
-              <div class="code" v-text="commodity.code"></div>
+              <div class="brand" v-if="commodity.brandNameEn" v-text="commodity.brandNameEn"></div>
+              <div class="brand" v-if="!commodity.brandNameEn">—</div>
+              <div class="code" v-if="commodity.code" v-text="commodity.code"></div>
+              <div class="code" v-if="!commodity.code">—</div>
             </td>
             <td>
-              <div class="package" v-text="commodity.packaging || '暂无包装信息'"></div>
-              <div class="date" v-text="commodity.produceDate">2016-12-01</div>
+              <div class="package" v-if="commodity.packaging" v-text="commodity.packaging"></div>
+              <div class="package" v-if="!commodity.packaging && !commodity.produceDate">—</div>
+              <div class="date" v-if='commodity.produceDate' v-text="commodity.produceDate">2016-12-01</div>
             </td>
             <td style="text-align: left;vertical-align: middle;">
-              <div class="goods">
+              <div class="goods" v-if="commodity.reserve">
                 库存:<span v-text="commodity.reserve">31500</span>
               </div>
-              <div class="from">
-                起拍:<span v-text="commodity.minBuyQty">300</span>
+              <div v-if="!commodity.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
+              <div class="from" v-if="commodity.reserve && commodity.reserve>0">
+                起拍:<span v-if="commodity.minBuyQty" v-text="commodity.minBuyQty">300</span>
               </div>
               <!--<div class="multiple">
                 倍数:<span>1</span>
               </div>-->
+              <div class="can-div-sell" v-if="commodity.reserve" v-text="commodity.breakUp?'可拆卖':'不可拆卖'"></div>
             </td>
             <td>
               <div v-for="price in commodity.prices" v-text="price.start + '+'"></div>
@@ -74,13 +79,13 @@
               <div v-show="commodity.currencyName.indexOf('USD')==-1 || !commodity.prices">
                 <span>—</span>
               </div>
-              <div v-for="price in commodity.prices" v-text="price.uSDPrice"></div>
+              <div v-for="price in commodity.prices">{{price.uSDPrice | currency}}</div>
             </td>
             <td>
               <div v-show="commodity.currencyName.indexOf('RMB')==-1 || !commodity.prices">
                 <span>—</span>
               </div>
-              <div v-for="price in commodity.prices" v-text="price.rMBPrice"></div>
+              <div v-for="price in commodity.prices" >{{price.rMBPrice | currency}}</div>
             </td>
             <td>
               <div v-if="commodity.b2cMinDelivery">交期:
@@ -88,6 +93,7 @@
                 <span v-if="commodity.b2cMinDelivery != commodity.b2cMaxDelivery" v-text="commodity.b2cMinDelivery + '-' + commodity.b2cMaxDelivery"></span>
                 <span v-if="commodity.b2cMinDelivery == commodity.b2cMaxDelivery" v-text="commodity.b2cMinDelivery"></span>
               </div>
+              <div v-if="!commodity.b2cMinDelivery"><span>—</span></div>
             </td>
             <td>
               <buy :item="commodity"></buy>
@@ -131,7 +137,7 @@ function getAllLeafIds (kind) {
     for (let i = 0; i < kind.children.length; i++) {
       ids.push(getAllLeafIds(kind.children[i]))
     }
-    return ids.join('-')
+    return ids.join(',')
   }
 }
 import Buy from '~components/common/buyOrCar/buyComponent.vue'
@@ -158,6 +164,32 @@ export default {
       ids: null
     }
   },
+  filters: {
+    currency: function (num) {
+      if (typeof num === 'number') {
+        if (num <= 0.000001) {
+          num = 0.000001
+        } else {
+          if (num.toString().indexOf('.') === -1) {
+            num += '.00'
+          } else {
+            let inputStr = num.toString()
+            let arr = inputStr.split('.')
+            let floatNum = arr[1]
+            if (floatNum.length > 6) {
+              num = inputStr.substring(0, arr[0].length + 7)
+              if (Number(floatNum.charAt(6)) > 4) {
+                num = (Number(num) * 1000000 + 1) / 1000000
+              }
+            } else if (floatNum.length === 1) {
+              num = num + '0'
+            }
+          }
+        }
+      }
+      return num
+    }
+  },
   computed: {
     commodities () {
       return this.$store.state.shop.storeInfo.storeCommodity.data
@@ -415,6 +447,9 @@ export default {
 		text-align: center;
 		line-height: 20px;
 	}
+  #goods-list-fragment .goodslist tbody>tr td .can-div-sell {
+    color: #333;
+  }
 
 	/* 物品列表按钮 */
 	#goods-list-fragment .btn-buy-now {

+ 35 - 7
components/store/RecommendProduct.vue

@@ -7,16 +7,16 @@
           <div class="content">
             <p v-text="commodity.comCode">MRFE6S9045NF001</p>
             <p class="color666" v-text="commodity.brandNameCn">PANFAEFQ</p>
-            <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB}}</p>
-            <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</p>
+            <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>
+            <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</p>
           </div>
           <div class="hover-show" :href="commodity.batchCode ? '/store/' + storeInfo.uuid + '/' + commodity.batchCode : '#'">
             <a :href="commodity.batchCode ? '/store/' + storeInfo.uuid + '/' + commodity.batchCode : '#'" class="href">
               <div class="title" v-text="commodity.comCode">MRFE6S9045NF001</div>
               <div class="type" v-text="commodity.brandNameCn">PANFAEFQ</div>
               <div class="hr"><span>抢购价</span></div>
-              <div class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB}}</div>
-              <div class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD || 0}}</div>
+              <div class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</div>
+              <div class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</div>
             </a>
             <div class="by-cart"><button title="加入购物车" @click="buyNow(false, commodity)"><img src="/images/store/icon/cart-blue.png"/></button></div>
             <div class="buy-now"><button title="立即购买" @click="buyNow(true, commodity)">立即购买</button></div>
@@ -41,13 +41,38 @@
         return this.$store.state.shop.storeInfo.store.data
       }
     },
+    filters: {
+      currency: function (num) {
+        if (typeof num === 'number') {
+          if (num <= 0.000001) {
+            num = 0.000001
+          } else {
+            if (num.toString().indexOf('.') === -1) {
+              num += '.00'
+            } else {
+              let inputStr = num.toString()
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
+              if (floatNum.length > 6) {
+                num = inputStr.substring(0, arr[0].length + 7)
+                if (Number(floatNum.charAt(6)) > 4) {
+                  num = (Number(num) * 1000000 + 1) / 1000000
+                }
+              } else if (floatNum.length === 1) {
+                num = num + '0'
+              }
+            }
+          }
+        }
+        return num
+      }
+    },
     methods: {
       buyNow: function (isBuy, item) {
-        console.log(item)
         if (!this.$store.state.option.user.logged) {
-          this.$http.get('/login/page').then(response => {
+          this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              this.$router.push('/auth/login')
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
         } else {
@@ -86,6 +111,9 @@
                   }
                 }, err => {
                   console.log(err)
+                  if (item.minBuyQty > item.reserve) {
+                    this.$message.error('商品' + item.code + '的库存已经不满足起订量')
+                  }
                 })
             } else {
               // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})

+ 15 - 6
components/store/common/StoreHeader.vue

@@ -27,14 +27,14 @@
             </div>
             <div style="background: #FFFFFF;" v-if="isOpen">
               <ul class = "shop-contact list-unstyled" style="padding: 15px 0; margin-bottom: 0; border-top: #e8e8e8 1px solid; margin-top: 20px;">
-                <li v-if="storeInfo.enterprise.enTel.length > 0">
+                <li v-if="storeInfo.enterprise.enTel">
                   <span>电话:</span><span v-text="storeInfo.enterprise.enTel"></span>
                 </li>
-                <li v-if="storeInfo.enterprise.enFax.length > 0">
+                <li v-if="storeInfo.enterprise.enFax">
                   <span>传真:</span><span v-text="storeInfo.enterprise.enFax"></span>
                 </li>
-                <li v-if="storeInfo.enterprise.enAddress.length > 0">
-                  <span>地址:</span><span v-text="storeInfo.enterprise.enAddress"></span>
+                <li v-if="storeInfo.enterprise.address || storeInfo.enterprise.enAddress">
+                  <span>地址:</span><span v-text="storeInfo.enterprise.address || storeInfo.enterprise.enAddress"></span>
                 </li>
                 <li class="text-right">
                   <nuxt-link :to="{ name: 'store-uuid-description', params: { uuid: storeInfo.uuid } }">了解更多&gt;</nuxt-link>
@@ -98,9 +98,9 @@ export default {
     },
     focus (id, name) {
       if (!this.user.logged) {
-        this.$http.get('/login/page').then(response => {
+        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            this.$router.push('/auth/login')
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
       } else {
@@ -124,6 +124,15 @@ export default {
   }
   .focus button.focus-btn a{
     color: #fff;
+    width: 100%;
+    height: 100%;
+    display: inline-block;
+  }
+  .focus button.focus-btn{
+    width: 138px;
+    height: 36px;
+    line-height: 36px;
+    padding: 0;
   }
 	#nav_fragment {
 		margin-bottom: 20px;

+ 29 - 22
layouts/error.vue

@@ -1,13 +1,12 @@
 <template>
   <div class="error">
-    <div class="error-content">
-      <h1 class="error-code">{{ error.statusCode }}</h1>
-      <div class="error-wrapper-message">
-        <h2 class="error-message">找不到页面</h2>
+    <div class="section">
+      <div class="container">
+        <div class="btn-click">
+          <a href="/"><i class="fa fa-home" style="margin-right:5px;"></i>返回首页</a>
+          <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
+        </div>
       </div>
-      <p>
-        <nuxt-link class="error-link" to="/">返回首页</nuxt-link>
-      </p>
     </div>
   </div>
 </template>
@@ -18,21 +17,29 @@
   }
 </script>
 
-<style lang="scss">
-  @import '~assets/scss/mixins';
-  @import '~assets/scss/variables';
-  .error {
-    position: relative;
-    background-color: $module-bg;
-    min-height: 10em;
-    width: 100%;
-    overflow: hidden;
+<style scoped lang="scss">
+  .section{
+    background: #ebfdff url('/images/404.png')no-repeat center center;
+    height:900px;
+    position:relative;
+  }
+  .section .btn-click{
+    position:absolute;
+    top:54%;
+    left:50%;
+    margin-left:-150px;
+  }
+  .section .btn-click a{
+    display:inline-block;
+    width:130px;
+    height:33px;
+    font-size: 16px;
+    line-height: 33px;
+    color:#fff;
+    background: #f87c29;
     text-align: center;
-    padding: 2em 0;
-    .error-content {
-      .error-code {
-        font-size: 6rem;
-      }
-    }
+    margin:0 10px;
+    border-radius: 2px;
+    text-decoration: none;
   }
 </style>

+ 5 - 1
middleware/authenticated.js

@@ -4,6 +4,10 @@ export default function ({ isServer, store, req, redirect }) {
   if (isServer && !req) return
 
   if (!store.state.option.user.logged) {
-    redirect('/auth/login')
+    this.$http.get('/logout/crossBefore').then(response => {
+      if (response.data) {
+        window.location.href = response.data.logoutUrl + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+      }
+    })
   }
 }

+ 4 - 3
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://www.usoftmall.com/' : 'http://192.168.253.121:8080/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://www.usoftmall.com/' : 'http://192.168.253.60:9090/platform-b2c/')
 
 module.exports = {
   router: {
@@ -97,7 +97,8 @@ module.exports = {
     src: '~plugins/vue-empty.js',
     ssr: false
   }, {
-    src: '~plugins/element-ui.js'
+    src: '~plugins/element-ui.js',
+    ssr: true
   }, {
     src: '~plugins/filters.js',
     ssr: false
@@ -106,5 +107,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/file**']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/release/**', '/auth/store/**', '/produce/**', '/file**', '/rate/**', '/log/**', '/help-service/**']
 }

+ 131 - 0
pages/activity/business.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="business">
+    <!--banner-->
+    <div class="banner"></div>
+    <!--介绍-->
+    <div class="session introduction">
+      <div class="content">
+        <h3>优软商城</h3>
+        <div class="text">
+          优软商城是由深圳市优软商城科技有限公司,为真正地解决电子信息行业的众多难题,秉持回归互联网精神的“分享与链接”,<br/>
+          基于垂直细分理念打造的一个独立的第三方电子交易商城。目前优软商城已经收录了3000家的原厂品牌,700多万现货型号.<br/>
+          针对电子信息行业的难题,优软商城将为客户提供更简单,更放心的解决方案。<br/>
+          我们严格把关供应商资质,从源头上杜绝虚假信息,做到付款交期如实,借助物流仓储的一站式服务帮您实现交易高效、库存无忧。<br/>
+        </div>
+        <div class="join">
+          <a href="http://account.ubtob.com/sso/register?returnURL=http%253A%252F%252Fwww.usoftmall.com%252Flogin%252Fproxy&appId=mall" target="_blank">立即入驻</a>
+        </div>
+      </div>
+    </div>
+    <div class="session advantage">
+      <div class="content">
+        <h3>六大特色功能</h3>
+        <div class="advantage-list">
+          <ul>
+            <li>
+              <p class="title">标准器件库</p>
+              <p>原厂型号,从源头上杜绝假货,品质更放心,售后有保障。</p>
+            </li>
+            <li>
+              <p class="title">元器件选型</p>
+              <p>3000家原厂品牌,700万产品型号,一键搜索,选您所需。</p>
+            </li>
+            <li>
+              <p class="title">现货交易</p>
+              <p>现货交易,如期如实,一周交货,生产高效不断链。</p>
+            </li>
+            <li>
+              <p class="title">库存寄售</p>
+              <p>死库料号,无需开店,免费注册,即可上架售卖。</p>
+            </li>
+            <li>
+              <p class="title">样品申领</p>
+              <p>海量原装料号,先试用再下单,采购零误差。</p>
+            </li>
+            <li>
+              <p class="title">电子社区</p>
+              <p>齐聚全球大人、发烧友和行业专家,分享行业快讯,交流高新技术难题。</p>
+            </li>
+          </ul>
+        </div>
+        <div class="join">
+          <a href="http://account.ubtob.com/sso/register?returnURL=http%253A%252F%252Fwww.usoftmall.com%252Flogin%252Fproxy&appId=mall" target="_blank">立即入驻</a>
+        </div>
+      </div>
+    </div>
+    <div class="session style">
+      <div class="content">
+        <h3>商家入驻  优势多多</h3>
+        <div class="style-list">
+          <ul>
+            <li>
+              <img src="/images/activity/style01.jpg" alt="">
+              <p>真实客户</p>
+            </li>
+            <li>
+              <img src="/images/activity/style02.jpg" alt="">
+              <p>免费入驻</p>
+            </li>
+            <li>
+              <img src="/images/activity/style03.jpg" alt="">
+              <p>免费广告</p>
+            </li>
+            <li>
+              <img src="/images/activity/style04.jpg" alt="">
+              <p>海量订单</p>
+            </li>
+            <li>
+              <img src="/images/activity/style05.jpg" alt="">
+              <p>极速上传</p>
+            </li>
+            <li>
+              <img src="/images/activity/style06.jpg" alt="">
+              <p>零佣金</p>
+            </li>
+            <li>
+              <img src="/images/activity/style07.jpg" alt="">
+              <p>库存寄售</p>
+            </li>
+            <li>
+              <img src="/images/activity/style08.jpg" alt="">
+              <p>订单通知</p>
+            </li>
+          </ul>
+        </div>
+        <div class="join">
+          <a href="http://account.ubtob.com/sso/register?returnURL=http%253A%252F%252Fwww.usoftmall.com%252Flogin%252Fproxy&appId=mall" target="_blank">立即入驻</a>
+        </div>
+      </div>
+    </div>
+    <div class="session join-us">
+      <div class="content">
+        <h3>成为优软商城卖家</h3>
+        <div class="join-step">
+          <div>
+            <h5>申请成为卖家</h5>
+            <p>提交入驻申请</p>
+          </div>
+          <div>
+            <h5>资质审核</h5>
+            <p>上传企业认证资料</p>
+          </div>
+          <div>
+            <h5>开通后台</h5>
+            <p>审核通过,上传产品、报价</p>
+          </div>
+        </div>
+        <div class="join">
+          <a href="http://account.ubtob.com/sso/register?returnURL=http%253A%252F%252Fwww.usoftmall.com%252Flogin%252Fproxy&appId=mall" target="_blank">立即入驻</a>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    layout: 'main'
+  }
+</script>
+<style scoped>
+  @import '~assets/scss/activity.css';
+</style>

+ 0 - 56
pages/auth/login.vue

@@ -1,56 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/login/crossBefore')
-        const params = data || {}
-        this.proxyLogin(params.askUrl, params.askData, params.loginUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogin (askUrl, askData, loginUrl) {
-      const crossAfter = this.crossAfter
-      this.$jsonp(`${askUrl}?askData=${askData}`, function (err, data) {
-        if (err) throw err
-
-        // 判断是否已经登录
-        if (data.error) {
-          // 如果未登录,跳转登录界面
-          window.location.href = loginUrl
-        } else {
-          crossAfter(data.content)
-        }
-      })
-    },
-    async crossAfter (content) {
-      if (!content && content === '') {
-        this.$router.replace('/')
-      }
-
-      try {
-        let { data } = await this.$http.post('/login/crossAfter', {}, { params: { replyTxt: content } })
-
-        this.$store.dispatch('loadUserInfo', data)
-
-        window.location.href = data.returnUrl || '/'
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    }
-  }
-}
-</script>

+ 0 - 34
pages/auth/logout.vue

@@ -1,34 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/logout/crossBefore')
-        const params = data || {}
-        this.proxyLogout(params.askUrl, params.returnUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogout (askUrl, returnUrl) {
-      this.$jsonp(`${askUrl}`, function (err, data) {
-        if (err) throw err
-        console.log(data)
-
-        window.location.href = returnUrl && returnUrl !== 'null' ? returnUrl : '/'
-      })
-    }
-  }
-}
-</script>

+ 23 - 9
pages/help/home.vue

@@ -31,13 +31,25 @@
   </div>
 </template>
 <script>
-  // 升序
-  function compare (property) {
-    return function (a, b) {
-      var value1 = a[property]
-      var value2 = b[property]
-      return value1 - value2
+//   升序
+//  function compare (property) {
+//    return function (a, b) {
+//      var value1 = a[property]
+//      var value2 = b[property]
+//      return value1 - value2
+//    }
+//  }
+  function sortBy (arr, property) {
+    for (let i = 0; i < arr.length; i++) {
+      for (let j = i; j < arr.length; j++) {
+        if (arr[i][property] > arr[j][property]) {
+          let tmp = arr[i]
+          arr[i] = arr[j]
+          arr[j] = tmp
+        }
+      }
     }
+    return arr
   }
   import { left, helpHeader } from '~components/help'
   export default {
@@ -53,10 +65,12 @@
     },
     computed: {
       helpNav () {
-        let list = this.$store.state.help.snapsho.data.sort(compare('detno'))
-        if (list) {
+        let list = this.$store.state.help.snapsho.data || []
+        if (list.length > 0) {
+          list = sortBy(list, 'detno')
           for (let i = 0; i < list.length; i++) {
-            list[i].children = list[i].children.sort(compare('detno'))
+            let tem = sortBy(list[i].children, 'detno')
+            list[i].children = tem
           }
         }
         return list

+ 0 - 1
pages/news/index.vue

@@ -28,7 +28,6 @@
     methods: {
       listenChild: function (nPage) {
         this.nowPage = nPage
-        console.log(this.nowPage)
         this.$store.dispatch('newsData/loadAllNews', { page: this.nowPage, pageSize: this.pageSize })
       }
     }

+ 0 - 56
pages/platform-b2c/login/proxy.vue

@@ -1,56 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/login/crossBefore')
-        const params = data || {}
-        this.proxyLogin(params.askUrl, params.askData, params.loginUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogin (askUrl, askData, loginUrl) {
-      const crossAfter = this.crossAfter
-      this.$jsonp(`${askUrl}?askData=${askData}`, function (err, data) {
-        if (err) throw err
-
-        // 判断是否已经登录
-        if (data.error) {
-          // 如果未登录,跳转登录界面
-          window.location.href = loginUrl
-        } else {
-          crossAfter(data.content)
-        }
-      })
-    },
-    async crossAfter (content) {
-      if (!content && content === '') {
-        this.$router.replace('/')
-      }
-
-      try {
-        let { data } = await this.$http.post('/login/crossAfter', {}, { params: { replyTxt: content } })
-
-        this.$store.dispatch('loadUserInfo', data)
-
-        window.location.href = data.returnUrl || '/'
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    }
-  }
-}
-</script>

+ 0 - 34
pages/platform-b2c/logout/proxy.vue

@@ -1,34 +0,0 @@
-<template>
-  <!-- Login 代理页面 -->
-  <div>
-  </div>
-</template>
-<script>
-
-export default {
-  layout: 'login',
-  mounted () {
-    this.crossBefore()
-  },
-  methods: {
-    async crossBefore () {
-      try {
-        let { data } = await this.$http.get('/logout/crossBefore')
-        const params = data || {}
-        this.proxyLogout(params.askUrl, params.returnUrl)
-      } catch (err) {
-        this.$router.replace('/')
-        console.log(err)
-      }
-    },
-    proxyLogout (askUrl, returnUrl) {
-      this.$jsonp(`${askUrl}`, function (err, data) {
-        if (err) throw err
-        console.log(data)
-
-        window.location.href = returnUrl && returnUrl !== 'null' ? returnUrl : '/'
-      })
-    }
-  }
-}
-</script>

+ 1 - 1
pages/product/kind/_id.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="container">
     <categroy-nav></categroy-nav>
-    <category-property  @loadCmpGoodsByBrandEvent="listemBrandFilter" @loadCmpGoodsByTypeEvent="listemProTypeFilter"></category-property>
+    <!--<category-property  @loadCmpGoodsByBrandEvent="listemBrandFilter" @loadCmpGoodsByTypeEvent="listemProTypeFilter"></category-property>-->
     <component-goods :brandid="brandid" :propertyJSON="propertyJSON"></component-goods>
   </div>
 </template>

+ 1 - 1
pages/provider/list.vue

@@ -12,7 +12,7 @@ export default {
   layout: 'main',
   fetch ({ store }) {
     return Promise.all([
-      store.dispatch('provider/loadRecommendStores'),
+      store.dispatch('provider/loadRecommendStores', { types: 'AGENCY-DISTRIBUTION', num: 5 }),
       store.dispatch('provider/findStoreList', { page: 1, count: 10, types: 'AGENCY-DISTRIBUTION' })
     ])
   },

+ 1 - 1
pages/store/_uuid/_batchCode.vue

@@ -11,7 +11,7 @@ export default {
   layout: 'shop',
   fetch ({ store, route }) {
     return Promise.all([
-      store.dispatch('shop/findStoreInfoFromUuid', route.params),
+//      store.dispatch('shop/findStoreInfoFromUuid', route.params),
       store.dispatch('shop/findCommodityOnBatchInfo', route.params)
     ])
   },

+ 2 - 2
plugins/axios.js

@@ -4,12 +4,12 @@ import store from '~store'
 
 const service = axios.create({
   withCredentials: true,
-  baseURL: process.env.proxyUrl || process.env.baseUrl
+  baseURL: '/'
 })
 
 service.interceptors.request.use(config => {
   // is server render, use ${baseUrl} directly rather than ${proxyUrl}
-  if (process.env.proxyUrl && typeof window === 'undefined') {
+  if (typeof window === 'undefined') {
     config.url = process.env.baseUrl + config.url
     config.headers.cookie = store.state.option.cookies + '; ' + store.state.option.sessionId
     config.headers['User-Agent'] = store.state.option.userAgent

+ 16 - 0
post.sh

@@ -0,0 +1,16 @@
+#!/bin/sh
+
+groupId=com.uas.platform
+artifactId=mall-ssr
+packaging=tgz
+version=1.0.0
+repo_uri='http://10.10.100.23:23004/v1/artifact'
+
+basepath=$(cd `dirname $0`; pwd)
+buildfile=$basepath/dist.tgz
+
+cnpm install
+npm run build
+tar -czf $buildfile .
+curl -H "Expect:" -F "groupId=$groupId" -F "artifactId=$artifactId" -F "packaging=$packaging"  -F "version=$version" -F "file=@$buildfile" $repo_uri
+rm -rf $buildfile

+ 0 - 1
run.sh

@@ -7,6 +7,5 @@ if [ "$NODE_ENV" == 'production' ]; then
   npm run build
   npm run start
 else
-  npm run dev-build
   npm run dev-start
 fi

二進制
static/images/404.png


二進制
static/images/activity/business-banner.jpg


二進制
static/images/activity/business.png


二進制
static/images/activity/style01.jpg


二進制
static/images/activity/style02.jpg


二進制
static/images/activity/style03.jpg


二進制
static/images/activity/style04.jpg


二進制
static/images/activity/style05.jpg


二進制
static/images/activity/style06.jpg


二進制
static/images/activity/style07.jpg


二進制
static/images/activity/style08.jpg


二進制
static/images/all/count_bg.png


二進制
static/images/partners/8.jpg


二進制
static/images/zhongqiu/zq1.png


二進制
static/images/zhongqiu/zq10.png


二進制
static/images/zhongqiu/zq11.png


二進制
static/images/zhongqiu/zq12.png


二進制
static/images/zhongqiu/zq13.png


二進制
static/images/zhongqiu/zq2.png


二進制
static/images/zhongqiu/zq3.png


二進制
static/images/zhongqiu/zq4.png


二進制
static/images/zhongqiu/zq5.png


二進制
static/images/zhongqiu/zq6.png


二進制
static/images/zhongqiu/zq7.png


二進制
static/images/zhongqiu/zq8.png


二進制
static/images/zhongqiu/zq9.png


+ 2 - 1
store/index.js

@@ -41,7 +41,8 @@ export const actions = {
     }
     return Promise.all([
       // 全局数据
-      store.dispatch('loadUserInfo')
+      store.dispatch('loadUserInfo'),
+      store.dispatch('loadProductCounts', { _status: 'actived' })
     ])
   },
   // 获取用户信息

+ 16 - 0
store/shop.js

@@ -10,6 +10,19 @@ function StoreFocusList ({ commit }, params = {}) {
       commit('storeInfo/GET_FOCUSLIST_FAILURE', err)
     })
 }
+// 根据UUID获取某店铺信息
+function findStoreInfoFromUuid ({ commit }, params = {}) {
+  commit('storeInfo/REQUEST_STORE_INFO')
+  return axios.get('/api/store-service/stores', { params })
+    .then(response => {
+      commit('storeInfo/GET_STORE_INFO_SUCCESS', response.data)
+      return Promise.all([
+        StoreFocusList({ commit }, {id: response.data.id})
+      ])
+    }, err => {
+      commit('storeInfo/GET_STORE_INFO_FAILURE', err)
+    })
+}
 
 export const actions = {
   // 根据UUID获取某店铺信息
@@ -35,6 +48,9 @@ export const actions = {
         return axios.get(`/api/commodity/component/${commodity.uuid}`)
           .then(response => {
             commit('storeInfo/GET_COMPONENT_SUCCESS', response.data)
+            return Promise.all([
+              findStoreInfoFromUuid({ commit }, {uuid: commodity.storeid})
+            ])
           }, err => {
             commit('storeInfo/GET_COMPONENT_FAILURE', err)
           })