Browse Source

新增分享求购,手机端求购页面

shenjj 7 years ago
parent
commit
ba42d13dfe
66 changed files with 2793 additions and 1875 deletions
  1. 7 3
      Dockerfile
  2. 1 0
      README.md
  3. 26 24
      app.html
  4. 2 2
      assets/scss/common.scss
  5. 18 11
      assets/scss/mobileCommon.scss
  6. 6 6
      assets/scss/variables.scss
  7. 398 546
      components/applyPurchase/ApplyInfo.vue
  8. 919 418
      components/applyPurchase/BatchPublish.vue
  9. 85 77
      components/applyPurchase/PublishApply.vue
  10. 2 2
      components/applyPurchase/SayPrice.vue
  11. 3 73
      components/common/buyOrCar/buyComponent.vue
  12. 4 1
      components/common/loading/Loading.vue
  13. 1 1
      components/default/Footer.vue
  14. 89 0
      components/error/error.vue
  15. 3 0
      components/error/index.js
  16. 12 12
      components/home/Advert.vue
  17. 2 0
      components/home/News.vue
  18. 15 11
      components/home/floor/FloorList.vue
  19. 64 4
      components/mobile/Home.vue
  20. 1 1
      components/mobile/MobileFooter.vue
  21. 1 1
      components/mobile/MobileHeader.vue
  22. 14 7
      components/mobile/applyPurchase/PublishSeek.vue
  23. 34 18
      components/mobile/applyPurchase/SayPrice.vue
  24. 20 14
      components/mobile/applyPurchase/SayPriceInfo.vue
  25. 47 24
      components/mobile/applyPurchase/SeekList.vue
  26. 19 1
      components/mobile/common/LoginBox.vue
  27. 1 20
      components/mobile/share/store/StoreHeader.vue
  28. 123 7
      components/product/brand/BrandComponent.vue
  29. 4 9
      components/register-saler/Register.vue
  30. 330 303
      components/register-saler/register/StepFirst.vue
  31. 2 2
      components/register-saler/register/StepThird.vue
  32. 1 0
      components/store/BaseInfo.vue
  33. 3 73
      components/store/CommodityInfo.vue
  34. 3 71
      components/store/RecommendProduct.vue
  35. 3 0
      components/store/common/StoreHeader.vue
  36. 42 12
      layouts/main.vue
  37. 4 1
      nuxt.config.js
  38. 1 0
      pages/applyPurchase/_id.vue
  39. 14 6
      pages/applyPurchase/result.vue
  40. 2 2
      pages/index.vue
  41. 7 1
      pages/mobile/applyPurchase/list/index.vue
  42. 24 5
      pages/mobile/share/purChase/_uuid.vue
  43. 154 40
      pages/mobile/user/index.vue
  44. 2 6
      pages/product/brand/_code.vue
  45. 53 33
      pages/product/component/_uuid.vue
  46. 1 1
      pages/product/kind/_id.vue
  47. 1 4
      pages/register-saler/index.vue
  48. 10 1
      plugins/axios.js
  49. 1 1
      post.sh
  50. 1 1
      server.js
  51. BIN
      static/images/404-details.png
  52. BIN
      static/images/all/banner-cuxiao001.jpg
  53. BIN
      static/images/all/select-icon-full.png
  54. BIN
      static/images/applyPurchase/batch-icon.png
  55. BIN
      static/images/applyPurchase/link-buyer.png
  56. BIN
      static/images/applyPurchase/select2.png
  57. BIN
      static/images/floor/banner01.jpg
  58. BIN
      static/images/floor/banner02.jpg
  59. BIN
      static/images/mobile/@2x/applyPurchase/home/app-banner_01.jpg
  60. BIN
      static/images/mobile/@2x/applyPurchase/home/app-banner_02.jpg
  61. BIN
      static/images/store/common/goIn.png
  62. 22 0
      store/applyPurchase.js
  63. 6 0
      store/applyPurchase/bomMaterial.js
  64. 34 19
      store/product.js
  65. 18 0
      store/product/supplierInformation.js
  66. 133 0
      utils/baseUtils.js

+ 7 - 3
Dockerfile

@@ -1,4 +1,5 @@
-FROM 10.10.100.200:5000/node-webpack:0.0.1
+#FROM 10.10.100.200:5000/node-webpack:0.0.1
+FROM 10.10.100.200:5000/node-yarn:8.10-alpine
 
 RUN mkdir -p /app
 WORKDIR /app
@@ -7,10 +8,13 @@ COPY . /app
 
 RUN chmod +x run.sh
 
+RUN npm install -g node-gyp
+RUN yarn
+
 RUN export SASS_BINARY_PATH=linux_musl-x64-57_binding.node
 RUN export PATH=$PATH:$SASS_BINARY_PATH
 
-RUN cnpm install
-RUN npm run build
+#RUN cnpm install
+#RUN npm run build
 
 CMD [ "/app/run.sh" ]

+ 1 - 0
README.md

@@ -20,3 +20,4 @@ $ npm run generate
 ```
 
 For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).
+

+ 26 - 24
app.html

@@ -47,30 +47,32 @@
       s.parentNode.insertBefore(bp, s);
 
       // 用户浏览统计
-      // <!-- Piwik -->
-      var u = "//piwik.ubtob.com/";
-      _paq.push(['setTrackerUrl', u + 'piwik.php']);
-      _paq.push(['setSiteId', '1']);
-      var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
-      g.type = 'text/javascript'; g.async = true; g.defer = true; g.src = u + 'piwik.js'; s.parentNode.insertBefore(g, s);
-      // <!-- End Piwik Code -->
-      // if (/(iPhone|iPad|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/ig.test(w.navigator.userAgent) || w.location.pathname.indexOf('mobile/share') > -1) {
-      //   var docEl = d.documentElement
-      //   var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
-      //   var recalc = function () {
-      //     var clientWidth = docEl.clientWidth
-      //     if (!clientWidth) return
-      //     if (clientWidth >= 750) {
-      //       docEl.style.fontSize = '100px'
-      //     } else {
-      //       docEl.style.fontSize = 100 * (clientWidth / 750) + 'px'
-      //     }
-      //   }
-      //   //        recalc()
-      //   if (!d.addEventListener) return
-      //   w.addEventListener(resizeEvt, recalc, false)
-      //   d.addEventListener('DOMContentLoaded', recalc, false)
-      // }
+      <!-- Piwik -->
+        var u="//piwik.ubtob.com/";
+        _paq.push(['setTrackerUrl', u+'piwik.php']);
+        _paq.push(['setSiteId', '1']);
+        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
+      <!-- End Piwik Code -->
+/*
+      if (/(iPhone|iPad|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/ig.test(w.navigator.userAgent) || w.location.pathname.indexOf('mobile/share') > -1) {
+        var docEl = d.documentElement
+        var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
+        var recalc = function () {
+          var clientWidth = docEl.clientWidth
+          if (!clientWidth) return
+          if (clientWidth >= 750) {
+            docEl.style.fontSize = '100px'
+          } else {
+            docEl.style.fontSize = 100 * (clientWidth / 750) + 'px'
+          }
+        }
+//        recalc()
+        if (!d.addEventListener) return
+        w.addEventListener(resizeEvt, recalc, false)
+        d.addEventListener('DOMContentLoaded', recalc, false)
+      }
+*/
     })(window, document)
   </script>
   <script type="text/javascript">

+ 2 - 2
assets/scss/common.scss

@@ -1,7 +1,7 @@
 // scroll
 ::-webkit-scrollbar {
-  width: .5rem;
-  height: .5rem;
+  width: 6px;
+  height: 6px;
   background: hsla(0, 0%, 100%, 0.6);
 }
 

+ 18 - 11
assets/scss/mobileCommon.scss

@@ -1,3 +1,4 @@
+
 html {
   overflow-y: scroll;
   -webkit-text-size-adjust: 100%;
@@ -23,6 +24,11 @@ body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fiel
   padding: 0;
 }
 
+/* 设置顶层fontSize */
+// html {
+//   font-size: calc(100vw / 750 * 100) !important;
+// }
+
 input, select, textarea {
   font-size: 100%;
 }
@@ -104,7 +110,7 @@ ins, a {
   left: 0;
   right: 0;
   z-index: 999;
-  background: rgba(0,0,0,.3);
+  background: rgba(0,0,0,.4);
   .mobile-modal-box {
     position: absolute;
     /*width: 5.92rem;*/
@@ -120,8 +126,8 @@ ins, a {
       text-align: center;
       font-size: .32rem;
       position: relative;
-      border-top-left-radius: .1rem;
-      border-top-right-radius: .1rem;
+      border-top-left-radius: .07rem;
+      border-top-right-radius: .07em;
       i {
         position: absolute;
         right: -.25rem;
@@ -133,8 +139,8 @@ ins, a {
       background: #fff;
       color: #333;
       padding: 0 .54rem;
-      border-bottom-left-radius: .1rem;
-      border-bottom-right-radius: .1rem;
+      border-bottom-left-radius: .07rem;
+      border-bottom-right-radius: .07rem;
       div {
         padding: .2rem 0;
         line-height: .4rem;
@@ -221,7 +227,7 @@ input {
   line-height: .96rem;
   text-align: center;
   position: relative;
-  border-bottom: .04rem solid rgb(219, 219, 219);
+  border-bottom: .02rem solid rgb(219, 219, 219);
   > img {
     width: .36rem;
     height: .38rem;
@@ -254,9 +260,10 @@ input {
   input {
     width: 6.48rem;
     height: .58rem;
+    line-height: .58rem;
     border-radius: .14rem;
     margin: 0 0 0 .11rem;
-    font-size: .23rem;
+    font-size: .26rem;
     padding: 0 0 0 .21rem;
   }
   span {
@@ -271,7 +278,7 @@ input {
     margin-left: -.68rem;
     text-align: center;
     i {
-      font-size: .3rem;
+      font-size: .31rem;
     }
   }
   img {
@@ -287,10 +294,10 @@ input {
   //width: 7.17rem;
   margin: 0 auto .18rem;
   background: #fff;
-  padding: 0 .29rem;
+  padding: .1rem .29rem;
   .content-line {
-    height: .5rem;
-    line-height: .5rem;
+    height: .46rem;
+    line-height: .46rem;
     font-size: .28rem;
     overflow: hidden;
     text-overflow: ellipsis;

+ 6 - 6
assets/scss/variables.scss

@@ -51,12 +51,12 @@ $font-family: "Microsoft YaHei",'微软雅黑',serif;
 //Typography
 $font-size-small: 12px;
 $font-size: 14px;
-$font-size-large: 1.2rem;
-$font-size-h1: 2rem;
-$font-size-h2: 1.75rem;
-$font-size-h3: 1.5rem;
-$font-size-h4: 1.2rem;
-$font-size-h5: 1rem;
+$font-size-large: 12px;
+$font-size-h1: 20px;
+$font-size-h2: 17.5px;
+$font-size-h3: 15px;
+$font-size-h4: 12px;
+$font-size-h5: 10px;
 $font-size-h6: $font-size-small;
 
 $line-height: 1.2;

+ 398 - 546
components/applyPurchase/ApplyInfo.vue

@@ -9,124 +9,110 @@
       </div>
     </div>
     <div class="apply-info-list">
-      <p>
-        <span>发布时间
-          <a href="javascript:void(0)" @click="sortListByParam('releaseDate')">
-            <!--<i class=" fa fa-long-arrow-up" :class="{active: sorting.releaseDate == 'ASC'}"></i>-->
-            <!--<i class=" fa fa-long-arrow-down" :class="{active: sorting.releaseDate == 'DESC'}"></i>-->
-          </a>
+      <p class="list-title">
+        <span class="list-title-item">买家/发布时间
+          <!--<a href="javascript:void(0)" @click="sortListByParam('releaseDate')">
+            <i class=" fa fa-long-arrow-up" :class="{active: sorting.releaseDate == 'ASC'}"></i>
+            <i class=" fa fa-long-arrow-down" :class="{active: sorting.releaseDate == 'DESC'}"></i>
+          </a>-->
         </span>
-        <span>买家</span>
-        <span>型号</span>
-        <span>品牌</span>
-        <span>已报价
-          <a href="javascript:void(0)" @click="sortListByParam('offerAmount')">
-            <!--<i class=" fa fa-long-arrow-up" :class="{active: sorting.offerAmount == 'ASC'}"></i>-->
-            <!--<i class=" fa fa-long-arrow-down" :class="{active: sorting.offerAmount == 'DESC'}"></i>-->
-          </a>
+        <span class="list-title-item">产品信息</span>
+        <span class="list-title-item">已报价
+          <!--<a href="javascript:void(0)" @click="sortListByParam('offerAmount')">
+            <i class=" fa fa-long-arrow-up" :class="{active: sorting.offerAmount == 'ASC'}"></i>
+            <i class=" fa fa-long-arrow-down" :class="{active: sorting.offerAmount == 'DESC'}"></i>
+          </a>-->
         </span>
-        <span>截止时间
-          <a href="javascript:void(0)" @click="sortListByParam('deadline')">
-            <!--<i class=" fa fa-long-arrow-up" :class="{active: sorting.deadline == 'ASC'}"></i>-->
-            <!--<i class=" fa fa-long-arrow-down" :class="{active: sorting.deadline == 'DESC'}"></i>-->
-          </a>
+        <span class="list-title-item">截止时间
+          <!--<a href="javascript:void(0)" @click="sortListByParam('deadline')">
+            <i class=" fa fa-long-arrow-up" :class="{active: sorting.deadline == 'ASC'}"></i>
+            <i class=" fa fa-long-arrow-down" :class="{active: sorting.deadline == 'DESC'}"></i>
+          </a>-->
         </span>
-        <span>操作</span>
       </p>
       <ul v-if="purchaseManList.content && purchaseManList.content.length">
         <li v-for="(purchaseMan, index) in purchaseManList.content" :class="{'active': purchaseMan.active}" :key="index" ref="purchaseManList">
-          <div>{{purchaseMan.date| date}}</div>
-          <div v-if="purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName">{{purchaseMan.inquiry.enterprise.enName | enterpriseFilter}}</div>
-          <div v-else>{{purchaseMan.userName | userNameFilter}}</div>
-          <div :title="purchaseMan.cmpCode">{{purchaseMan.cmpCode || '-'}}</div>
-          <div :title="purchaseMan.inbrand">{{purchaseMan.inbrand || '-'}}</div>
-          <div class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10">
-            <span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</div>
-          <div class="date-content">
-            <div v-if="purchaseMan.remainingTime > 0">
-              <span>剩余&nbsp;</span>
-              <span v-if="getDay(purchaseMan.remainingTime) > 0" v-text="getDay(purchaseMan.remainingTime)"></span>
-              <i v-if="getDay(purchaseMan.remainingTime) > 0">&nbsp;天&nbsp;</i>
-              <span v-if="getDay(purchaseMan.remainingTime) <= 0" v-text="getHours(purchaseMan.remainingTime)"></span>
-              <i v-if="getDay(purchaseMan.remainingTime) <= 0">&nbsp;小时</i>
-            </div>
-            <span v-if="!purchaseMan.remainingTime || purchaseMan.remainingTime <= 0">已截止</span>
+          <div class="il-item il-left">
+            <div class="item" v-if="purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName" :title="user.logged ? purchaseMan.inquiry.enterprise.enName : null">{{[purchaseMan.inquiry.enterprise.enName, user] | enterpriseFilter}}</div>
+            <div class="item" v-else :title="user.logged ? purchaseMan.userName : null">{{[purchaseMan.userName, user] | userNameFilter}}</div>
+            <div>{{purchaseMan.date| date}}</div>
           </div>
-          <div class="btn-content">
-            <!--<a @click="setLinkBoxIndex(index)">联系买家</a>-->
-            <!--判断该求购是自己的-->
-            <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt=""></div>
-            <div v-else>
-              <a title="该求购已截止" v-if="!purchaseMan.remainingTime || purchaseMan.remainingTime <= 0" style="background: #cccbcb;" @click="sayPriceStop">我要报价</a>
-              <a title="此为贵公司的求购" v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && (user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" style="background: #cccbcb;" @click="sayPriceSeft">我要报价</a>
-              <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && !(user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" @click="sayPrice(purchaseMan, index)">我要报价</a>
-            </div>
-
-          </div>
-
-          <div class="expand-content">
-            <div>
-              封装:{{purchaseMan.encapsulation || '-'}}
-            </div>
-            <div>
-              采购数量:
-              <span>{{purchaseMan.needquantity || '-'}}</span>
-              <span v-if="purchaseMan.needquantity">个</span>
-            </div>
-            <div>
-              单价预算:
-              <span>{{purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'}}</span>
+          <div class="il-item il-center">
+            <div class="il-box-large il-box">
+              <div :title="purchaseMan.prodTitle | nullFilter" class="fl item size-middle">
+                <span>类目:</span>
+                <div class="content">{{(purchaseMan.prodTitle || '-') | nullFilter}}</div>
+              </div>
+              <div :title="purchaseMan.cmpCode" class="fl item">
+                <span>型号:</span>
+                <div class="content">{{purchaseMan.cmpCode || '-'}}</div>
+              </div>
+              <div :title="purchaseMan.inbrand" class="fl item bottom size-middle">
+                <span>品牌:</span>
+                <div class="content">{{purchaseMan.inbrand || '-'}}</div>
+              </div>
+              <div :title="purchaseMan.spec" class="fl item bottom">
+                <span>规格:</span>
+                <div class="content">{{purchaseMan.spec || '-'}}</div>
+              </div>
             </div>
-            <div>
-              生产日期:{{purchaseMan.produceDate || '-'}}
+            <div class="il-box-small il-box">
+              <div :title="purchaseMan.encapsulation" class="item">
+                <span>封装:</span>{{purchaseMan.encapsulation || '-'}}</div>
+              <div :title="purchaseMan.produceDate" class="item">
+                <span>生产日期:</span>{{purchaseMan.produceDate || '-'}}</div>
+              <div :title="purchaseMan.needquantity" class="item">
+                <span>采购数量:</span>{{purchaseMan.needquantity || '-'}}</div>
+              <div :title="purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'" class="item">
+                <span>单价预算:</span>{{purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'}}</div>
             </div>
           </div>
-          <div class="sharecode">
-            <div class="sharecodeR"></div>
-            <div class="sharecodeL" @mouseover="setShowShare(!showShare, index, purchaseMan.id)">
-              <div class="sharecodeT">求<br/>购<br/>分<br/>享</div>
-              <div class="sharecodeBtn" @mouseout="hideShowShare(!showShare, index, purchaseMan.id)">
-                <img src="/images/mobile/@2x/purChase/code.png" />
+          <div class="il-item number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10">
+            <span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</div>
+          <div class="il-item il-right">
+            <div class="date-content">
+              <div v-if="purchaseMan.remainingTime > 0">
+                <span>剩余&nbsp;</span>
+                <span v-if="getDay(purchaseMan.remainingTime) > 0" v-text="getDay(purchaseMan.remainingTime)"></span>
+                <i v-if="getDay(purchaseMan.remainingTime) > 0">&nbsp;天&nbsp;</i>
+                <span v-if="getDay(purchaseMan.remainingTime) <= 0" v-text="getHours(purchaseMan.remainingTime)"></span>
+                <i v-if="getDay(purchaseMan.remainingTime) <= 0">&nbsp;小时</i>
               </div>
+              <span v-if="!purchaseMan.remainingTime || purchaseMan.remainingTime <= 0">已截止</span>
             </div>
-
-          </div>
-          <div class="sharescancodekuang">
-            <div class="sharescancode icon-style" ref="sharescancode" @mouseover="showShowShare(!showShare, index, purchaseMan.id)" @mouseout="hideShowShare(!showShare, index, purchaseMan.id)">
-              <div class="share">
-                <div>
-                  <div class="title">求购分享</div>
-                  <canvas :class="'qrccode-canvas_'+index" width="98" height="98"></canvas>
-                  <input :value="url" readonly>
-                  <span :class="'copyLink_'+index" :data-clipboard-text="url">复制链接</span>
-                </div>
+            <div class="btn-content">
+              <!--<a @click="setLinkBoxIndex(index)">联系买家</a>-->
+              <!--判断该求购是自己的-->
+              <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt=""></div>
+              <div v-else>
+                <a title="该求购已截止" v-if="!purchaseMan.remainingTime || purchaseMan.remainingTime <= 0" style="background: #cccbcb;" @click="sayPriceStop">我要报价</a>
+                <a title="此为贵公司的求购" v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && (user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" style="background: #cccbcb;" @click="sayPriceSeft">我要报价</a>
+                <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && !(user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" @click="sayPrice(purchaseMan, index)">我要报价</a>
               </div>
             </div>
-          </div>
+            <div class="sharecode">
+              <div class="sharecodeR"></div>
+              <div class="sharecodeL" @mouseover="setShowShare(!showShare, index, purchaseMan.id)">
+                <div class="sharecodeT">求<br/>购<br/>分<br/>享</div>
+                <div class="sharecodeBtn" @mouseout="hideShowShare(!showShare, index, purchaseMan.id)">
+                  <img src="/images/mobile/@2x/purChase/code.png" />
+                </div>
+              </div>
 
-          <!--<div class="say-price">
-            <div>报价</div>
-            <div>
-              <i>*</i>单价
-              <select v-if="!purchaseMan.currency" v-model="sayPriceObj.currency">
-                <option value="RMB">¥</option>
-                <option value="USD">$</option>
-              </select>
-              <div v-if="purchaseMan.currency" v-text="purchaseMan.currency == 'RMB' ? '¥' : '$'"></div>
-              <input type="number" v-model="sayPriceObj.unitPrice" class="form-control" @blur="onUnitPriceBlur" @input="onUnitPriceChange">
             </div>
-            <div>
-              <i>*</i>交期&nbsp;
-              <input type="number" v-model="sayPriceObj.minDay" @blur="onMinDayInput" @input="onMinDayChange" class="form-control">&nbsp;-&nbsp;<input type="number" v-model="sayPriceObj.maxDay" @blur="onMaxDayInput" @input="onMaxDayChange" class="form-control">&nbsp;天
-            </div>
-            <div>
-              生产日期&nbsp;<input v-model="sayPriceObj.produceDate" @input="onProduceDateChange" type="text" class="form-control">
-            </div>
-            <div>
-              <span @click="cancelSayPrice(purchaseMan)">取消</span>
-              <span @click="commitSayPrice(purchaseMan)">提交</span>
+            <div class="sharescancodekuang">
+              <div class="sharescancode icon-style" ref="sharescancode" @mouseover="showShowShare(!showShare, index, purchaseMan.id)" @mouseout="hideShowShare(!showShare, index, purchaseMan.id)">
+                <div class="share">
+                  <div>
+                    <div class="title">求购分享</div>
+                    <canvas :class="'qrccode-canvas_'+index" width="98" height="98"></canvas>
+                    <input :value="url" readonly>
+                    <span :class="'copyLink_'+index" :data-clipboard-text="url">复制链接</span>
+                  </div>
+                </div>
+              </div>
             </div>
-          </div>-->
+          </div>
         </li>
       </ul>
       <div class="empty" v-else>
@@ -157,6 +143,7 @@
 <script>
 import Page from '~components/common/page/pageComponent.vue'
 import SayPrice from './SayPrice.vue'
+import { checkNullStr } from '~utils/baseUtils'
 import Clipboard from 'clipboard'
 let QRCode = require('qrcode')
 export default {
@@ -173,9 +160,8 @@ export default {
       Timer: {}
     }
   },
-  components: {
-    Page,
-    SayPrice
+  phone: function(str) {
+    return str ? str.substring(0, 3) + '****' + str.substring(7, 11) : '-'
   },
   filters: {
     date: function(date) {
@@ -192,19 +178,31 @@ export default {
     phone: function(str) {
       return str ? str.substring(0, 3) + '****' + str.substring(7, 11) : '-'
     },
-    enterpriseFilter(str) {
-      return str
-        ? str.length > 4
-          ? str.substring(0, 2) +
-            '**' +
-            str.substring(str.length - 2, str.length)
-          : str
-        : '-'
+    enterpriseFilter([str, user]) {
+      if (!user.logged) {
+        return str
+          ? str.length > 4
+            ? str.substring(0, 2) +
+              '**' +
+              str.substring(str.length - 2, str.length)
+            : str
+          : '-'
+      } else {
+        return str || '-'
+      }
+    },
+    userNameFilter([str, user]) {
+      if (!user.logged) {
+        return str ? str.substring(0, 1) + '**' : '-'
+      } else {
+        return str || '-'
+      }
     },
-    userNameFilter(str) {
-      return str ? str.substring(0, 1) + '**' : '-'
+    nullFilter(str) {
+      return checkNullStr(str) ? str : '-'
     }
   },
+  components: { Page, SayPrice },
   computed: {
     storeInfo() {
       return this.$store.state.shop.storeInfo.store.data
@@ -261,7 +259,9 @@ export default {
       clearTimeout(this.Timer[index] ? this.Timer[index] : '')
       this.$refs.sharescancode[index].style.display = 'block'
       this.$refs.purchaseManList[index].onmouseout = () => {
-        clearTimeout(this.Timer[index] ? this.Timer[index] : '')
+        if (this.Timer[index] !== 'undefined') {
+          clearTimeout(this.Timer[index])
+        }
         this.Timer[index] = setTimeout(() => {
           this.$refs.sharescancode[index].style.display = 'none'
         }, 300)
@@ -428,27 +428,34 @@ export default {
         text-align: center;
         display: inline-block;
       }
-    }
-  }
-  .apply-info-list {
-    > p {
-      background: #ededed;
-      height: 40px;
-      line-height: 40px;
-      margin: 9px 0 0 0;
-      span {
-        display: inline-block;
-        text-align: center;
-        a {
-          i {
-            color: #333;
-            &.active {
-              color: #5078cb;
-            }
+      > div {
+        float: right;
+        height: 33px;
+        line-height: 33px;
+        > input {
+          width: 241px;
+          height: 33px;
+          line-height: 33px;
+          font-size: 13px;
+          border: {
+            top-right-radius: 0;
+            bottom-right-radius: 0;
           }
         }
-        &:nth-child(1) {
-          width: 186px;
+        > span {
+          display: inline-block;
+          width: 69px;
+          color: #fff;
+          background: #3975f4;
+          text-align: center;
+          margin: 0 6px 0 -1px;
+          height: 33px;
+          /*vertical-align: middle;*/
+          border: {
+            top-right-radius: 3px;
+            bottom-right-radius: 3px;
+          }
+          cursor: pointer;
         }
         &:nth-child(2) {
           width: 106px;
@@ -471,462 +478,307 @@ export default {
         }
       }
     }
+
+    .empty {
+      text-align: center;
+      height: 200px;
+      line-height: 200px;
+      border: 1px solid #e8e8e8;
+      margin-bottom: 10px;
+      span {
+        color: #999;
+        margin-left: 10px;
+      }
+    }
+  }
+  .apply-info-list {
+    .list-title {
+      background: #e2ebff;
+      height: 40px;
+      line-height: 40px;
+      margin: 9px 0 0 0;
+      .list-title-item {
+        display: inline-block;
+        text-align: center;
+        .fa {
+          color: #333;
+          &.active {
+            color: #5078cb;
+          }
+        }
+        &:nth-child(1) {
+          margin-left: 76px;
+        }
+        &:nth-child(2) {
+          margin-left: 345px;
+        }
+        &:nth-child(3) {
+          margin-left: 399px;
+        }
+        &:nth-child(4) {
+          margin-left: 71px;
+        }
+      }
+    }
     > ul {
       margin-bottom: 29px;
       > li {
         position: relative;
-        min-height: 61px;
-        line-height: 61px;
         border: 1px solid #ededed;
-        > div {
-          overflow-x: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
+        &.active {
+          border: 1px solid #4290f7;
+          box-shadow: 2px 4px 5px 0 rgb(205, 221, 252);
+        }
+        &:hover {
+          border: 1px solid #4290f7;
+          box-shadow: 2px 4px 5px 0 rgb(205, 221, 252);
+          .il-item.il-right .sharecode {
+            display: block;
+          }
+        }
+        .il-item {
+          height: 120px;
           display: inline-block;
           text-align: center;
           color: #3c3c3c;
+          padding-top: 16px;
           vertical-align: middle;
-          &:nth-child(1) {
-            width: 186px;
-          }
-          &:nth-child(2) {
-            width: 106px;
-          }
-          &:nth-child(3) {
-            width: 200px;
-          }
-          &:nth-child(4) {
-            width: 174px;
-          }
-          &:nth-child(5) {
-            width: 152px;
-          }
-          &:nth-child(6) {
-            width: 158px;
-          }
-          &:nth-child(7) {
-            width: 180px;
-            margin-left: 32px;
-            float: right;
-          }
-          &.date-content {
+          .item {
+            display: inline-block;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
             span {
-              &:first-child {
-                font-size: 12px;
-                color: #666;
-              }
-              color: #f71026;
-            }
-            i {
-              font-style: normal;
+              color: #999;
             }
           }
-          &.number-content {
-            span {
-              color: #5392f9;
-              &.active {
-                color: #ff9a00;
+          &.il-left {
+            width: 236px;
+            padding: 16px 10px 0;
+            div {
+              display: block;
+              &:last-child {
+                margin-top: 37px;
+                color: #666;
               }
             }
-            > img {
-              margin-bottom: 5px;
-              margin-right: 2px;
-            }
           }
-          &.btn-content {
-            > div a {
-              display: inline-block;
-              width: 71px;
-              height: 28px;
-              line-height: 28px;
-              color: #fff;
-              background: #3c7cf5;
-              border-radius: 3px;
-              cursor: pointer;
-              /*  &:first-child {
-                    background: #ffa200;
-                    float: left;
-                    margin-top: 19px;
-                  }*/
-            }
-            .is-say-price {
+          &.il-center {
+            text-align: left;
+            width: 654px;
+            .il-box {
               display: inline-block;
-              color: #39ae05;
-              margin-left: 11px;
-              img {
-                margin-bottom: 2px;
+              float: left;
+              span {
+                color: #999;
               }
-              .say-price-history {
-                position: absolute;
-                top: 53px;
-                right: 11px;
-                line-height: normal;
-                width: 198px;
-                height: 0;
-                background: #fff;
-                border: 1px solid #fab89a;
-                z-index: 1;
-                overflow: hidden;
-                transition: height 1s;
-                -moz-transition: height 1s; /* Firefox 4 */
-                -webkit-transition: height 1s; /* Safari 和 Chrome */
-                -o-transition: height 1s; /* Opera */
-                opacity: 0;
-                p {
-                  color: #020202;
-                  font-weight: bold;
-                  margin: 0;
-                  &.price-title {
-                    background: #fee6db;
-                    height: 28px;
-                    line-height: 28px;
-                  }
-                  &.price-level {
-                    margin: 6px 0;
-                    text-align: left;
-                  }
+            }
+            .il-box-large {
+              width: 482px;
+              .fl {
+                width: 284px;
+                line-height: 19px;
+                word-break: break-all;
+                white-space: unset;
+                &.bottom {
+                  margin-top: 14px;
                 }
-                > div {
-                  padding: 9px 12px;
-                  > div {
-                    display: inline-block;
-                    text-align: left;
-                    &:nth-child(1) {
-                      float: left;
-                    }
-                    &:nth-child(2) {
-                      margin-left: 32px;
-                    }
-                    span {
-                      color: #020202;
-                      margin: 0;
-                      &.red-text {
-                        color: #f62d37;
-                      }
-                    }
-                    &.pre-line {
-                      display: block;
-                      padding: 13px 0;
-                      border-bottom: 1px dashed #fee6db;
-                    }
-                  }
-                  ul {
-                    li {
-                      color: #333;
-                      height: 22px;
-                      line-height: 22px;
-                      padding: 0 6px;
-                      &:nth-child(odd) {
-                        background: #f6f5f4;
-                      }
-                      span {
-                        color: #333;
-                        display: inline-block;
-                        text-align: left;
-                        width: 50%;
-                        margin: 0;
-                      }
-                      &:last-child {
-                        span {
-                          color: #4290f7;
-                        }
-                      }
-                    }
+                .content {
+                  display: inline-block;
+                  width: 220px;
+                  overflow: hidden;
+                  vertical-align: middle;
+                  height: 38px;
+                }
+                span {
+                  float: left;
+                }
+                &.size-middle {
+                  width: 136px;
+                  margin-right: 37px;
+                  .content {
+                    width: 86px;
                   }
                 }
               }
-              &:hover {
-                .say-price-history {
-                  opacity: 1;
-                  /* animation: expand 1s infinite;
-                     -webkit-animation: expand 1s infinite; !*Safari and Chrome*!
-                     animation-iteration-count: 1;
-                     -webkit-animation-iteration-count: 1;*/
-                  height: 210px;
-                }
+            }
+            .il-box-small {
+              width: 151px;
+              margin-left: 12px;
+              .item {
+                color: #020202;
+                width: 151px;
+                margin-bottom: 6px;
               }
-              /* @keyframes expand {
-                   from {bottom: 58px}
-                   to {bottom: auto}
-                 }
-                 @-webkit-keyframes expand {
-                   from {bottom: 58px}
-                   to {bottom: auto}
-                 }*/
             }
           }
-          &.sharecode {
-            position: absolute;
-            right: 0;
-            top: 0;
-            height: 110px;
-            z-index: 99;
-            display: none;
-            .sharecodeR {
-              width: 4px;
-              height: 110px;
-              background: #4290f7;
-              float: right;
-            }
-            .sharecodeL {
-              float: right;
-              margin-right: 1px;
-            }
-            .sharecodeT {
-              padding-top: 5px;
-              margin-top: 2px;
-              width: 28px;
-              height: 68px;
-              background-color: #3c7cf5;
-              border-radius: 2px;
-              color: #ffffff;
-              font-size: 14px;
-              word-wrap: break-word;
-              white-space: pre-wrap;
-              line-height: 14px;
-            }
-            .sharecodeBtn {
-              width: 28px;
-              height: 28px;
-              margin-top: 4px;
-              &::after {
-                content: ' ';
-                clear: both;
-                display: inline;
-                visibility: hidden;
+          &.il-right {
+            width: 100px;
+            .date-content {
+              margin-top: 14px;
+              margin-bottom: 17px;
+              span {
+                &:first-child {
+                  font-size: 12px;
+                  color: #666;
+                }
+                color: #f71026;
               }
-              img {
-                float: left;
+              i {
+                font-style: normal;
               }
             }
-          }
-        }
-        .expand-content {
-          display: none;
-          position: absolute;
-          top: 63px;
-          justify-content: space-between;
-          padding: 0 236px 0 36px;
-          background: #fffbf0;
-          height: 48px;
-          line-height: 48px;
-          color: #020202;
-          div {
-            display: inline-block;
-            span {
-              color: #f71026;
-            }
-          }
-        }
-        .sharescancodekuang {
-          width: 100%;
-          height: 220px;
-          position: absolute;
-          top: 110px;
-          left: 0px;
-          background: rgba(0, 0, 0, 0);
-        }
-        .sharescancode {
-          position: absolute;
-          background: url('/images/mobile/@2x/purChase/codebg.png');
-          width: 248px;
-          height: 207px;
-          top: 0px;
-          right: 0px;
-          z-index: 98;
-          display: none;
-          line-height: 14px;
-          canvas {
-            display: block;
-            text-align: center;
-            margin: 0 auto;
-            line-height: 14px;
-          }
-          .title {
-            color: #3c7cf5;
-            font-size: 16px;
-            margin: 21px auto;
-            margin-bottom: 0px;
-            text-align: center;
-            line-height: 14px;
-          }
-          div input {
-            display: inline-block;
-            width: 140px;
-            overflow: hidden;
-            height: 35px;
-            vertical-align: middle;
-            margin-left: 14px;
-            line-height: 35px;
-          }
-          div span {
-            display: inline-block;
-            color: #fff;
-            background: #4290f7;
-            height: 36px;
-            line-height: 36px;
-            width: 70px;
-            font-style: normal;
-            vertical-align: middle;
-            cursor: pointer;
-          }
-        }
-        &:hover {
-          border-top: 1px solid #4290f7;
-          border-left: 1px solid #4290f7;
-          border-right: 1px solid #4290f7;
-          .expand-content {
-            display: flex;
-            width: 1190px;
-            z-index: 1;
-            border-bottom: 1px solid #4290f7;
-            border-left: 1px solid #4290f7;
-            border-right: 1px solid #4290f7;
-            left: -1px;
-          }
-          .sharecode {
-            display: block;
-          }
-        }
-        .say-price {
-          background-color: #e7eef9;
-          height: 64px;
-          line-height: 64px;
-          display: none;
-          > div {
-            display: inline-block;
-            position: relative;
-            height: 64px;
-            line-height: 64px;
-            input {
-              border-radius: 3px;
-            }
-            &:nth-child(1) {
-              width: 282px;
-              background: url('/images/applyPurchase/say-price.png')no-repeat;
-              text-align: center;
-              margin-right: 44px;
-            }
-            &:nth-child(2) {
-              margin-right: 39px;
-              input {
-                width: 118px;
-                height: 26px;
-                border: 1px solid #5392f9;
-              }
-              select {
-                position: absolute;
-                top: 19px;
-                width: 32px;
-                height: 26px;
-                background: url('/images/applyPurchase/arrow-down.png')no-repeat
-                  right center;
-                -webkit-box-shadow: none;
-                -moz-box-shadow: none;
-                box-shadow: none;
-                border: {
-                  left: none;
-                  top: none;
-                  bottom: none;
-                  right: 1px solid #5392f9;
-                  bottom-left-radius: 4px;
-                  top-left-radius: 4px;
-                }
-                color: #5392f9;
-                font: small-caption;
-                padding-left: 8px;
-                & + input {
-                  padding-left: 34px;
-                }
+            .btn-content {
+              > div a {
+                display: inline-block;
+                width: 71px;
+                height: 28px;
+                line-height: 28px;
+                color: #fff;
+                background: #3c7cf5;
+                border-radius: 3px;
+                cursor: pointer;
+                /*  &:first-child {
+                      background: #ffa200;
+                      float: left;
+                      margin-top: 19px;
+                    }*/
               }
-              div {
-                position: absolute;
-                top: 19px;
-                left: 38px;
-                width: 32px;
-                height: 26px;
-                line-height: 26px;
-                text-align: center;
-                border: {
-                  left: none;
-                  top: none;
-                  bottom: none;
-                  right: 1px solid #5392f9;
-                  bottom-left-radius: 4px;
-                  top-left-radius: 4px;
-                }
-                color: #5392f9;
-                & + input {
-                  padding-left: 34px;
+              .is-say-price {
+                display: inline-block;
+                color: #39ae05;
+                margin-left: 11px;
+                img {
+                  margin-bottom: 2px;
                 }
               }
             }
-            &:nth-child(3) {
-              margin-right: 37px;
-              input {
-                width: 32px;
-                height: 26px;
-                padding: 0 0 0 6px;
-              }
+            .sharescancodekuang {
+              // width: 100%;
+              // height: 220px;
+              // position: absolute;
+              // top: 115px;
+              // left: 0px;
+              // background: rgba(0, 0, 0, 0);
             }
-            &:nth-child(4) {
-              margin-right: 132px;
-              input {
-                width: 118px;
-                height: 26px;
+            .sharescancode {
+              position: absolute;
+              background: url('/images/mobile/@2x/purChase/codebg.png');
+              width: 248px;
+              height: 207px;
+              top: 115px;
+              right: 0px;
+              z-index: 98;
+              display: none;
+              line-height: 14px;
+              canvas {
+                display: block;
+                text-align: center;
+                margin: 0 auto;
+                line-height: 14px;
               }
-            }
-            &:nth-child(5) {
-              span {
-                width: 71px;
-                height: 28px;
-                line-height: 28px;
+              .title {
+                color: #3c7cf5;
+                font-size: 16px;
+                margin: 21px auto;
+                margin-bottom: 0px;
                 text-align: center;
+                line-height: 14px;
+              }
+              div input {
                 display: inline-block;
+                width: 140px;
+                overflow: hidden;
+                height: 35px;
+                vertical-align: middle;
+                margin-left: 14px;
+                line-height: 35px;
+              }
+              div span {
+                display: inline-block;
+                color: #fff;
+                background: #4290f7;
+                height: 36px;
+                line-height: 36px;
+                width: 70px;
+                font-style: normal;
+                vertical-align: middle;
                 cursor: pointer;
-                &:first-child {
-                  background: #dedddd;
-                  margin-right: 10px;
+              }
+            }
+            .sharecode {
+              position: absolute;
+              right: 0;
+              top: 0;
+              height: 120px;
+              z-index: 99;
+              display: none;
+              .sharecodeR {
+                width: 4px;
+                height: 120px;
+                background: #4290f7;
+                float: right;
+              }
+              .sharecodeL {
+                float: right;
+                margin-right: 1px;
+              }
+              .sharecodeT {
+                padding-top: 5px;
+                margin-top: 10px;
+                width: 28px;
+                height: 68px;
+                background-color: #3c7cf5;
+                border-radius: 2px;
+                color: #ffffff;
+                font-size: 14px;
+                word-wrap: break-word;
+                white-space: pre-wrap;
+                line-height: 14px;
+              }
+              .sharecodeBtn {
+                width: 28px;
+                height: 28px;
+                margin-top: 4px;
+                &::after {
+                  content: ' ';
+                  clear: both;
+                  display: inline;
+                  visibility: hidden;
                 }
-                &:last-child {
-                  background: #fa4701;
-                  color: #fff;
+                img {
+                  float: left;
                 }
               }
             }
-            i {
-              color: #e41515;
-              position: relative;
-              top: 2px;
-              right: 3px;
-            }
+          }
+          i {
+            color: #e41515;
+            position: relative;
+            top: 2px;
+            right: 3px;
           }
         }
-        &.active {
-          border: 1px solid #4290f7;
-          .expand-content {
-            display: flex;
-            width: 1190px;
-            z-index: 1;
-            border: 1px solid #4290f7;
-            left: -1px;
-            border-top: none;
+        .number-content {
+          margin-left: 56px;
+          line-height: 120px;
+          padding-top: 0;
+          width: 77px;
+          margin-right: 34px;
+          span {
+            color: #5392f9;
+            &.active {
+              color: #ff9a00;
+            }
+          }
+          > img {
+            margin-bottom: 5px;
+            margin-right: 2px;
           }
-          /*.say-price {*/
-          /*display: block;*/
-          /*}*/
         }
-      }
-    }
-    .empty {
-      text-align: center;
-      height: 200px;
-      line-height: 200px;
-      border: 1px solid #e8e8e8;
-      margin-bottom: 10px;
-      span {
-        color: #999;
-        margin-left: 10px;
+        /*.say-price {*/
+        /*display: block;*/
+        /*}*/
       }
     }
   }

File diff suppressed because it is too large
+ 919 - 418
components/applyPurchase/BatchPublish.vue


+ 85 - 77
components/applyPurchase/PublishApply.vue

@@ -59,6 +59,18 @@
             </select>
             <input type="number" class="form-control" :class="{'error': !validObj.unitPrice}" v-model="applyObj.unitPrice" @blur="checkUnitPrice" @input="onUnitPriceInput" />
           </div>
+          <div class="form-item">
+           <span>
+              类目:
+            </span>
+            <input type="text" class="form-control" v-model="applyObj.prodTitle" @input="onProdTitleInput"/>
+          </div>
+          <div class="form-item">
+           <span>
+              规格:
+            </span>
+            <input type="text" class="form-control" :class="{'error': !validObj.spec}" v-model="applyObj.spec" @blur="checkSpec" @input="onSpecInput"/>
+          </div>
           <div class="form-item">
            <span>
               封装:
@@ -143,49 +155,7 @@
   </div>
 </template>
 <script>
-  let getRealLen = function (str) {
-    let len = 0
-    for (let i = 0; i < str.length; i++) {
-      if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
-        len += 2
-      } else {
-        len++
-      }
-    }
-    return len
-  }
-  let cutOutString = function (str, length) {
-    for (let i = 1; i <= str.length; i++) {
-      if (getRealLen(str.substr(0, i)) > length) {
-        str = str.substr(0, i - 1)
-        break
-      }
-    }
-    return str
-  }
-  let formatDate = function (date, fmt) {
-    if (typeof date === 'string') {
-      date = new Date(Date.parse(date.replace(/-/g, '/')))
-    }
-    let o = {
-      'M+': date.getMonth() + 1, // 月份
-      'd+': date.getDate(), // 日
-      'h+': 23, // 小时
-      'm+': 59, // 分
-      's+': 59, // 秒
-      'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
-      'S': date.getMilliseconds() // 毫秒
-    }
-    if (/(y+)/.test(fmt)) {
-      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
-    }
-    for (let k in o) {
-      if (new RegExp('(' + k + ')').test(fmt)) {
-        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-      }
-    }
-    return fmt
-  }
+  import { getRealLen, cutOutString, formatDate, checkNullStr } from '~utils/baseUtils'
   export default {
     data () {
       return {
@@ -194,6 +164,8 @@
           brand: '',
           unitPrice: '',
           currency: 'RMB',
+          prodTitle: '',
+          spec: '',
           encapsulation: '',
           produceDate: '',
           amount: '',
@@ -206,7 +178,8 @@
 //          encapsulation: true,
 //          produceDate: true,
           amount: true,
-          deadline: true
+          deadline: true,
+          spec: true
         },
         pickerOptions: {
           disabledDate (time) {
@@ -268,6 +241,7 @@
               inquiry.enUU = this.user.data.enterprise.uu
             }
             let date = new Date()
+            let currency = this.applyObj.unitPrice ? this.applyObj.currency : null
             inquiry.recorderUU = this.user.data.userUU
             inquiry.code = 'MALL' + date.getTime()
             inquiry.date = date
@@ -282,16 +256,19 @@
             inquiryItem.userTel = this.user.data.userTel
             inquiryItem.needquantity = this.applyObj.amount
             inquiryItem.inbrand = this.applyObj.brand
-            inquiryItem.currency = this.applyObj.unitPrice ? this.applyObj.currency : null
-            inquiryItem.cmpCode = (this.applyObj.code).toUpperCase()
+            inquiryItem.currency = currency
+            inquiryItem.cmpCode = this.applyObj.code.toUpperCase()
             inquiryItem.unitPrice = this.applyObj.unitPrice
             inquiryItem.produceDate = this.applyObj.produceDate
             inquiryItem.date = date
             inquiryItem.endDate = this.applyObj.deadline
             inquiryItem.encapsulation = this.applyObj.encapsulation
+            inquiryItem.spec = this.applyObj.spec
+            inquiryItem.prodTitle = this.applyObj.prodTitle
             let inquiryItems = []
             inquiryItems.push(inquiryItem)
             inquiry.inquiryItems = inquiryItems
+            inquiry.currency = this.applyObj.unitPrice ? this.applyObj.currency : null
             this.$http.post('/inquiry/buyer/save', inquiry)
               .then(response => {
                 this.$message.success('发布成功')
@@ -304,11 +281,7 @@
                 this.$message.error('发布失败')
               })
           } else {
-            if (!this.validObj.code) {
-              this.$message.error('型号不能为空')
-            } else if (!this.validObj.brand) {
-              this.$message.error('品牌不能为空')
-            } else if (!this.validObj.deadline) {
+            if (!this.validObj.deadline) {
               this.$message.error('截止日期不能为空')
             } else if (!this.validObj.amount) {
               this.$message.error('请输入正确的数值')
@@ -319,30 +292,48 @@
         }
       },
       getSimilarCode: function () {
-        this.$http.get('/search/similarComponents', {params: {keyword: this.applyObj.code}})
-          .then(response => {
-            this.similarCode = response.data
-            this.showSimilarCodeList = response.data.length > 0
-          })
+        if (this.applyObj.code) {
+          this.$http.get('/search/similarComponents', {params: {keyword: this.applyObj.code}})
+            .then(response => {
+              this.similarCode = response.data
+              this.showSimilarCodeList = response.data.length > 0
+            })
+        } else {
+          this.showSimilarCodeList = false
+        }
       },
       getSimilarBrand: function () {
-        this.$http.get('/search/similarBrands', {params: {keyword: this.applyObj.brand}})
-          .then(response => {
-            this.similarBrand = response.data
-            this.showSimilarBrandList = response.data.length > 0
-          })
+        if (this.applyObj.brand) {
+          this.$http.get('/search/similarBrands', {params: {keyword: this.applyObj.brand}})
+            .then(response => {
+              this.similarBrand = response.data
+              this.showSimilarBrandList = response.data.length > 0
+            })
+        } else {
+          this.showSimilarBrandList = false
+        }
       },
       checkCode: function () {
-        this.validObj.code = this.applyObj.code && this.applyObj.code !== ''
+        let nullStrFlag = checkNullStr(this.applyObj.code)
+        this.validObj.code = this.applyObj.code && this.applyObj.code !== '' && nullStrFlag
         if (!this.validObj.code) {
-          this.$message.error('型号不能为空')
+          if (!nullStrFlag) {
+            this.$message.error('型号输入不合法')
+          } else {
+            this.$message.error('型号不能为空')
+          }
         }
         return this.validObj.code
       },
       checkBrand: function () {
-        this.validObj.brand = this.applyObj.brand && this.applyObj.brand !== ''
+        let nullStrFlag = checkNullStr(this.applyObj.brand)
+        this.validObj.brand = this.applyObj.brand && this.applyObj.brand !== '' && nullStrFlag
         if (!this.validObj.brand) {
-          this.$message.error('品牌不能为空')
+          if (!nullStrFlag) {
+            this.$message.error('品牌输入不合法')
+          } else {
+            this.$message.error('品牌不能为空')
+          }
         }
         return this.validObj.brand
       },
@@ -353,12 +344,20 @@
         }
         return this.validObj.unitPrice
       },
+      checkSpec: function () {
+        let nullStrFlag = checkNullStr(this.applyObj.spec)
+        this.validObj.spec = nullStrFlag
+        if (!nullStrFlag) {
+          this.$message.error('规格输入不合法')
+        }
+        return this.validObj.spec
+      },
       checkAmount: function () {
         this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
         return this.validObj.amount
       },
       checkAll: function () {
-        return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
+        return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount() && this.checkSpec()
       },
       checkDeadline: function () {
         this.validObj.deadline = Boolean(this.applyObj.deadline)
@@ -391,6 +390,16 @@
           this.applyObj.encapsulation = cutOutString(this.applyObj.encapsulation, 20)
         }
       },
+      onProdTitleInput: function () {
+        if (this.applyObj.prodTitle && getRealLen(this.applyObj.prodTitle) > 40) {
+          this.applyObj.prodTitle = cutOutString(this.applyObj.prodTitle, 40)
+        }
+      },
+      onSpecInput: function () {
+        if (this.applyObj.spec && getRealLen(this.applyObj.spec) > 100) {
+          this.applyObj.spec = cutOutString(this.applyObj.spec, 100)
+        }
+      },
       onCodeChange: function () {
         this.applyObj.code = this.applyObj.code.trim()
         if ((/[^\x00-\xff]/g).test(this.applyObj.code)) {
@@ -423,9 +432,8 @@
           }
         } else if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 50) {
           this.applyObj.brand = cutOutString(this.applyObj.brand, 50)
-        } else {
-          this.getSimilarBrand()
         }
+        this.getSimilarBrand()
       },
       onAmountInput: function () {
         if (!(/^[0-9]*$/).test(this.applyObj.amount)) {
@@ -445,7 +453,7 @@
         if (!this.user.logged) {
           this.$router.push('/auth/login?returnUrl=' + window.location.href)
         } else if (data.success) {
-          window.open('/applyPurchase/' + data.data)
+          window.location.href = '/applyPurchase/' + data.data
         } else {
           this.$message.error(data.message)
         }
@@ -547,16 +555,16 @@
         float: left;
         height: 100%;
         p {
-          padding-top: 18px;
-          font-size: 26px;
+          padding-top: 8px;
+          font-size: 22px;
           color: #3975f4;
-          margin-bottom: 7px;
+          margin-bottom: 4px;
         }
         >div {
           text-align: left;
           margin-left: 14px;
           .form-item {
-            margin-bottom: 5px;
+            margin-bottom: 3px;
             position: relative;
             span {
               width: 80px;
@@ -616,8 +624,8 @@
             input {
               font-size: 12px;
               width: 111px;
-              height: 20px;
-              line-height: 20px;
+              height: 18px;
+              line-height: 18px;
               border-radius: 2px;
               padding: 0 3px;
               box-shadow: none;
@@ -652,8 +660,8 @@
         color: #fff;
         position: relative;
         h1 {
-          font-size: 26px;
-          margin: 22px 0 0 0;
+          font-size: 22px;
+          margin: 11px 0 0 0;
         }
         h2 {
           font-size: 16px;

+ 2 - 2
components/applyPurchase/SayPrice.vue

@@ -219,8 +219,8 @@
         }
       },
       onReplyLapQtyBlur: function (index) {
-        let lapQty = this.sayPriceObj.replies[index].lapQty
-        let limitDownObj = this.getLimitDownQty()
+        let lapQty = Number(this.sayPriceObj.replies[index].lapQty)
+        let limitDownObj = Number(this.getLimitDownQty())
         if (!lapQty || lapQty < 1) {
           this.sayPriceObj.replies[index].lapQty = ''
           this.$message.error('输入值必须为正整数')

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

@@ -6,6 +6,7 @@
 </template>
 
 <script>
+  import { enidfilter } from '~utils/baseUtils'
   export default {
     props: ['item', 'disabledFlag'],
     methods: {
@@ -30,19 +31,17 @@
                 minPackQty: this.item.minPackQty
               }])
                 .then(response => {
-          //        window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
                   if (response.data.success) {
                     if (response.data.message) {
                       this.$message({
                         message: response.data.message,
                         type: 'success'
                       })
-                      let _self = this
                       window.setTimeout(function () {
-                        window.location.href = '/user#/order/pay/' + _self.enidfilter(response.data.data.orderid)
+                        window.location.href = '/user#/order/pay/' + enidfilter(response.data.data.orderid)
                       }, 1000)
                     } else {
-                      window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.data.orderid)
+                      window.location.href = '/user#/order/pay/' + enidfilter(response.data.data.orderid)
                     }
                   } else {
                     if (response.data.data && response.data.data.unvailable === 1) {
@@ -58,7 +57,6 @@
                   }
                 })
             } else {
-              // this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
               this.$http.post('trade/cart/add', {
                 uuid: this.item.uuid,
                 batchCode: this.item.batchCode,
@@ -94,74 +92,6 @@
             }
           }
         }
-        // window.location.href = 'user#/order/pay/' + this.enidfilter(this.buy_info.orderid)
-      },
-      enidfilter: function (str) {
-        if (str) {
-          let encryptStr = '' // 最终返回的加密后的字符串
-          // 产生三位随机数
-          let num = ''
-          for (let i = 0; i < 3; i++) {
-            num += Math.floor(Math.random() * 10)
-          }
-          encryptStr += num // 产生3位随机数
-
-          // 16位加密
-          let tempspit = ''
-          let strspit = str.toString().toLowerCase()
-          if (strspit.match(/^[-+]?\d*$/) === null) { // 非整数字符,对每一个字符都转换成16进制,然后拼接
-            /**
-             * Unicode汉字、英文字母、数字的unicode范围
-             *汉字:[0x4e00,0x9fa5](或十进制[19968,40869])
-             *数字:[0x30,0x39](或十进制[48, 57])
-             *小写字母:[0x61,0x7a](或十进制[97, 122])
-             *大写字母:[0x41,0x5a](或十进制[65, 90]
-             * 'a'的Unicode编码:'&#97;',charCodeAt()的值是97
-             * '码'的Unicode编码:'\u7801', new String('码').charCodeAt()的值是30721,30721的16进制表示是7801
-             */
-            let s = strspit.split('')
-            for (let i = 0; i < s.length; i++) {
-              s[i] = s[i].charCodeAt() // 先转换成Unicode编码
-              s[i] = s[i].toString(16)
-              // 因为在服务器是每两位当做一个字符进行解析的,所以这里每个字符的Unicode编码范围必须在0——255之间。数字和大小写满足该要求,特殊字符则不一定,如果后续有特殊字符的要求,需要重写编码器和解码器
-              if (s[i].length === 1) {
-                s[i] = '0' + s[i]
-              }
-              tempspit = tempspit + s[i]
-            }
-            tempspit = tempspit + '{' + 1 // 1代表字符
-          } else { // 数字直接转换成16进制
-            strspit = parseInt(strspit)
-              .toString(16)
-            tempspit = strspit + '{' + 0 // 0代表纯数字
-          }
-
-          let temp = tempspit.split('{') // 对要加密的字符转换成16进制
-          let numLength = temp[0].length // 转换后的字符长度
-          numLength = numLength.toString(16) // 字符长度换算成16进制
-          if (numLength.length === 1) { // 如果是1,补一个0
-            numLength = '0' + numLength
-          } else if (numLength.length > 3) { // 转换后的16进制字符长度如果大于2位数,则返回,不支持
-            return ''
-          }
-          encryptStr += numLength
-          if (temp[1] === '0') {
-            encryptStr += 0
-          } else if (temp[1] === '1') {
-            encryptStr += 1
-          }
-          encryptStr += temp[0]
-          if (encryptStr.length < 20) { // 如果小于20位,补上随机数
-            // 产生三位随机数
-            let numtwo = ''
-            for (let i = 0; i < 20 - encryptStr.length; i++) {
-              numtwo += Math.floor(Math.random() * 10)
-            }
-            let ran = numtwo // 产生3位随机数
-            encryptStr += ran
-          }
-          return encryptStr
-        }
       }
     }
   }

+ 4 - 1
components/common/loading/Loading.vue

@@ -1,5 +1,5 @@
 <template lang="html">
-  <div class="loading" v-if="loading">
+  <div class="loading" v-show="loading" id="loading">
     <img src="/images/all/loading.gif" alt="">
   </div>
 </template>
@@ -33,4 +33,7 @@
     position: relative;
     top: 40%;
   }
+  .loading.in {
+    display: block !important;
+  }
 </style>

+ 1 - 1
components/default/Footer.vue

@@ -44,7 +44,7 @@
       <ul class="footer-notice list-unstyled">
         <li>客服电话:400-830-1818</li>
         <li>公司地址:深圳市南山区英唐大厦一楼</li>
-        <li>©2016 深圳市优软科技有限公司 粤ICP备15112126号-3</li>
+        <li>©2016 深圳市优软科技有限公司 粤ICP备15112126号-4</li>
       </ul>
       <div class="footer-credit">
         <a href="javascript:void(0)"><img src="/images/credit/1.jpg" /></a>

+ 89 - 0
components/error/error.vue

@@ -0,0 +1,89 @@
+<template>
+  <div class="Content404">
+    <div class="image404">
+      <div class="bottomText">
+        <div class="title">
+          <template v-if="title=== '产品'">
+            抱歉!您查看的{{title}}
+            <span>不存在</span>,可能已
+            <span>下架</span>或
+            <span>被转移</span>......
+          </template>
+          <template v-else>
+            抱歉!您查看的{{title}}
+            <span>不存在</span>......
+          </template>
+        </div>
+        <div class="infotext" v-if="title==='店铺' || title==='器件' || title==='类目'">您可以逛逛:
+          <nuxt-link :to="{ path: '/'}">商城首页</nuxt-link>
+          <span>|</span>
+          <nuxt-link :to="{ path: '/provider/factories'}">原厂专区</nuxt-link>
+          <span>|</span>
+          <nuxt-link :to="{ path: '/provider/home'}">代理经销</nuxt-link>
+        </div>
+
+        <div class="infotext" v-else-if="title==='品牌'">您可以逛逛:
+          <nuxt-link :to="{ path: '/'}">商城首页</nuxt-link>
+          <span>|</span>
+          <nuxt-link :to="{ path: '/product/brand/brandList/ABC'}">品牌中心</nuxt-link>
+          <span>|</span>
+          <nuxt-link :to="{ path: '/provider/factories'}">原厂专区</nuxt-link>
+        </div>
+
+        <div class="infotext" v-else-if="title==='品牌'">您可以逛逛:
+          <nuxt-link :to="{ path: '/'}">商城首页</nuxt-link>
+          <span>|</span>
+          <nuxt-link :to="{ path: '/product/home'}">代理分销</nuxt-link>
+          <span>|</span>
+          <nuxt-link :to="{ name: 'store-uuid', params: { uuid: '33069557578d44e69bd91ad12d28a8d4' }}">库存寄售</nuxt-link>
+        </div>
+
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    title: {
+      type: String,
+      default: ''
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.Content404 {
+  background: #fff;
+  text-align: center;
+  .image404 {
+    position: relative;
+    background: url('/images/404-details.png') top center no-repeat;
+    height: 500px;
+    position: relative;
+    text-align: center;
+    margin: 0 auto;
+    color: #666;
+    font-weight: bold;
+    font-size: 24px;
+    .bottomText {
+      position: absolute;
+      width: 100%;
+      bottom: 70px;
+      .title span {
+        color: #fd7022;
+      }
+      .infotext {
+        margin-top: 25px;
+        color: #959494;
+        font-size: 14px;
+        span {
+          margin: 0 6px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 3 - 0
components/error/index.js

@@ -0,0 +1,3 @@
+import ErrorPage from './error.vue'
+
+export { ErrorPage }

+ 12 - 12
components/home/Advert.vue

@@ -25,26 +25,26 @@
           url: 'http://www.usoftmall.com/store/worldshine',
           img: '/images/adverts/1.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/adtracon',
-          img: '/images/adverts/2.jpg'
+          url: 'https://www.usoftmall.com/store/d2dd2e6fb752434396c58448a91ac85b',
+          img: 'https://dfs.ubtob.com/group1/M00/62/22/CgpkyFp6yqCAOX_SAAAXCY1rKvQ451.jpg'
         }, {
           url: 'http://www.usoftmall.com/store/compa',
           img: '/images/adverts/3.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/corestaff',
-          img: '/images/adverts/4.jpg'
+          url: 'https://www.usoftmall.com/store/9e8d68432e8a43b59e10f623a4946378',
+          img: 'https://dfs.ubtob.com/group1/M00/61/FD/CgpkyFpgcaiAYBj8AAA4_ERd5ds479.png'
         }, {
-          url: 'http://www.usoftmall.com/store/chipled',
-          img: '/images/adverts/5.jpg'
+          url: 'https://www.usoftmall.com/store/d53e5fea4f5c4432802e3e3673985029',
+          img: 'https://dfs.ubtob.com/group1/M00/88/2D/CgpkyFqvflSAJkX4AAA-iLkJ9wM609.png'
         }, {
-          url: 'http://www.usoftmall.com/store/opd',
-          img: '/images/adverts/6.jpg'
+          url: 'https://www.usoftmall.com/store/1669779299694c53a898897f87460ec7',
+          img: 'https://dfs.ubtob.com/group1/M00/2E/BD/CgpkyFlsFsKAJws_AAAcqAKgSlI228.png'
         }, {
-          url: 'http://www.usoftmall.com/store/jrxy',
-          img: '/images/adverts/7.jpg'
+          url: 'https://www.usoftmall.com/store/ff8d0fe60f5e4fcf8cdccce1ca71ec3d',
+          img: 'https://dfs.ubtob.com/group1/M00/87/FB/CgpkyFqflhaAdMC0AADLt1xhsxk699.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/hbt',
-          img: '/images/adverts/8.jpg'
+          url: 'https://www.usoftmall.com/store/bf0090954cfd4f96bb2ff47f3ed6eb09',
+          img: 'https://dfs.ubtob.com/group1/M00/88/59/CgpkyFramdyAA_EaAABuHeBKg18053.jpg'
         }, {
           url: 'http://www.usoftmall.com/store/yjycoin',
           img: '/images/adverts/9.jpg'

+ 2 - 0
components/home/News.vue

@@ -57,6 +57,8 @@
 </script>
 <style lang="scss" scoped>
   .news {
+    width: 100%;
+    margin: 0 auto;
     height: 280px;
     width: 100%;
     margin: 0 auto;

+ 15 - 11
components/home/floor/FloorList.vue

@@ -6,7 +6,7 @@
       <div v-if="purchaseManListData && false"></div>
       <div class="banner">
         <ul class="seek-banner">
-          <li><a href="/store/33069557578d44e69bd91ad12d28a8d4" target="_blank"><img src="/images/all/banner-cuxiao001.png" alt=""></a></li>
+          <li><a href="/store/33069557578d44e69bd91ad12d28a8d4" target="_blank"><img src="/images/all/banner-cuxiao001.jpg" alt=""></a></li>
           <li>
             <div class="banner-cuxiao">
               <div class="wrap">
@@ -23,8 +23,8 @@
                   <li v-for="(purchaseMan, index) in purchaseManList.content" :style="'top: -' + 32 * timerIndex + 'px'">
                     <div>{{purchaseMan.date | date}}</div>
                     <div>
-                      <span v-if="purchaseMan.inquiry && purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName">{{purchaseMan.inquiry.enterprise.enName | enterpriseFilter}}</span>
-                      <span v-else>{{purchaseMan.userName | userNameFilter}}</span>
+                      <span :title="user.logged ? purchaseMan.inquiry.enterprise.enName : null" v-if="purchaseMan.inquiry && purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName">{{[purchaseMan.inquiry.enterprise.enName, user] | enterpriseFilter}}</span>
+                      <span :title="user.logged ? purchaseMan.userName : null" v-else>{{[purchaseMan.userName, user] | userNameFilter}}</span>
                     </div>
                     <div :title="purchaseMan.cmpCode">{{purchaseMan.cmpCode}}</div>
                     <div>
@@ -76,7 +76,7 @@
                 backGroundColor: '',
                 body: '',
                 hrefUrl: '/store/33069557578d44e69bd91ad12d28a8d4',
-                pictureUrl: '/images/floor/banner1.jpg',
+                pictureUrl: '/images/floor/banner01.jpg',
                 size: 'large'
               }
             ]
@@ -87,7 +87,7 @@
                 backGroundColor: '',
                 body: '',
                 hrefUrl: '/store/33069557578d44e69bd91ad12d28a8d4',
-                pictureUrl: '/images/floor/banner2.jpg',
+                pictureUrl: '/images/floor/banner02.jpg',
                 size: 'large'
               }
             ]
@@ -121,15 +121,19 @@
         const day = (new Date(date).getDate() - now)
         return day <= 0 ? '今天' : day + '天前'
       },
-      enterpriseFilter (str) {
-        if (str) {
-          return str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str
+      enterpriseFilter ([str, user]) {
+        if (!user.logged) {
+          return str ? str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str : '-'
         } else {
-          return '-'
+          return str || '-'
         }
       },
-      userNameFilter (str) {
-        return str ? str.substring(0, 1) + '**' : '-'
+      userNameFilter ([str, user]) {
+        if (!user.logged) {
+          return str ? str.substring(0, 1) + '**' : '-'
+        } else {
+          return str || '-'
+        }
       }
     },
     computed: {

+ 64 - 4
components/mobile/Home.vue

@@ -2,6 +2,17 @@
   <div>
     <div class="home" v-if="!showMainSearch">
       <div class="header">
+        <div v-swiper:mySwiper="swiperOption">
+          <div class="swiper-wrapper">
+            <div class="swiper-slide">
+              <img class="home-bg" src="/images/mobile/@2x/applyPurchase/home/app-banner_01.jpg" alt="">
+            </div>
+            <div class="swiper-slide">
+              <img class="home-bg" src="/images/mobile/@2x/applyPurchase/home/app-banner_02.jpg" alt="">
+            </div>
+          </div>
+          <div class="swiper-pagination swiper-pagination-bullets"></div>
+        </div>
         <div class="search-content">
           <input type="text" placeholder="请输入您要查找的型号或品牌" @click="onHomeSearchClick()">
           <span>
@@ -15,12 +26,14 @@
           <nuxt-link to="/mobile/shop">
             <img src="/images/mobile/@2x/applyPurchase/home/shop.png" alt="">
             <span>店铺列表</span>
+            <i></i>
           </nuxt-link>
         </li>
         <li>
           <nuxt-link to="/mobile/brand/brandCenter/ABCD">
             <img src="/images/mobile/@2x/applyPurchase/home/brand.png" alt="">
             <span>品牌列表</span>
+            <i></i>
           </nuxt-link>
         </li>
         <li>
@@ -58,7 +71,21 @@
     data () {
       return {
         showStoreInfo: false,
-        showMainSearch: false
+        showMainSearch: false,
+        swiperOption: {
+          autoplay: 3000,
+          initialSlide: 0,
+          pagination: '.swiper-pagination',
+          // 解决点击分页器后图片就不能轮播的问题
+          autoplayDisableOnInteraction: false,
+          paginationClickable: true,
+          mousewheelControl: false,
+          effect: 'fade',
+          lazyLoading: true,
+          loop: true,
+          prevButton: '.swiper-button-prev',
+          nextButton: '.swiper-button-next'
+        }
       }
     },
     components: {
@@ -81,18 +108,42 @@
     }
   }
 </script>
-<style lang="scss" scoped>
+<style lang="scss">
   .home {
     padding-bottom: 1rem;
     .header {
-      background: url('/images/mobile/@2x/applyPurchase/home/home-bg.png') no-repeat;
-      background-size: cover;
       height: 3.26rem;
+      position: relative;
+      .home-bg {
+        height: 3.26rem;
+        width: 100%;
+      }
+      .search-content {
+        position: absolute;
+        top: 0;
+        width: 100%;
+      }
+      .swiper-container {
+        height: 3.26rem;
+        position: absolute;
+        top: 0;
+        width: 100%;
+        z-index: 0;
+      }
+      .swiper-pagination-fraction, .swiper-pagination-custom, .swiper-container-horizontal > .swiper-pagination-bullets {
+        bottom: .1rem !important;
+      }
+      .swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet {
+        width: .16rem !important;
+        height: .16rem !important;
+        margin: 0 .2rem;
+      }
     }
     .link-list {
       background: #f3f3f7;
       height: 1.36rem;
       li {
+        position: relative;
         display: inline-block;
         width: 33.3%;
         text-align: center;
@@ -109,6 +160,15 @@
           display: block;
           margin-top: .15rem;
         }
+        i {
+          height: 0.9rem;
+          width: .01rem;
+          background: #ddd;
+          display: block;
+          position: absolute;
+          right: 0;
+          top: .2rem;
+        }
       }
     }
   }

+ 1 - 1
components/mobile/MobileFooter.vue

@@ -108,7 +108,7 @@
     width:100%;
     height:.98rem;
     text-align: center;
-    border-top:.04rem solid #ccc;
+    border-top:.02rem solid #ccc;
     background: #ffffff;
     z-index: 10;
   }

+ 1 - 1
components/mobile/MobileHeader.vue

@@ -279,7 +279,7 @@
     width:100%;
     height:.88rem;
     line-height: .88rem;
-    border-bottom:.04rem solid #ccc;
+    border-bottom:.01rem solid #ccc;
     background: #3e82f5;
     padding:0 .2rem 0 .1rem;
     color:#fff;

+ 14 - 7
components/mobile/applyPurchase/PublishSeek.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="mobile-modal" v-if="showSayPriceBox">
+  <div class="mobile-modal" v-if="showSayPriceBox" @click="setShowCurrencyList(false)">
     <div class="mobile-modal-box">
       <div class="mobile-modal-header">发布求购<i class="icon-guanbi iconfont" @click="cancel"></i></div>
       <div class="publish-seek">
@@ -24,7 +24,7 @@
         </div>
         <div class="content-line">
           <span>币种:</span>
-          <a v-text="applyObj.currency" @click="showCurrencyList = !showCurrencyList"></a>
+          <a v-text="applyObj.currency" @click="setShowCurrencyList(!showCurrencyList, $event)"></a>
           <img v-if="!showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-down.png" alt="">
           <img v-if="showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-up.png" alt="">
           <ul v-if="showCurrencyList">
@@ -152,6 +152,12 @@
       setRemindText: function (str) {
         this.$emit('remindAction', str)
       },
+      setShowCurrencyList: function (flag, e) {
+        if (e) {
+          e.stopPropagation()
+        }
+        this.showCurrencyList = flag
+      },
       goPublish: function () {
         if (this.checkAll()) {
           let inquiry = {}
@@ -161,6 +167,7 @@
           }
           let date = new Date()
           let endDate = formatDate(this.applyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
+          let currency = this.applyObj.currency === '不限' ? null : this.applyObj.currency
           inquiry.recorderUU = this.user.data.userUU
           inquiry.code = 'MALL' + date.getTime()
           inquiry.date = date
@@ -175,7 +182,7 @@
           inquiryItem.userTel = this.user.data.userTel
           inquiryItem.needquantity = this.applyObj.amount
           inquiryItem.inbrand = this.applyObj.brand
-          inquiryItem.currency = this.applyObj.currency === '不限' ? null : this.applyObj.currency
+          inquiryItem.custCurrency = currency
           inquiryItem.cmpCode = (this.applyObj.code).toUpperCase()
           inquiryItem.unitPrice = this.applyObj.unitPrice
           inquiryItem.produceDate = this.applyObj.produceDate
@@ -185,6 +192,7 @@
           let inquiryItems = []
           inquiryItems.push(inquiryItem)
           inquiry.inquiryItems = inquiryItems
+          inquiry.currency = currency
           this.$http.post('/inquiry/buyer/save', inquiry)
             .then(response => {
 //              this.$message.success('发布成功')
@@ -213,7 +221,6 @@
       },
       setCurrency: function (type) {
         this.applyObj.currency = type
-        this.showCurrencyList = false
       },
       isValidDate: function (date) {
         let now = new Date(formatDate(new Date(), 'yyyy-MM-dd')).getTime()
@@ -330,17 +337,17 @@
           line-height: .8rem;
           font-size: .26rem;
           text-align: left;
-          border-bottom: .02rem solid #b7d5fe;
+          border-bottom: 1px solid #d0e3fd;
           input {
             width: 3.49rem;
             height: .52rem;
             line-height: normal;
             padding: .1rem .19rem;
-            /*padding-left: .19rem;*/
-            border: .02rem solid #7e7e7e;
+            border: 1px solid #7e7e7e;
             font-size: .26rem;
             vertical-align: middle;
             background: #fff;
+            border-radius: 0;
           }
           > span {
             display: inline-block;

+ 34 - 18
components/mobile/applyPurchase/SayPrice.vue

@@ -17,7 +17,10 @@
             采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
           </div>
           <div class="content-line">
-            币种:<span>{{purchaseDetail.currency || '不限'}}</span>
+            币种:<span>{{purchaseDetail.custCurrency || '不限'}}</span>
+          </div>
+          <div class="content-line">
+            生产日期:<span>{{purchaseDetail.produceDate || '-'}}</span>
           </div>
           <div class="content-line">
             截止日期:<span>{{purchaseDetail.endDate | date}}</span>
@@ -28,10 +31,10 @@
             <span class="fl">价格梯度<span>(PCS)</span></span>
             <span class="fr">
           <!--<span v-text="sayPriceObj.currency" @click="setShowCurrencyList($event)"></span>-->
-          <span v-if="!purchaseDetail.currency" v-text="sayPriceObj.currency" @click="setShowCurrencyList($event)"></span>
-          <span v-if="purchaseDetail.currency" v-text="purchaseDetail.currency"></span>
-          <img v-if="!purchaseDetail.currency && !showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-down.png" alt="">
-          <img v-if="!purchaseDetail.currency && showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-up.png" alt="">
+          <span v-if="!purchaseDetail.custCurrency" v-text="sayPriceObj.currency" @click="setShowCurrencyList($event)"></span>
+          <span v-if="purchaseDetail.custCurrency" v-text="purchaseDetail.custCurrency"></span>
+          <img v-if="!purchaseDetail.custCurrency && !showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-down.png" alt="">
+          <img v-if="!purchaseDetail.custCurrency && showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-up.png" alt="">
           <ul v-if="showCurrencyList">
             <li @click="setCurrency('RMB')">RMB</li>
             <li @click="setCurrency('USD')">USD</li>
@@ -93,6 +96,7 @@
         } else {
           document.body.style.position = 'relative'
         }
+        this.resetSayPrice()
       }
     },
     mounted () {
@@ -160,6 +164,7 @@
         }
       },
       commitSayPrice: function () {
+        console.log(this.sayPriceObj)
         if (this.checkValid()) {
           let purchaseMan = JSON.parse(JSON.stringify(this.purchaseDetail))
 //          this.showLoading = true
@@ -168,9 +173,7 @@
           purchaseMan.vendUU = this.user.data.enterprise.uu
           purchaseMan.vendUserUU = this.user.data.userUU
           purchaseMan.qutoApp = 'MALL'
-          if (!purchaseMan.currency) {
-            purchaseMan.currency = this.sayPriceObj.currency
-          }
+          purchaseMan.currency = purchaseMan.custCurrency || this.sayPriceObj.currency
           this.$http.post('/inquiry/sale/item/save', purchaseMan).then(response => {
             this.showLoading = false
             if (response.data.success === false) {
@@ -269,11 +272,18 @@
         return {index: -1}
       },
       checkValid: function () {
+        this.validSayPrice.repliesLapQty = true
+        this.validSayPrice.repliesPrice = true
         for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
-          if (!this.sayPriceObj.replies[i].lapQty || !this.sayPriceObj.replies[i].price) {
-            return false
+          if (!this.sayPriceObj.replies[i].lapQty) {
+            this.validSayPrice.repliesLapQty = false
+            break
+          } else if (!this.sayPriceObj.replies[i].price) {
+            this.validSayPrice.repliesPrice = false
+            break
           }
         }
+        console.log(this.validSayPrice.leadtime + '-' + this.validSayPrice.repliesLapQty + '-' + this.validSayPrice.repliesPrice)
         return this.validSayPrice.leadtime && this.validSayPrice.repliesLapQty && this.validSayPrice.repliesPrice
       },
       onRemind: function (str) {
@@ -289,8 +299,9 @@
       top: 5%;
       left: 3%;
       right: 3%;
-      width: auto;
+      width: 7rem;
       bottom: 3%;
+      margin: 0 auto;
       .say-price {
         background: #f3f3f3;
         padding: .18rem 0;
@@ -304,17 +315,19 @@
           > div {
             height: .7rem;
             line-height: .7rem;
-            width: 6.12rem;
+            width: 5.82rem;
             font-size: .28rem;
-            margin: 0 auto .2rem;
+            margin: 0 0 .18rem .3rem;
             input {
               height: .7rem;
               text-align: center;
-              border: .02rem solid #666;
+              border: 1px solid #666;
               border-radius: .05rem;
+              line-height: normal;
+              padding: .1rem .2rem;
             }
             &.form-title {
-              border: .02rem solid #666;
+              border: 1px solid #666;
               border-radius: .05rem;
               padding: 0 .07rem 0 .17rem;
               .fl {
@@ -356,11 +369,11 @@
             &.form-item {
               position: relative;
               input {
-                width: 2.93rem;
+                width: 2.84rem;
               }
               i {
                 position: absolute;
-                right: -.42rem;
+                right: -.5rem;
                 top: 0;
                 font-size: .36rem;
                 &.icon-add {
@@ -373,10 +386,13 @@
             }
             &.date {
               input {
-                width: 4.8rem;
+                width: 4.6rem;
               }
             }
           }
+          .say-price-btn {
+            width: 6.44rem;
+          }
         }
       }
     }

+ 20 - 14
components/mobile/applyPurchase/SayPriceInfo.vue

@@ -18,7 +18,10 @@
               采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
             </div>
             <div class="content-line">
-              币种:<span>{{purchaseDetail.currency || '不限'}}</span>
+              币种:<span>{{purchaseDetail.custCurrency || '不限'}}</span>
+            </div>
+            <div class="content-line">
+              生产日期:<span>{{purchaseDetail.produceDate || '-'}}</span>
             </div>
             <div class="content-line">
               截止日期:<span>{{purchaseDetail.endDate | date}}</span>
@@ -26,7 +29,7 @@
           </div>
           <div class="base-info">
             <div class="content-line">
-              买家:<span>{{purchaseDetail.inquiry.enterprise && purchaseDetail.inquiry.enterprise.enName || purchaseDetail.userName}}</span>
+              买家:<span>{{purchaseDetail.inquiry.enterprise ? purchaseDetail.inquiry.enterprise.enName : purchaseDetail.userName}}</span>
             </div>
             <div class="content-line">
               联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
@@ -40,7 +43,7 @@
               {{item.vendName}}
             </div>
             <div class="content-line">
-              报价人:<span v-if="item.user">{{item.user.userName | userNameFilter}}</span>
+              报价人:<span v-if="item.user">{{item.user.userName}}</span>
               <span v-else>-</span>
             </div>
             <div class="content-line">
@@ -56,7 +59,7 @@
               <ul>
                 <li v-for="replie in item.replies">
                   <span>{{replie.lapQty ? replie.lapQty + '+' : '-'}}</span>
-                  <span>{{replie.price ? (purchaseDetail.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
+                  <span>{{replie.price ? (item.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
                 </li>
               </ul>
             </div>
@@ -78,13 +81,16 @@
               采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
             </div>
             <div class="content-line">
-              币种:<span>{{purchaseDetail.currency || '不限'}}</span>
+              币种:<span>{{purchaseDetail.custCurrency || '不限'}}</span>
+            </div>
+            <div class="content-line">
+              生产日期:<span>{{purchaseDetail.produceDate || '-'}}</span>
             </div>
             <div class="content-line">
               截止日期:<span>{{purchaseDetail.endDate | date}}</span>
             </div>
             <div class="content-line">
-              买家:<span>{{purchaseDetail.inquiry.enterprise.enName || purchaseDetail.userName}}</span>
+              买家:<span>{{purchaseDetail.inquiry.enterprise ? purchaseDetail.inquiry.enterprise.enName : purchaseDetail.userName}}</span>
             </div>
             <div class="content-line">
               联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
@@ -92,7 +98,7 @@
           </div>
           <div class="base-info">
             <div class="content-line">
-              报价人:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userName | userNameFilter}}</span>
+              报价人:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userName}}</span>
               <span v-else>-</span>
             </div>
             <div class="content-line">
@@ -206,11 +212,14 @@
       width: auto;
       .say-price-info {
         background: #f3f3f3;
-        padding: .18rem 0;
+        padding: .18rem 0 0 0;
         width: 100%;
         overflow-y: auto;
-        height: 90%;
+        max-height: 90%;
         .base-info {
+          &:last-child {
+            margin-bottom: 0;
+          }
           &.say-info {
             /*height: 4.54rem;*/
             position: relative;
@@ -243,7 +252,7 @@
               /*right: .3rem;*/
               position: relative;
               bottom: .3rem;
-              width: 4rem;
+              width: 4.4rem;
               text-align: center;
               margin-left: 2rem;
               p {
@@ -266,11 +275,8 @@
                     overflow: hidden;
                     text-overflow: ellipsis;
                     white-space: nowrap;
-                    &:first-child {
-                      width: 45%;
-                    }
+                    width: 50%;
                     &:last-child {
-                      width: 55%;
                       border-right: .02rem solid #7e7e7e;
                     }
                   }

+ 47 - 24
components/mobile/applyPurchase/SeekList.vue

@@ -3,11 +3,14 @@
     <ul class="seek-list">
       <li v-for="(item, index) in purchaseManList">
         <div class="top">
-          <span v-if="item.inquiry.enterprise && item.inquiry.enterprise.enName">{{item.inquiry.enterprise.enName | enterpriseFilter}}</span>
-          <span v-else>{{item.userName | userNameFilter}}</span>
+          <span v-if="item.inquiry.enterprise && item.inquiry.enterprise.enName">{{[item.inquiry.enterprise.enName, user.logged] | enterpriseFilter}}</span>
+          <span v-else>{{[item.userName, user.logged] | userNameFilter}}</span>
         </div>
         <div>
           <div class="fl">
+            <div>
+              类目(产品名称):<span>{{item.prodTitle || '-'}}</span>
+            </div>
             <div>
               型号:<span>{{item.cmpCode || '-'}}</span>
             </div>
@@ -17,6 +20,9 @@
             <div>
               规格:<span>{{item.spec || '-'}}</span>
             </div>
+            <div>
+              采购数量:<span>{{item.needquantity || '-'}}</span>
+            </div>
             <div>
               截止日期:<span class="date">{{item.endDate | date}}</span>
             </div>
@@ -28,7 +34,7 @@
               <span v-if="getDay(item.remainingTime) <= 0" v-text="getHours(item.remainingTime)"></span>
               <i v-if="getDay(item.remainingTime) <= 0" >&nbsp;小时</i>
             </p>
-            <p v-else>已截止</p>
+            <p class="over-deadline" v-else>已截止</p>
             <!--<a v-if="!userType && item.quoted == 1">已报价</a>-->
             <a v-if="!userType && item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && (user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise)))" class="self-publish" @click="onRemind('此为贵公司的求购')">我要报价</a>
             <a v-if="!(userType == 'saler' && seekType  && seekType != 'wait') && (item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && !(user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise))))"  @click="goSayPrice(item.id, index)">我要报价</a>
@@ -82,11 +88,19 @@
           return '-'
         }
       },
-      enterpriseFilter (str) {
-        return str && str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str || '-'
+      enterpriseFilter ([str, logged]) {
+        if (logged) {
+          return str
+        } else {
+          return str && str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str || '-'
+        }
       },
-      userNameFilter (str) {
-        return str ? str.substring(0, 1) + '**' : '-'
+      userNameFilter ([str, logged]) {
+        if (logged) {
+          return str
+        } else {
+          return str ? str.substring(0, 1) + '**' : '-'
+        }
       }
     },
     computed: {
@@ -106,10 +120,17 @@
       },
       goSayPrice: function (id, index) {
         if (this.user.logged) {
-//          this.$router.push('/mobile/applyPurchase/sayPrice/' + path)
-          this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {itemId: id, enuu: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null})
-          this.showSayPriceBox = true
-          this.activeIndex = index
+          if (this.user.data.enterprise.uu) {
+            if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
+              this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {itemId: id, enuu: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null})
+              this.showSayPriceBox = true
+              this.activeIndex = index
+            } else {
+              this.onRemind('抱歉,您需开通卖家功能才可报价')
+            }
+          } else {
+            this.onRemind('个人账户暂不可报价')
+          }
         } else {
           this.showLoginBox = true
         }
@@ -148,11 +169,9 @@
     width: 7.26rem;
     margin: .13rem auto 0;
     li {
-      border: .04rem solid #e0e0e4;
-      height: 3.32rem;
+      border: 1px solid #e0e0e4;
+      height: 4.2rem;
       margin-bottom: .2rem;
-
-      >
       div.top {
         font-size: .32rem;
         color: #3a3a3a;
@@ -163,13 +182,12 @@
         span {
           display: block;
           width: 6.9rem;
-          border-bottom: .04rem dashed #9f9f9f;
+          border-bottom: 1px dashed #9f9f9f;
           margin: 0 auto;
         }
 
       }
-      >
-      div {
+      > div {
         font-size: .3rem;
         // display: inline-block;
         &::after {
@@ -182,10 +200,10 @@
         .fl {
           color: #666;
           width: 4.8rem;
-          height: 1.74rem;
+          height: 2.62rem;
           margin: .27rem 0 .29rem .18rem;
           line-height: .46rem;
-          border-right: .04rem dashed #9f9f9f;
+          border-right: 1px dashed #9f9f9f;
 
           > div {
             overflow: hidden;
@@ -194,7 +212,6 @@
 
             span {
               color: #333;
-
               &.date {
                 color: #e6353d;
               }
@@ -206,10 +223,16 @@
         }
         .fr {
           width: 2.2rem;
-          padding: .66rem 0 0 .2rem;
+          padding: .9rem 0 0 0;
 
           p {
             font-size: .28rem;
+            text-align: center;
+
+            &.over-deadline {
+              text-align: center;
+              padding-right: .2rem;
+            }
 
             span {
               font-size: .35rem;
@@ -229,8 +252,8 @@
             text-align: center;
             font-size: .32rem;
             color: #e62f36;
-            border: .02rem solid #ea494f;
-            margin-top: .34rem;
+            border: 1px solid #ea494f;
+            margin: .34rem auto 0;
             border-radius: .06rem;
 
             &.self-publish {

+ 19 - 1
components/mobile/common/LoginBox.vue

@@ -3,7 +3,8 @@
     <div class="mobile-modal-box">
       <div class="mobile-modal-header">请登录后再操作<i @click="close" class="icon-guanbi iconfont"></i></div>
       <div class="mobile-modal-content">
-        <span @click="close">暂不登录</span><span @click="goLogin">马上登录</span>
+        <span @click="onRegisterClick">立即注册</span><span @click="goLogin">马上登录</span>
+        <p><i>*</i>目前手机端暂不支持开店功能,完成注册后请前往PC端操作</p>
       </div>
     </div>
   </div>
@@ -17,6 +18,13 @@
       },
       goLogin: function () {
         this.$router.push('/auth/login?returnUrl=' + window.location.href)
+      },
+      onRegisterClick () {
+        this.$http.get('/register/page').then(response => {
+          if (response.data) {
+            window.location.href = response.data.content
+          }
+        })
       }
     }
   }
@@ -38,5 +46,15 @@
         margin-right: .5rem;
       }
     }
+    p {
+      font-size: .28rem;
+      color: #666;
+      margin-top: .2rem;
+      i {
+        font-style: normal;
+        color: red;
+        margin-right: .05rem;
+      }
+    }
   }
 </style>

+ 1 - 20
components/mobile/share/store/StoreHeader.vue

@@ -12,26 +12,7 @@
   </div>
 </template>
 <script>
-  let getRealLen = function (str) {
-    let len = 0
-    for (let i = 0; i < str.length; i++) {
-      if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
-        len += 2
-      } else {
-        len++
-      }
-    }
-    return len
-  }
-  let cutOutString = function (str, len) {
-    for (let i = 1; i <= str.length; i++) {
-      if (getRealLen(str.substr(0, i)) > len) {
-        str = str.substr(0, i - 1)
-        break
-      }
-    }
-    return str
-  }
+  import { getRealLen, cutOutString } from '~utils/baseUtils'
   export default {
     computed: {
       storeInfo () {

+ 123 - 7
components/product/brand/BrandComponent.vue

@@ -1,14 +1,15 @@
 <template>
   <div class="component-list container">
-    <div class="type-list">型号列表</div>
-    <div class="input-group">
+    <div :class="activeTab == 0 ? 'type-list active' : 'type-list'" @click="activeTab = 0">型号列表</div>
+    <div :class="activeTab == 1 ? 'type-list active' : 'type-list'" @click="activeTab = 1">代理商</div>
+    <div class="input-group" v-if="activeTab == 0">
       <input  type="search" class="input-sm form-control" placeholder="请输入型号" title="code"
       v-model="searchCode" @search="goodsSearch(searchCode)"/>
       <span class="input-group-btn">
 					<button class="search btn btn-default" type="button" @click="goodsSearch(searchCode)">搜索器件</button>
 			</span>
     </div>
-    <table class="table">
+    <table class="table" v-if="activeTab == 0">
       <thead>
         <tr class="bgf7">
           <th width="500">型号</th>
@@ -39,10 +40,63 @@
         </tr>
       </tbody>
     </table>
-    <div style="float: right;">
+    <div style="float: right;" v-if="activeTab == 0">
       <page :total="list.totalElements" :page-size="pageParams.count"
             :current="pageParams.page" @childEvent="handleCurrentChange"></page>
     </div>
+    <table class="table supper-table" v-if="activeTab == 1">
+      <thead>
+      <tr class="bgf7">
+        <th width="100"></th>
+        <th width="200">代理商</th>
+        <th width="200">地址</th>
+        <th width="110">电话</th>
+        <th width="110">传真</th>
+        <th width="110">邮箱</th>
+        <th width="120">网址</th>
+      </tr>
+      </thead>
+      <tbody>
+      <tr class="text-center" v-for="item in supplier.content">
+        <td v-if="item.storeuuid">
+          <a class='add-link' :href="'/store/' + item.storeuuid">
+            <img :src="item.img || '/images/store/common/default.png'" alt="" class="showImg">
+            <img src="/images/store/common/goIn.png" alt="" class="goIn">
+          </a>
+        </td>
+        <td v-if="!item.storeuuid"><img :src="item.img || '/images/store/common/default.png'" alt="" class="showImg"></td>
+        <td :title='item.vendorName'  v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.vendorName || '-'}}</a></td>
+        <td :title='item.vendorName' v-if="!item.storeuuid">{{item.vendorName || '-'}}</td>
+        <td :title='item.detailAddress' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.detailAddress || '-'}}</a></td>
+        <td :title='item.detailAddress' v-if="!item.storeuuid">{{item.detailAddress || '-'}}</td>
+        <td :title='item.tel' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.tel || '-'}}</a></td>
+        <td :title='item.tel' v-if="!item.storeuuid">{{item.tel || '-'}}</td>
+        <td :title='item.fax' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.fax || '-'}}</a></td>
+        <td :title='item.fax' v-if="!item.storeuuid">{{item.fax || '-'}}</td>
+        <td :title='item.email' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.email || '-'}}</a></td>
+        <td :title='item.email' v-if="!item.storeuuid">{{item.email || '-'}}</td>
+        <td :title='item.website' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.website || '-'}}</a></td>
+        <td :title='item.website' v-if="!item.storeuuid">{{item.website || '-'}}</td>
+      </tr>
+      <tr v-if="!supplier.content || supplier.content.length === 0">
+        <td colspan="10" class="text-center">
+          <div class="empty">
+            <div class="empty-img">
+              <img src="/images/brandList/empty-cart.png">
+            </div>
+            <div class="empty-info">
+              <p class="grey f16"> 暂无供应商信息 </p>
+              <i class="fa fa-mail-reply fa-xs"></i>&nbsp;<a href="javascript:history.go(-1)">返回上一页</a>
+            </div>
+          </div>
+        </td>
+      </tr>
+      </tbody>
+    </table>
+    <div style="float: right;" v-if="activeTab == 1">
+      <page :total="supplier.totalElements" :page-size="supplierPageParams.size"
+            :current="supplierPageParams.page" @childEvent="handleChange"></page>
+    </div>
   </div>
 </template>
 <script>
@@ -56,7 +110,13 @@
           count: 10,
           filter: {}
         },
-        searchCode: ''
+        supplierPageParams: {
+          page: 1,
+          size: 5,
+          sort: {'updatetime': 'DESC'}
+        },
+        searchCode: '',
+        activeTab: 0
       }
     },
     components: {
@@ -71,6 +131,9 @@
       },
       brand () {
         return this.$store.state.brandDetail.detail.data
+      },
+      supplier () {
+        return this.$store.state.product.supplierInformation.information.data
       }
     },
     methods: {
@@ -98,6 +161,19 @@
         this.pageParams.filter.brandid = this.brand.id
         this.pageCmpGoods(this.pageParams)
       },
+//      获取供应商分页
+      async pageSupplier (params) {
+        let uuid = this.$route.params.code
+        let { data } = await this.$http.get(`/api/produce/vendorlist/${uuid}`, { params })
+        this.$store.commit('product/supplierInformation/GET_INFORMATION_SUCCESS', data)
+      },
+      handleChange (page) {
+        this.supplierPageParams.page = page
+        this.pageSupplier(this.supplierPageParams)
+      },
+      listenChild: function (brand) {
+        this.$store.dispatch('loadBrandPages', {count: 10, filter: { brandid: brand.id }, page: brand.page})
+      },
       toAttach: function (url) {
         if (url === '1') {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
@@ -126,12 +202,17 @@
     height: 34px;
     width: 150px;
     border: 1px solid #5078cb;
-    background-color: #5078CB;
+    /*background-color: #5078CB;*/
     float: left;
-    color: #fff;
+    color: #5078cb;
     line-height: 34px;
     text-align: center;
     font-size: 14px;
+    cursor: pointer ;
+  }
+  .component-list .type-list.active{
+    background-color: #5078CB;
+    color: #fff;
   }
   .component-list .input-group {
     width: 300px;
@@ -169,6 +250,12 @@
     color: #337ab7;
     font-size: 12px;
   }
+  .component-list table tbody tr td a.add-link {
+    width: 100%;
+    color: #474443;
+    font-size: 14px;
+    cursor: pointer;
+  }
   .component-list .btn-default {
     color: #214797;
     font-size: 12px;
@@ -219,4 +306,33 @@
     font-size: 14px;
     color: #5078cb;
   }
+  .component-list .supper-table thead th.text-left{
+    text-align: left;
+  }
+  .component-list .supper-table tbody tr{
+    height: 74px;
+    vertical-align:middle ;
+  }
+  .component-list .supper-table tbody tr:hover{
+    background: #eee;
+  }
+  .component-list .supper-table tbody tr td{
+    position: relative;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    max-width: 100px;
+  }
+  .component-list .supper-table tbody tr img.showImg{
+    width: 90px;
+    height: 49px;
+    border: 1px solid #dcdcdc;
+  }
+  .component-list .supper-table tbody tr img.goIn {
+    position: absolute;
+    top: 13px;
+    right: 3px;
+    width: 35px;
+    height: 35px;
+  }
 </style>

+ 4 - 9
components/register-saler/Register.vue

@@ -84,18 +84,13 @@
       } else {
         isSelf = true
       }
-      if (!isSelf) {
-        this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/detailInfo')
+      if (!isSelf) { // 是企业
+        this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/info')
           .then(response => {
             this.enterpriseData = response.data
+            this.section = 1
+            this.checkData.checked = false
           })
-        if (tempEnterprise.isVendor === 1690) { // 是企业
-          this.section = 3
-          this.checkData.checked = true
-        } else if (typeof tempEnterprise.isVendor === 'undefined' || tempEnterprise.isVendor === '') {
-          this.section = 2
-          this.checkData.checked = false
-        }
       } else { // 是个人
         this.$http.get('/basic/user/userCacheEnterprise')
           .then(response => {

+ 330 - 303
components/register-saler/register/StepFirst.vue

@@ -27,14 +27,14 @@
       <div class="row">
         <label class="col-sm-2 x-required">营业执照号:</label>
         <div class="col-sm-5">
-          <input type="text" :class="!validLicence.isValidLicence?'form-control error-box-border':'form-control'" :disabled="!loginData.isSelf" @input="validLicence.init=false" @change="licenceCheck(3)" v-model="data.licenceId" name="name" required="" placeholder="请填写营业执照上的注册号">
+          <input type="text" :class="!validLicence.isValidLicence?'form-control error-box-border':'form-control x-input'" :disabled="!loginData.isSelf" @input="validLicence.init=false" @change="licenceCheck(3)" v-model="data.licenceId" name="name" required="" placeholder="请填写营业执照上的注册号">
         </div>
         <div class="x-text-help" v-show="validLicence.isValidLicence && !validLicence.init">
           <i class="glyphicon glyphicon-ok x-icon-left"></i>
         </div>
         <div class="col-sm-5" v-show="!validLicence.isValidLicence && !validLicence.init"><p><i class="fa fa-info-circle"></i>请填写营业执照上的注册号</p></div>
       </div>
-      <div class="row">
+      <!--<div class="row">
         <label class="col-sm-2 x-required">营业执照:</label>
         <div class="col-sm-5">
           <a class="x-btn-blank" v-if="loginData.isSelf" title="请上传营业执照扫描件(≤5M的图片或PDF)">
@@ -58,11 +58,11 @@
           <i class="glyphicon glyphicon-ok x-icon-left"></i>
         </div>
         <div class="col-sm-5" v-show="!validLawPerson.isValidLawPerson && !validLawPerson.init"><p><i class="fa fa-info-circle"></i>请填写营业执照上的法定代表人</p></div>
-      </div>
+      </div>-->
       <div class="row">
         <label class="col-sm-2 x-required">企业地址:</label>
         <div class="col-sm-5">
-          <input type="text" readonly aria-haspopup="true" aria-expanded="false" @click="onShowAddress" :style="!loginData.isSelf?'background-color: #eee;':''" :disabled="!loginData.isSelf" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="padding-left:20px;background-color: transparent;">
+          <input type="text" readonly aria-haspopup="true" aria-expanded="false" @click="onShowAddress" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="padding-left:20px;background-color: transparent;">
           <span class="fa fa-map-marker"></span>
           <div v-show="showAddressBox"
                @mouseenter="isInAddressBox = true"
@@ -111,7 +111,7 @@
         </div>
         <div class="col-sm-5" v-show="!validAddress.isValidAddress && !validAddress.init"><p><i class="fa fa-info-circle"></i>填写总部所在地详细地址</p></div>
       </div>
-      <div class="row">
+      <!--<div class="row">
         <label class="col-sm-2">联系人:</label>
         <div class="col-sm-5">
           <input type="text" :disabled="!loginData.isSelf" class="form-control" title="请填写企业对外的联系人,为空则默认为管理员" v-model="data.linkman" name="name" required="" placeholder="请填写企业对外的联系人,为空则默认为管理员">
@@ -178,7 +178,7 @@
           </div>
         </div>
         <div class="col-sm-5"></div>
-      </div>
+      </div>-->
       <!--<div class="row"  >
         <label class="col-sm-2">企业LOGO:</label>
         <div class="col-sm-5">
@@ -194,7 +194,7 @@
         </div>
         <div class="col-sm-5" v-show="!validUpload.isValidUpload && !validUpload.init"><p><i class="fa fa-info-circle"></i>请上传营业执照扫描件(≤5M的图片或PDF)</p></div>&ndash;&gt;
       </div>-->
-      <div class="row">
+     <!-- <div class="row">
         <label class="col-sm-2">经营范围标签:</label>
         <div class="col-sm-8">
           <div class="no-tags" v-if="!data.tagsData || data.tagsData.length == 0">暂无标签</div>
@@ -214,7 +214,7 @@
           </div>
         </div>
         <div class="col-sm-12 tags-lists" v-if="loginData.isSelf"><em class="pull-left">例如:</em><span>企业管理咨询</span><span>电子产品开发</span><span>货运代理</span></div>
-      </div>
+      </div>-->
       <div class="row next-btn"><button class="btn" :style="loginData.isSelf && !isValid ? 'opacity: .65;':''" @click="sectionChange(2)">下一步</button></div>
     </div>
   </div>
@@ -225,28 +225,28 @@
       return {
         data: {
           name: '',
-          lawPerson: '',
-          url: '',
+//          lawPerson: '',
+//          url: '',
           licenceId: '',
-          address: '',
-          linkman: '',
-          phone: '',
-          email: '',
-          fax: '',
-          website: '',
-          profession: '',
-          logoUrl: '',
-          tagsData: []
+          address: ''
+//          linkman: '',
+//          phone: '',
+//          email: '',
+//          fax: '',
+//          website: '',
+//          profession: '',
+//          logoUrl: '',
+//          tagsData: []
         },
         validName: {
           isValidTypeName: true,
           isValidName: true,
           init: true
         },
-        validUpload: {
-          isValidUpload: true,
-          init: true
-        },
+//        validUpload: {
+//          isValidUpload: true,
+//          init: true
+//        },
         validLicence: {
           isValidLicence: true,
           init: true
@@ -255,32 +255,32 @@
           isValidAddress: true,
           init: true
         },
-        validLawPerson: {
-          isValidLawPerson: true,
-          init: true
-        },
-        validPhone: {
-          isValidPhone: true,
-          init: true
-        },
-        validEmail: {
-          isValidEmail: true,
-          init: true
-        },
-        validFax: {
-          isValidFax: true,
-          init: true
-        },
-        validLogo: {
-          isValidLogo: true,
-          init: true
-        },
+//        validLawPerson: {
+//          isValidLawPerson: true,
+//          init: true
+//        },
+//        validPhone: {
+//          isValidPhone: true,
+//          init: true
+//        },
+//        validEmail: {
+//          isValidEmail: true,
+//          init: true
+//        },
+//        validFax: {
+//          isValidFax: true,
+//          init: true
+//        },
+//        validLogo: {
+//          isValidLogo: true,
+//          init: true
+//        },
         isValid: false,
-        isPdf: false,
+//        isPdf: false,
         showAddressBox: false,
         isInAddressBox: false,
-        showProfessionBox: false,
-        isInProfessionBox: false,
+//        showProfessionBox: false,
+//        isInProfessionBox: false,
         temCityData: {},
         cityData: {
           province: [],
@@ -292,48 +292,58 @@
           currentCity: '',
           currentDistrict: '',
           detail: ''
-        },
-        tempProfession: {},
-        professionData: {
-          profession: [],
-          detail: [],
-          thirdDetail: []
-        },
-        currentProfession: {
-          profession: '',
-          detail: '',
-          thirdDetail: ''
-        },
-        tag: ''
+        }
+//        tempProfession: {},
+//        professionData: {
+//          profession: [],
+//          detail: [],
+//          thirdDetail: []
+//        },
+//        currentProfession: {
+//          profession: '',
+//          detail: '',
+//          thirdDetail: ''
+//        },
+//        tag: ''
       }
     },
     props: ['loginData', 'enterpriseData', 'businessImgUrl'],
     watch: {
       enterpriseData: function (val, oldVal) {
-        if (val !== {}) {
-          if (this.loginData.isSelf) {
-            this.initSelfData(val)
-            this.nameCheck(3)
-            this.nameTypeCheck()
-            this.licenceCheck(3)
-            this.addressCheck()
-            this.imgUrlCheck()
-            this.lawPersonCheck()
+        if (val.name) {  // 个人
+          this.initData(val)
+          this.nameCheck(3)
+          this.nameTypeCheck()
+          this.licenceCheck(3)
+          this.addressCheck()
+//            this.imgUrlCheck()
+//            this.lawPersonCheck()
 //            this.phoneCheck()
 //            this.emailCheck()
 //            this.faxCheck()
-            this.checkFullData()
-            this.submitRegisterData()
-          } else {
-            this.initEnterpriseData(val)
-          }
+          this.checkFullData()
+          this.submitRegisterData()
+        }
+        if (val.uu) {  // 企业
+          this.initData(val)
+//          this.nameCheck(3)
+//          this.nameTypeCheck()
+//          this.licenceCheck(3)
+          this.enAddressCheck()
+//            this.imgUrlCheck()
+//            this.lawPersonCheck()
+//            this.phoneCheck()
+//            this.emailCheck()
+//            this.faxCheck()
+//          this.checkFullData()
+          this.submitRegisterData()
         }
-      },
-      businessImgUrl: function (val, oldVal) {
-        this.data.url = val
-        this.checkFullData()
-        this.submitRegisterData()
       }
+//      businessImgUrl: function (val, oldVal) {
+//        this.data.url = val
+//        this.checkFullData()
+//        this.submitRegisterData()
+//      }
     },
     mounted () {
       this.$http.get('/data/city.json').then(response => {
@@ -342,166 +352,147 @@
           this.cityData.province.push(province)
         }
       })
-      this.$http.get('/data/profession.json').then(response => {
-        this.tempProfession = response.data
-        for (let profession in response.data) {
-          this.professionData.profession.push(profession)
-        }
-      })
+//      this.$http.get('/data/profession.json').then(response => {
+//        this.tempProfession = response.data
+//        for (let profession in response.data) {
+//          this.professionData.profession.push(profession)
+//        }
+//      })
     },
     methods: {
-      initEnterpriseData: function (val) {
-        this.data.name = val.name || ''
-        this.data.licenceId = val.businessCode || ''
-        this.data.url = val.businessCodeImage || ''
-        this.data.lawPerson = val.corporation || ''
-        this.data.address = val.address || ''
-        this.data.website = val.url || ''
-        this.data.linkman = val.contactMan || ''
-        this.data.phone = val.contactTel || ''
-        this.data.email = val.contactEmail || ''
-        this.data.fax = val.fax || ''
-        this.data.logoUrl = val.logoImage || ''
-        this.data.profession = val.profession || ''
-//        this.data.tagsData = val.tags || []
-        if (typeof val.tags === 'string') {
-//          let tmp = val.tags || ''
-          this.data.tagsData = val.tags.split(',')
-        } else {
-          this.data.tagsData = []
-        }
-      },
-      initSelfData: function (val) {
-        this.data.name = val.name || ''
-        this.data.licenceId = val.licenceId || ''
-        this.data.url = val.url || ''
-        this.data.lawPerson = val.lawPerson || ''
-        this.data.address = val.address || ''
-        this.data.website = val.website || ''
-        this.data.linkman = val.linkman || ''
-        this.data.phone = val.phone || ''
-        this.data.email = val.email || ''
-        this.data.fax = val.fax || ''
-        this.data.logoUrl = val.logoUrl || ''
-        this.data.profession = val.profession || ''
-        if (typeof val.tagsData === 'string' || !val.tagsData) {
-          this.data.tagsData = val.tagsData.split(',') || []
-        } else {
-          this.data.tagsData = val.tagsData || []
-        }
+      initData: function (val) {
+        this.data.name = val.spaceName || val.enName || val.name || ''
+        this.data.licenceId = val.businessCode || val.licenceId || val.enBussinessCode || ''
+        this.data.address = val.address || val.enAddress || ''
       },
       sectionChange: function (type) {
-        if (this.loginData.isSelf && !this.isValid) {
+        if (!this.isValid) {
           this.$message.error('请填写正确的注册信息')
         } else {
-          this.checkFullData()
+          if (this.enterpriseData.uu) {
+            this.enCheckFullData()
+          } else {
+            this.checkFullData()
+          }
           let enterprise = this.data
 //          enterprise.tagsData = enterprise.tagsData.toString()
-          if (typeof this.data.tagsData === 'string') {
-            this.data.tagsData = this.data.tagsData.split(',')
-          }
+//          if (typeof this.data.tagsData === 'string') {
+//            this.data.tagsData = this.data.tagsData.split(',')
+//          }
           let data = {}
           data.enterprise = enterprise
           data.isValidRegister = this.isValid
-          data.url = this.data.url
+//          data.url = this.data.url
           enterprise.enIsRead = false
 //          enterprise.enBussinessCodeImage = this.data.url
+          // 个人用户,提交保存缓存企业信息
           if (this.loginData.isSelf) {
             this.$http.post('/basic/user/userCacheEnterprise', enterprise)
             this.$emit('isSelfCacheDataAction', enterprise)
+          } else { // 企业用户,更新当前企业信息,主要是更新企业地址
+            this.enterpriseData.enAddress = this.data.address
+            this.$http.post('/basic/enterprise/' + this.enterpriseData.uu + '/info', this.enterpriseData)
           }
           this.$emit('registerAction', data)
           this.$emit('sectionEvent', type)
-          this.$emit('businessImgUrlAction', this.data.url)
-        }
-      },
-      upload: function (e) {
-        let file = e.target.files[0]
-        this.validUpload.init = false
-        if (file.size > 5 * 1024 * 1024) {
-          this.validUpload.isValidUpload = false
-        } else {
-          this.validUpload.isValidUpload = true
-          if (file.type !== 'application/pdf') {
-            this.isPdf = false
-            let param = new FormData()
-            param.append('file', file, file.name)
-            param.append('chunk', '0')
-            let config = {
-              headers: {'Content-Type': 'multipart/form-data'}
-            }
-            this.$http.post('/api/images', param, config)
-              .then(response => {
-                this.data.url = response.data[0].path
-                this.$emit('businessImgUrlAction', this.data.url)
-              }, err => {
-                console.log(err)
-                this.validUpload.isValidUpload = false
-              })
-          } else {
-            let param = new FormData()
-            param.append('file', file, file.name)
-            let config = {
-              headers: {'Content-Type': file.type}
-            }
-            this.$http.post('/file', param, config)
-              .then(response => {
-                this.isPdf = true
-                this.data.url = response.data[0].path
-                this.$emit('businessImgUrlAction', this.data.url)
-              }, err => {
-                console.log(err)
-                this.validUpload.isValidUpload = false
-              })
-          }
-        }
-        this.validCheck()
-      },
-      uploadLogo: function (e) {
-        this.validLogo.init = false
-        let file = e.target.files[0]
-        if (file.size > 100 * 1024) {
-          this.validLogo.isValidLogo = false
-//          this.$message.error('图片请勿超过100Kb')
-        } else {
-          let param = new FormData()
-          param.append('file', file, file.name)
-          let config = {
-            headers: {'Content-Type': file.type}
-          }
-          this.$http.post('/api/images', param, config)
-            .then(response => {
-              this.validLogo.isValidLogo = true
-              this.data.logoUrl = response.data[0].path
-            }, err => {
-              console.log(err)
-              this.$message.error('图片上传失败')
-            })
+//          this.$emit('businessImgUrlAction', this.data.url)
         }
       },
+//      upload: function (e) {
+//        let file = e.target.files[0]
+//        this.validUpload.init = false
+//        if (file.size > 5 * 1024 * 1024) {
+//          this.validUpload.isValidUpload = false
+//        } else {
+//          this.validUpload.isValidUpload = true
+//          if (file.type !== 'application/pdf') {
+//            this.isPdf = false
+//            let param = new FormData()
+//            param.append('file', file, file.name)
+//            param.append('chunk', '0')
+//            let config = {
+//              headers: {'Content-Type': 'multipart/form-data'}
+//            }
+//            this.$http.post('/api/images', param, config)
+//              .then(response => {
+//                this.data.url = response.data[0].path
+//                this.$emit('businessImgUrlAction', this.data.url)
+//              }, err => {
+//                console.log(err)
+//                this.validUpload.isValidUpload = false
+//              })
+//          } else {
+//            let param = new FormData()
+//            param.append('file', file, file.name)
+//            let config = {
+//              headers: {'Content-Type': file.type}
+//            }
+//            this.$http.post('/file', param, config)
+//              .then(response => {
+//                this.isPdf = true
+//                this.data.url = response.data[0].path
+//                this.$emit('businessImgUrlAction', this.data.url)
+//              }, err => {
+//                console.log(err)
+//                this.validUpload.isValidUpload = false
+//              })
+//          }
+//        }
+//        this.validCheck()
+//      },
+//      uploadLogo: function (e) {
+//        this.validLogo.init = false
+//        let file = e.target.files[0]
+//        if (file.size > 100 * 1024) {
+//          this.validLogo.isValidLogo = false
+// //          this.$message.error('图片请勿超过100Kb')
+//        } else {
+//          let param = new FormData()
+//          param.append('file', file, file.name)
+//          let config = {
+//            headers: {'Content-Type': file.type}
+//          }
+//          this.$http.post('/api/images', param, config)
+//            .then(response => {
+//              this.validLogo.isValidLogo = true
+//              this.data.logoUrl = response.data[0].path
+//            }, err => {
+//              console.log(err)
+//              this.$message.error('图片上传失败')
+//            })
+//        }
+//      },
       validCheck: function () {
         this.isValid =
-          this.validUpload.isValidUpload && !this.validUpload.init &&
+//          this.validUpload.isValidUpload && !this.validUpload.init &&
           this.validName.isValidTypeName && !this.validName.init && this.validName.isValidName &&
           this.validLicence.isValidLicence && !this.validLicence.init &&
-          this.validAddress.isValidAddress && !this.validAddress.init &&
-          this.validLawPerson.isValidLawPerson && !this.validLawPerson.init &&
-          (this.validPhone.init || this.validPhone.isValidPhone) &&
-          (this.validEmail.init || this.validEmail.isValidEmail) &&
-          (this.validFax.init || this.validFax.isValidFax)
+          this.validAddress.isValidAddress && !this.validAddress.init
+//          this.validLawPerson.isValidLawPerson && !this.validLawPerson.init &&
+//          (this.validPhone.init || this.validPhone.isValidPhone) &&
+//          (this.validEmail.init || this.validEmail.isValidEmail) &&
+//          (this.validFax.init || this.validFax.isValidFax)
+      },
+      enValidCheck: function () {
+        this.isValid = this.validAddress.isValidAddress && !this.validAddress.init
       },
       checkFullData: function () {
         this.isValid =
-          this.validUpload.isValidUpload &&
+//          this.validUpload.isValidUpload &&
           this.validName.isValidTypeName && this.validName.isValidName &&
           this.validLicence.isValidLicence &&
-          this.validAddress.isValidAddress &&
-          this.validLawPerson.isValidLawPerson
+          this.validAddress.isValidAddress
+//          this.validLawPerson.isValidLawPerson
+      },
+      enCheckFullData: function () {
+        this.isValid = this.validAddress.isValidAddress
       },
+      // 企业名称字符验证
       nameTypeCheck: function () {
         this.validName.isValidTypeName = this.data.name !== '' && this.data.name.length >= 2 && this.data.name.length <= 99 && this.commonValid(this.data.name)
         this.validName.init = false
       },
+      // 企业名称是否已存在验证
       nameCheck: function (num) {
         if (num > 0) {
           this.$http.post('/basic/enterprise/register/valid/name?name=' + this.data.name)
@@ -516,10 +507,10 @@
             })
         }
       },
-      imgUrlCheck: function () {
-        this.validUpload.init = false
-        this.validUpload.isValidUpload = this.data.url !== ''
-      },
+//      imgUrlCheck: function () {
+//        this.validUpload.init = false
+//        this.validUpload.isValidUpload = this.data.url !== ''
+//      },
       licenceCheck: function (num) {
         if ((/^[\S-]{1,255}$/).test(this.data.licenceId)) {
           if (num > 0) {
@@ -541,31 +532,38 @@
           this.validCheck()
         }
       },
+      // 个人地址校验
       addressCheck: function () {
         this.validAddress.init = false
         this.validAddress.isValidAddress = this.data.address !== ''
         this.validCheck()
       },
-      lawPersonCheck: function () {
-        this.validLawPerson.init = false
-        this.validLawPerson.isValidLawPerson = (/^\S{1,255}$/).test(this.data.lawPerson)
-        this.validCheck()
-      },
-      phoneCheck: function () {
-        this.validPhone.init = false
-        this.validPhone.isValidPhone = (/^[\d-]{8,}$/).test(this.data.phone) || this.data.phone === ''
-        this.validCheck()
-      },
-      emailCheck: function () {
-        this.validEmail.init = false
-        this.validEmail.isValidEmail = (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/).test(this.data.email) || this.data.email === ''
-        this.validCheck()
-      },
-      faxCheck: function () {
-        this.validFax.init = false
-        this.validFax.isValidFax = (/^(([\0]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/).test(this.data.fax) || this.data.fax === ''
-        this.validCheck()
-      },
+      // 企业地址校验
+      enAddressCheck: function () {
+        this.validAddress.init = false
+        this.validAddress.isValidAddress = this.data.address !== ''
+        this.enValidCheck()
+      },
+//      lawPersonCheck: function () {
+//        this.validLawPerson.init = false
+//        this.validLawPerson.isValidLawPerson = (/^\S{1,255}$/).test(this.data.lawPerson)
+//        this.validCheck()
+//      },
+//      phoneCheck: function () {
+//        this.validPhone.init = false
+//        this.validPhone.isValidPhone = (/^[\d-]{8,}$/).test(this.data.phone) || this.data.phone === ''
+//        this.validCheck()
+//      },
+//      emailCheck: function () {
+//        this.validEmail.init = false
+//        this.validEmail.isValidEmail = (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/).test(this.data.email) || this.data.email === ''
+//        this.validCheck()
+//      },
+//      faxCheck: function () {
+//        this.validFax.init = false
+//        this.validFax.isValidFax = (/^(([\0]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/).test(this.data.fax) || this.data.fax === ''
+//        this.validCheck()
+//      },
       commonValid: function (str) {
         return str.indexOf(' ') === -1
       },
@@ -574,12 +572,12 @@
         let data = {}
         data.enterprise = enterprise
         data.isValidRegister = this.isValid
-        data.url = this.data.url
+//        data.url = this.data.url
         this.$emit('registerAction', data)
       },
       onHideBox: function () {
         this.onHideAddress()
-        this.onHideProfession()
+//        this.onHideProfession()
       },
       onShowAddress: function () {
         if (this.showAddressBox) {
@@ -595,20 +593,20 @@
         }
         this.isClickInputAddress = false
       },
-      onShowProfession: function () {
-        if (this.showProfessionBox) {
-          this.onHideProfession()
-        } else {
-          this.showProfessionBox = true
-          this.isClickInputProfession = true
-        }
-      },
-      onHideProfession: function () {
-        if (!this.isInProfessionBox && !this.isClickInputProfession) {
-          this.showProfessionBox = false
-        }
-        this.isClickInputProfession = false
-      },
+//      onShowProfession: function () {
+//        if (this.showProfessionBox) {
+//          this.onHideProfession()
+//        } else {
+//          this.showProfessionBox = true
+//          this.isClickInputProfession = true
+//        }
+//      },
+//      onHideProfession: function () {
+//        if (!this.isInProfessionBox && !this.isClickInputProfession) {
+//          this.showProfessionBox = false
+//        }
+//        this.isClickInputProfession = false
+//      },
       getCity: function (province) {
         this.cityData.city = []
         this.address.currentCity = ''
@@ -632,7 +630,11 @@
           if (this.address.detail !== '') {
             this.data.address = this.address.currentProvince + this.address.currentCity + this.address.currentDistrict + this.address.detail
             this.showAddressBox = false
-            this.addressCheck()
+            if (this.enterpriseData.uu) {
+              this.enAddressCheck()
+            } else {
+              this.addressCheck()
+            }
           } else {
             this.$message.error('请输入详细地址')
           }
@@ -640,65 +642,65 @@
           this.$message.error('请输入省、市、区')
         }
       },
-      getProfessionDetail: function (profession) {
-        this.currentProfession.profession = profession
-        this.currentProfession.detail = ''
-        this.professionData.detail = []
-        this.currentProfession.thirdDetail = ''
-        this.professionData.thirdDetail = []
-        let _this = this
-        _this.professionData.detail = []
-        for (let item in this.tempProfession[profession]) {
-          if (typeof this.tempProfession[profession][item] !== 'object') {
-            _this.professionData.detail.push(this.tempProfession[profession][item])
-          } else {
-            _this.professionData.detail.push(item)
-          }
-        }
-      },
-      chooseProfessionDetail: function (detail) {
-        this.currentProfession.detail = detail
-        this.currentProfession.thirdDetail = ''
-        this.professionData.thirdDetail = []
-        if (typeof this.tempProfession[this.currentProfession.profession][detail] !== 'object') {
-          this.data.profession = detail
-          this.showProfessionBox = false
-        } else {
-          this.professionData.thirdDetail = this.tempProfession[this.currentProfession.profession][detail]
-        }
-      },
-      chooseProfessionThirdDetail: function (thirdDetail) {
-        this.currentProfession.thirdDetail = thirdDetail
-        this.data.profession = thirdDetail
-        this.showProfessionBox = false
-      },
-      tagCheck: function () {
-        if (this.tag.length > 10) {
-          this.tag = this.tag.substring(0, 10)
-        }
-      },
-      addTags: function () {
-        let flag = true
-        let _this = this
-        if (!this.tag || this.tag === '') {
-          flag = false
-        } else {
-          this.data.tagsData.forEach(function (item) {
-            if (item === _this.tag) {
-              flag = false
-            }
-          })
-        }
-        if (flag) {
-          this.data.tagsData.push(this.tag)
-          this.tag = ''
-        } else {
-          this.tag = ''
-        }
-      },
-      removeTag: function (index) {
-        this.data.tagsData.splice(index, 1)
-      },
+//      getProfessionDetail: function (profession) {
+//        this.currentProfession.profession = profession
+//        this.currentProfession.detail = ''
+//        this.professionData.detail = []
+//        this.currentProfession.thirdDetail = ''
+//        this.professionData.thirdDetail = []
+//        let _this = this
+//        _this.professionData.detail = []
+//        for (let item in this.tempProfession[profession]) {
+//          if (typeof this.tempProfession[profession][item] !== 'object') {
+//            _this.professionData.detail.push(this.tempProfession[profession][item])
+//          } else {
+//            _this.professionData.detail.push(item)
+//          }
+//        }
+//      },
+//      chooseProfessionDetail: function (detail) {
+//        this.currentProfession.detail = detail
+//        this.currentProfession.thirdDetail = ''
+//        this.professionData.thirdDetail = []
+//        if (typeof this.tempProfession[this.currentProfession.profession][detail] !== 'object') {
+//          this.data.profession = detail
+//          this.showProfessionBox = false
+//        } else {
+//          this.professionData.thirdDetail = this.tempProfession[this.currentProfession.profession][detail]
+//        }
+//      },
+//      chooseProfessionThirdDetail: function (thirdDetail) {
+//        this.currentProfession.thirdDetail = thirdDetail
+//        this.data.profession = thirdDetail
+//        this.showProfessionBox = false
+//      },
+//      tagCheck: function () {
+//        if (this.tag.length > 10) {
+//          this.tag = this.tag.substring(0, 10)
+//        }
+//      },
+//      addTags: function () {
+//        let flag = true
+//        let _this = this
+//        if (!this.tag || this.tag === '') {
+//          flag = false
+//        } else {
+//          this.data.tagsData.forEach(function (item) {
+//            if (item === _this.tag) {
+//              flag = false
+//            }
+//          })
+//        }
+//        if (flag) {
+//          this.data.tagsData.push(this.tag)
+//          this.tag = ''
+//        } else {
+//          this.tag = ''
+//        }
+//      },
+//      removeTag: function (index) {
+//        this.data.tagsData.splice(index, 1)
+//      },
       onDetailAddressInput: function () {
         this.address.detail = this.address.detail.trim()
       }
@@ -707,6 +709,9 @@
 </script>
 
 <style scoped>
+  .register{
+    height: 700px;
+  }
   .register input[type="file"] {
     display: block;
   }
@@ -718,6 +723,9 @@
   .x-union-menu {
     width: 600px
   }
+  .x-union-header{
+    margin-top: -40px;
+  }
   .x-union-header>div{
     background: #f5f8fa;
     font-weight: 700;
@@ -848,6 +856,25 @@
   .register .row .tags-box {
     margin-top: 15px;
   }
+  .register .row p {
+    color: red;
+  }
+  .register .row .form-control:focus{
+    border-color: #5078cb;
+    box-shadow: none;
+  }
+  .x-input:focus, .x-input-blank:focus {
+    border-color: #5078cb;
+    box-shadow: none;
+  }
+
+  .register .row .fa-map-marker{
+    position: relative;
+    top: -34px;
+    left: -5px;
+
+  }
+
   .register .row .tags-list ul{
     list-style: none;
   }

+ 2 - 2
components/register-saler/register/StepThird.vue

@@ -434,7 +434,7 @@
             } else {
               this.isSelfRegisterSuccess = false
               this.showLoading = false
-              this.$message.error('企业注册失败,请重新填写信息')
+              this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
             }
           }, err => {
             console.log(err)
@@ -571,7 +571,7 @@
                   this.reflashEnterprise(response.data.data.enuu, baseUrl || '/vendor#/vendor_upload')
                 } else {
                   this.isSelfRegisterSuccess = false
-                  this.$message.error('企业注册失败,请重新填写信息')
+                  this.$message.error(response.data.message || '企业注册失败,请重新填写信息')
                 }
                 this.showLoading = false
               }, err => {

+ 1 - 0
components/store/BaseInfo.vue

@@ -35,6 +35,7 @@
             <div v-if="storeInfo.enterprise.enAddress.length >0"><span class="public">地址:</span><span v-text="storeInfo.enterprise.address || storeInfo.enterprise.enAddress">深圳市南山区科技园科技南五路英唐大厦一楼</span></div>
             <div v-if="storeInfo.enterprise.enTel.length >0"><span class="public">电话:</span><span v-text="storeInfo.enterprise.enTel">0755-26038000/26038047/26038008/86140880</span></div>
             <div v-if="storeInfo.enterprise.enFax && storeInfo.enterprise.enFax.length > 0"><span class="public">传真:</span><span v-text="storeInfo.enterprise.enFax">0755-26038111</span></div>
+            <div v-if="storeInfo.enterprise.enUrl.length >0">官网地址:<a :href=storeInfo.enterprise.enUrl target="_blank">{{storeInfo.enterprise.enUrl}}</a></div>
             <div v-if="storeInfo.enterprise.enPhone && storeInfo.enterprise.enPhone.length > 0"><span class="public">手机:</span><span v-text="storeInfo.enterprise.enPhone">136********</span></div>
             <div v-if="storeInfo.enterprise.enWeixin && storeInfo.enterprise.enWeixin.length > 0"><span class="public">微信:</span><span v-text="storeInfo.enterprise.enWeixin">好名字更容易让人记住你</span></div>
             <div v-if="storeInfo.enterprise.enQQ && storeInfo.enterprise.enQQ.length > 0"><span class="public">Q&nbsp;Q:</span><span v-text="storeInfo.enterprise.enQQ">123456789</span></div>

+ 3 - 73
components/store/CommodityInfo.vue

@@ -167,7 +167,7 @@
       }
     }
   }
-
+  import { enidfilter } from '~utils/baseUtils'
   export default {
     name: 'commodity-info',
     data () {
@@ -380,19 +380,17 @@
                 minPackQty: item.minPackQty
               }])
                 .then(response => {
-                  //        window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
                   if (response.data.success) {
                     if (response.data.message) {
                       this.$message({
                         message: response.data.message,
                         type: 'success'
                       })
-                      let _self = this
                       window.setTimeout(function () {
-                        window.location.href = '/user#/order/pay/' + _self.enidfilter(response.data.data.orderid)
+                        window.location.href = '/user#/order/pay/' + enidfilter(response.data.data.orderid)
                       }, 1000)
                     } else {
-                      window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.data.orderid)
+                      window.location.href = '/user#/order/pay/' + enidfilter(response.data.data.orderid)
                     }
                   } else {
                     if (response.data.data && response.data.data.unvailable === 1) {
@@ -442,74 +440,6 @@
             }
           }
         }
-        // window.location.href = 'user#/order/pay/' + this.enidfilter(this.buy_info.orderid)
-      },
-      enidfilter: function (str) {
-        if (str) {
-          let encryptStr = '' // 最终返回的加密后的字符串
-          // 产生三位随机数
-          let num = ''
-          for (let i = 0; i < 3; i++) {
-            num += Math.floor(Math.random() * 10)
-          }
-          encryptStr += num // 产生3位随机数
-
-          // 16位加密
-          let tempspit = ''
-          let strspit = str.toString().toLowerCase()
-          if (strspit.match(/^[-+]?\d*$/) === null) { // 非整数字符,对每一个字符都转换成16进制,然后拼接
-            /**
-             * Unicode汉字、英文字母、数字的unicode范围
-             *汉字:[0x4e00,0x9fa5](或十进制[19968,40869])
-             *数字:[0x30,0x39](或十进制[48, 57])
-             *小写字母:[0x61,0x7a](或十进制[97, 122])
-             *大写字母:[0x41,0x5a](或十进制[65, 90]
-             * 'a'的Unicode编码:'&#97;',charCodeAt()的值是97
-             * '码'的Unicode编码:'\u7801', new String('码').charCodeAt()的值是30721,30721的16进制表示是7801
-             */
-            let s = strspit.split('')
-            for (let i = 0; i < s.length; i++) {
-              s[i] = s[i].charCodeAt() // 先转换成Unicode编码
-              s[i] = s[i].toString(16)
-              // 因为在服务器是每两位当做一个字符进行解析的,所以这里每个字符的Unicode编码范围必须在0——255之间。数字和大小写满足该要求,特殊字符则不一定,如果后续有特殊字符的要求,需要重写编码器和解码器
-              if (s[i].length === 1) {
-                s[i] = '0' + s[i]
-              }
-              tempspit = tempspit + s[i]
-            }
-            tempspit = tempspit + '{' + 1 // 1代表字符
-          } else { // 数字直接转换成16进制
-            strspit = parseInt(strspit)
-              .toString(16)
-            tempspit = strspit + '{' + 0 // 0代表纯数字
-          }
-
-          let temp = tempspit.split('{') // 对要加密的字符转换成16进制
-          let numLength = temp[0].length // 转换后的字符长度
-          numLength = numLength.toString(16) // 字符长度换算成16进制
-          if (numLength.length === 1) { // 如果是1,补一个0
-            numLength = '0' + numLength
-          } else if (numLength.length > 3) { // 转换后的16进制字符长度如果大于2位数,则返回,不支持
-            return ''
-          }
-          encryptStr += numLength
-          if (temp[1] === '0') {
-            encryptStr += 0
-          } else if (temp[1] === '1') {
-            encryptStr += 1
-          }
-          encryptStr += temp[0]
-          if (encryptStr.length < 20) { // 如果小于20位,补上随机数
-            // 产生三位随机数
-            let numtwo = ''
-            for (let i = 0; i < 20 - encryptStr.length; i++) {
-              numtwo += Math.floor(Math.random() * 10)
-            }
-            let ran = numtwo // 产生3位随机数
-            encryptStr += ran
-          }
-          return encryptStr
-        }
       },
       toAttach: function (url) {
         if (this.user.logged) {

+ 3 - 71
components/store/RecommendProduct.vue

@@ -34,6 +34,7 @@
 </template>
 <script>
   import Buy from '~components/common/buyOrCar/buyComponent.vue'
+  import { enidfilter } from '~utils/baseUtils'
   export default {
     name: 'recommend-product',
     components: {
@@ -97,19 +98,17 @@
                 minPackQty: item.minPackQty ? item.minPackQty : item.minBuyQty
               }])
                 .then(response => {
-                  //        window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
                   if (response.data.success) {
                     if (response.data.message) {
                       this.$message({
                         message: response.data.message,
                         type: 'success'
                       })
-                      let _self = this
                       window.setTimeout(function () {
-                        window.location.href = '/user#/order/pay/' + _self.enidfilter(response.data.data.orderid)
+                        window.location.href = '/user#/order/pay/' + enidfilter(response.data.data.orderid)
                       }, 1000)
                     } else {
-                      window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.data.orderid)
+                      window.location.href = '/user#/order/pay/' + enidfilter(response.data.data.orderid)
                     }
                   } else {
                     if (response.data.data && response.data.data.unvailable === 1) {
@@ -159,73 +158,6 @@
             }
           }
         }
-      },
-      enidfilter: function (str) {
-        if (str) {
-          let encryptStr = '' // 最终返回的加密后的字符串
-          // 产生三位随机数
-          let num = ''
-          for (let i = 0; i < 3; i++) {
-            num += Math.floor(Math.random() * 10)
-          }
-          encryptStr += num // 产生3位随机数
-
-          // 16位加密
-          let tempspit = ''
-          let strspit = str.toString().toLowerCase()
-          if (strspit.match(/^[-+]?\d*$/) === null) { // 非整数字符,对每一个字符都转换成16进制,然后拼接
-            /**
-             * Unicode汉字、英文字母、数字的unicode范围
-             *汉字:[0x4e00,0x9fa5](或十进制[19968,40869])
-             *数字:[0x30,0x39](或十进制[48, 57])
-             *小写字母:[0x61,0x7a](或十进制[97, 122])
-             *大写字母:[0x41,0x5a](或十进制[65, 90]
-             * 'a'的Unicode编码:'&#97;',charCodeAt()的值是97
-             * '码'的Unicode编码:'\u7801', new String('码').charCodeAt()的值是30721,30721的16进制表示是7801
-             */
-            let s = strspit.split('')
-            for (let i = 0; i < s.length; i++) {
-              s[i] = s[i].charCodeAt() // 先转换成Unicode编码
-              s[i] = s[i].toString(16)
-              // 因为在服务器是每两位当做一个字符进行解析的,所以这里每个字符的Unicode编码范围必须在0——255之间。数字和大小写满足该要求,特殊字符则不一定,如果后续有特殊字符的要求,需要重写编码器和解码器
-              if (s[i].length === 1) {
-                s[i] = '0' + s[i]
-              }
-              tempspit = tempspit + s[i]
-            }
-            tempspit = tempspit + '{' + 1 // 1代表字符
-          } else { // 数字直接转换成16进制
-            strspit = parseInt(strspit)
-              .toString(16)
-            tempspit = strspit + '{' + 0 // 0代表纯数字
-          }
-
-          let temp = tempspit.split('{') // 对要加密的字符转换成16进制
-          let numLength = temp[0].length // 转换后的字符长度
-          numLength = numLength.toString(16) // 字符长度换算成16进制
-          if (numLength.length === 1) { // 如果是1,补一个0
-            numLength = '0' + numLength
-          } else if (numLength.length > 3) { // 转换后的16进制字符长度如果大于2位数,则返回,不支持
-            return ''
-          }
-          encryptStr += numLength
-          if (temp[1] === '0') {
-            encryptStr += 0
-          } else if (temp[1] === '1') {
-            encryptStr += 1
-          }
-          encryptStr += temp[0]
-          if (encryptStr.length < 20) { // 如果小于20位,补上随机数
-            // 产生三位随机数
-            let numtwo = ''
-            for (let i = 0; i < 20 - encryptStr.length; i++) {
-              numtwo += Math.floor(Math.random() * 10)
-            }
-            let ran = numtwo // 产生3位随机数
-            encryptStr += ran
-          }
-          return encryptStr
-        }
       }
     }
   }

+ 3 - 0
components/store/common/StoreHeader.vue

@@ -234,6 +234,9 @@ export default {
         .then(response => {
           if (response.data.success) {
             newTab.location.href = 'https://im.ubtob.com/chat/visit?gid=' + response.data.content
+          } else {
+            newTab.close()
+            this.$message.error(response.data.message)
           }
         })
     },

+ 42 - 12
layouts/main.vue

@@ -22,10 +22,10 @@
     },
     head () {
       return {
-        title: this.title,
+        title: this.title || '【优软商城】IC电子元器件现货采购交易平台商城',
         meta: [
-          {hid: 'description', name: 'description', content: this.description},
-          {hid: 'keywords', name: 'keywords', content: this.keywords}
+          {hid: 'description', name: 'description', content: this.description || '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!'},
+          {hid: 'keywords', name: 'keywords', content: this.keywords || '优软商城'}
         ]
       }
     },
@@ -55,13 +55,23 @@
         if (path === '/product/kind/home') {
           return '电子元器件器件选型参数型号查询器件类别分类大全-优软商城'
         } else if (path.startsWith('/product/kind/')) {
-          return this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全-优软商城'
+          if (this.kinds[this.kinds.length - 1]) {
+            return this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全-优软商城'
+          }
+          return ''
         } else if (path.startsWith('/product/component/')) {
-          return this.componentDetail.brand.nameCn + this.componentDetail.code + '参数|供应商|数据手册中文资料|规格书-优软商城'
+          if (this.componentDetail) {
+            return this.componentDetail.brand.nameCn + this.componentDetail.code + '参数|供应商|数据手册中文资料|规格书-优软商城'
+          } else {
+            return ''
+          }
         } else if (path.startsWith('/product/brand/brandList/')) {
           return 'IC电子元器件品牌中心品牌大全-优软商城'
         } else if (path.startsWith('/product/brand/')) {
-          return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn + ')产品分类及产品型号大全-优软商城'
+          if (this.brandDetail.nameEn) {
+            return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn + ')产品分类及产品型号大全-优软商城'
+          }
+          return '【优软商城】IC电子元器件现货采购交易平台商城'
         } else if (path === '/provider/factories') {
           return 'IC电子元器件厂家原厂直销原厂专卖店大全-优软商城'
         } else if (path === '/provider/home') {
@@ -83,13 +93,23 @@
         if (path === '/product/kind/home') {
           return '优软商城电子元器件器件型号查询器件类别分类大全,优软商城提供元器件智能选型服务,能让您完美的找到热门型号的替代型号产品,一键搜索功能让您快速找到您想要的型号。'
         } else if (path.startsWith('/product/kind/')) {
-          return '优软商城' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全,能让您快速的找到' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号。'
+          if (this.kinds[this.kinds.length - 1]) {
+            return '优软商城' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号大全,能让您快速的找到' + this.kinds[this.kinds.length - 1].nameCn + '产品品牌型号。'
+          }
+          return ''
         } else if (path.startsWith('/product/component/')) {
-          return '优软商城提供' + this.componentDetail.brand.nameCn + this.componentDetail.code + '数据手册中文资料规格书下载,' + this.componentDetail.code + '供应商及参数报价。'
+          if (this.componentDetail) {
+            return '优软商城提供' + this.componentDetail.brand.nameCn + this.componentDetail.code + '数据手册中文资料规格书下载,' + this.componentDetail.code + '供应商及参数报价。'
+          } else {
+            return ''
+          }
         } else if (path.startsWith('/product/brand/brandList/')) {
           return 'IC电子元器件品牌中心品牌大全,优软商城品牌中心汇聚国内国际电子元器件品牌,全力打造国家级元器件电商品台。'
         } else if (path.startsWith('/product/brand/')) {
-          return this.brandDetail.brief
+          if (this.brandDetail.brief) {
+            return this.brandDetail.brief || '优软商城(usoftmall.com)是中国领先的IC电子元器件现货采购交易网上商城,提供上千万种电子元器件现货采购交易,采购电子元器件就上优软商城!'
+          }
+          return ''
         } else if (path === '/provider/factories') {
           return 'IC电子元器件厂家原厂直销原厂专卖店大全,优软商城原厂专区提供IC电子元器件厂家原厂直销原厂专卖店大全。'
         } else if (path === '/provider/home') {
@@ -107,13 +127,23 @@
         if (path === '/product/kind/home') {
           return '电子元器件分类,电子元器件参数,电子元器件型号,电子元器件类别'
         } else if (path.startsWith('/product/kind/')) {
-          return this.kinds[this.kinds.length - 1].nameCn
+          if (this.kinds[this.kinds.length - 1]) {
+            return this.kinds[this.kinds.length - 1].nameCn
+          }
+          return ''
         } else if (path.startsWith('/product/component/')) {
-          return this.componentDetail.code + '供应商,' + this.componentDetail.code + '数据手册,' + this.componentDetail.code + '规格书'
+          if (this.componentDetail) {
+            return this.componentDetail.code + '供应商,' + this.componentDetail.code + '数据手册,' + this.componentDetail.code + '规格书'
+          } else {
+            return ''
+          }
         } else if (path.startsWith('/product/brand/brandList/')) {
           return 'ic,元器件,品牌'
         } else if (path.startsWith('/product/brand/')) {
-          return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn
+          if (this.brandDetail.nameEn) {
+            return this.brandDetail.nameEn + '(' + this.brandDetail.nameCn
+          }
+          return '优软商城'
         } else if (path === '/provider/factories') {
           return '电子元器件原厂,电子元器件厂家'
         } else if (path === '/provider/home') {

+ 4 - 1
nuxt.config.js

@@ -161,6 +161,9 @@ module.exports = {
     '/UASBatchPutOnProperty**': baseUrl,
     '/UASBatchPutOnProperty/**': baseUrl,
     '/seek/**': baseUrl,
-    '/inquiry/**': commonUrl
+    '/inquiry/**': commonUrl,
+    '/b2b/**': baseUrl,
+    '/commodity-service/**': baseUrl,
+    '/background/**': baseUrl
   }
 }

+ 1 - 0
pages/applyPurchase/_id.vue

@@ -6,6 +6,7 @@
 <script>
   import { BatchPublish } from '~components/applyPurchase'
   export default {
+    middleware: 'authenticated',
     components: {
       BatchPublish
     },

+ 14 - 6
pages/applyPurchase/result.vue

@@ -6,17 +6,17 @@
       <h1>发布成功</h1>
       <h2>成功发布 <span>{{count}}</span> 条求购</h2>
       <div class="footer1">前往 <a href="/user#/seekPurchase">买家中心-我的求购</a> <span>{{timer}}s</span></div>
-      <div class="footer2">返回 <nuxt-link to="/">商城首页</nuxt-link> | <nuxt-link to="/applyPurchase">求购首页</nuxt-link></div>
+      <div class="footer2">返回 <a @click="go('/')">商城首页</a> | <a  @click="go('/applyPurchase')">求购首页</a></div>
     </div>
     <div class="container" v-else>
       <p>发布求购</p>
       <img src="/images/applyPurchase/batch-error.png" alt="">
-      <h1>上传失败</h1>
+      <h1>发布失败</h1>
       <h2>请完善产品信息</h2>
       <div class="footer1">立刻
         <label>
           <input type="file" @change="upload" accept="*.xls, *.xlsx">
-          <a>重新上传</a>
+          <a>重新发布</a>
         </label>
       </div>
       <div class="footer2">返回 <nuxt-link to="/">商城首页</nuxt-link> | <nuxt-link to="/applyPurchase">求购首页</nuxt-link></div>
@@ -27,15 +27,19 @@
   export default {
     data () {
       return {
-        timer: 5
+        timer: 5,
+        isChange: false
       }
     },
     mounted () {
       if (this.state === 'success') {
-        setInterval(() => {
+        let interval = setInterval(() => {
           this.timer--
-          if (this.timer === 0) {
+          if (this.timer === 0 && !this.isChange) {
+            clearInterval(interval)
             window.location.href = '/user#/seekPurchase'
+          } else if (this.timer < 0) {
+            clearInterval(interval)
           }
         }, 1000)
       }
@@ -77,6 +81,10 @@
               }
             })
         }
+      },
+      go: function (url) {
+        this.isChange = true
+        this.$router.push(url)
       }
     }
   }

+ 2 - 2
pages/index.vue

@@ -72,7 +72,6 @@
     },
     fetch ({store}) {
       return !store.state.option.isMobile ? Promise.all([
-        store.dispatch('loadStoreStatus', { op: 'check' }),
         store.dispatch('loadFloors'),
         store.dispatch('loadBanners', {type: 'home'}),
         store.dispatch('loadProductKinds', { id: 0 }),
@@ -103,7 +102,8 @@
             'BT2018012900002056',
             'BT2018012900002056']
         }),
-        store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 50, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null})
+        store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 50, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null}),
+        store.dispatch('loadStoreStatus', { op: 'check' })
       ]) : Promise.all([
         store.dispatch('loadStoreStatus', { op: 'check' }),
         store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: 1, pageSize: 5, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null})

+ 7 - 1
pages/mobile/applyPurchase/list/index.vue

@@ -123,9 +123,15 @@
       .search-content {
         margin-left: .5rem;
         line-height: normal;
-        padding-top: .08rem;
+        padding-top: .14rem;
         input {
           color: #333;
+          width: 5.78rem;
+          line-height: normal;
+        }
+        span {
+          height: .46rem;
+          line-height: .46rem;
         }
       }
     }

+ 24 - 5
pages/mobile/share/purChase/_uuid.vue

@@ -6,7 +6,10 @@
           <div class="title fl">{{purchaseDetail.inquiry.enName}}</div>
           <div class="time fr">{{purchaseDetail.endDate | date}}</div>
         </div>
-        <div class="desc">{{purchaseDetail.prodTitle}}</div>
+        <div class="desc">{{purchaseDetail.cmpCode}}</div>
+        <div class="size">类目(产品名称):
+          <span>{{purchaseDetail.prodTitle}}</span>
+        </div>
         <div class="brand">品牌:
           <span>{{purchaseDetail.inbrand || '-'}}</span>
         </div>
@@ -54,9 +57,10 @@
     <div class="purcharseListContent">
       <seek-list :purchaseManList="purchaseManListData" :isDataChange="true"></seek-list>
 
-      <nuxt-link to="/mobile/applyPurchase/list" class="purchase_btn_look" tag="div">查看更多</nuxt-link>
+      <div @click="toMore()" class="purchase_btn_look">查看更多</div>
       <div class="purchse_btn_more_title">
-        <a href="https://www.usoftmall.com">优软商城首页</a>
+        <nuxt-link :to="'/'">优软商城首页</nuxt-link>
+        <!-- <a href="https://www.usoftmall.com"></a> -->
       </div>
     </div>
 
@@ -65,7 +69,8 @@
       <img src="/images/mobile/@2x/shareStore/logo.png" alt="">
       <div class="hr right"></div>
       <p>此页面由深圳市优软商城科技有限公司提供</p>
-      <a href="https://www.usoftmall.com">www.usoftmall.com</a>
+      <nuxt-link :to="'/'">www.usoftmall.com</nuxt-link>
+      <!-- <a href="https://www.usoftmall.com">www.usoftmall.com</a> -->
     </div>
 
     <div class="purcharse_kong"></div>
@@ -134,6 +139,9 @@ export default {
   },
   computed: {
     purchaseDetail() {
+      console.log(
+        this.$store.state.applyPurchase.purchaseManList.purchaseManDetail.data
+      )
       return this.$store.state.applyPurchase.purchaseManList.purchaseManDetail
         .data
     },
@@ -143,6 +151,17 @@ export default {
     }
   },
   methods: {
+    toMore() {
+      if (
+        /(iPhone|iPad|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/gi.test(
+          window.navigator.userAgent
+        )
+      ) {
+        this.$router.push({ path: '/mobile/applyPurchase/list' })
+      } else {
+        this.$router.push({ path: '/applyPurchase' })
+      }
+    },
     getDay(timeStamp) {
       return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
     },
@@ -258,7 +277,7 @@ export default {
       }
       .desc {
         font-size: 0.4rem;
-        margin: 0.35rem 0;
+        margin: 0.2rem 0;
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;

+ 154 - 40
pages/mobile/user/index.vue

@@ -4,7 +4,17 @@
       <img src="/images/component/default.png"/>
       <div class="user-info">
         <p v-text="userInfo.data.userName"></p>
-        <p v-text="enterpriseInfo.enName"></p>
+        <p>{{enterpriseInfo.enName}}<a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a></p>
+        <ul class="en-list" v-show="showEnterpriseToggle">
+          <li class="menu-item"
+              v-for="en in sortEnterprises"
+              v-if="en.uu != enterpriseInfo.uu">
+            <a @click="switchEnterprise(en)">{{ en.enName }}</a>
+          </li>
+          <li class="menu-item"  v-if="enterpriseInfo.uu">
+            <a @click="switchEnterprise({uu: 0})"><span v-text="userInfo.data.userName"></span>(个人账户)</a>
+          </li>
+        </ul>
       </div>
       <a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
     </div>
@@ -13,11 +23,17 @@
       <li :class="{active: activeType == 'comp'}" @click="activeType = 'comp'">器件收藏</li>
       <li :class="{active: activeType == 'store'}" @click="activeType = 'store'">店铺关注</li>
     </ul>
-    <div class="seek" v-if="activeType == 'seek'">
-      <ul class="seek-type">
-        <li :class="{active: seekType == 'wait'}" @click="switchSeek('wait')"><div>待报价</div></li>
+    <div v-if="activeType == 'seek'">
+      <div class="seek" v-if="userType !== 'saler'">
+        <ul class="seek-type">
+          <li :class="{active: seekType == 'wait'}" @click="switchSeek('wait')"><div>待报价</div></li>
+          <li :class="{active: seekType == 'done'}" @click="switchSeek('done')"><div>已报价</div></li>
+          <!--<li :class="{active: seekType == 'accept'}" @click="switchSeek('accept')"><div>已采纳</div></li>-->
+        </ul>
+      </div>
+      <ul class="switch-list vendor-switch" v-if="userType === 'saler'">
+        <li :class="{active: seekType == 'wait'}" @click="switchSeek('wait')"><div>全部</div></li>
         <li :class="{active: seekType == 'done'}" @click="switchSeek('done')"><div>已报价</div></li>
-        <!--<li :class="{active: seekType == 'accept'}" @click="switchSeek('accept')"><div>已采纳</div></li>-->
       </ul>
       <div class="search-content">
         <input type="text" placeholder="请输入您要查找的型号或品牌" v-model="seekKeyword" @keyup.13="searchSeek">
@@ -101,7 +117,8 @@
         seekPage: 1,
         seekSize: 10,
         purchaseManListData: [],
-        isDataChange: false
+        isDataChange: false,
+        showEnterpriseToggle: false
       }
     },
     components: {
@@ -111,18 +128,53 @@
       Loading
     },
     fetch ({ store, route }) {
+      let user = store.state.option.user.data
+      let params = {
+        pageNumber: 1,
+        pageSize: 10,
+        state: (!route.query.type || route.query.type === 'buyer') ? 'todo' : null
+      }
+      if (user.enterprise.uu) {
+        params.enUU = user.enterprise.uu
+      } else {
+        params.userUU = user.userUU
+      }
+//      console.log(params)
       return Promise.all([
         store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
         store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 }),
-        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadPurchaseManList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', {pageNumber: 1, pageSize: 10, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : store.state.option.user.data.userUU, state: (!route.query.type || route.query.type === 'buyer') ? 'todo' : null})
+        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadPurchaseManList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
       ])
     },
     mounted: function () {
       this.$nextTick(() => {
         window.addEventListener('scroll', this.scroll, false)
+        document.body.addEventListener('click', () => {
+          this.setShowEnterpriseToggle(false)
+        }, false)
       })
     },
     methods: {
+      // 切换当前企业
+      switchEnterprise (en) {
+        this.showEnterpriseToggle = false
+        this.$http.get(`/user/authentication/${en.uu}`).then(() => {
+          this.isChange = true
+          this.$store.dispatch('loadUserInfo').then(() => {
+            if (this.userType === 'saler') {
+              this.$router.push('/mobile/user?type=buyer')
+            } else {
+              this.reloadData()
+            }
+          })
+        })
+      },
+      setShowEnterpriseToggle (flag, e) {
+        if (e) {
+          e.stopPropagation()
+        }
+        this.showEnterpriseToggle = flag
+      },
       cancelFocus: function (type, item, event) {
         event.stopPropagation()
         if (type === 'store') {
@@ -183,6 +235,7 @@
         this.reloadData()
       },
       switchType: function () {
+        this.activeType = 'seek'
         this.seekType = 'wait'
         this.seekKeyword = ''
         this.$router.push('/mobile/user' + (this.userType === 'saler' ? '?type=buyer' : '?type=saler'))
@@ -193,21 +246,35 @@
       },
       reloadData: function () {
         let type = this.seekType
+        let user = this.$store.state.option.user.data
+        let params = {
+          pageNumber: 1,
+          pageSize: 10,
+          keyword: this.seekKeyword || null
+        }
+        if (user.enterprise.uu) {
+          params.enUU = user.enterprise.uu
+        } else {
+          params.userUU = user.userUU
+        }
         if (this.userType !== 'saler') {
           if (type === 'wait') {
-            this.$store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, keyword: this.seekKeyword, state: 'todo'})
+            params.state = 'todo'
+            this.$store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
           } else if (type === 'done') {
-            this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
+            params._state = 'done'
+            this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', params)
           } else {
-            this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
+            params._state = 'done'
+            this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', params)
           }
         } else {
           if (type === 'wait') {
             this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise.uu, keyword: this.seekKeyword})
           } else if (type === 'done') {
-            this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
+            this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}, overdue: 1})
           } else {
-            this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
+            this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}, overdue: 1})
           }
         }
       },
@@ -241,6 +308,15 @@
         }
         return {enName: this.userInfo.data.userName + '(个人账户)'}
       },
+      sortEnterprises () {
+        let ens = this.userInfo.data.enterprises
+        if (ens && ens.length) {
+          ens.sort(function (a, b) {
+            return b.lastLoginTime - a.lastLoginTime
+          })
+        }
+        return ens
+      },
       isVendor () {
         return this.enterpriseInfo.isVendor === 313
       },
@@ -311,15 +387,16 @@
       }
     }
     .user-name{
-      padding:.14rem 0 .2rem .34rem;
-      background:#fff;
-      width:100%;
-      position:relative;
+      height: 1.8rem;
+      padding: .28rem 0 .28rem .34rem;
+      background: #fff;
+      width: 100%;
+      position: relative;
       img{
         display: inline-block;
-        width:1.25rem;
-        height:1.25rem;
-        border:.04rem solid #c5dbfc;
+        width: 1.25rem;
+        height: 1.25rem;
+        border: 1px solid #c5dbfc;
         border-radius: .05rem;
         vertical-align: middle;
       }
@@ -327,19 +404,48 @@
         margin-left:.25rem;
         display: inline-block;
         vertical-align: middle;
+        position: relative;
         p{
           font-size:.3rem;
           margin:0;
-          font-weight: bold;
           display: block;
           overflow: hidden;
           text-overflow: ellipsis;
           white-space: nowrap;
-          width: 3.92rem;
+          max-width: 3.92rem;
           &:nth-child(2) {
-            font-weight: normal;
-            margin-top: .3rem;
+            position: relative;
+            margin-top: .2rem;
+            padding-right: .7rem;
+            a {
+              position: absolute;
+              right: 0;
+            }
+          }
+        }
+        .en-list {
+          position: absolute;
+          max-width: 8rem;
+          max-height: 3rem;
+          overflow-y: auto;
+          border-radius: .05rem;
+          .menu-item {
+            height: .6rem;
+            line-height: .6rem;
+            font-size: .3rem;
+            padding: 0 .2rem;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+            background: rgba(0, 0, 0, .4);
+            &:active, &:focus, &:hover {
+              background: #7d7d7d;
+            }
+            a {
+              color: #fff;
+            }
           }
+
         }
       }
       > a {
@@ -348,7 +454,7 @@
         top: .45rem;
         right: .1rem;
         color: #3f84f6;
-        border: .02rem solid #3f84f6;
+        border: 1px solid #3f84f6;
         border-radius: .2rem;
         padding: .06rem .12rem;
       }
@@ -379,7 +485,7 @@
             &:nth-child(2) {
               width:2.4rem;
               height:1.69rem;
-              border: .04rem solid #eee;
+              border: 1px solid #eee;
             }
             &:nth-child(1) {
               position:absolute;
@@ -466,7 +572,7 @@
     }
     .collect-list-type {
       background: #fff;
-      border-bottom: .04rem solid #acacac;
+      border-bottom: 1px solid #acacac;
       p {
         font-size: .32rem;
         margin: 0 0 0 .13rem;
@@ -486,11 +592,11 @@
         font-size: .28rem;
         color: #666;
         background: #fff;
-        border: .02rem solid #b4b4b4;
+        border: 1px solid #b4b4b4;
         border-right: none;
         &.active {
           background: #0067e7;
-          border: .02rem solid #0067e7;
+          border: 1px solid #0067e7;
           color: #fff;
         }
         &:first-child {
@@ -500,10 +606,15 @@
           border-right: none;
         }
       }
+      &.vendor-switch {
+        li {
+          width: 50%;
+        }
+      }
     }
     .seek {
-      ul.seek-type {
-        margin-top: .06rem;
+      .seek-type {
+        margin-top: .15rem;
         li {
           font-size: .28rem;
           color: #666;
@@ -511,11 +622,10 @@
           width: 50%;
           text-align: center;
           div {
-            width: 2rem;
-            border-bottom: .02rem solid #c1c4c9;
+            border-bottom: 1px solid #c1c4c9;
             margin: 0 auto;
-            height: .6rem;
-            line-height: .6rem;
+            height: .46rem;
+            line-height: .46rem;
           }
           &.active {
             color: #3f84f6;
@@ -525,12 +635,16 @@
           }
         }
       }
-      .search-content {
-        text-align: center;
-        padding: .25rem 0 0 0;
-        input {
-          border: .02rem solid #376ff3;
-        }
+    }
+    .search-content {
+      text-align: center;
+      padding: .25rem 0 0 0;
+      input {
+        border: 1px solid #376ff3;
+      }
+      span {
+        height: .46rem;
+        line-height: .46rem;
       }
     }
   }

+ 2 - 6
pages/product/brand/_code.vue

@@ -25,13 +25,9 @@
     },
     fetch ({ store, params }) {
       return Promise.all([
-        store.dispatch('loadBrandDetail', { id: params.code })
+        store.dispatch('loadBrandDetail', { id: params.code }),
+        store.dispatch('product/loadSupplierInformation', { uuid: params.code, count: 5, page: 1 })
       ])
-    },
-    methods: {
-      listenChild: function (brand) {
-        this.$store.dispatch('loadBrandPages', {count: 10, filter: { brandid: brand.id }, page: brand.page})
-      }
     }
   }
 </script>

+ 53 - 33
pages/product/component/_uuid.vue

@@ -1,41 +1,61 @@
 <template>
   <div class="detail">
-    <component-menu/>
-    <component-detail/>
-    <store-info/>
+    <div v-if="componentDetail">
+      <component-menu/>
+      <component-detail/>
+      <store-info/>
+    </div>
+    <div v-else>
+      <error-page :title="'店铺'"></error-page>
+    </div>
   </div>
 </template>
 <script>
-  import { ComponentMenu, ComponentDetail, StoreInfo } from '~components/product'
-  export default {
-    layout: 'main',
-    components: {
-      ComponentMenu,
-      ComponentDetail,
-      StoreInfo
-    },
-    fetch ({ store, route }) {
-      return Promise.all([
-        store.dispatch('loadComponentDetail', {id: route.params.uuid}),
-        store.dispatch('loadComponentStore', {uuid: route.params.uuid}),
-        store.dispatch('loadComponentInformation',
-          {
-            count: 10,
-            page: 1,
-            sorting: {'minPriceRMB': 'ASC'},
-            filter: {
-              uuid: route.params.uuid,
-              ignoreUMall: false,
-              ignoreStore: false,
-              storeIds: '',
-              status: 601
-            }}),
-        store.dispatch('getUmallStoreId'),
-        store.dispatch('product/saveStores'),
-        store.dispatch('loadStoreStatus', { op: 'check' })
-      ])
-    },
-    created () {
+import { ComponentMenu, ComponentDetail, StoreInfo } from '~components/product'
+import { ErrorPage } from '~components/error'
+export default {
+  // validate({ params, redirect }) {
+  //   window.location.href = '/error'
+  // },
+  layout: 'main',
+  components: {
+    ComponentMenu,
+    ComponentDetail,
+    StoreInfo,
+    ErrorPage
+  },
+  fetch({ store, route }) {
+    return Promise.all([
+      store.dispatch('loadComponentDetail', { id: route.params.uuid }),
+      store.dispatch('loadComponentStore', { uuid: route.params.uuid }),
+      store.dispatch('loadComponentInformation', {
+        count: 10,
+        page: 1,
+        sorting: { minPriceRMB: 'ASC' },
+        filter: {
+          uuid: route.params.uuid,
+          ignoreUMall: false,
+          ignoreStore: false,
+          storeIds: '',
+          status: 601
+        }
+      }),
+      store.dispatch('getUmallStoreId'),
+      store.dispatch('product/saveStores'),
+      store.dispatch('loadStoreStatus', { op: 'check' })
+    ])
+  },
+  computed: {
+    componentDetail() {
+      return this.$store.state.componentDetail.detail.data
     }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      // if (!this.$store.state.componentDetail.detail.data) {
+      //   this.$router.replace('/error')
+      // }
+    })
   }
+}
 </script>

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

@@ -20,7 +20,7 @@
     fetch ({store, route}) {
       return Promise.all([
         store.dispatch('product/loadKindParentsWithBothers', {id: route.params.id}),
-        store.dispatch('product/loadKindBrands', {id: route.params.id}),
+        // store.dispatch('product/loadKindBrands', {id: route.params.id}),
         store.dispatch('product/pageComGoods', {kindid: route.params.id})
       ])
     },

+ 1 - 4
pages/register-saler/index.vue

@@ -33,12 +33,9 @@
 </script>
 <style>
   /* 公共模块 */
-  body{
-    background: #F5F5F5;
-    font-family: "Microsoft Yahei", "微软雅黑";
-  }
   .become-store{
     width: 100%;
+    background: #F5F5F5;
     margin: 0 auto;
   }
   .become-store .all-content{

+ 10 - 1
plugins/axios.js

@@ -7,9 +7,10 @@ const service = axios.create({
   baseURL: '/'
 })
 
+const isServer = typeof window === 'undefined'
 service.interceptors.request.use(config => {
   // is server render, use ${baseUrl} directly rather than ${proxyUrl}
-  if (typeof window === 'undefined') {
+  if (isServer) {
     if (config.url.indexOf('/inquiry') === 0) {
       config.url = process.env.commonUrl + config.url
     } else {
@@ -17,6 +18,8 @@ service.interceptors.request.use(config => {
     }
     config.headers.cookie = store.state.option.cookies + '; ' + store.state.option.sessionId
     config.headers['User-Agent'] = store.state.option.userAgent
+  } else {
+    document.getElementById('loading').setAttribute('class', 'loading in')
   }
   return config
 }, error => {
@@ -37,8 +40,14 @@ service.interceptors.response.use(response => {
       }
     }
   }
+  if (!isServer) {
+    document.getElementById('loading').setAttribute('class', 'loading')
+  }
   return response
 }, error => {
+  if (!isServer) {
+    document.getElementById('loading').setAttribute('class', 'loading')
+  }
   return Promise.reject(error)
 })
 

+ 1 - 1
post.sh

@@ -10,7 +10,7 @@ basepath=$(cd `dirname $0`; pwd)
 buildfile=$basepath/dist.tgz
 
 cnpm install
-npm run build
+#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

+ 1 - 1
server.js

@@ -1,4 +1,4 @@
-const Nuxt = require('nuxt')
+const Nuxt = require('nuxt')
 const app = require('express')()
 const proxy = require('http-proxy-middleware')
 const cookiejar = require('cookiejar')

BIN
static/images/404-details.png


BIN
static/images/all/banner-cuxiao001.jpg


BIN
static/images/all/select-icon-full.png


BIN
static/images/applyPurchase/batch-icon.png


BIN
static/images/applyPurchase/link-buyer.png


BIN
static/images/applyPurchase/select2.png


BIN
static/images/floor/banner01.jpg


BIN
static/images/floor/banner02.jpg


BIN
static/images/mobile/@2x/applyPurchase/home/app-banner_01.jpg


BIN
static/images/mobile/@2x/applyPurchase/home/app-banner_02.jpg


BIN
static/images/store/common/goIn.png


+ 22 - 0
store/applyPurchase.js

@@ -27,6 +27,17 @@ import axios from '~plugins/axios'
 //   })
 // }
 
+// 获取商城现货
+let getSpotGoods = function ({commit}, params = {}) {
+  return axios.get('/seek/getMallGoodsList', {params: {brand: params.brand, code: params.code}})
+    .then(response => {
+      params.spotGoods = response.data
+      // commit('bomMaterial/ADD_BOM_MATERIAL_BY_SPOT_GOODS', params)
+    }, err => {
+      console.log(err)
+    })
+}
+
 export const actions = {
   // 获取手机端首页求购数据
   loadMobileHomeList ({ commit }, params = {}) {
@@ -136,6 +147,17 @@ export const actions = {
     commit('bomMaterial/REQUEST_BOM_MATERIAL')
     return axios.get('/seek/getSeekPurchaseByBatchPageInfo', {params: params})
       .then(response => {
+        let list = response.data.content
+        if (list && list.length) {
+          let promises = []
+          for (let i = 0; i < list.length; i++) {
+            list[i].$index = i
+            promises.push(getSpotGoods({commit}, list[i]))
+          }
+          return Promise.all(promises).then(() => {
+            commit('bomMaterial/GET_BOM_MATERIAL_SUCCESS', response.data)
+          })
+        }
         commit('bomMaterial/GET_BOM_MATERIAL_SUCCESS', response.data)
       }, err => {
         commit('bomMaterial/GET_BOM_MATERIAL_FAILURE', err)

+ 6 - 0
store/applyPurchase/bomMaterial.js

@@ -20,6 +20,12 @@ export const mutations = {
     state.bomList.fetching = false
     state.bomList.data = result
   },
+  ADD_BOM_MATERIAL_BY_SPOT_GOODS (state, result) {
+    if (result.$index === 0) {
+      state.bomList.data.content = []
+    }
+    state.bomList.data.content.push(result)
+  },
   REQUEST_BOM_INFO (state) {
     state.bomNumber.fetching = true
   },

+ 34 - 19
store/product.js

@@ -62,25 +62,25 @@ export const actions = {
     return axios.get(`/api/product/kind/${id}/parentsWithBothers`)
       .then(response => {
         commit('kind/GET_KINDPARENTSWITHBOTHERS_SUCCESS', response.data)
-        if (response.data) {
-          if (!response.data[response.data.length - 1].leaf) {
-            commit('kind/REQUEST_CHILDREN')
-            return axios.get(`/api/product/kind/${id}/children`)
-              .then(response => {
-                commit('kind/GET_CHILDREN_SUCCESS', response.data)
-              }, err => {
-                commit('kind/GET_CHILDREN_FAILURE', err)
-              })
-          } else {
-            commit('kind/REQUEST_KINDPROPERTY')
-            return axios.get(`/api/product/kind/${id}/properties/values`)
-              .then(response => {
-                commit('kind/GET_KINDPROPERTY_SUCCESS', response.data)
-              }, err => {
-                commit('kind/GET_KINDPROPERTY_FAILURE', err)
-              })
-          }
-        }
+        // if (response.data) {
+        //   if (!response.data[response.data.length - 1].leaf) {
+        //     // commit('kind/REQUEST_CHILDREN')
+        //     // return axios.get(`/api/product/kind/${id}/children`)
+        //     //   .then(response => {
+        //     //     commit('kind/GET_CHILDREN_SUCCESS', response.data)
+        //     //   }, err => {
+        //     //     commit('kind/GET_CHILDREN_FAILURE', err)
+        //     //   })
+        //   } else {
+        //     // commit('kind/REQUEST_KINDPROPERTY')
+        //     // return axios.get(`/api/product/kind/${id}/properties/values`)
+        //     //   .then(response => {
+        //     //     commit('kind/GET_KINDPROPERTY_SUCCESS', response.data)
+        //     //   }, err => {
+        //     //     commit('kind/GET_KINDPROPERTY_FAILURE', err)
+        //     //   })
+        //   }
+        // }
       }, err => {
         commit('kind/GET_KINDPARENTSWITHBOTHERS_FAILURE', err)
       })
@@ -134,5 +134,20 @@ export const actions = {
       }, err => {
         commit('common/GET_COLLECTLIST_FAILURE', err)
       })
+  },
+  // 供应商维护
+  loadSupplierInformation ({ commit }, params = {}) {
+    let uuid = params.uuid
+    let param = {
+      page: params.page,
+      count: params.count
+    }
+    commit('supplierInformation/REQUEST_INFORMATION')
+    return axios.get(`/api/produce/vendorlist/${uuid}`, {params: param})
+      .then(response => {
+        commit('supplierInformation/GET_INFORMATION_SUCCESS', response.data)
+      }, err => {
+        commit('supplierInformation/GET_INFORMATION_FAILURE', err)
+      })
   }
 }

+ 18 - 0
store/product/supplierInformation.js

@@ -0,0 +1,18 @@
+export const state = () => ({
+  information: {
+    fetching: false,
+    data: []
+  }
+})
+export const mutations = {
+  REQUEST_INFORMATION (state) {
+    state.information.fetching = true
+  },
+  GET_INFORMATION_FAILURE (state) {
+    state.information.fetching = false
+  },
+  GET_INFORMATION_SUCCESS (state, result) {
+    state.information.fetching = false
+    state.information.data = result
+  }
+}

+ 133 - 0
utils/baseUtils.js

@@ -0,0 +1,133 @@
+
+const NULL_ARR = ['空', '没', '无', '-', '—', 'null', '#N/A']
+
+const getRealLength = function (str) {
+  let len = 0
+  for (let i = 0; i < str.length; i++) {
+    if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+      len += 2
+    } else {
+      len++
+    }
+  }
+  return len
+}
+
+// 订单号转换
+export const enidfilter = (str) => {
+  if (str) {
+    let encryptStr = '' // 最终返回的加密后的字符串
+    // 产生三位随机数
+    let num = ''
+    for (let i = 0; i < 3; i++) {
+      num += Math.floor(Math.random() * 10)
+    }
+    encryptStr += num // 产生3位随机数
+
+    // 16位加密
+    let tempspit = ''
+    let strspit = str.toString().toLowerCase()
+    if (strspit.match(/^[-+]?\d*$/) === null) { // 非整数字符,对每一个字符都转换成16进制,然后拼接
+      /**
+       * Unicode汉字、英文字母、数字的unicode范围
+       *汉字:[0x4e00,0x9fa5](或十进制[19968,40869])
+       *数字:[0x30,0x39](或十进制[48, 57])
+       *小写字母:[0x61,0x7a](或十进制[97, 122])
+       *大写字母:[0x41,0x5a](或十进制[65, 90]
+       * 'a'的Unicode编码:'&#97;',charCodeAt()的值是97
+       * '码'的Unicode编码:'\u7801', new String('码').charCodeAt()的值是30721,30721的16进制表示是7801
+       */
+      let s = strspit.split('')
+      for (let i = 0; i < s.length; i++) {
+        s[i] = s[i].charCodeAt() // 先转换成Unicode编码
+        s[i] = s[i].toString(16)
+        // 因为在服务器是每两位当做一个字符进行解析的,所以这里每个字符的Unicode编码范围必须在0——255之间。数字和大小写满足该要求,特殊字符则不一定,如果后续有特殊字符的要求,需要重写编码器和解码器
+        if (s[i].length === 1) {
+          s[i] = '0' + s[i]
+        }
+        tempspit = tempspit + s[i]
+      }
+      tempspit = tempspit + '{' + 1 // 1代表字符
+    } else { // 数字直接转换成16进制
+      strspit = parseInt(strspit)
+        .toString(16)
+      tempspit = strspit + '{' + 0 // 0代表纯数字
+    }
+
+    let temp = tempspit.split('{') // 对要加密的字符转换成16进制
+    let numLength = temp[0].length // 转换后的字符长度
+    numLength = numLength.toString(16) // 字符长度换算成16进制
+    if (numLength.length === 1) { // 如果是1,补一个0
+      numLength = '0' + numLength
+    } else if (numLength.length > 3) { // 转换后的16进制字符长度如果大于2位数,则返回,不支持
+      return ''
+    }
+    encryptStr += numLength
+    if (temp[1] === '0') {
+      encryptStr += 0
+    } else if (temp[1] === '1') {
+      encryptStr += 1
+    }
+    encryptStr += temp[0]
+    if (encryptStr.length < 20) { // 如果小于20位,补上随机数
+      // 产生三位随机数
+      let numtwo = ''
+      for (let i = 0; i < 20 - encryptStr.length; i++) {
+        numtwo += Math.floor(Math.random() * 10)
+      }
+      let ran = numtwo // 产生3位随机数
+      encryptStr += ran
+    }
+    return encryptStr
+  }
+}
+
+// 获取字符串字符长度
+export const getRealLen = getRealLength
+
+// 根据字符长度剪切字符
+export const cutOutString = (str, length) => {
+  for (let i = 1; i <= str.length; i++) {
+    if (getRealLength(str.substr(0, i)) > length) {
+      str = str.substr(0, i - 1)
+      break
+    }
+  }
+  return str
+}
+
+// 格式化日期,返回字符串
+export const formatDate = (date, fmt) => {
+  if (!date) {
+    return null
+  }
+  if (typeof date === 'string') {
+    date = new Date(Date.parse(date.replace(/-/g, '/')))
+  }
+  let o = {
+    'M+': date.getMonth() + 1, // 月份
+    'd+': date.getDate(), // 日
+    'h+': 23, // 小时
+    'm+': 59, // 分
+    's+': 59, // 秒
+    'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+    'S': date.getMilliseconds() // 毫秒
+  }
+  if (/(y+)/.test(fmt)) {
+    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
+  }
+  for (let k in o) {
+    if (new RegExp('(' + k + ')').test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+    }
+  }
+  return fmt
+}
+
+export const checkNullStr = (str) => {
+  let flag = true
+  NULL_ARR.map(s => {
+    flag = str === s ? false : flag
+  })
+  return flag
+}

Some files were not shown because too many files changed in this diff