Browse Source

Merge branch 'master' into feature/im-0915

# Conflicts:
#	nuxt.config.js
wangdy 8 years ago
parent
commit
18da82ab4e
78 changed files with 1708 additions and 450 deletions
  1. 1 1
      Dockerfile
  2. 9 0
      app.html
  3. 242 0
      assets/scss/activity.css
  4. 26 0
      assets/scss/common.scss
  5. 5 2
      components/common/buyOrCar/buyComponent.vue
  6. 40 6
      components/common/page/pageComponent.vue
  7. 6 6
      components/default/Footer.vue
  8. 10 8
      components/default/Header.vue
  9. 10 15
      components/default/RightBar.vue
  10. 7 1
      components/home/Carousel.vue
  11. 3 0
      components/home/KindCategory.vue
  12. 4 4
      components/home/floor/Floor.vue
  13. 18 16
      components/home/floor/FloorBar.vue
  14. 36 9
      components/main/Search.vue
  15. 28 19
      components/main/count/Box.vue
  16. 93 27
      components/main/count/Item.vue
  17. 52 15
      components/product/ComponentGoods.vue
  18. 1 0
      components/product/brand/BrandComponent.vue
  19. 24 14
      components/product/component/ComponentDetail.vue
  20. 62 17
      components/product/component/StoreInfo.vue
  21. 18 2
      components/provider/NewStore.vue
  22. 3 3
      components/provider/Suppliers.vue
  23. 43 17
      components/search/GoodList.vue
  24. 2 2
      components/search/Kind.vue
  25. 179 0
      components/searchStore/SearchTitle.vue
  26. 317 0
      components/searchStore/StoreContent.vue
  27. 4 0
      components/searchStore/index.js
  28. 78 13
      components/store/CommodityInfo.vue
  29. 45 10
      components/store/CommodityList.vue
  30. 35 7
      components/store/RecommendProduct.vue
  31. 6 6
      components/store/common/StoreHeader.vue
  32. 29 22
      layouts/error.vue
  33. 0 10
      layouts/main.vue
  34. 5 1
      middleware/authenticated.js
  35. 1 1
      nuxt.config.js
  36. 131 0
      pages/activity/business.vue
  37. 0 56
      pages/auth/login.vue
  38. 0 34
      pages/auth/logout.vue
  39. 23 9
      pages/help/home.vue
  40. 0 1
      pages/news/index.vue
  41. 0 56
      pages/platform-b2c/login/proxy.vue
  42. 0 34
      pages/platform-b2c/logout/proxy.vue
  43. 1 1
      pages/product/kind/_id.vue
  44. 40 0
      pages/searchStore/_keyword.vue
  45. 1 1
      pages/store/_uuid/_batchCode.vue
  46. 2 2
      plugins/axios.js
  47. 16 0
      post.sh
  48. 0 1
      run.sh
  49. BIN
      static/images/404.png
  50. BIN
      static/images/activity/business-banner.jpg
  51. BIN
      static/images/activity/business.png
  52. BIN
      static/images/activity/style01.jpg
  53. BIN
      static/images/activity/style02.jpg
  54. BIN
      static/images/activity/style03.jpg
  55. BIN
      static/images/activity/style04.jpg
  56. BIN
      static/images/activity/style05.jpg
  57. BIN
      static/images/activity/style06.jpg
  58. BIN
      static/images/activity/style07.jpg
  59. BIN
      static/images/activity/style08.jpg
  60. BIN
      static/images/all/count_bg.png
  61. BIN
      static/images/all/xiala.png
  62. BIN
      static/images/zhongqiu/zq1.png
  63. BIN
      static/images/zhongqiu/zq10.png
  64. BIN
      static/images/zhongqiu/zq11.png
  65. BIN
      static/images/zhongqiu/zq12.png
  66. BIN
      static/images/zhongqiu/zq13.png
  67. BIN
      static/images/zhongqiu/zq2.png
  68. BIN
      static/images/zhongqiu/zq3.png
  69. BIN
      static/images/zhongqiu/zq4.png
  70. BIN
      static/images/zhongqiu/zq5.png
  71. BIN
      static/images/zhongqiu/zq6.png
  72. BIN
      static/images/zhongqiu/zq7.png
  73. BIN
      static/images/zhongqiu/zq8.png
  74. BIN
      static/images/zhongqiu/zq9.png
  75. 2 1
      store/index.js
  76. 15 0
      store/searchStore.js
  77. 19 0
      store/searchStore/searchStoreDetail.js
  78. 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); }
+}*/

+ 26 - 0
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 {
@@ -618,3 +623,24 @@ div.el-tree-node__content{
   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;
+  /*将默认的select选择框样式清除*/
+  appearance:none;
+  -moz-appearance:none;
+  -webkit-appearance:none;
+  -ms-appearance:none;
+
+}
+.select-adder::-ms-expand {
+  display: none;
+}

+ 5 - 2
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})

+ 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: '迈迪杰科技'
         }]
       }
     }

+ 10 - 8
components/default/Header.vue

@@ -23,7 +23,7 @@
                 </li>
                 <li class="menu-item"
                     v-for="en in user.data.enterprises"
-                    v-if="showEnterprises && en.enName!=enterprise.enName">
+                    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">
@@ -37,7 +37,7 @@
             <!--<a class="item" :href="url + '/user'">买家中心</a>
             <a class="item" :href="url + '/vendor'">卖家中心</a>-->
             <a class="item" href="/user#/index">买家中心</a>
-            <a class="item" href="/vendor#/index">卖家中心</a>
+            <a class="item" href="/vendor#/index" v-if="enterprise.uu">卖家中心</a>
           </template>
           <template v-else>
             <a class="item" @click="onLoginClick()">登录</a>
@@ -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
           }
         })
@@ -104,7 +106,7 @@
         this.toggleEnterprises()
         this.$http.get(`/user/authentication/${en.uu}`).then(() => {
           this.$store.dispatch('loadUserInfo')
-          window.location.reload()
+//          window.location.reload()
         })
       }
     },

+ 10 - 15
components/default/RightBar.vue

@@ -156,35 +156,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 - 780) / 2

+ 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 {

+ 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;

+ 18 - 16
components/home/floor/FloorBar.vue

@@ -28,24 +28,26 @@
     },
     methods: {
       onScroll () {
-        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
+        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 - 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
+          } 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
+                }
               }
             }
           }

+ 36 - 9
components/main/Search.vue

@@ -1,6 +1,10 @@
 <template>
   <div class="search-box">
     <div class="input-group">
+      <select @change="onSelectTypeChange" class="form-control select-type select-adder">
+        <option value="">产品</option>
+        <option value="">店铺</option>
+      </select>
       <input v-model="keyword" type="text" class="search-input form-control input-primary"
              placeholder="型号/类目/品牌"
              @focus.stop.prevent="onFocus()"
@@ -12,7 +16,7 @@
         <button class="btn btn-primary search-btn" type="button">搜&nbsp;索</button>
       </span>
     </div>
-    <ul class="association" v-show="showAssociate"
+    <ul class="association" v-show="showAssociate && searchType == 'product'"
         @mouseenter="associate.focus=true" @mouseleave="associate.focus=false">
       <li v-for="(k, index) in similarKeywords.data" :key="k" class="item"
           :class="{'active': index==associate.activeIndex}"
@@ -40,7 +44,8 @@
           show: false,
           activeIndex: null
         },
-        click_flag: false
+        click_flag: false,
+        searchType: 'product'
       }
     },
     computed: {
@@ -82,6 +87,14 @@
       }
     },
     methods: {
+      onSelectTypeChange: function (e) {
+        let type = e.target[e.target.selectedIndex].innerHTML
+        if (type === '产品') {
+          this.searchType = 'product'
+        } else if (type === '店铺') {
+          this.searchType = 'store'
+        }
+      },
       onFocus () {
         this.associate.show = true
       },
@@ -126,7 +139,11 @@
         if (this.keyword) {
           this.associate.show = false
           this.$store.dispatch('resetSearchKeywords')
-          this.$router.push({path: '/search?w=' + encodeURIComponent(this.keyword)})
+          if (this.searchType === 'product') {
+            this.$router.push({path: '/search?w=' + encodeURIComponent(this.keyword)})
+          } else if (this.searchType === 'store') {
+            this.$router.push({path: '/searchStore?w=' + encodeURIComponent(this.keyword)})
+          }
         }
       },
       onAssociateClick (word) {
@@ -146,18 +163,28 @@
     border-radius: 0;
   }
   .search-box {
-    width: 470px;
+    width: 520px;
     height: 40px;
     position: relative;
-
+    .search-input{
+      width: 372px;
+      float: left;
+    }
     .search-input, .search-btn {
       height: 40px;
       border-width: 2px;
     }
-
+    .select-type{
+      width: 70px;
+      float: left;
+      border: #5078cb 2px solid;
+      height: 40px;
+      border-right: none;
+      margin-right: -1px;
+    }
     .search-btn {
       font-size: 16px;
-      width: 78px;
+      width: 79px;
       border-radius: 0;
     }
     .search-hot ul li a{
@@ -177,9 +204,9 @@
 
     .association {
       position: absolute;
-      left: 0;
+      left: 69px;
       top: 100%;
-      right: 79px;
+      right: 81px;
       background: $white;
       border: $border;
       border-top-width: 0;

+ 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>

+ 52 - 15
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">
             倍数:<span>{{compGoods.minPackQty}}</span>
           </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;
@@ -229,6 +259,10 @@
   }
   .product-list td a{
     color: #337ab7;
+    max-width: 160px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: block;
   }
   .product-list td a:hover {
     color: #23527c;
@@ -269,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 => {

+ 24 - 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">
@@ -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 () {
@@ -71,9 +71,6 @@
         dialogVisible: false
       }
     },
-    mounted () {
-      this.collectList()
-    },
     computed: {
       lists () {
         return this.$store.state.componentDetail.detail
@@ -96,25 +93,38 @@
               return true
             }
           }
+        } else {
+          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)
         }
       }
     }

+ 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>

+ 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>

+ 43 - 17
components/search/GoodList.vue

@@ -55,37 +55,43 @@
           <tbody id="productList-content">
           <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">
                 倍数:<span v-text="item.minPackQty"></span>
               </div>-->
+              <div v-if="item.reserve" v-text="item.breakUp?'可拆卖':'不可拆卖'"></div>
             </td>
             <td>
               <div v-show="!item.prices">
@@ -169,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
@@ -399,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;

+ 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)
       }
     }
   }

+ 179 - 0
components/searchStore/SearchTitle.vue

@@ -0,0 +1,179 @@
+<template>
+  <div class="search-store-title">
+    <span class="search-result">
+      搜索 "
+      <span style="color: #ff0101">{{keyword}}</span>
+      ",为您找到
+      <span v-text="goodsCount">1000</span>
+      家店铺:
+    </span>
+    <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 == 4?'active':''">
+          <select @change="onSelectTypeChange" class="form-control select-type select-adder">
+            <option value="">店铺类型</option>
+            <option value="">原厂</option>
+            <option value="">代理</option>
+            <option value="">经销</option>
+            <!--<option value="">寄售</option>-->
+          </select>
+        </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>
+  </div>
+</template>
+<script>
+  export default {
+    props: ['keyword'],
+    data () {
+      return {
+        activeType: 0,
+        paramType: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY-CONSIGNMENT',
+        show: true
+      }
+    },
+    computed: {
+      goodsCount () {
+        if (this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores) {
+          return this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores.totalElements || 0
+        } else {
+          return 0
+        }
+      }
+    },
+    methods: {
+      defaultSearch: function () {
+        this.activeType = 0
+        this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
+        this.$store.dispatch('searchStore/searchStoreDetail',
+          {
+            page: 1,
+            count: 4,
+            keyword: this.$route.query.w,
+            types: this.paramType,
+            op: 'pageByType'})
+      },
+      onSelectTypeChange: function (e) {
+        let type = e.target[e.target.selectedIndex].innerHTML
+        if (type === '原厂') {
+          this.paramType = 'ORIGINAL_FACTORY'
+        } else if (type === '代理') {
+          this.paramType = 'AGENCY'
+        } else if (type === '经销') {
+          this.paramType = 'DISTRIBUTION'
+        } else if (type === '店铺类型') {
+          this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
+        }
+        this.$emit('typeAction', this.paramType)
+        this.$store.dispatch('searchStore/searchStoreDetail',
+          {
+            page: 1,
+            count: 4,
+            keyword: this.$route.query.w,
+            types: this.paramType,
+            op: 'pageByType'})
+        this.activeType = 4
+      },
+      showClick: function () {
+        this.show = !this.show
+        this.$emit('showAction', this.show)
+      }
+    }
+  }
+</script>
+<style>
+  .search-store-title {
+    margin-top: 22px;
+  }
+  .search-store-title .select-type {
+    min-width: 87px;
+  }
+  .tab-filter{
+    width: 1190px;
+    height: 40px;
+    margin-top: 14px;
+    line-height: 40px;
+    background: #f4f8ff;
+    border: 1px solid rgb( 231, 231, 231 );
+    border-bottom: none;
+  }
+  .tab-filter .fl,.tab-filter .fr{
+    float: left;
+  }
+  .tab-filter .fl{
+    font-size: 14px;
+  }
+  .tab-filter .fr{
+    max-width: 1050px;
+    margin-left: 10px;
+  }
+  .tab-filter .fl span{
+    font-size: 14px;
+  }
+  .tab-filter .fr div{
+    float: left;
+    margin-right: 10px;
+  }
+  .tab-filter .fr div.active a, .tab-filter .fr div.active select{
+    border: #5078cb 1px solid;
+    color: #5078cb;
+  }
+  .tab-filter .fr div.active select option {
+    color: #000;
+  }
+  .tab-filter .fr a{
+    display: inline-block;
+    padding: 0 10px;
+    border: #ccc 1px solid;
+    line-height: 30px;
+    font-size: 14px;
+    text-align: center;
+    color: #333;
+    height: 30px;
+    background: #fff;
+  }
+  .tab-filter .fr a i{
+    /*margin-left: 5px;*/
+  }
+  .tab-filter .fr a:hover{
+    border: #5078cb 1px solid;
+    color: #5078cb;
+  }
+  .tab-filter .off{
+    float: right;
+    margin-right: 20px;
+    color: black;
+  }
+  .tab-filter .off a:hover{
+    border: none;
+    color: #5078cb;
+  }
+  .tab-filter .off a{
+    border: none;
+    text-align: right;
+    background: none;
+    color: #333;
+  }
+  .tab-filter .off a i{
+    font-size: 16px;
+  }
+  .tab-filter .fr .form-control{
+    width: 85px;
+    height: 30px;
+    line-height: 30px;
+    border-radius: 0;
+    padding: 0 5px;
+  }
+</style>

+ 317 - 0
components/searchStore/StoreContent.vue

@@ -0,0 +1,317 @@
+<template>
+  <div>
+  <ul class="store-list" v-if="storeData.content && storeData.content.length > 0">
+    <li v-for="(store, index) in storeData.content">
+      <div class="store-content-left">
+        <a :href="'/store/' + store.uuid" target="_blank">
+          <img :src="store.logoUrl?store.logoUrl:'/images/all/default.png'" class="storeImg" alt="">
+        </a>
+        <div class="store-detail">
+          <a :href="'/store/' + store.uuid" target="_blank" :title="store.storeName">{{store.storeName}}</a>
+          <span style="position: relative;" class="call-seller">
+            <img src="static/img/common/songguo.png?_v=1503050008623">
+							<a name="21059" href="javascript:void(0)" class="contact_btn">联系卖家</a>
+          </span>
+          <span class="main-product">
+             <a :href="'/store/' + store.uuid" target="_blank" v-text="'店铺简介:' + store.description"></a>
+          </span>
+        </div>
+        <div class="component-count">
+          <span style="margin-right: 30px">销量:<span v-text="salesData[index]"></span></span>
+          <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'?'已关注':'关注店铺'" :class="{'is-focus': focusData[index] === 'true'}"></a>
+          <a :href="'/store/' + store.uuid" target="_blank" class="enter-store store-btn">进入店铺</a>
+        </div>
+      </div>
+      <ul class="store-component-list" v-if="componentData">
+        <li v-for="(item, index2) in componentData[index].content" @click="goStore(index, index2)">
+          <!--<a :href="`/product/component/${item.uuid}`" style="display: block"><img :src="item.img?item.img:'/images/all/default.png'" alt=""></a>
+          <div class="describe-list">
+            <a style="margin-bottom: 8px" :href="`/product/component/${item.uuid}`" class="store-component-code" v-text="item.code" :title="item.code"></a>
+            <a style="margin-bottom: 8px" :href="`/product/brand/${item.branduuid}`" v-text="item.brandNameEn"></a>
+            <a :href="`/product/kind/${item.kindUuid}`" v-text="item.kindNameCn"></a>
+          </div>-->
+          <a style="display: block"><img :src="item.img?item.img:'/images/all/default.png'" alt=""></a>
+          <div class="describe-list">
+            <a class="store-component-code" v-text="item.code" :title="item.code"></a>
+            <a v-text="item.brandNameEn" :title="item.brandNameEn"></a>
+            <a v-text="item.kindNameCn" :title="item.kindNameCn"></a>
+          </div>
+        </li>
+      </ul>
+    </li>
+  </ul>
+    <page :total="storeData.totalElements" :page-size="pageSize"
+          :current="nowPage" v-on:childEvent="listenPage"></page>
+    <el-dialog
+      :visible.sync="dialogVisible"
+      size="tiny"
+    >
+      <h3 class="header-text">关注成功!</h3>
+      <div class="focus modal-body">
+        <button type="button" @click="dialogVisible = false" class="btn" style="margin-left:25px;">关&nbsp;&nbsp;闭</button>
+        <button type="button" @click="dialogVisible = false" class="focus-btn btn btn btn-info" style="margin-left:35px;">
+          <a href="/user#/storeFocus" target="_blank">查看我的店铺关注</a>
+        </button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import Page from '~components/common/page/pageComponent.vue'
+  export default {
+    data () {
+      return {
+        dialogVisible: false,
+        pageSize: 8,
+        nowPage: 1
+      }
+    },
+    components: {
+      Page
+    },
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      },
+      storeDetail () {
+        return this.$store.state.searchStore.searchStoreDetail.detail.data
+      },
+      storeData () {
+        return this.storeDetail[0].stores
+      },
+      focusData () {
+        return this.storeDetail[1].isFocus
+      },
+      componentData () {
+        return this.storeDetail[1].image
+      },
+      salesData () {
+        return this.storeDetail[1].sales
+      }
+    },
+    methods: {
+      focusStore: function (store, index) {
+        if (!this.user.logged) {
+          this.$http.get('/login/page').then(response => {
+            if (response.data) {
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+            }
+          })
+        } else {
+          if (this.focusData[index] === 'true') {
+            // 已关注
+            this.$message.error('店铺已关注,不能重复关注')
+          } else {
+            // 未关注
+            this.$http.post('/trade/storeFocus/save', {storeName: store.storeName, storeid: store.id})
+              .then(response => {
+                if (response.data === 'success') {
+                  // 关注成功
+                  this.dialogVisible = true
+                  this.focusData[index] = 'true'
+                } else {
+                  // 关注失败
+                  this.$message.error('关注失败')
+                }
+              })
+          }
+        }
+      },
+      listenPage: function (page) {
+        this.$emit('pageAction', page)
+      },
+      goStore: function (index, compIndex) {
+        window.open('/store/' + this.componentData[index].content[compIndex].storeid + '/' + this.componentData[index].content[compIndex].batchCode)
+      }
+    }
+  }
+</script>
+<style scoped>
+  .store-list {
+    border-right: 1px solid rgb( 231, 231, 231 );
+    border-left: 1px solid rgb( 231, 231, 231 );
+  }
+  .store-list >li{
+    border-bottom: 1px solid rgb( 231, 231, 231 );
+    padding: 20px 0;
+  }
+  .store-content-left {
+    display: inline-block;
+    margin-right: 27px;
+  }
+  .store-content-left .component-count{
+    display: block;
+    margin-left: 10px;
+    margin-top: 20px;
+  }
+  .store-content-left >div {
+    display: inline-block;
+  }
+  .store-content-left >a {
+    color: black;
+    float: left;
+    width: 100px;
+    height: 100px;
+    line-height: 100px;
+    display: inline-block;
+    border: 1px solid rgb( 231, 231, 231 );
+    overflow: hidden;
+    margin-left: 10px;
+  }
+  .store-content-left >a >img.storeImg {
+    max-width: 100px;
+    max-height: 100px;
+  }
+  .btn-content {
+    display: block!important;
+    margin-top: 20px;
+  }
+  .btn-content >span {
+    display: block;
+  }
+  .btn-content >span:hover {
+    cursor: pointer;
+  }
+  .store-detail {
+    margin-left: 20px;
+  }
+  .store-detail >a {
+    font-size: 14px;
+    font-weight: 700;
+    color: black;
+    display: block;
+    overflow: hidden;
+    width: 175px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+  .store-detail >span{
+    display: block;
+    font-size: 12px;
+    width: 190px;
+  }
+  .store-detail .call-seller {
+    margin-top: 14px;
+  }
+  .store-detail .call-seller .contact_btn {
+    width: 62px;
+    height: 18px;
+    line-height: 18px;
+    background: #ef7f03;
+    display: inline-block;
+    text-align: center;
+    color: #fff;
+    font-size: 12px;
+    border-radius: 5px;
+    margin-left: 5px;
+  }
+  .store-detail .main-product {
+    margin-top: 12px;
+  }
+  .store-detail .main-product a:hover {
+    cursor: pointer;
+    color: #5078cb!important;
+  }
+  .store-detail .main-product a {
+    color: #333;
+    width: 126px;
+    display: inline-block;
+    float: left;
+    overflow: hidden;
+    word-break: break-all;
+    height: 35px;
+    line-height: 16px;
+    text-overflow: ellipsis;
+    /*-webkit-line-clamp: 2;
+    -moz-line-clamp: 2;
+    -o-line-clamp: 2;
+    -ms-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    -moz-box-orient: vertical;
+    -o-box-orient: vertical;
+    -ms-box-orient: vertical;*/
+  }
+  .btn-content .store-btn {
+    padding: 4px 14px;
+    color: white;
+    display: inline-block;
+  }
+  .btn-content .focus-store {
+    margin-right: 30px;
+    margin-left: 10px;
+    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;
+  }
+  .store-component-list {
+    display: inline-block;
+    margin-right: 6px;
+    width: 834px;
+    float: right;
+  }
+  .store-component-list >li {
+    display: inline-block;
+    text-align: center;
+    border: 1px solid rgb( 231, 231, 231 );
+    margin-right: 14px;
+    width: 152px;
+    height: 178px;
+  }
+  .store-component-list >li:hover {
+    cursor: pointer;
+    color: #fff!important;
+    border: 1px solid #5078cb;
+  }
+  .store-component-list >li:hover .describe-list {
+    background: #5078cb;
+  }
+  .store-component-list >li:hover div a {
+    color: #fff;
+  }
+  .store-component-list >li img {
+    width: 149px;
+    height:114px;
+  }
+  .store-component-list >li .describe-list {
+    padding: 2px 10px;
+    background: #dee0e5;
+    height: 64px;
+  }
+  .store-component-list >li div a {
+    display: block;
+    font-size: 14px;
+    text-align: left;
+    color: #333;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    line-height: 20px;
+    white-space: nowrap;
+  }
+ /* .store-component-list >li a:hover {
+    color: #f39801;
+  }*/
+  /*.store-component-list .store-component-code {
+  }*/
+  .header-text {
+    text-align: center;
+    font-size: 20px;
+    color: #008B00;
+    margin-top: 0;
+  }
+  .el-dialog__body{
+    padding: 20px !important;
+  }
+  .focus button.focus-btn a{
+    color: #fff;
+  }
+</style>

+ 4 - 0
components/searchStore/index.js

@@ -0,0 +1,4 @@
+import SearchTitle from './SearchTitle.vue'
+import StoreContent from './StoreContent.vue'
+
+export { SearchTitle, StoreContent }

+ 78 - 13
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
@@ -258,12 +286,14 @@ export default {
       }
     },
     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)
     },
@@ -272,15 +302,15 @@ export default {
         this.changeNum(this.fragment.num)
         getFragment(this.commodity, this.fragment)
       } else {
-        this.$message.error('请输入数')
+        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 {
@@ -319,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 +640,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})

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

@@ -31,14 +31,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&&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&&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.address&&storeInfo.enterprise.address.length > 0">
-                  <span>地址:</span><span v-text="storeInfo.enterprise.address"></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>
@@ -102,9 +102,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 {

+ 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>

+ 0 - 10
layouts/main.vue

@@ -20,15 +20,5 @@
       MainHeader,
       MainNav
     }
-//    data () {
-//      return {
-//        url: window.location.href
-//      }
-//    },
-//    watch: {
-//      url: function (val, oldVal) {
-//        console.log(val)
-//      }
-//    }
   }
 </script>

+ 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)
+      }
+    })
   }
 }

+ 1 - 1
nuxt.config.js

@@ -107,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/**', '/release/**', '/auth/store/**', '/produce/**', '/file**', '/rate/**', '/log/**']
+  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>

+ 40 - 0
pages/searchStore/_keyword.vue

@@ -0,0 +1,40 @@
+<template>
+  <div class="container" id="searchResult">
+    <search-title :keyword="key" @showAction="showAction" @typeAction="onTypeChanged"></search-title>
+    <store-content v-show="show" @pageAction="onPageChanged"></store-content>
+  </div>
+</template>
+<script>
+  import { SearchTitle, StoreContent } from '~components/searchStore'
+  export default {
+    layout: 'main',
+    components: {
+      SearchTitle,
+      StoreContent
+    },
+    data () {
+      return {
+        key: this.$route.query.w,
+        show: true,
+        type: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
+      }
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('searchStore/searchStoreDetail', {page: 1, count: 8, keyword: route.query.w, types: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY', op: 'pageByType'})
+      ])
+    },
+    methods: {
+      showAction: function (show) {
+        this.show = show
+      },
+      onPageChanged: function (page) {
+        this.$store.dispatch('searchStore/searchStoreDetail', {page: page, count: 8, keyword: this.$route.query.w, types: this.type, op: 'pageByType'})
+      },
+      onTypeChanged: function (type) {
+        this.type = type
+      }
+    }
+  }
+</script>
+

+ 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

BIN
static/images/404.png


BIN
static/images/activity/business-banner.jpg


BIN
static/images/activity/business.png


BIN
static/images/activity/style01.jpg


BIN
static/images/activity/style02.jpg


BIN
static/images/activity/style03.jpg


BIN
static/images/activity/style04.jpg


BIN
static/images/activity/style05.jpg


BIN
static/images/activity/style06.jpg


BIN
static/images/activity/style07.jpg


BIN
static/images/activity/style08.jpg


BIN
static/images/all/count_bg.png


BIN
static/images/all/xiala.png


BIN
static/images/zhongqiu/zq1.png


BIN
static/images/zhongqiu/zq10.png


BIN
static/images/zhongqiu/zq11.png


BIN
static/images/zhongqiu/zq12.png


BIN
static/images/zhongqiu/zq13.png


BIN
static/images/zhongqiu/zq2.png


BIN
static/images/zhongqiu/zq3.png


BIN
static/images/zhongqiu/zq4.png


BIN
static/images/zhongqiu/zq5.png


BIN
static/images/zhongqiu/zq6.png


BIN
static/images/zhongqiu/zq7.png


BIN
static/images/zhongqiu/zq8.png


BIN
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' })
     ])
   },
   // 获取用户信息

+ 15 - 0
store/searchStore.js

@@ -0,0 +1,15 @@
+import axios from '~plugins/axios'
+
+export const actions = {
+  // 获取搜索店铺数据
+  searchStoreDetail ({ commit }, params = {}) {
+    commit('searchStoreDetail/REQUEST_STORE', params)
+    return axios.get(`/search/stores`, {params})
+      .then(response => {
+        commit('searchStoreDetail/GET_STORE_SUCCESS', response.data)
+      }, err => {
+        commit('searchStoreDetail/GET_STORE_FAILURE', err)
+      })
+  }
+}
+

+ 19 - 0
store/searchStore/searchStoreDetail.js

@@ -0,0 +1,19 @@
+export const state = () => ({
+  detail: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_STORE (state) {
+    state.detail.fetching = true
+  },
+  GET_STORE_FAILURE (state) {
+    state.detail.fetching = false
+  },
+  GET_STORE_SUCCESS (state, result) {
+    state.detail.fetching = false
+    state.detail.data = result
+  }
+}

+ 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)
           })