Browse Source

Merge branch 'feature-201819-wangcz' into dev

Administrator 8 years ago
parent
commit
b032cf076d
44 changed files with 3685 additions and 544 deletions
  1. 231 0
      components/applyPurchase/SeekProduct.vue
  2. 2 1
      components/applyPurchase/index.js
  3. 76 0
      components/base/SupplierEmpty.vue
  4. 2 0
      components/base/index.js
  5. 17 1
      components/common/buyOrCar/buyComponent.vue
  6. 24 5
      components/common/upload/upload.vue
  7. 13 13
      components/default/Header.vue
  8. 70 2
      components/default/RightBar.vue
  9. 2 1
      components/help/helpHeader.vue
  10. 2 2
      components/main/Nav.vue
  11. 112 22
      components/main/Search.vue
  12. 133 191
      components/mobile/applyPurchase/PublishSeek.vue
  13. 12 6
      components/mobile/common/PullUp.vue
  14. 124 71
      components/mobile/search/MainSearch.vue
  15. 17 15
      components/mobile/store/StoreDetail.vue
  16. 1 1
      components/personalMaterial/PersonalMaterial.vue
  17. 9 2
      components/product/brand/BrandDetail.vue
  18. 2 2
      components/product/component/ComponentDetail.vue
  19. 112 0
      components/search/BrandList.vue
  20. 155 0
      components/search/ForwardGoodsList.vue
  21. 15 17
      components/search/GoodList.vue
  22. 7 23
      components/search/ResultTitle.vue
  23. 188 0
      components/search/SupplierList.vue
  24. 4 1
      components/search/index.js
  25. 3 3
      components/store/home/EnterpriseInfo.vue
  26. 2 2
      layouts/main.vue
  27. 183 0
      pages/mobile/center/user/applyPurchase.vue
  28. 3 7
      pages/mobile/center/user/index.vue
  29. 8 7
      pages/mobile/center/vendor/payCenter.vue
  30. 445 17
      pages/mobile/center/vendor/product.vue
  31. 1237 0
      pages/mobile/search/newkeycode.vue
  32. 1 1
      pages/product/component/_uuid.vue
  33. 242 129
      pages/search/_keyword.vue
  34. 8 1
      plugins/mixin.js
  35. BIN
      static/images/mobile/@2x/productDetail/Strand.png
  36. BIN
      static/images/mobile/@2x/productDetail/isStrand.png
  37. 10 0
      store/index.js
  38. 28 1
      store/option.js
  39. 10 0
      store/product.js
  40. 14 0
      store/product/common.js
  41. 15 0
      store/search.js
  42. 10 0
      store/searchData.js
  43. 14 0
      store/searchData/searchList.js
  44. 122 0
      utils/mixin.js

+ 231 - 0
components/applyPurchase/SeekProduct.vue

@@ -0,0 +1,231 @@
+<template>
+  <div class="seek-product">
+    <el-dialog
+      title="我要询价"
+      :visible.sync="showObj.show">
+      <div class="form_dialog">
+        <ul class="list-inline">
+          <li class="form-item">
+            <span>品牌:</span>
+            <p>123123123123</p>
+          </li>
+          <li class="form-item">
+            <span>物料名称(类目):</span>
+            <p>1123132123</p>
+          </li>
+          <li class="form-item">
+            <span>型号:</span>
+            <p>3123123123123123123123123</p>
+          </li>
+          <li class="form-item">
+            <span>规格:</span>
+            <p>3</p>
+          </li>
+          <li class="form-item">
+            <span><i>*</i>截止日期:</span>
+            <el-date-picker
+              :class="{'error': !validObj.deadline}"
+              v-model="applyObj.deadline"
+              type="date"
+              :picker-options="pickerOptions"
+              @change="setDeadLineValid"
+              :editable="false"
+              :clearable="true"
+              size="mini">
+            </el-date-picker>
+          </li>
+          <li class="form-item">
+            <span>封装:</span>
+            <input type="text" class="form-control" v-model="applyObj.encapsulation"/>
+          </li>
+          <!--<li class="form-item">-->
+          <!--<span>单价预算:</span>-->
+          <!--<select v-model="applyObj.currency" class="form-control" style="width:40px;">-->
+          <!--<option value="RMB">¥</option>-->
+          <!--<option value="USD">$</option>-->
+          <!--</select>-->
+          <!--<input type="number" v-model="applyObj.unitPrice" class="form-control" :class="{'error': !validObj.unitPrice}"/>-->
+          <!--</li>-->
+          <!--<li class="form-item">-->
+          <!--<span>生产日期:</span>-->
+          <!--<input type="text" class="form-control" v-model="applyObj.produceDate"/>-->
+          <!--</li>-->
+          <li class="form-item">
+            <span>采购数量(PCS):</span>
+            <input type="number" class="form-control" v-model="applyObj.amount" :class="{'error': !validObj.amount}"/>
+          </li>
+        </ul>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <button @click="authorityInterceptor(baseUrls.userPublishSeek, goPublish)">询价提交</button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import { seekProduct } from '~utils/mixin'
+  export default {
+    mixins: [seekProduct],
+    props: {
+      showObj: {
+        type: Object,
+        default: function () {
+          return {show: false}
+        }
+      },
+      /*
+      *  spec: '',
+       prodName: '',
+       brand: '',
+       cmpCode: ''
+      * */
+      productItem: {
+        type: Object,
+        default: {}
+      }
+    },
+    watch: {
+      'showObj.show': {
+        handler: function (val) {
+          if (val) {
+            this.emptyForm()
+          }
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  .seek-product {
+    .el-dialog{
+      width: 680px!important;
+      .el-dialog__header{
+        background: #4290f7;
+        line-height: 40px;
+        padding: 0 20px 0;
+        display:block;
+        .el-dialog__title{
+          color:#fff;
+        }
+        .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
+          color:#fff;
+        }
+      }
+      .el-dialog__body{
+        padding: 10px 20px;
+      }
+      .el-dialog__footer{
+        text-align: center;
+        button{
+          display:inline-block;
+          border:0;
+          box-shadow: none;
+          background: #3c7cf5;
+          color:#fff;
+          font-size: 14px;
+          line-height: 30px;
+          height:30px;
+          padding:0 10px;
+          border-radius:5px;
+        }
+      }
+    }
+    .form_dialog{
+      .el-date-editor--date {
+        width: 230px;
+        &.error {
+          input {
+            border: 1px solid #f4645f !important;
+          }
+        }
+      }
+      ul{
+        li{
+          width:50%;
+          font-size: 14px;
+          color:#666;
+          vertical-align: top;
+          margin-bottom:15px;
+          &.form-item {
+            position: relative;
+            p{
+              margin:0;
+              margin-left:112px;
+              word-break: break-all;
+              word-wrap: break-word;
+            }
+            span {
+              float:left;
+              width: 112px;
+              text-align: right;
+              display: inline-block;
+              color:#3c7cf5;
+              i {
+                position: relative;
+                top: 2px;
+                right: 5px;
+                color: #e41515;
+              }
+            }
+            ul {
+              line-height: normal;
+              position: absolute;
+              top: 19px;
+              left: 79px;
+              background: #fff;
+              border: 1px solid #b5b5b5;
+              z-index: 1;
+              max-height: 120px;
+              overflow-y: auto;
+              overflow-x: hidden;
+              border-radius: 3px;
+              width: 114px;
+              font-size: 12px;
+              li {
+                height: 24px;
+                line-height: 24px;
+                cursor: pointer;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                padding: 0 5px;
+                &:hover {
+                  background: #ddd;
+                }
+              }
+            }
+            select {
+              width: 40px;
+              position: absolute;
+              height: 20px;
+              background: url('/images/applyPurchase/select.png')no-repeat right;
+              background-position-x: 23px;
+              padding: 0 0 0 7px;
+              border-radius: 0;
+              & + input {
+                padding-left: 45px;
+              }
+            }
+            .el-input {
+              width: 198px;
+            }
+            input {
+              font-size: 14px;
+              width: 198px;
+              height: 20px;
+              line-height: 20px;
+              border-radius: 2px;
+              padding: 0 3px;
+              box-shadow: none;
+              -webkit-box-shadow: none;
+              -moz-box-shadow: none;
+              &.error {
+                border-color: #f4645f!important;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 2 - 1
components/applyPurchase/index.js

@@ -7,5 +7,6 @@ import ArticleOne from './articleOne'
 import ArticleTwo from './articleTwo'
 import ArticleThree from './articleThree'
 import ArticleFour from './articleFour'
+import SeekProduct from './SeekProduct.vue'
 
-export { ApplyInfo, PublishApply, ApplyFooter, BusinessOpportunities, BatchPublish, ArticleOne, ArticleTwo, ArticleThree, ArticleFour }
+export { ApplyInfo, PublishApply, ApplyFooter, BusinessOpportunities, BatchPublish, ArticleOne, ArticleTwo, ArticleThree, ArticleFour, SeekProduct }

+ 76 - 0
components/base/SupplierEmpty.vue

@@ -0,0 +1,76 @@
+<template>
+  <div class="supplier-empty">
+    <el-dialog
+      title="提示"
+      :visible.sync="showObj.show">
+      <div class="form_dialog">
+        <p><span>供应商正在完善产品信息,</span>暂时不能查看更多。 </p>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <a type="button" @click="showObj.show = false">我知道了</a>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  export default {
+    props: {
+      showObj: {
+        type: Object,
+        default: () => {
+          return {
+            show: false
+          }
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  .supplier-empty {
+    .el-dialog{
+      width: 290px!important;
+      .el-dialog__header{
+        background: #4290f7;
+        line-height: 40px;
+        padding: 0 20px 0;
+        display:block;
+        .el-dialog__title{
+          color:#fff;
+        }
+        .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
+          color:#fff;
+        }
+      }
+      .el-dialog__body{
+        padding: 10px 20px;
+      }
+      .el-dialog__footer{
+        text-align: center;
+        a{
+          display:inline-block;
+          background: #3c7cf5;
+          color:#fff;
+          font-size: 14px;
+          line-height: 30px;
+          height:30px;
+          padding:0 10px;
+          border-radius:5px;
+        }
+      }
+    }
+    .form_dialog{
+      p{
+        width:200px;
+        font-size: 14px;
+        color:#666666;
+        margin:0 auto;
+        padding-top:5px;
+        line-height: 20px;
+        span{
+          color:#eb6054;
+        }
+      }
+    }
+  }
+</style>

+ 2 - 0
components/base/index.js

@@ -0,0 +1,2 @@
+import SupplierEmpty from './SupplierEmpty.vue'
+export { SupplierEmpty }

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

@@ -6,6 +6,7 @@
             :class="{'disabled': disabledFlag}"
             @click="buyNow(true, $event)">
       <span class="watch">立即购买</span>
+
     </button>
     <button style="z-index: 1000;"
             ref="addCartBtn"
@@ -17,6 +18,7 @@
             @click="buyNow(false, $event)">
       <span class="watch">加入购物车</span>
     </button>
+
   </div>
 </template>
 
@@ -24,7 +26,21 @@
   export default {
     props: ['item', 'disabledFlag', 'btnColor'],
     methods: {
+      drop(el) {
+        this.$store.commit('option/SET_BALLSLIST_SUCCESS', el)
+      },
       buyNow: function (isBuy, event) {
+        // let $el = this.$refs.ballCard
+        // let transform = whichTransitionEvent()
+        // let _shopCar = document.getElementById('shopCar')
+        // let _eltop = event.currentTarget.getBoundingClientRect().top - 22
+        // let _elleft = event.currentTarget.getBoundingClientRect().left - 278
+        // // $el.style = `left: ${_elleft}px;top:${_eltop}px`
+        // $el.style[transform] = `translate3d(${_elleft}px,${_eltop}px,0)`
+        // $el.style.transition = 'all 0.5s'
+        // let _shopCarTop = _shopCar.getBoundingClientRect().top
+        // let _shopCarLeft = _shopCar.getBoundingClientRect().left
+        // $el.style[transform] = `translate3d(${_shopCarLeft}px,${_shopCarTop}px,0)`
         event.stopPropagation()
         if (!this.$store.state.option.user.logged) {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
@@ -126,8 +142,8 @@
     height: 30px;
     font-size: 12px;
     border: 1px solid #5078cb;
+    position: relative;
   }
-
   .btn-add-cart {
     margin-top: 10px;
     color: #214797;

+ 24 - 5
components/common/upload/upload.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
     <div class="preview">
-      <img :src="qualifications.url==''? uploadImgTemp : isPdf?'/images/all/timg.png':qualifications.url" class="previewImage" :class="{'mobile-previewImage': isMobile}"/>
+      <img :src="qualifications.url==''? uploadImgTemp : isPdf?'/images/all/timg.png':qualifications.url" class="previewImage" :class="{'mobile-previewImage': isMobile}"
+        :style="imgStyle"
+      />
       <input type="file" v-if="!qualifications.url" class="com-input" @change="update" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" />
     </div>
     <div class="hover-show" v-if="qualifications.url && !noReview">
@@ -21,7 +23,7 @@
 </template>
 <script>
   export default {
-    props: ['typeData', 'url', 'NopassThree', 'noReview', 'maxSize'],
+    props: ['typeData', 'url', 'NopassThree', 'noReview', 'maxSize', 'imgStyle', 'HASPDF'],
     data () {
       return {
         qualifications: {
@@ -35,6 +37,7 @@
     watch: {
       url: function (val, oldVal) {
         if (val && val !== '') {
+          console.log(val)
           this.qualifications.url = val
         }
       }
@@ -44,6 +47,9 @@
         return this.isMobile ? '/images/mobile/openStore/upload.png' : '/images/all/upload-apply.png'
       }
     },
+    mounted() {
+      this.qualifications.url = this.url
+    },
     methods: {
       update (e) {
         let file = e.target.files[0]
@@ -62,6 +68,9 @@
         let param = new FormData()
         param.append('file', file, file.name)
         param.append('chunk', '0')
+        if (this.HASPDF === false && file.type === 'application/pdf') {
+          this.$emit('remindAction', `请选择有效图片进行上传`)
+        }
         if (file.type !== 'application/pdf') {
           let config = {
             headers: {'Content-Type': 'multipart/form-data'}
@@ -106,9 +115,19 @@
 </script>
 <style scoped>
   .mobile-previewImage {
-    width: .5rem !important;
-    height: .5rem !important;
+    width: .5rem;
+    height: .5rem ;
     display: block;
-    margin: .3rem auto 0 !important;
+    margin: .3rem auto 0;
+  }
+  .com-input{
+    width: 100%;
+    height: 100%;
+    text-align: center;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    opacity: 0;
+    display: inline-block !important;
   }
 </style>

+ 13 - 13
components/default/Header.vue

@@ -1,11 +1,11 @@
 <template>
   <header class="header">
-    <div class="apply-adv" v-if="isShowApplyAdv">
-      <a href="/applyPurchase#opportunities">
-        <img src="/images/applyPurchase/apply-top-ad.jpg" alt="">
-      </a>
-      <i @click="ShowApplyAdv = false"></i>
-    </div>
+    <!--<div class="apply-adv" v-if="isShowApplyAdv">-->
+      <!--<a href="/applyPurchase#opportunities">-->
+        <!--<img src="/images/applyPurchase/apply-top-ad.jpg" alt="">-->
+      <!--</a>-->
+      <!--<i @click="ShowApplyAdv = false"></i>-->
+    <!--</div>-->
     <nav class="navbar">
       <div class="navbar-container container">
         <div class="navbar-header">
@@ -76,17 +76,17 @@
 //        searchEnterpriseArr: [],
 //        keyword: '',
 //        isSearching: false
-        ShowApplyAdv: true,
+//         ShowApplyAdv: true,
         showEnterpriseToggle: false
       }
     },
     computed: {
-      isShowApplyAdv () {
-        if (this.$route.path.indexOf('/applyPurchase') === -1) {
-          this.ShowApplyAdv = true
-        }
-        return this.ShowApplyAdv && this.$route.path.indexOf('/applyPurchase') !== -1
-      },
+      // isShowApplyAdv () {
+      //   if (this.$route.path.indexOf('/applyPurchase') === -1) {
+      //     this.ShowApplyAdv = true
+      //   }
+      //   return this.ShowApplyAdv && this.$route.path.indexOf('/applyPurchase') !== -1
+      // },
       user () {
         // console.log(this.$store.state.option.user)
         return this.$store.state.option.user

+ 70 - 2
components/default/RightBar.vue

@@ -8,7 +8,7 @@
           </a>
           <div class="sidebar-menu"><a @click="goShop" title="我的店铺" target="_blank">我的店铺</a></div>
         </li>
-        <li class="right-bar-item" @mouseenter="loadCarCount()">
+        <li class="right-bar-item" @mouseenter="loadCarCount()" id="shopCar">
           <a @click="goCart" class="title" target="_blank">
             <i class="iconfont icon-shopping-cart icon-xlg"></i>
           </a>
@@ -77,6 +77,14 @@
       size="tiny">
       <message-board @pageEvent="listenPage" @openBoardEvent="listenOpen"/>
     </el-dialog>
+
+    <div v-for="(ball, index) in balls" v-bind:key="index">
+      <transition name="drop" @before-enter="beforeEnter" @enter="enter" @after-enter="afterEnter">
+        <div class="ball" v-show="ball.show">
+          <div class="inner inner-hook"></div>
+        </div>
+      </transition>
+    </div>
   </div>
 </template>
 <script>
@@ -92,13 +100,18 @@
         count: 3,
         currentPage: 1,
         chatCount: 0,
-        showMyshop: false
+        showMyshop: false,
+        // balls: [],
+        dropBalls: []
       }
     },
     components: {
       MessageBoard
     },
     computed: {
+      balls() {
+        return this.$store.state.option.ballsList
+      },
       user () {
         // console.log(this.$store.state.option)
         return this.$store.state.option.user
@@ -126,6 +139,37 @@
       }
     },
     methods: {
+      beforeEnter(el) {
+        let count = this.balls.length
+        while (count--) {
+          let ball = this.balls[count]
+          if (ball.show) {
+            let rect = ball.el.getBoundingClientRect()
+            let x = -(rect.right - rect.left + 56)
+            let y = -(rect.top + window.innerHeight * 0.6)
+            el.style.webkitTransform = `translate3d(0, ${y}px,0)`
+            el.style.transform = `translate3d(0, ${y}px,0)`
+            el.style.display = ''
+            let inner = el.getElementsByClassName("inner-hook")[0]
+            inner.style.webkitTransform = `translate3d(${x}px, 0, 0)`
+            inner.style.transform = `translate3d(${x}px,0,0)`
+          }
+        }
+      },
+      enter(el, done) {
+        let rf = el.offestHeight
+        this.$nextTick(() => {
+          el.style.webkitTransform = 'translate3d(0, 0, 0)'
+          el.style.transform = 'translate3d(0, 0, 0)'
+          let inner = el.getElementsByClassName('inner-hook')[0]
+          inner.style.webkitTransform = 'translate3d(0, 0, 0)'
+          inner.style.transform = 'translate3d(0, 0, 0)'
+          el.addEventListener('transitionend', done)
+        })
+      },
+      afterEnter(el) {
+        this.$store.commit('option/SET_BALLSLIST_SUCCESS_DROP', el)
+      },
       listenPage: function (p) {
         this.page = p
         this.$store.dispatch('getMessageBoardInformation', {page: this.page, count: 3})
@@ -254,6 +298,16 @@
             })
         }
       }
+    },
+    mounted() {
+      this.$nextTick(() => {
+        let length = document.getElementsByClassName('ball')
+        let _top = parseInt(window.innerHeight * 0.6) + 36
+        for (let i = 0; i < length.length; i++) {
+          length[i].style.top = _top + 'px'
+          length[i].style.left = window.innerWidth + 'px'
+        }
+      })
     }
   }
 </script>
@@ -534,4 +588,18 @@ i {
     }
   }
 }
+.ball {
+  position: fixed;
+  right: 0;
+  z-index: 200;
+  bottom: calc(100vh * 0.4);
+  transition: all 0.4s cubic-bezier(0.49,-0.29,0.75, 0.14);
+}
+.ball .inner {
+  width: 16px;
+  height: 16px;
+  border-radius: 50%;
+  background: rgb(0, 160, 220);
+  transition: all 0.4s linear
+}
 </style>

+ 2 - 1
components/help/helpHeader.vue

@@ -34,9 +34,10 @@
 <style scoped>
   .user_center {
     width: 100%;
-    margin: 0px auto;
+    margin: 0 auto;
     height: 80px;
     background: #5078cb;
+    margin-top:-20px;
   }
   .wid1190{
     width: 100%;

+ 2 - 2
components/main/Nav.vue

@@ -83,9 +83,9 @@
       },
       goB2B () {
         if (this.user.logged) {
-          window.location.href = `${process.env.uasUrl}/#/index`
+          window.location.href = `${process.env.uasUrl}#/sale/pubinquiry`
         } else {
-          this.$router.push('/btbBusiness')
+          this.login()
         }
       }
     }

+ 112 - 22
components/main/Search.vue

@@ -1,13 +1,19 @@
 <template>
-  <div class="search-box" :class="{'search-box2': !SelectItem}">
+  <div class="search-box"><!-- :class="{'search-box2': !SelectItem}"-->
     <div class="input-group">
       <template v-if="!isPcb">
-        <select v-model="searchType" class="form-control select-type select-adder" v-if="SelectItem">
+        <div class="type">
+          <span class="type-item" :class="{active: newSearchType == 'component'}" @click="setNewSearchType('component')">型号</span>
+          <span class="type-item" :class="{active: newSearchType == 'kind'}" @click="setNewSearchType('kind')">物料名称</span>
+          <span class="type-item" :class="{active: newSearchType == 'store'}" @click="setNewSearchType('store')">卖家</span>
+          <span class="type-item" :class="{active: newSearchType == 'brand'}" @click="setNewSearchType('brand')">品牌</span>
+        </div>
+        <!--<select v-model="searchType" class="form-control select-type select-adder" v-if="SelectItem">
           <option value="product">产品</option>
           <option value="store">店铺</option>
-        </select>
+        </select>-->
         <input v-model="keyword" type="text" class="search-input form-control input-primary"
-               :placeholder="searchType === 'product' ? '品牌/物料名称/型号' : '店铺名称'"
+               :placeholder="placeholderByType"
                @focus.stop.prevent="onFocus()"
                @blur.stop.prevent="onBlur()"
                @keyup.40="onSelectChange(1)"
@@ -31,10 +37,14 @@
     </div>
     <ul class="association"
         :class="{'association2': !SelectItem, 'pcb-asso': isPcb}"
-        v-show="showAssociate && searchType == 'product'"
+        v-show="showAssociate"
         @mouseenter="associate.focus=true"
         @mouseleave="associate.focus=false">
-      <li v-if="similarKeywords.data.brand && similarKeywords.data.brand.length > 0" class="similar-title">品牌:</li>
+      <li v-for="(v, index) in similarKeywords.result" class="item"
+          :class="{'active': index==associate.activeIndex}"
+          @click.stop.prevent="onAssociateClick(v.value)">{{v.value}}
+      </li>
+     <!-- <li v-if="similarKeywords.data.brand && similarKeywords.data.brand.length > 0" class="similar-title">品牌:</li>
       <li v-for="(k, index) in similarKeywords.data.brand" class="item"
           :class="{'active': index==associate.activeIndex}"
           @click.stop.prevent="onAssociateClick(isCnStart() ? k.nameCn : k.nameEn)">{{ isCnStart() ? k.nameCn : k.nameEn }}
@@ -48,7 +58,7 @@
       <li v-for="(k, index) in similarKeywords.data.component" class="item"
           :class="{'active': index==associate.activeIndex}"
           @click.stop.prevent="onAssociateClick(k.code)">{{ k.code }}
-      </li>
+      </li>-->
     </ul>
     <div class="search-hot" v-if="SelectItem">
       <ul class="list-untyled">
@@ -88,7 +98,10 @@
           activeIndex: null
         },
         click_flag: false,
-        searchType: 'product'
+        searchType: 'product',
+        // 新版搜索控制变量
+        newSearchType: 'component',
+        isInit: false
       }
     },
     computed: {
@@ -99,13 +112,38 @@
         return this.$store.state.hotSearchBrand.hot.data
       },
       similarKeywords () {
-        return this.$store.state.search.keywords
+        let list = []
+        let data = this.$store.state.search.keywords.data.result
+        if (data && data.length > 0) {
+          data.forEach(item => {
+            if (this.newSearchType === 'component' && item.code) {
+              list.push({
+                value: item.code
+              })
+            } else if (this.newSearchType === 'kind' && item.nameCn) {
+              list.push({
+                value: item.nameCn
+              })
+            } else if (this.newSearchType === 'store' && item.name) {
+              list.push({
+                value: item.name
+              })
+            } else if (this.newSearchType === 'brand' && item.nameEn) {
+              list.push({
+                value: item.nameEn
+              })
+            }
+          })
+        }
+        return {
+          result: list
+        }
       },
       showAssociate () {
         return this.keyword &&
           this.associate.show &&
-          this.similarKeywords.data &&
-          (this.similarKeywords.data.brand || this.similarKeywords.data.component || this.similarKeywords.data.kind)
+          this.similarKeywords.result &&
+          this.similarKeywords.result.length
       },
       hotSearchData () {
         let list = this.$store.state.floor.list_v3.data
@@ -134,16 +172,46 @@
           return tmp || true
         }
         return true
+      },
+      placeholderByType () {
+        let type
+        switch (this.newSearchType) {
+          case 'component':
+            type = '型号'
+            break
+          case 'brand':
+            type = '品牌'
+            break
+          case 'kind':
+            type = '物料名称'
+            break
+          case 'store':
+            type = '卖家名称'
+            break
+          default:
+            type = '型号'
+        }
+        return `请输入${type}`
       }
     },
     watch: {
       'keyword': {
         handler (val, oldVal) {
-          let keywords = this.similarKeywords.data
-          if (!keywords || !keywords.length || this.associate.activeIndex === null || val !== keywords[this.associate.activeIndex]) {
+          let keywords = this.similarKeywords
+          if (!keywords.result || !keywords.result.length || this.associate.activeIndex === null || val !== keywords[this.associate.activeIndex]) {
             this.onChange()
           }
         }
+      },
+      '$route': {
+        handler: function (route) {
+          if (route.path === '/search') {
+            this.newSearchType = route.query.type || 'component'
+            this.keyword = route.query.w || ''
+          }
+          this.isInit = true
+        },
+        immediate: true
       }
     },
     methods: {
@@ -162,7 +230,7 @@
         this.associate.show = this.associate.focus
       },
       onSelectChange (count) {
-        let keywords = this.similarKeywords.data
+        let keywords = this.similarKeywords
         if (keywords && keywords.length) {
           let index = this.associate.activeIndex
           if (index === null) {
@@ -184,7 +252,11 @@
           this.associate.show = false
           this.$store.dispatch('resetSearchKeywords')
         } else {
-          this.searchKeywords()
+          if (!this.isInit) {
+            this.searchKeywords()
+          } else {
+            this.isInit = false
+          }
         }
         if (this.click_flag) {
           this.associate.show = false
@@ -192,10 +264,8 @@
         }
       },
       searchKeywords () {
-        if (this.searchType === 'product') {
-          this.associate.show = true
-          this.$store.dispatch('searchKeywords', { keyword: this.keyword })
-        }
+        this.associate.show = true
+        this.$store.dispatch('searchKeywords', { keyword: this.keyword, type: this.newSearchType })
       },
       onSearch () {
         document.getElementsByClassName('search-input')[0].blur()
@@ -206,7 +276,7 @@
             this.$router.push({path: '/pcb/search?w=' + encodeURIComponent(this.keyword)})
           } else {
             if (this.searchType === 'product') {
-              this.$router.push({path: '/search?w=' + encodeURIComponent(this.keyword)})
+              this.$router.push({path: `/search?w=${encodeURIComponent(this.keyword)}&type=${this.newSearchType}`})
             } else if (this.searchType === 'store') {
               this.$router.push({path: '/searchStore?w=' + encodeURIComponent(this.keyword)})
             }
@@ -222,6 +292,9 @@
         if (this.keyword && this.keyword.length > 0) {
           return this.keyword.charCodeAt(0) > 255
         }
+      },
+      setNewSearchType (type) {
+        this.newSearchType = type
       }
     },
     created () {
@@ -239,7 +312,7 @@
     height: 40px;
     position: relative;
     .search-input{
-      width: 372px;
+      width: 441px;
       float: left;
     }
     .search-input, .search-btn {
@@ -309,7 +382,7 @@
 
     .association {
       position: absolute;
-      left: 69px;
+      left: 0;
       top: 100%;
       right: 81px;
       background: $white;
@@ -345,6 +418,23 @@
       left: 2px;
       right: 71px
     }
+
+    .input-group {
+      .type {
+        position: absolute;
+        top: -21px;
+        .type-item {
+          padding: 4px 12px;
+          color: #5078cb;
+          font-size: 14px;
+          cursor: pointer;
+          &.active, &:hover {
+            background: #4071c6;
+            color: #fff;
+          }
+        }
+      }
+    }
   }
 
   .search-box2 {

+ 133 - 191
components/mobile/applyPurchase/PublishSeek.vue

@@ -1,70 +1,65 @@
 <template>
-  <div class="mobile-modal" v-if="showSayPriceBox" @click="setShowCurrencyList(false)" @touchmove="preventTouchMove($event)">
-    <div class="mobile-modal-box">
-      <div class="mobile-modal-header">
-        <i class="icon-guanbi iconfont" @click="cancel"></i>
+  <div class="publish_seek_mobile">
+    <div class="publish-seek">
+      <div class="content-line">
+        <span><i>*</i>品牌:</span>
+        <input type="text" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" placeholder="请勿填中文符号">
+        <ul class="similar brand-similar-list" v-show="showSimilarBrandList && applyObj.brand">
+          <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
+        </ul>
       </div>
-      <div class="publish-seek">
-        <div class="content-line">
-          <span><i>*</i>品牌:</span>
-          <input type="text" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" placeholder="请勿填中文符号">
-          <ul class="similar brand-similar-list" v-show="showSimilarBrandList && applyObj.brand">
-            <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
-          </ul>
-        </div>
-        <div class="content-line">
-          <span><i>*</i>物料名称(类目):</span>
-          <input type="text" v-model="applyObj.prodTitle" @blur="checkProdTitle" @input="onProdTitleInput">
-        </div>
-        <div class="content-line">
-          <span><i>*</i>型号:</span>
-          <input type="text" v-model="applyObj.code" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号">
-          <ul class="similar" v-show="showSimilarCodeList && applyObj.code">
-            <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
-          </ul>
-        </div>
-        <div class="content-line">
-          <span>规格:</span>
-          <input type="text" v-model="applyObj.spec" @blur="checkSpec" @input="onSpecInput">
-        </div>
-        <div class="content-line">
-          <span><i>*</i>截止日期:</span>
-          <input type="date" v-model="applyObj.deadline" :min="minDay" :max="maxDay" @blur="deadlineChange">
-          <!--<el-date-picker-->
-            <!--v-model="applyObj.deadline"-->
-            <!--type="date"-->
-            <!--:editable="false"-->
-            <!--:clearable="true"-->
-            <!--size="mini">-->
-          <!--</el-date-picker>-->
-        </div>
-        <!--<div class="content-line">
-          <span>币种:</span>
-          <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">
-            <li @click="setCurrency('不限')">不限</li>
-            <li @click="setCurrency('RMB')">RMB</li>
-            <li @click="setCurrency('USD')">USD</li>
-          </ul>
-        </div>-->
-        <div class="content-line">
-          <span>数量(PCS):</span>
-          <input type="text" v-model="applyObj.amount" @blur="checkAmount" @input="onAmountInput">
-        </div>
-        <!--<div class="content-line">
-          <span>生产日期:</span>
-          <input type="text" v-model="applyObj.produceDate" @input="onProduceDateChange">
-        </div>-->
-        <a @click="authorityInterceptor(baseUrls.userPublishSeek, goPublish)">确认发布</a>
+      <div class="content-line">
+        <span><i>*</i>物料名称(类目):</span>
+        <input type="text" v-model="applyObj.prodTitle" @blur="checkProdTitle" @input="onProdTitleInput">
       </div>
+      <div class="content-line">
+        <span><i>*</i>型号:</span>
+        <input type="text" v-model="applyObj.code" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号">
+        <ul class="similar" v-show="showSimilarCodeList && applyObj.code">
+          <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
+        </ul>
+      </div>
+      <div class="content-line">
+        <span>规格:</span>
+        <input type="text" v-model="applyObj.spec" @blur="checkSpec" @input="onSpecInput">
+      </div>
+      <div class="content-line">
+        <span><i>*</i>截止日期:</span>
+        <input type="date" v-model="applyObj.deadline" :min="minDay" :max="maxDay" @blur="deadlineChange">
+        <!--<el-date-picker-->
+        <!--v-model="applyObj.deadline"-->
+        <!--type="date"-->
+        <!--:editable="false"-->
+        <!--:clearable="true"-->
+        <!--size="mini">-->
+        <!--</el-date-picker>-->
+      </div>
+      <!--<div class="content-line">
+        <span>币种:</span>
+        <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">
+          <li @click="setCurrency('不限')">不限</li>
+          <li @click="setCurrency('RMB')">RMB</li>
+          <li @click="setCurrency('USD')">USD</li>
+        </ul>
+      </div>-->
+      <div class="content-line">
+        <span>数量(PCS):</span>
+        <input type="text" v-model="applyObj.amount" @blur="checkAmount" @input="onAmountInput">
+      </div>
+      <!--<div class="content-line">
+        <span>生产日期:</span>
+        <input type="text" v-model="applyObj.produceDate" @input="onProduceDateChange">
+      </div>-->
     </div>
+    <a @click="authorityInterceptor(baseUrls.userPublishSeek, goPublish)">确认发布</a>
   </div>
 </template>
 <script>
   export default {
-    props: ['showSayPriceBox'],
+    props: ['dataObj'],
     data () {
       return {
         applyObj: {
@@ -106,29 +101,19 @@
         return deadDate
       }
     },
-    watch: {
-      showSayPriceBox: function (val, old) {
-        this.emptyForm()
-//        if (val) {
-//          document.body.style.position = 'fixed'
-//          document.body.style.left = '0'
-//          document.body.style.right = '0'
-//        } else {
-//          document.body.style.position = 'static'
-//        }
-      }
-    },
     mounted () {
       let _this = this
+      if (this.dataObj) {
+        this.applyObj = this.dataObj
+      } else {
+        this.emptyForm()
+      }
       document.body.onclick = function () {
         _this.showSimilarCodeList = false
         _this.showSimilarBrandList = false
       }
     },
     methods: {
-      cancel: function () {
-        this.$emit('cancelAction')
-      },
       emptyForm: function () {
         for (let attr in this.applyObj) {
           this.applyObj[attr] = attr === 'currency' ? '不限' : ''
@@ -147,6 +132,7 @@
         return this.$http.get('/productuser/match/getKind', {params: {cmpCode: code, brand: brand}})
       },
       goPublish: function () {
+        console.log('12', this.applyObj)
         if (this.checkAll()) {
           this.getMaterialKind(this.applyObj.code, this.applyObj.brand).then(response => {
             let inquiry = {}
@@ -186,16 +172,11 @@
             inquiry.currency = currency
             this.$http.post('/inquiry/buyer/save', inquiry)
               .then(response => {
-                //              this.$message.success('发布成功')
                 this.setRemindText('发布成功')
-                //                this.showRemindBox = true
                 this.emptyForm()
-                //                this.validObj.deadline = true
                 this.$emit('reloadAction')
-                this.cancel()
               }, error => {
                 console.log(error)
-                //              this.$message.error('发布失败')
                 this.setRemindText('发布失败')
               })
           })
@@ -368,129 +349,90 @@
   }
 </script>
 <style lang="scss" scoped>
-  .mobile-modal {
-    .mobile-modal-box {
-      position: fixed;
-      width: 5.92rem;
-      font-size: .28rem;
-      top: 50%;
-      left: 50%;
-      right: 11%;
-      z-index: 1000;
-      margin-top: -3.7rem;
-      margin-left: -2.96rem;
+  .publish_seek_mobile{
+    padding:.2rem;
+    .publish-seek {
       background: #fff;
-      .mobile-modal-header {
-        font-size: .38rem;
-        background: #fff;
-        background: url(/images/mobile/@2x/applyPurchase/pub.png) no-repeat;
-        background-size: cover;
-        height: 1.51rem;
-        i {
-          top: -.36rem;
+      padding: .1rem;
+      border-radius:.1rem;
+      .content-line {
+        position: relative;
+        height: 1rem;
+        line-height: 1rem;
+        font-size: .26rem;
+        text-align: left;
+        border-bottom:1px solid #d3d3d3;
+        &:last-child{
+          border:none;
         }
-      }
-      .publish-seek {
-        background: #fff;
-        padding-top: .1rem;
-        padding-bottom: .4rem;
-        .content-line {
-          position: relative;
-          height: .8rem;
-          line-height: .8rem;
+        input {
+          width: 3.49rem;
+          height: .52rem;
+          border: none;
           font-size: .26rem;
-          text-align: left;
-          input {
-            width: 3.49rem;
-            height: .52rem;
-            line-height: normal;
-            padding: .1rem .19rem;
-            border: 1px solid #7e7e7e;
-            font-size: .26rem;
-            vertical-align: middle;
-            background: #fff;
-            border-radius: 0;
-          }
-          > span {
-            display: inline-block;
-            width: 2.26rem;
-            text-align: right;
-            i {
-              color: #ff0000;
-              margin-right: .05rem;
-              font-style: normal;
-            }
+          vertical-align: middle;
+          background: #fff;
+          border-radius: 0;
+        }
+        > span {
+          display: inline-block;
+          width: 2.5rem;
+          text-align: right;
+          color:#3176e9;
+          i {
+            color: #ff0000;
+            margin-right: .05rem;
+            font-style: normal;
           }
-          > a {
+        }
+        > a {
+          font-size: .26rem;
+          color: #666;
+        }
+        > img {
+          width: .12rem;
+          height: .06rem;
+          margin-left: .04rem;
+        }
+        .similar {
+          position: absolute;
+          width: 3.52rem;
+          max-height: 2.5rem;
+          overflow-y: auto;
+          z-index: 12;
+          border: 1px solid #7e7e7e;
+          border-radius: .05rem;
+          left: 2.25rem;
+          top: .7rem;
+          background: #fff;
+          li {
+            height: .5rem;
+            line-height: .5rem;
             font-size: .26rem;
-            color: #666;
-          }
-          > img {
-            width: .12rem;
-            height: .06rem;
-            margin-left: .04rem;
-          }
-          .similar {
-            position: absolute;
-            width: 3.52rem;
-            max-height: 2.5rem;
-            overflow-y: auto;
-            z-index: 12;
-            border: 1px solid #7e7e7e;
-            border-radius: .05rem;
-            left: 2.25rem;
-            top: .7rem;
-            background: #fff;
-            li {
-              height: .5rem;
-              line-height: .5rem;
-              font-size: .26rem;
-              color: #999;
-              padding-left: .19rem;
-              &:focus, &:active, &:hover {
-                background: #999;
-                color: #fff;
-              }
+            color: #999;
+            padding-left: .19rem;
+            &:focus, &:active, &:hover {
+              background: #999;
+              color: #fff;
             }
           }
-          /*> ul {
-            position: absolute;
-            top: .6rem;
-            left: 1.16rem;
-            z-index: 1;
-            width: 1.75rem;
-            background: #fff;
-            text-align: center;
-            border-radius: .1rem;
-            border: .02rem solid #dfdfdf;
-            -webkit-box-shadow: 0 0 .12rem .02rem #e2d9d975;
-            -moz-box-shadow:  0 0 .12rem .02rem #e2d9d975;
-            box-shadow:  0 0 .12rem .02rem #e2d9d975;
-            li {
-              height: .52rem;
-              line-height: .52rem;
-              border-bottom: .02rem solid #dfdfdf;
-              &:hover, &:active {
-                background: #dedede;
-              }
-            }
-          }*/
-        }
-        > a {
-          display: block;
-          width: 5.19rem;
-          height: .84rem;
-          text-align: center;
-          line-height: .84rem;
-          font-size: .38rem;
-          margin: .3rem auto 0;
-          background: #3f84f6;
-          color: #fff;
-          border-radius: .08rem;
         }
       }
     }
+    > a {
+      display: block;
+      width: 5.19rem;
+      height: .84rem;
+      text-align: center;
+      line-height: .84rem;
+      font-size: .38rem;
+      margin: .3rem auto 0;
+      background: #3176e9;
+      color: #fff;
+      border-radius: .08rem;
+    }
   }
+
   .datepicker-overlay {
     z-index: 9999;
     .cov-date-body {

+ 12 - 6
components/mobile/common/PullUp.vue

@@ -27,6 +27,10 @@
       isValid: {
         type: Boolean,
         default: true
+      },
+      FixedEl: { // 获取元素区域内滚动高度
+        type: Boolean,
+        default: false
       }
     },
     mounted () {
@@ -46,6 +50,7 @@
       scroll: function () {
         let scrolled = 0
         let height = 0
+        let availHeight = window.screen.availHeight
 //        console.log(document.getElementById(this.fixId).scrollHeight)
 //        console.log(document.getElementById(this.fixId).scrollTop + window.screen.availHeight + '-------')
         if (this.fixId) {
@@ -59,12 +64,13 @@
         } else {
           height = document.body.scrollHeight
           scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
-        }
-//        this.hideToTop = scrolled <= window.screen.availHeight
-//        console.log(this.hideToTop)
-//        console.log(this.allPage)
-//        console.log(this.page)
-        if (Math.ceil(scrolled + window.screen.availHeight) >= height && !this.searchMore && this.page < this.allPage) {
+        } if (this.FixedEl) {
+          let obj = document.getElementById(this.fixId)
+          // availHeight = document.getElementById(this.fixId).clientHeight + 50
+          if (obj.clientHeight + obj.scrollTop >= obj.scrollHeight && !this.searchMore && this.page < this.allPage) {
+            this.getMore()
+          }
+        } else if (Math.ceil(scrolled + availHeight) >= height && !this.searchMore && this.page < this.allPage) {
           this.getMore()
         }
       },

+ 124 - 71
components/mobile/search/MainSearch.vue

@@ -1,29 +1,44 @@
 <template>
   <div class="main-search" @touchstart="cancelFocus" @click="setShowSearchType(false)" id="main-search">
+    <!--<div class="main-search-header">-->
+      <!--<div class="options" @click="setShowSearchType(!showSearchType, $event)">-->
+        <!--{{searchType == 'product' ? '产品' : '店铺'}}-->
+        <!--<i></i>-->
+        <!--<ul v-if="showSearchType">-->
+          <!--<li @click="setSearchType(searchType == 'product' ? 'store' : 'product', $event)">{{searchType == 'product' ? '店铺' : '产品'}}</li>-->
+        <!--</ul>-->
+      <!--</div>-->
+      <!--<input type="text" id="search-box" v-model="keyword" @keyup.13="onSearch()">-->
+      <!--<span @click="onSearch()">搜索</span>-->
+      <!--<a @click="cancelSearch">取消</a>-->
+    <!--</div>-->
     <div class="main-search-header">
-      <div class="options" @click="setShowSearchType(!showSearchType, $event)">
-        {{searchType == 'product' ? '产品' : '店铺'}}
-        <i></i>
-        <ul v-if="showSearchType">
-          <li @click="setSearchType(searchType == 'product' ? 'store' : 'product', $event)">{{searchType == 'product' ? '店铺' : '产品'}}</li>
-        </ul>
-      </div>
-      <input type="text" id="search-box" v-model="keyword" @keyup.13="onSearch()">
+      <input type="text" v-model="keyword" id="search-box" @keyup.13="onSearch()" :placeholder="placeholder">
       <span @click="onSearch()">搜索</span>
-      <a @click="cancelSearch">取消</a>
+      <a @click="cancelSearch()">取消</a>
+      <div class="main-search-header-controll clearfix">
+        <span :class="ChooseTop === 'component' ? 'active' : ''" @click="setChangelistHander('component')"><a>型号</a></span>
+        <span :class="ChooseTop === 'kind' ? 'active' : ''" @click="setChangelistHander('kind')"><a>物料名称</a></span>
+        <span :class="ChooseTop === 'store' ? 'active' : ''" @click="setChangelistHander('store')"><a>卖家</a></span>
+        <span :class="ChooseTop === 'brand' ? 'active' : ''" @click="setChangelistHander('brand')"><a>品牌</a></span>
+      </div>
     </div>
     <ul class="associate-list" v-show="associate.show">
-      <li @click="onAssociateClick(similar)" v-for="similar in similarKeywords.all">
+      <li @click="onAssociateClick(similar)" v-for="similar in similarKeywords.result">
         <i class="icon-sousuo iconfont"></i>
-        <span>{{similar}}</span>
+        <span>{{Getsimilar(similar)}}</span>
+        <!--<span v-if="ChooseTop === 'component'">{{similar.code}}</span>-->
+        <!--<span v-else-if="ChooseTop === 'product'">{{similar}}</span>-->
+        <!--<span v-else-if="ChooseTop === 'store'">{{similar}}</span>-->
+        <!--<span v-else-if="ChooseTop === 'brand'">{{similar.nameEn}}</span>-->
       </li>
       <li @click="onAssociateClick(keyword)">查找“{{baseUtils.filterStringEllipsis(keyword, 30)}}”</li>
     </ul>
-    <div class="hot-history" v-show="!associate.show">
+    <div class="hot-history" v-show="!associate.show" style="margin-top: 2.08rem">
       <div class="search-history" v-if="searchHistory && searchHistory.length > 0">
         <p>历史搜索<i class="iconfont icon-lajitong" @click="deleteHistory"></i></p>
         <ul>
-          <li v-for="item in searchHistory" @click="onSearch(item)" v-if="item.keyword && item.keyword.trim().length">
+          <li v-for="item in searchHistory" @click="onSearch(item.keyword)" v-if="item.keyword && item.keyword.trim().length">
             <a>{{item.keyword}}</a>
           </li>
         </ul>
@@ -49,7 +64,8 @@
           show: false
         },
         searchType: 'product',
-        showSearchType: false
+        showSearchType: false,
+        ChooseTop: 'component'
       }
     },
     props: {
@@ -78,23 +94,32 @@
 //      }
 //    },
     methods: {
+      setChangelistHander(str) {
+        this.ChooseTop = str
+        if (!this.keyword) return
+        this.$store.dispatch('searchKeywords', {keyword: this.keyword, type: this.ChooseTop})
+        this.associate.show = true
+      },
       onSearch (item) {
-        if (item) {
-          this.keyword = item.keyword
-          if (item.type === 'SEARCH_STORE') {
-            this.$router.push('/mobile/shop?keyword=' + encodeURIComponent(this.keyword))
-          } else if (item.type === 'SEARCH_PRODUCT') {
-            this.$router.push('/mobile/search?w=' + encodeURIComponent(this.keyword))
-          }
-        } else {
-          if (this.keyword) {
-            if (this.searchType === 'product') {
-              this.$router.push('/mobile/search?w=' + encodeURIComponent(this.keyword))
-            } else if (this.searchType === 'store') {
-              this.$router.push('/mobile/shop?keyword=' + encodeURIComponent(this.keyword))
-            }
-          }
+        if (this.keyword) {
+          this.$router.push(`/mobile/search/newkeycode?choosetype=${this.ChooseTop}&keyword=${encodeURIComponent(this.keyword)}`)
         }
+        // if (item) {
+        //   this.keyword = item.keyword
+        //   if (item.type === 'SEARCH_STORE') {
+        //     this.$router.push('/mobile/shop?keyword=' + encodeURIComponent(this.keyword))
+        //   } else if (item.type === 'SEARCH_PRODUCT') {
+        //     this.$router.push('/mobile/search?w=' + encodeURIComponent(this.keyword))
+        //   }
+        // } else {
+        //   if (this.keyword) {
+        //     if (this.searchType === 'product') {
+        //       this.$router.push('/mobile/search?w=' + encodeURIComponent(this.keyword))
+        //     } else if (this.searchType === 'store') {
+        //       this.$router.push('/mobile/shop?keyword=' + encodeURIComponent(this.keyword))
+        //     }
+        //   }
+        // }
       },
       onChange () {
         if (!this.keyword) {
@@ -108,15 +133,32 @@
         }
       },
       searchKeywords () {
-        if (this.searchType === 'product') {
-          this.$store.dispatch('searchKeywords', { keyword: this.keyword })
-          this.associate.show = true
-        }
+        this.$store.dispatch('searchKeywords', {keyword: this.keyword, type: this.ChooseTop})
+        this.associate.show = true
       },
       onAssociateClick (word) {
-        this.keyword = word
+        if (this.ChooseTop === 'component') {
+          this.keyword = word.code
+        } else if (this.ChooseTop === 'kind') {
+          this.keyword = word.nameCn
+        } else if (this.ChooseTop === 'store') {
+          this.keyword = word.name
+        } else if (this.ChooseTop === 'brand') {
+          this.keyword = word.nameEn
+        }
         this.onSearch()
       },
+      Getsimilar(word) {
+        if (this.ChooseTop === 'component') {
+          return word.code
+        } else if (this.ChooseTop === 'kind') {
+          return word.nameCn
+        } else if (this.ChooseTop === 'store') {
+          return word.name
+        } else if (this.ChooseTop === 'brand') {
+          return word.nameEn
+        }
+      },
       cancelSearch: function () {
         this.$emit('cancelSearchAction')
       },
@@ -169,11 +211,31 @@
       },
       searchHistory () {
         return this.$store.state.searchData.searchHistory.searchHistory.data
+      },
+      placeholder() {
+        if (this.ChooseTop === 'cmpcode') {
+          return '请输入您要搜索的型号'
+        } else if (this.ChooseTop === 'materiel') {
+          return '请输入您要搜索的物料名称'
+        } else if (this.ChooseTop === 'seller') {
+          return '请输入您要搜索的卖家名称'
+        } else if (this.ChooseTop === 'cmpbrand') {
+          return '请输入您要搜索的品牌'
+        }
       }
     }
   }
 </script>
 <style lang="scss" scoped>
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
   .main-search {
     background: #fff;
     width: 100%;
@@ -182,20 +244,20 @@
     top: 0;
     bottom: 0;
     .main-search-header {
-      position: relative;
-      height: .88rem;
+      position: absolute;
       background: #3e82f5;
-      padding-left: .3rem;
       line-height: .88rem;
       margin-top: 0;
       z-index: 1;
+      width: 100%;
       input {
         width: 4.88rem;
         height: .62rem;
         line-height: .62rem;
         font-size: .26rem;
         color: #999;
-        padding-left: 1.26rem;
+        margin-left: 0.3rem;
+        /*padding-left: 1.26rem;*/
         border: .04rem solid #fff;
         background: #fff;
         outline: none;
@@ -226,49 +288,41 @@
         color: #fff;
         margin-left: .2rem;
       }
-      .options {
-        position: absolute;
-        left: .3rem;
-        width: 1.25rem;
-        padding-left: .25rem;
-        background: url(/images/mobile/@2x/search/select-arrow-blue.jpg) no-repeat;
-        background-size: .14rem .12rem;
-        background-position: .92rem .36rem;
-        color: #3e82f5;
-        font-size: .3rem;
-        i {
-          height: .46rem;
-          width: .01rem;
-          background: #eceef0;
-          display: block;
-          float: right;
-          margin-top: .18rem;
-        }
-        ul {
-          position: absolute;
-          left: 0;
-          top: .54rem;
-          z-index: -1;
-          li {
-            width: 1.25rem;
-            height: .99rem;
-            border-radius: .05rem;
-            background: #666;
-            color: rgba(255, 255, 255, 0.89);
-            text-align: center;
-            line-height: 1.2rem;
-            font-size: .3rem;
+      .main-search-header-controll {
+        background: #3e82f5;
+        span {
+          padding: 0 0.2rem;
+          @include lineHeight(0.66rem);
+          font-size: 0.28rem;
+          color: #fff;
+          margin: 0;
+          background: rgba(0,0,0,0);
+          border-radius: 0;
+          width: auto;
+          &.active a{
+            color: #fff;
+            border-bottom: 0.04rem solid #fff;
           }
         }
       }
     }
     .associate-list {
+      position: absolute;
+      width: 100%;
       background: #fff;
+      top: 0.8rem;
+      border: 1px solid #dcdcdc;
+      z-index: 100;
+      height: 100%;
+      left: 0;
+      bottom: 0;
+      right: 0;
       li {
         height: 0.7rem;
         line-height: .9rem;
         margin: 0 .45rem;
         border-bottom: .04rem solid #f1f0f0;
+        @include overFlowHidden();
         i {
           font-size: .36rem;
           margin-right: .24rem;
@@ -298,7 +352,6 @@
     .hot-history {
       .search-history {
         padding-left: .51rem;
-        padding-top: .38rem;
         >p {
           font-size: .3rem;
           color: #333;

+ 17 - 15
components/mobile/store/StoreDetail.vue

@@ -97,42 +97,42 @@
             <div class="list">
               <div class="fl">
                 <div class="name">品牌:</div>
-                <div class="text">{{item.brandNameEn}}</div>
+                <div class="text overHidden" style="width: 2.3rem">{{item.brandNameEn}}</div>
               </div>
               <div class="fl">
                 <div class="name">交期(天):</div>
-                <div class="text" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery != item.b2cMinDelivery)" v-text="item.b2cMinDelivery + '-'+ item.b2cMaxDelivery"></div>
-                <div class="text" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery == item.b2cMinDelivery)" v-text="item.b2cMinDelivery"></div>
+                <div class="text overHidden" style="width: 1.8rem" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery != item.b2cMinDelivery)" v-text="item.b2cMinDelivery + '-'+ item.b2cMaxDelivery"></div>
+                <div class="text overHidden" style="width: 1.8rem" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery == item.b2cMinDelivery)" v-text="item.b2cMinDelivery"></div>
               </div>
             </div>
             <div class="list">
               <div class="fl">
                 <div class="name">物料名称(类目):</div>
-                <div class="text">{{item.kindNameCn || '-'}}</div>
+                <div class="text overHidden" style="width: 1rem">{{item.kindNameCn || '-'}}</div>
               </div>
               <div class="fl">
                 <div class="name">库存:</div>
-                <div class="text">{{item.reserve || '-'}}</div>
+                <div class="text overHidden" style="width: 2.3rem">{{item.reserve || '-'}}</div>
               </div>
             </div>
             <div class="list">
               <div class="fl">
                 <div class="name">型号:</div>
-                <div class="text">{{item.code || '-'}}</div>
+                <div class="text overHidden" style="width: 2.3rem">{{item.code || '-'}}</div>
               </div>
               <div class="fl">
                 <div class="name">起拍:</div>
-                <div class="text">{{item.minBuyQty || '-'}}</div>
+                <div class="text overHidden" style="width: 2.3rem">{{item.minBuyQty || '-'}}</div>
               </div>
             </div>
             <div class="list">
               <div class="fl">
                 <div class="name">规格:</div>
-                <div class="text">{{item.spec || '-'}}</div>
+                <div class="text overHidden" style="width: 2.3rem">{{item.spec || '-'}}</div>
               </div>
               <div class="fl">
                 <div class="name">包装:</div>
-                <div class="text">{{item.packaging || '无包装信息'}}</div>
+                <div class="text overHidden" style="width: 2.3rem">{{item.packaging || '无包装信息'}}</div>
               </div>
             </div>
             <div class="list">
@@ -144,7 +144,7 @@
               </div>
               <div class="fl">
                 <div class="name">生产日期:</div>
-                <div class="text" :title="item.produceDate">{{item.produceDate || '-'}}</div>
+                <div class="text overHidden" style="width: 1.75rem" :title="item.produceDate">{{item.produceDate || '-'}}</div>
               </div>
             </div>
             <div class="list">
@@ -406,7 +406,11 @@
     background: #f7f7f7;
     top: 5% !important;
   }
-
+  .overHidden {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
   .store-detail {
     padding: 0 !important;;
     margin: 0.88rem auto 0rem;
@@ -641,9 +645,6 @@
         .fl {
           width: 3.2rem;
           float: left;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
         }
         .fr {
           text-align: left;
@@ -665,7 +666,8 @@
         .text {
           display: inline-block;
           color: #333;
-          font-size: 0.28rem
+          font-size: 0.28rem;
+          vertical-align: top;
         }
         .table {
           width: 5.25rem;

+ 1 - 1
components/personalMaterial/PersonalMaterial.vue

@@ -425,7 +425,7 @@
       position: fixed;
       top: 23%;
       left: 31%;
-      z-index: 10;
+      z-index: 102;
       width: 577px;
       height: 239px;
       background: #fff;

+ 9 - 2
components/product/brand/BrandDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="brandDetail container">
-    <div class="menu-com row">
+    <div class="menu-com row" v-if="!supBrandObj">
       <div class="menu-title col-md-12">
         <a href="/product/brand/brandList/A">品牌中心</a> > <span>{{list.nameEn}}</span>
       </div>
@@ -27,6 +27,13 @@
 <script>
   export default {
     name: 'BrandsDetail',
+    // 主动传入的品牌
+    props: {
+      supBrandObj: {
+        type: Object,
+        default: null
+      }
+    },
     data () {
       return {
         applications: []
@@ -59,7 +66,7 @@
     },
     computed: {
       list () {
-        let list = this.baseUtils.deepCopy(this.$store.state.brandDetail.detail.data)
+        let list = this.supBrandObj || this.baseUtils.deepCopy(this.$store.state.brandDetail.detail.data)
         if (list.application && list.application !== '') {
           this.applications = list.application.split(',')
         }

+ 2 - 2
components/product/component/ComponentDetail.vue

@@ -17,13 +17,13 @@
             <div class="message-detail" v-if="list.brand">
               <div class="message-item">品牌</div>
               <div class="colon">:</div>
-              <div :title="list.brand.nameCn"><a class="message-body blue" target="_blank" :href="`/product/brand/${list.brand.uuid}`">{{list.brand.nameCn}}</a></div>
+              <div :title="list.brand ? list.brand.nameCn : ''"><a class="message-body blue" target="_blank" :href="`/product/brand/${list.brand.uuid}`">{{list.brand && list.brand.nameCn ?  list.brand.nameCn : ''}}</a></div>
             </div>
             <div class="message-detail">
               <div class="message-item">物料名称(类目)</div>
               <div class="colon">:</div>
               <div class="message-body body-long">
-                {{list.kind.nameCn || '-'}}
+                {{list.kind && list.kind.nameCn ? list.kind.nameCn : '-'}}
               </div>
             </div>
             <div class="message-detail">

+ 112 - 0
components/search/BrandList.vue

@@ -0,0 +1,112 @@
+<template>
+  <div class="search-brand-list">
+    <ul>
+      <nuxt-link :key="item.id" :to="`/search?w=${encodeURIComponent(item.nameEn)}&type=brand`" tag="li" v-for="item in brands">
+        <div class="img inline-block">
+          <img :src="item.logoUrl || '/images/component/default.png'" alt="">
+        </div>
+        <div class="params inline-block">
+          <p>
+            <span class="title inline-block">主营产品:</span>
+            <span class="content inline-block" :title="item.series">{{item.series}}</span>
+          </p>
+          <p>
+            <span class="title inline-block">应用领域:</span>
+            <span class="content inline-block" :title="item.applications">{{item.applications}}</span>
+          </p>
+          <p>
+            <span class="title inline-block">品牌介绍:</span>
+            <span class="content inline-block" :title="item.brief">{{item.brief}}</span>
+          </p>
+          <p>
+            <span class="title inline-block">官网地址:</span>
+            <span class="content inline-block" :title="item.url">{{item.url}}</span>
+          </p>
+        </div>
+        <button>了解详情</button>
+      </nuxt-link>
+    </ul>
+  </div>
+</template>
+<script>
+  export default {
+    computed: {
+      brands () {
+        let brands = this.baseUtils.deepCopy(this.$store.state.searchData.searchList.listNew.data.content) || []
+        if (brands.length) {
+          brands.forEach(item => {
+            if (item.application && item.application !== '') {
+              item.applications = item.application.split(',').join('|')
+            }
+          })
+        }
+        return brands
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .search-brand-list {
+    li {
+      border: 1px solid #e8e8e8;
+      border-bottom: none;
+      padding: 29px 18px 25px 30px;
+      &:last-child {
+        border-bottom: 1px solid #e8e8e8;
+      }
+      .img {
+        width: 208px;
+        height: 156px;
+        text-align: center;
+        line-height: 154px;
+        border-radius: 2px;
+        background: #fff;
+        border: 1px solid #e2e2e2;
+        img {
+          max-width: 186px;
+          max-height: 152px;
+        }
+      }
+      .params {
+        margin-left: 12px;
+        width: 743px;
+        color: #666;
+        p {
+          margin-top: 15px;
+          &:first-child {
+            margin-top: 0;
+          }
+          .title {
+            font-weight: bold;
+            vertical-align: top;
+          }
+          .content {
+            word-break: break-all;
+          }
+        }
+      }
+      button {
+        outline: none;
+        border: 1px solid #2496f1;
+        border-radius: 3px;
+        background: #fff;
+        color: #2496f1;
+        width: 100px;
+        height: 28px;
+        text-align: center;
+        margin-left: 75px;
+        &:hover {
+          background: #2496f1;
+          color: #fff;
+        }
+      }
+      &:hover {
+        background: #ecf2fd;
+        cursor: pointer;
+        .params {
+          color: #2e91f0;
+        }
+      }
+    }
+  }
+</style>

+ 155 - 0
components/search/ForwardGoodsList.vue

@@ -0,0 +1,155 @@
+<template>
+  <div class="forward-goods-list">
+    <table>
+      <thead>
+        <tr>
+          <th width="25%">型号/品牌</th>
+          <th width="25%">卖家名称</th>
+          <th width="25%">物料名称(类目)/单位</th>
+          <th width="15%">规格</th>
+          <th width="15%"></th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr v-for="item in forwardGood.content">
+          <td>
+            <div class="line">
+              <span class="title inline-block">型号</span>
+              <span class="content inline-block" :title="item.code" v-text="item.code || '-'"></span>
+            </div>
+            <div class="line">
+              <span class="title inline-block">品牌</span>
+              <span class="content inline-block" :title="item.pbrand || item.pbranden">{{item.pbrand || item.pbranden ||  '-'}}</span>
+            </div>
+          </td>
+          <td class="single">
+            <div class="line">
+              <span class="title inline-block">卖家</span>
+              <span class="content inline-block" :title="item.storeName">{{item.storeName || '-'}}</span>
+            </div>
+          </td>
+          <td>
+            <div class="line">
+              <span class="title inline-block">物料名称(类目)</span>
+              <span class="content inline-block" :title="item.kind || item.kinden">{{item.kind || item.kinden || '-'}}</span>
+            </div>
+            <div class="line">
+              <span class="title inline-block">单位</span>
+              <span class="content inline-block" :title="item.unit">{{item.unit || '-'}}</span>
+            </div>
+          </td>
+          <td class="single">
+            <div class="line">
+              <span class="title inline-block">规格</span>
+              <span class="content inline-block" :title="item.spec">{{item.spec || '-'}}</span>
+            </div>
+          </td>
+          <td><button @click="authenticateInterceptor(goSeek(item))">立即询价</button></td>
+        </tr>
+      </tbody>
+    </table>
+    <seek-product :productItem="productItem" :showObj="showSeekObj"></seek-product>
+  </div>
+</template>
+<script>
+  import { SeekProduct } from '~components/applyPurchase'
+  export default {
+    data () {
+      return {
+        showSeekObj: {
+          show: false
+        },
+        productItem: {}
+      }
+    },
+    components: {
+      SeekProduct
+    },
+    computed: {
+      goods () {
+        return this.$store.state.searchData.searchList.listNew.data
+      },
+      forwardGood () {
+        return this.goods ? this.goods.futures : {}
+      }
+    },
+    methods: {
+      goSeek: function (item) {
+        this.productItem.cmpCode = item.code
+        this.productItem.brand = item.brand.nameEn
+        this.productItem.prodName = item.kind.nameCn
+        this.productItem.spec = item.spec
+        this.showSeekObj.show = true
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .forward-goods-list {
+    table {
+      width: 100%;
+      margin: 10px 0 50px;
+      thead tr {
+        background: #f7f7f7;
+        font-size: 14px;
+        color: #333;
+        height: 40px;
+        th {
+          text-align: center;
+        }
+      }
+      tbody tr {
+        &:hover {
+          background: #ecf2fd;
+        }
+        border: 1px solid #e8e8e8;
+        border-bottom: none;
+        &:last-child {
+          border-bottom: 1px solid #e8e8e8;
+        }
+        td {
+          padding: 24px 0;
+          font-size: 12px;
+          &.single {
+            float: left;
+            width: 100%;
+            height: 100%;
+          }
+          .line {
+            margin-top: 24px;
+            &:first-child {
+              margin-top: 0;
+            }
+            .title {
+              color: #2496f1;
+              width: 30%;
+              text-align: right;
+              vertical-align: top;
+            }
+            .content {
+              width: 70%;
+              padding-left: 10px;
+              vertical-align: top;
+              word-break: break-all;
+              color: #666;
+              height: 30px;
+              overflow: hidden;
+            }
+          }
+          button {
+            width: 80px;
+            text-align: center;
+            border-radius: 3px;
+            height: 30px;
+            color: #fff;
+            background: #2e91f0;
+            border: none;
+            outline: none;
+            display: block;
+            margin: 0 auto;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 15 - 17
components/search/GoodList.vue

@@ -41,7 +41,7 @@
           <thead>
           <tr style="height: 40px;">
             <!--<th width="80"></th>-->
-            <th width="140">品牌/物料名称(类目)/型号/规格</th>
+            <th width="200">品牌/物料名称(类目)/型号/规格</th>
             <th width="100">包装/生产日期</th>
             <th width="110">卖家名称</th>
             <th width="140">库存</th>
@@ -54,7 +54,7 @@
           </tr>
           </thead>
           <tbody id="productList-content">
-          <tr v-for="item in good_list.components" @click="goUnstandardDetail(item)">
+          <tr v-for="item in good_list.content" @click="goUnstandardDetail(item)">
             <!--<td>-->
             <!--<nuxt-link class="component-img-box" :to="item.batchCode?`/store/${item.storeId}/${item.batchCode}`:`/product/component/${item.uuid}`">-->
               <!--&lt;!&ndash;          <img :src="item.img?item.img:item.brand&&item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">&ndash;&gt;-->
@@ -64,10 +64,10 @@
           <!--</td>-->
             <td class="brand-code">
               <img v-if="item.status === 602" class="sellout-flag" src="/images/search/sellout-search.png" alt="">
-              <div class="brand" v-if="item.brand&&item.brand.nameEn"><nuxt-link :to="`/product/brand/${item.brand.uuid}`" class="text-num" v-text="item.brand.nameEn"></nuxt-link></div>
+              <div class="brand" v-if="item.branduuid"><nuxt-link :to="`/product/brand/${item.branduuid}`" class="text-num" v-text="item.brandNameCn || item.brandNameEn || '-'"></nuxt-link></div>
               <div class="brand" v-if="!item.brand||!item.brand.nameEn">{{item.brandEn||'—'}}</div>
-              <div class="brand"  v-if="item.kind&&item.kind.nameCn"><nuxt-link :to="`/product/kind/${item.kindid}`" v-text="item.kind.nameCn"></nuxt-link></div>
-              <div class="brand" v-if="!item.kind||!item.kind.nameCn">{{item.kindName || '—'}}</div>
+              <div class="brand" v-if="item.kindUuid"><nuxt-link :to="`/product/kind/${item.kindUuid}`" v-text="item.kindNameCn"></nuxt-link></div>
+              <div class="brand" v-if="!item.kindUuid">{{item.kindNameCn || '—'}}</div>
               <div class="code"  v-if="item.code">
                 <nuxt-link v-if="item.uuid" :to="`/product/component/${item.uuid}`" class="f16 text-bold text-num" v-text="item.code"></nuxt-link>
                 <span v-if="!item.uuid">{{item.code}}</span>
@@ -147,7 +147,7 @@
               </div>
             </td>
           </tr>
-          <tr v-if="good_list.components.length == 'undefined' ||good_list.components.length == 0">
+          <tr v-if="!good_list.content || !good_list.content.length">
             <td colspan="12">
               <div class="empty">
                 <p class="empty-img">
@@ -163,14 +163,12 @@
           </tbody>
         </table>
       </div>
-      <page :total="total_count" :page-size="pageSize"
-      :current="nowPage" @childEvent="listenPage"></page>
     </div>
   </div>
 </template>
 
 <script>
-  import Page from '~components/common/page/pageComponent.vue'
+//  import Page from '~components/common/page/pageComponent.vue'
   import Buy from '~components/common/buyOrCar/buyComponent.vue'
   export default {
     data () {
@@ -188,7 +186,7 @@
       }
     },
     components: {
-      Page,
+//      Page,
       Buy
     },
     props: ['crname_click_flag'],
@@ -226,13 +224,13 @@
     },
     computed: {
       good_lists () {
-        return this.$store.state.searchData.searchList.lists
+        return this.$store.state.searchData.searchList.listNew.data
       },
       good_list () {
-        return this.good_lists.data
+        return this.good_lists.stock || {}
       },
       total_count () {
-        return Math.min(this.good_list.total, 100 * this.pageSize)
+        return Math.min(this.good_list.total || 0, 100 * this.pageSize)
       },
       buy_info () {
         return this.$store.state.user.buy.buyInfo.data
@@ -261,10 +259,10 @@
           })
         }
       },
-      listenPage: function (changedPage) {
-        this.nowPage = changedPage
-        this.$emit('pageEvent', this.nowPage)
-      },
+//      listenPage: function (changedPage) {
+//        this.nowPage = changedPage
+//        this.$emit('pageEvent', this.nowPage)
+//      },
       sortBy: function (param) {
         if (param === 'normal1') {
           this.sorting = {}

+ 7 - 23
components/search/ResultTitle.vue

@@ -1,36 +1,19 @@
 <template>
   <div class="result-title text-muted">
-    搜索"<span class="text-inverse" >{{keyword}}</span>"<span v-if="status != 1">暂无此型号</span>
-    <span v-if="status != 3">,为您找到
-    <span class="text-num" v-text="good_list.total"></span> 个<span v-if="status == 2">相关</span>产品</span>:
+    搜索"<span class="text-inverse" >{{keyword}}</span>"
+    <!--<span v-if="status != 1">暂无此型号</span>-->
+    <span>,为您找到
+    <span class="text-num" v-text="count || 0"></span> 条信息
+    </span>:
   </div>
 </template>
 <script>
   export default{
-    props: ['keyword', 'page'],
+    props: ['keyword', 'page', 'count'],
     data () {
       return {
         status: 1
       }
-    },
-    computed: {
-      good_lists () {
-        return this.$store.state.searchData.searchList.lists
-      },
-      good_list () {
-        if (this.page === 1) {
-          if (this.good_lists.data.components && this.good_lists.data.components.length > 0) {
-            if (this.keyword.toUpperCase() === this.good_lists.data.components[0].code.toUpperCase()) {
-              this.status = 1
-            } else {
-              this.status = 2
-            }
-          } else {
-            this.status = 3
-          }
-        }
-        return this.good_lists.data
-      }
     }
   }
 </script>
@@ -49,5 +32,6 @@
   .text-num {
     font-style: normal;
     font-family: verdana;
+    color: #0b7bef;
   }
 </style>

+ 188 - 0
components/search/SupplierList.vue

@@ -0,0 +1,188 @@
+<template>
+  <div class="search-suppliers-list">
+    <ul class="list-inline">
+      <li class="clearfix" v-for="item in currentGoods.content" @click="goSup(item)">
+        <div class="img">
+          <img :src="item.storeLogoUrl || item.enLogoUrl || item.logoUrl || '/images/all/default.png'">
+          <!--<span class="has_shop"></span>-->
+        </div>
+        <div class="content">
+          <h3 class="enterprise_name">{{item.enName}}</h3>
+          <p>
+            <span>企业执照号:</span><span :title="item.enBusinesscode">{{item.enBusinesscode || '暂无信息'}}</span>
+            <span class="split_line">|</span>
+            <span>地址:</span><span :title="item.enAddress">{{item.enAddress || '暂无信息'}}</span>
+          </p>
+          <p>
+            <span>邮箱:</span><span :title="item.enEmail">{{item.enEmail || '暂无信息'}}</span>
+            <span class="split_line">|</span>
+            <span>电话:</span><span :title="item.enTel">{{item.enTel || '暂无信息'}}</span>
+            <span class="split_line">|</span>
+            <span>行业:</span><span :title="item.enIndustry">{{item.enIndustry || '暂无信息'}}</span>
+          </p>
+        </div>
+        <div class="select_btn">{{resultType === 'current' ? '进入店铺' : '了解详情'}}</div>
+      </li>
+    </ul>
+    <supplier-empty :showObj="showDialogObj"></supplier-empty>
+  </div>
+</template>
+<script>
+  import { SupplierEmpty } from '~components/base'
+  export default {
+    props: {
+      resultType: {
+        type: String,
+        default: 'current'
+      }
+    },
+    components: {
+      SupplierEmpty
+    },
+    data () {
+      return {
+        showSeekObj: {
+          show: false
+        },
+        productItem: {},
+        showDialogObj: {
+          show: false
+        }
+      }
+    },
+    computed: {
+      goods () {
+        return this.$store.state.searchData.searchList.listNew.data
+      },
+      currentGoods () {
+        if (this.goods) {
+          if (this.resultType === 'current') {
+            return this.goods.stock || {}
+          } else {
+            return this.goods.futures || {}
+          }
+        } else {
+          return {}
+        }
+      }
+    },
+    methods: {
+      goSup (item) {
+        if (this.resultType === 'current') {
+          if (item.storeUuid) {
+            this.$router.push(`/store/${item.storeUuid}`)
+          }
+        } else {
+          this.$http.get('vendor/introduction/product/count', {params: {vendUU: item.enUU}})
+            .then(res => {
+              if (res.data.count > 0) {
+                this.$router.push('supplier/' + item.enUU)
+              } else {
+                this.showDialogObj.show = true
+              }
+            }, err => {
+              console.log(err)
+            })
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  $border: 1px solid #e8e8e8;
+  .search-suppliers-list {
+    ul{
+      margin:0;
+      border: {
+        left: $border;
+        right: $border;
+        top: $border;
+      }
+      li{
+        position:relative;
+        width:100%;
+        vertical-align: top;
+        height:112px;
+        padding:15px;
+        border-bottom: $border;
+        .img{
+          position:relative;
+          float:left;
+          width:80px;
+          height:80px;
+          border:1px solid #ccc;
+          img{
+            width:100%;
+            height:100%;
+            vertical-align: top;
+          }
+          .has_shop {
+            position:absolute;
+            left:0;
+            top:0;
+            width:68px;
+            height:22px;
+            background: url(/images/supplier/icon/top_left.png)no-repeat;
+            color:#fff;
+            font-weight: bold;
+            text-align: center;
+            line-height: 22px;
+          }
+        }
+        .content{
+          margin-left:100px;
+          color:#333;
+          padding-top:2px;
+          .enterprise_name{
+            width:690px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space:nowrap;
+            font-weight: bold;
+            color:#333;
+            font-size: 16px;
+            margin:0 0 10px;
+          }
+          p{
+            width:690px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space:nowrap;
+            font-size: 14px;
+            color:#333;
+            margin:0 0 5px;
+            span{
+              &.split_line{
+                margin:0 5px;
+              }
+            }
+          }
+        }
+        .select_btn{
+          position:absolute;
+          top:40%;
+          right:20px;
+          z-index:250;
+          padding:5px 10px;
+          text-align: center;
+          background: #1891e4;
+          color:#fff;
+          border-radius:3px;
+        }
+        &:hover{
+          cursor:pointer;
+          background: #ecf2fd;
+          .content{
+            color:#2496f1;
+            .enterprise_name{
+              color:#2496f1;
+            }
+            p{
+              color:#2496f1;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 4 - 1
components/search/index.js

@@ -1,5 +1,8 @@
 import GoodList from './GoodList.vue'
 import Kind from './Kind.vue'
 import ResultTitle from './ResultTitle.vue'
+import ForwardGoodsList from './ForwardGoodsList.vue'
+import SupplierList from './SupplierList.vue'
+import BrandList from './BrandList.vue'
 
-export { GoodList, Kind, ResultTitle }
+export { GoodList, Kind, ResultTitle, ForwardGoodsList, SupplierList, BrandList }

+ 3 - 3
components/store/home/EnterpriseInfo.vue

@@ -158,9 +158,9 @@
       // 店铺简介
       getIntro (text) {
         let realLength = this.baseUtils.getRealLen(text)
-        if (realLength > 495) {
+        if (realLength > 494) {
           this.showMore = true
-          text = this.baseUtils.cutOutString(text, 495) + '...'
+          text = this.baseUtils.cutOutString(text, 494) + '...'
         } else {
           this.showMore = false
         }
@@ -351,7 +351,7 @@
             .information-list {
               font-size: 12px;
               color: #333;
-              margin-bottom: 3px;
+              margin-bottom: 2px;
               /*background: #fff;*/
             &:first-child{
                /*padding-top: 10px;*/

+ 2 - 2
layouts/main.vue

@@ -43,7 +43,7 @@
           }
           return ''
         } else if (path.startsWith('/product/component/')) {
-          if (this.componentDetail) {
+          if (this.componentDetail && this.componentDetail.brand) {
             return this.componentDetail.brand.nameCn + this.componentDetail.code + '参数|供应商|数据手册中文资料|规格书-优软商城'
           } else {
             return ''
@@ -81,7 +81,7 @@
           }
           return ''
         } else if (path.startsWith('/product/component/')) {
-          if (this.componentDetail) {
+          if (this.componentDetail && this.componentDetail.brand) {
             return '优软商城提供' + this.componentDetail.brand.nameCn + this.componentDetail.code + '数据手册中文资料规格书下载,' + this.componentDetail.code + '供应商及参数报价。'
           } else {
             return ''

+ 183 - 0
pages/mobile/center/user/applyPurchase.vue

@@ -0,0 +1,183 @@
+<template>
+  <div class="apply_purchase_mobile">
+    <div class="com-mobile-header mobile-center-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p>发布求购</p>
+      <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
+    </div>
+    <div class="mobile-fix-content mobile-centerfix-content" id="mobileFixContent">
+      <div class="search-content search-content2">
+        <input type="text" placeholder="请输入您要询价求购的型号" v-model="keyword" @keyup.13="searchComplist">
+        <span @click="searchComplist" >
+          <i class="iconfont icon-sousuo"></i>
+      </span>
+      </div>
+      <publish-seek v-if="showPublishBox" :dataObj="componentSeekObj" @remindAction="onRemind"></publish-seek>
+      <template v-else>
+        <ul v-if="compList && compList.length">
+          <li v-for="comp in compList">
+            <div class="listInfo">
+              <p>品牌:<span v-text="comp.brand || '-'"></span></p>
+              <p>物料名称(类目):<span v-text="comp.kind || '-'"></span></p>
+              <p>型号:<span v-text="comp.cmpCode || '-'"></span></p>
+              <p>规格:<span v-text="comp.spec || '-'"></span></p>
+              <p>单位:<span v-text="comp.unit || 'PCS'"></span></p>
+            </div>
+            <a class="sa-pub" @click="compInquiry(comp, $event)">立即询价</a>
+          </li>
+        </ul>
+        <empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'" v-else></empty-status>
+      </template>
+    </div>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+    <pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
+  </div>
+</template>
+<script>
+  import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
+  import {PublishSeek} from '~components/mobile/applyPurchase'
+  export default {
+    middleware: 'authenticated',
+    layout: 'mobileNoHeader',
+    fetch ({ store }) {
+      return Promise.all([
+        store.dispatch('product/loadPublishList', { count: 10, page: 1, keyword: null })
+      ])
+    },
+    data () {
+      return {
+        keyword: '',
+        remindText: '',
+        timeoutCount: 0,
+        page: 1,
+        count: 10,
+        isChange: false,
+        compList: [],
+        componentSeekObj: {
+          code: '',
+          brand: '',
+          spec: '',
+          prodTitle: ''
+        },
+        showPublishBox: true
+      }
+    },
+    watch: {
+      'compCollectList.data': {
+        handler: function (val) {
+          if (this.isChange) {
+            this.compList = val.content
+            this.isChange = false
+          } else {
+            this.compList = [...this.compList, ...val.content]
+          }
+        },
+        immediate: true
+      }
+    },
+    computed: {
+      compCollectList () {
+        console.log('123', this.$store.state.product.common.publishMobile)
+        return this.$store.state.product.common.publishMobile
+      },
+      fetching () {
+        return this.compCollectList.fetching
+      },
+      allPage () {
+        return Math.floor(this.compCollectList.data.totalElements / this.compCollectList.data.size) + Math.floor(this.compCollectList.data.totalElements % this.compCollectList.data.size > 0 ? 1 : 0)
+      }
+    },
+    components: {
+      RemindBox,
+      PullUp,
+      EmptyStatus,
+      PublishSeek
+    },
+    methods: {
+      searchComplist () {
+        this.showPublishBox = false
+        this.page = 1
+        this.isChange = true
+        if (this.keyword) {
+          this.reloadList()
+        }
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount++
+      },
+      reloadList: function () {
+        this.$store.dispatch('product/loadPublishList', { page: this.page, count: this.count, keyword: this.keyword })
+      },
+      onPullUpAction: function () {
+        this.page++
+        this.reloadList()
+      },
+      compInquiry: function (item, e) {
+        if (e) {
+          e.stopPropagation()
+        }
+        this.componentSeekObj.code = item.cmpCode ? item.cmpCode : '-'
+        this.componentSeekObj.brand = item.brand ? item.brand : '-'
+        this.componentSeekObj.spec = item.spec ? item.spec : '-'
+        this.componentSeekObj.prodTitle = item.kind ? item.kind : '-'
+        this.componentSeekObj = JSON.parse(JSON.stringify(this.componentSeekObj))
+        this.showPublishBox = true
+      },
+      goUrl: function (url) {
+        this.$router.push(url)
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .mobile-fix-content {
+    .search-content {
+      text-align: center;
+      input {
+        border: 1px solid #376ff3;
+      }
+      span{
+        top:0;
+      }
+    }
+    ul {
+      margin: .2rem;
+      li {
+        border-radius: .05rem;
+        margin: .25rem 0 0 0;
+        position: relative;
+        background: #fff;
+        .listInfo {
+          padding: .25rem .1rem .25rem .23rem;
+          p {
+            color: #666;
+            font-size: .3rem;
+            line-height: .45rem;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            span {
+              color: #333;
+            }
+          }
+        }
+        .sa-pub {
+          position: absolute;
+          bottom: .2rem;
+          right:0;
+          display: block;
+          width: 1.7rem;
+          height: .47rem;
+          line-height: .47rem;
+          text-align: center;
+          font-size: .26rem;
+          color: #fff;
+          background: #008bf7;
+          margin-right:.2rem;
+          border-radius: .05rem;
+        }
+      }
+    }
+  }
+</style>

+ 3 - 7
pages/mobile/center/user/index.vue

@@ -12,10 +12,10 @@
       <div class="block-wrap seek-operation">
         <p><i></i>我的求购</p>
         <ul>
-          <li @click="showPublishBox = true">
+          <nuxt-link to="/mobile/center/user/applyPurchase" tag="li">
             <img src="/images/mobile/center/user/pub.png" alt="">
             <p>发布求购</p>
-          </li>
+          </nuxt-link>
           <nuxt-link to="/mobile/center/user/seek?seekType=wait" tag="li">
             <img src="/images/mobile/center/user/wait.png" alt="">
             <p>待报价</p>
@@ -62,19 +62,16 @@
       </div>
 
     </div>
-    <publish-seek :showSayPriceBox="showPublishBox" @cancelAction="showPublishBox = false" @remindAction="onRemind"></publish-seek>
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 <script>
   import { RemindBox } from '~components/mobile/common'
-  import { PublishSeek } from '~components/mobile/applyPurchase'
   export default {
     layout: 'mobileNoHeader',
     middleware: 'authenticated',
     data () {
       return {
-        showPublishBox: false,
         remindText: '',
         timeoutCount: 0,
         carCount: 0
@@ -92,8 +89,7 @@
       return Promise.all(promises)
     },
     components: {
-      RemindBox,
-      PublishSeek
+      RemindBox
     },
     computed: {
       compCount () {

+ 8 - 7
pages/mobile/center/vendor/payCenter.vue

@@ -112,14 +112,14 @@
           </div>
         </li>
       </ul>
-      <div class="fix-count-wrap" v-if="recordList.length">
-        <span class="content">收入总计:<span>{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}}</span></span>
-        <span class="content">支出总计:<span>{{currencySymbol | currencyFilter}}&nbsp;0</span></span>
-        <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}} (共计{{recordList.length || 0}}笔交易)</p>
-      </div>
+
     </div>
     <!-- 交易记录end -->
-
+    <div class="fix-count-wrap" v-if="recordList.length">
+      <span class="content">收入总计:<span>{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}}</span></span>
+      <span class="content">支出总计:<span>{{currencySymbol | currencyFilter}}&nbsp;0</span></span>
+      <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}} (共计{{recordList.length || 0}}笔交易)</p>
+    </div>
     <!-- 新增账户弹框start -->
     <modal-wrapper :noHeader="true" :showModal="showModal" @closeAction="showModal = false">
       <div class="add-account-modal in-wrapper">
@@ -729,6 +729,7 @@
     }
   }
   .vendor-pay-record {
-    bottom: 2.23rem !important;
+    /*bottom: 2.23rem !important;*/
+    padding-bottom: 1.25rem;
   }
 </style>

+ 445 - 17
pages/mobile/center/vendor/product.vue

@@ -1,13 +1,6 @@
 <template>
-  <div class="user-content">
-    <div class="provider">
-      <!--<div class="seek">
-        <ul class="seek-type" >
-          <li :class="{active: providerType == 'enterprise'}" style="width: 33.3%" @click="switchprovide('enterprise')"><div>企业产品库</div></li>
-          <li :class="{active: providerType == 'person'}" style="width: 33.3%" @click="switchprovide('person')"><div>个人产品库</div></li>
-          <li :class="{active: providerType == 'onLine'}" style="width: 33.3%" @click="switchprovide('onLine')"><div>在售产品</div></li>
-        </ul>
-      </div>-->
+  <div class="user-content" >
+    <div class="provider" id="provider-wrapper">
       <div class="search-content" style="border-bottom: 1px solid #f5f5f5;padding-bottom: 0.25rem">
         <input type="text" placeholder="请输入您要查找的品牌或型号" v-model="seekKeyword" @keyup.13="searchSeek">
         <span @click="searchSeek" >
@@ -49,6 +42,7 @@
             <div class="pull-right add" v-if="providerType === 'enterprise'" @click="addProtoperson(item)" :class="{noadd: item.addProductPerson}">加入个人产品</div>
             <div class="pull-right look" @click="lookProductitem(item.id, item)" v-if="item.batchCount">查看产品</div>
             <div class="pull-right look" @click="toAddpro(item)" v-else>编辑上架</div>
+            <div class="pull-right look" v-if="providerType === 'enterprise'" @click="updateMateriel(item)">编辑物料</div>
           </div>
         </div>
         <div v-else>
@@ -269,13 +263,98 @@
       <nuxt-link to="/">返回首页</nuxt-link>
     </div>
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
-    <pull-up :searchMore="isSearchSearchingMore" :allPage="EnterprisePage" :page="seekPage" @pullUpAction="getMoreSearch"></pull-up>
+    <pull-up :fixId="'provider-wrapper'" :searchMore="isSearchSearchingMore" :allPage="EnterprisePage" :page="seekPage" @pullUpAction="getMoreSearch"></pull-up>
     <!-- 在售产品编辑框 -->
+    <!-- 编辑物料 -->
+    <div class="update-materiel" v-if="showMateriel">
+      <div class="mobile-nav">
+        <div class="mobile-header mobile-center-header">
+          <a @click="showMateriel = false"><i class="iconfont icon-fanhui"></i></a>
+          <p>编辑物料</p>
+          <p class="en-name">
+            <img :src="`/images/mobile/center/${user.data.enterprise && user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}
+          </p>
+        </div>
+      </div>
+      <div class="update-materiel-wrapper">
+        <!--<div class="clearfix">-->
+          <!--<div class="update-materiel-wrapper-image pull-left">-->
+            <!--<img :src="cmpImg || '/images/mobile/openStore/upload.png'"  style='width: 1.1rem; height: 1.1rem;display:block;margin: 0.2rem auto'/>-->
+            <!--<input type="file" class="com-input" @change="update" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" />-->
+            <!--<span style="position: relative">点击上传</span>-->
+          <!--</div>-->
+          <!--<div class="uploadImgBtn pull-left">上传图片<input type="file" class="com-input" @change="update" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" /></div>-->
+          <!--<span class="uploadImgInfo pull-left">图片上传须知</span>-->
+        <!--</div>-->
+        <template v-if="MaterielItem.standard === 1">
+          <img class="imgUrl" src="/images/mobile/@2x/productDetail/Strand.png" />
+        </template>
+        <template v-else>
+          <img class="imgUrl" src="/images/mobile/@2x/productDetail/isStrand.png" />
+        </template>
+        <div class="update-materiel-wrapper-list clearfix overHidden">
+          <div class="name pull-left"><a class="red">*</a>品牌:</div>
+          <template v-if="MaterielItem.standard === 1">
+            {{MaterielItem.brand}}
+          </template>
+          <template v-else>
+            <div class="input pull-left clearfix overHidden">
+              <input type="text" v-model="MaterielItem.brand" placeholder="请勿填中文符号" @blur="checkBrand" @input="onBrandChange"/>
+              <ul class="similar brand-similar-list" v-show="showSimilarBrandList && MaterielItem.brand">
+                <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
+              </ul>
+              <i class="iconfont icon-guanbi1" @click="MaterielItem.brand = ''"></i>
+            </div>
+          </template>
+        </div>
+        <div class="update-materiel-wrapper-list clearfix overHidden">
+          <div class="name pull-left"><a class="red">*</a>物料名称(类目):</div>
+          <template v-if="MaterielItem.standard === 1">
+            {{MaterielItem.kind}}
+          </template>
+          <template v-else>
+            <div class="input pull-left clearfix"  style="width: 4.09rem">
+              <!--<input type="text" v-model="MaterielItem.kind" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号">-->
+              <input type="text" placeholder="请输入物料名称(类目)" v-model="MaterielItem.kind"/>
+              <i class="iconfont icon-guanbi1" @click="MaterielItem.kind = ''"></i>
+            </div>
+          </template>
+        </div>
+        <div class="update-materiel-wrapper-list clearfix">
+          <div class="name pull-left"><a class="red">*</a>型号:</div>
+          <template v-if="MaterielItem.standard === 1">
+            {{MaterielItem.cmpCode}}
+          </template>
+          <template v-else>
+            <div class="input pull-left clearfix">
+              <input type="text" v-model="MaterielItem.cmpCode" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号">
+              <ul class="similar" v-show="showSimilarCodeList && MaterielItem.cmpCode">
+                <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
+              </ul>
+              <!--<input type="text" placeholder="请输入型号" v-model="MaterielItem.cmpCode"/>-->
+              <i class="iconfont icon-guanbi1" @click="MaterielItem.code = ''"></i>
+            </div>
+          </template>
+        </div>
+        <div class="update-materiel-wrapper-list clearfix">
+          <div class="name pull-left"><a class="red" style="opacity: 0">*</a>规格:</div>
+          <div class="input pull-left clearfix">
+            <input type="text" placeholder="请输入规格" v-model="MaterielItem.spec" @blur="checkSpec" @input="onSpecInput"/>
+            <i class="iconfont icon-guanbi1" @click="MaterielItem.spec = ''"></i>
+          </div>
+        </div>
+        <div class="update-materiel-wrapper-controll clearfix">
+          <div class="pull-left" @click="saveMateriel()">保存</div>
+          <div class="pull-right" @click="showMateriel = false">取消</div>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
   import { RemindBox, PullUp } from '~components/mobile/common'
+  import Upload from '~components/common/upload/upload.vue'
   export default {
     layout: 'mobile',
     middleware: 'authenticated',
@@ -294,7 +373,15 @@
         EnterprisePage: 1,
         chooseItem: {},
         vendorlist: [], // 查看更多信息
-        showoffshelf: false
+        showoffshelf: false,
+        showMateriel: false,
+        imgStyle: 'width: 1.1rem;height:1.1rem',
+        MaterielItem: {},
+        showSimilarCodeList: false,
+        showSimilarBrandList: false,
+        similarCode: [],
+        similarBrand: [],
+        cmpImg: ''
       }
     },
     methods: {
@@ -494,6 +581,13 @@
       closeMoreinfo: function() {
         this.showMoreinfn = false
       },
+      // 编辑物料
+      updateMateriel(item) {
+        this.MaterielItem = item
+        this.cmpImg = item.cmpImg || ''
+        // this.MaterielItem.cmpImg = item.cmpImg || ''
+        this.showMateriel = true
+      },
       addProtoperson: function(item) {
         if (item.addProductPerson) {
           this.collectResult = '已在个人产品库'
@@ -513,6 +607,144 @@
             this.collectResult = '绑定失败'
             this.timeoutCount++
           })
+      },
+      checkBrand: function () {
+        // this.MaterielItem.brand = this.MaterielItem.brand && this.MaterielItem.brand !== ''
+        if (!this.MaterielItem.brand || this.MaterielItem.brand === '') {
+          this.setRemindText('品牌不能为空')
+        }
+        return this.MaterielItem.brand
+      },
+      checkCode: function () {
+        if (!this.MaterielItem.cmpCode || this.MaterielItem.cmpCode === '') {
+          this.setRemindText('型号不能为空')
+        }
+        return this.MaterielItem.cmpCode
+      },
+      onCodeChange: function () {
+        this.MaterielItem.cmpCode = this.MaterielItem.cmpCode.trim()
+        if ((/[^\x00-\xff]/g).test(this.MaterielItem.cmpCode)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.MaterielItem.cmpCode.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.MaterielItem.cmpCode.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          this.MaterielItem.cmpCode = this.baseUtils.cutOutString(this.MaterielItem.cmpCode, chineseIndex)
+        } else if (this.MaterielItem.cmpCode && this.baseUtils.getRealLen(this.MaterielItem.cmpCode) > 100) {
+          this.MaterielItem.cmpCode = this.baseUtils.cutOutString(this.MaterielItem.cmpCode, 100)
+        } else {
+          this.getSimilarCode()
+        }
+      },
+      onBrandChange: function () {
+        this.MaterielItem.brand = this.MaterielItem.brand.trim()
+        if ((/[^\x00-\xff]/g).test(this.MaterielItem.brand)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.MaterielItem.brand.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.MaterielItem.brand.charAt(i)) && !(/[\u4e00-\u9fa5]/).test(this.MaterielItem.brand.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          if (chineseIndex > -1) {
+            this.MaterielItem.brand = this.MaterielItem.brand.substring(0, chineseIndex)
+          }
+        } else if (this.MaterielItem.brand && this.baseUtils.getRealLen(this.MaterielItem.brand) > 50) {
+          this.MaterielItem.brand = this.baseUtils.cutOutString(this.MaterielItem.brand, 50)
+        } else {
+          this.getSimilarBrand()
+        }
+      },
+      getSimilarBrand: function () {
+        if (this.MaterielItem.brand) {
+          this.$http.get('/search/similarBrands', {params: {keyword: this.MaterielItem.brand}})
+            .then(response => {
+              this.similarBrand = response.data
+              this.showSimilarBrandList = response.data.length > 0
+            })
+        } else {
+          this.showSimilarBrandList = false
+        }
+      },
+      getSimilarCode: function () {
+        if (this.MaterielItem.cmpCode) {
+          this.$http.get('/search/similarComponents', {params: {keyword: this.MaterielItem.cmpCode}})
+            .then(response => {
+              this.similarCode = response.data
+              this.showSimilarCodeList = response.data.length > 0
+            })
+        } else {
+          this.showSimilarCodeList = false
+        }
+      },
+      setCode: function (code) {
+        this.MaterielItem.cmpCode = code
+        this.showSimilarCodeList = false
+      },
+      setBrand: function (brand) {
+        this.MaterielItem.brand = brand
+        this.showSimilarBrandList = false
+      },
+      setRemindText: function (str) {
+        this.collectResult = str
+        this.timeoutCount++
+      },
+      checkSpec: function () {
+        // let nullStrFlag =
+        // this.MaterielItem.spec = nullStrFlag
+        if (!this.baseUtils.checkNullStr(this.MaterielItem.spec)) {
+          this.setRemindText('规格输入不合法')
+        }
+        return this.MaterielItem.spec
+      },
+      onSpecInput: function () {
+        if (this.MaterielItem.spec && this.baseUtils.getRealLen(this.MaterielItem.spec) > 100) {
+          this.MaterielItem.spec = this.baseUtils.cutOutString(this.MaterielItem.spec, 100)
+        }
+      },
+      saveMateriel() {
+        if (this.MaterielItem.brand === '') {
+          this.setRemindText('品牌不能为空')
+          return
+        } else if (this.MaterielItem.kind === '') {
+          this.setRemindText('类目不能为空')
+          return
+        } else if (this.MaterielItem.cmpCode === '') {
+          this.setRemindText('型号不能为空')
+          return
+        }
+        this.MaterielItem.pcmpcode = this.MaterielItem.cmpCode
+        this.MaterielItem.pbranden = this.MaterielItem.brand
+        this.MaterielItem.pbranden = this.MaterielItem.brand
+        this.$http.post('/trade/products/update/product', this.MaterielItem).then(res => {
+          this.setRemindText('修改成功')
+          this.showMateriel = false
+          this.page = 1
+          this.getResourceProvidor()
+        })
+      },
+      update (e) {
+        let file = e.target.files[0]
+        if (file.size > 3 * 1024 * 1024) {
+          this.setRemindText(`上传文件不得超过3M`)
+        }
+        let param = new FormData()
+        param.append('file', file, file.name)
+        param.append('chunk', '0')
+        if (file.type === 'application/pdf') {
+          this.setRemindText(`请选择有效图片进行上传`)
+          return
+        }
+        let config = {
+          headers: {'Content-Type': 'multipart/form-data'}
+        }
+        this.$http.post('/api/images', param, config)
+          .then(response => {
+            this.MaterielItem.img = response.data[0].path
+            this.cmpImg = response.data[0].path
+          })
       }
     },
     computed: {
@@ -556,15 +788,34 @@
     },
     components: {
       RemindBox,
-      PullUp
+      PullUp,
+      Upload
     }
   }
 </script>
 
 <style scoped lang="scss">
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+  .overHidden  {
+    @include overFlowHidden()
+  }
   .user-content{
-    margin-bottom: .98rem;
-    margin-top: 1.26rem;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    .provider {
+      margin: 1.26rem 0 0.98rem 0;
+      height: calc(100vh - 1.26rem - 0.98rem);
+      overflow-y: auto;
+    }
     .sa-pub {
       display: inline-block;
       width: 1.41rem;
@@ -1250,7 +1501,7 @@
   }
   .deleteKuang {
     position: fixed;
-    background: rgba(0,0,0,0.5);
+    background: rgba(0, 0, 0, 0.5);
     top: 0;
     left: 0;
     right: 0;
@@ -1288,7 +1539,7 @@
         margin-top: 0.4rem;
         line-height: 0.7rem;
         height: 0.7rem;
-        &::after{
+        &::after {
           clear: both;
           display: block;
           content: ' ';
@@ -1317,7 +1568,7 @@
       right: -0.3rem;
       top: -0.35rem;
       color: #fff;
-      &::after{
+      &::after {
         position: absolute;
         top: -0.1rem;
         left: -0.1rem;
@@ -1394,4 +1645,181 @@
       }
     }
   }
+  .update-materiel {
+    position: fixed;
+    z-index: 99;
+    background: #f1f3f6;
+    top: 0;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    .mobile-header{
+      position: fixed;
+      top: 0;
+      z-index: 10;
+      width:100%;
+      height: 1.26rem;
+      line-height: 1.26rem;
+      /*border-bottom:.01rem solid #ccc;*/
+      background: #3e82f5;
+      padding:0 .2rem 0 .1rem;
+      color:#fff;
+    }
+    .mobile-header p{
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      font-size:.36rem;
+      text-align: center;
+      width: 6rem;
+      padding-left: 1rem;
+    }
+    .mobile-center-header p.en-name {
+      font-size: .3rem;
+    }
+    .mobile-header a{
+      font-size:.28rem;
+      color:#fff;
+      position: absolute;
+    }
+    .mobile-header a i{
+      font-size: .48rem;
+      margin-right: -.1rem;
+    }
+    .update-materiel-wrapper {
+      border: 1px solid #dcdcdc;
+      border-radius: 0.07rem;
+      background: #fff;
+      margin: 1.46rem 0.2rem 0;
+      position: relative;
+      padding-bottom: 0.4rem;
+      padding-top: 1rem;
+      position: relative;
+      .imgUrl{
+        position: absolute;
+        width: 0.94rem;
+        height: 0.94rem;
+        right: 0;
+        top: 0;
+      }
+      .update-materiel-wrapper-image {
+        width: 2.28rem;
+        height: 2.28rem;
+        border: 1px solid #dcdcdc;
+        border-radius: 0.07rem;
+        position: relative;
+        margin: 0.27rem 0 0 0.55rem;
+        text-align: center;
+        position: relative;
+        span {
+          color: #b2b2b2;
+          font-size: 0.28rem;
+        }
+        .com-input {
+          width: 100%;
+          height: 100%;
+          text-align: center;
+          position: absolute;
+          bottom: 0;
+          left: 0;
+          opacity: 0;
+          display: inline-block !important;
+        }
+      }
+      .uploadImgBtn {
+        color: #fff;
+        font-size: .28rem;
+        width: 1.51rem;
+        @include lineHeight(0.47rem);
+        border-radius: 0.07rem;
+        background: #f9b209;
+        text-align: center;
+        margin:2rem 0.1rem 0;
+        position: relative;
+        .com-input {
+          width: 100%;
+          height: 100%;
+          text-align: center;
+          position: absolute;
+          bottom: 0;
+          left: 0;
+          opacity: 0;
+          display: inline-block !important;
+        }
+      }
+      .uploadImgInfo {
+        color: #3f84f6;
+        font-size: 0.24rem;
+        margin-top: 2.15rem;
+      }
+      .update-materiel-wrapper-list {
+        margin-left:0.28rem;
+        margin-top: 0.3rem;
+        line-height: 0.5rem;
+        .red {color: #ea0f42}
+        .name {color: #666;}
+        .input {
+          position: relative;
+          width:5.4rem;
+          line-height: 0.5rem;
+          height: 0.5rem;border: 1px solid #dcdcdc;
+          input {
+            text-indent: 5px;
+            border: 0;
+            border-radius: 0.07rem;
+            line-height: 0.44rem;
+            height: 0.44rem;
+            width: 90%;
+            font-size:0.28rem;
+            float: left;
+            color: #333;
+          }
+          i {
+            font-size: 0.16rem;
+            vertical-align: top;
+            color: #666;
+            float: right;
+            margin-right: 0.05rem
+          }
+          .similar {
+            position: absolute;
+            width:100%;
+            max-height: 2.5rem;
+            overflow-y: auto;
+            z-index: 12;
+            border: 1px solid #7e7e7e;
+            border-radius: .05rem;
+            top: .5rem;
+            background: #fff;
+            li {
+              height: .5rem;
+              line-height: .5rem;
+              font-size: .26rem;
+              color: #999;
+              padding-left: .19rem;
+              &:focus, &:active, &:hover {
+                background: #999;
+                color: #fff;
+              }
+            }
+          }
+        }
+      }
+      .update-materiel-wrapper-controll {
+        margin: 0.4rem 0.2rem 0;
+        div {
+          width: 48%;
+          background: #b5b5b5;
+          font-size: 0.3rem;
+          color: #fafbfc;
+          text-align: center;
+          @include lineHeight(0.62rem);
+          border-radius: 0.07rem;
+          &:first-child {
+            background: #3f84f6;
+          }
+        }
+      }
+    }
+  }
 </style>

+ 1237 - 0
pages/mobile/search/newkeycode.vue

@@ -0,0 +1,1237 @@
+<template>
+ <div class="search-wrapper">
+   <!-- 头部搜索 -->
+   <div class="main-search-header">
+     <input type="text" id="search-box" v-model="keyword" @keyup.13="onClickSearchHander()" :placeholder="placeholder" @input="changeKeyWord()">
+     <span @click="onClickSearchHander()">搜索</span>
+     <a @click="cancelSearchHander()">取消</a>
+     <div class="main-search-header-controll clearfix">
+       <span :class="ChooseTop === 'component' ? 'active' : ''" @click="setChangelistHander('component')"><a>型号</a></span>
+       <span :class="ChooseTop === 'kind' ? 'active' : ''" @click="setChangelistHander('kind')"><a>物料名称</a></span>
+       <span :class="ChooseTop === 'store' ? 'active' : ''" @click="setChangelistHander('store')"><a>卖家</a></span>
+       <span :class="ChooseTop === 'brand' ? 'active' : ''" @click="setChangelistHander('brand')"><a>品牌</a></span>
+     </div>
+   </div>
+   <ul class="associate-list" v-show="associate.show" @click="associate.show = false">
+     <li @click.stop="onAssociateClick(similar)" v-for="similar in similarKeywords.result">
+       <i class="icon-sousuo iconfont"></i>
+       <span>{{Getsimilar(similar)}}</span>
+       <!--<span v-if="ChooseTop === 'component'">{{similar.code}}</span>-->
+       <!--<span v-else-if="ChooseTop === 'product'">{{similar}}</span>-->
+       <!--<span v-else-if="ChooseTop === 'store'">{{similar}}</span>-->
+       <!--<span v-else-if="ChooseTop === 'brand'">{{similar.nameEn}}</span>-->
+     </li>
+     <li @click.stop="onClickTosearch(keyword)">查找“{{baseUtils.filterStringEllipsis(keyword, 30)}}”</li>
+   </ul>
+   <!-- 主体内容 -->
+   <div class="main-search-wrapper">
+     <div class="search-title">搜索“<span>{{displayKeyword}}</span>”暂无此{{getNowChooseType}}{{allTotal === 0 ? '' : `,为您找到${allTotal}条相关信息`}}</div>
+     <template v-if="allTotal > 0">
+       <!-- 品牌精确查找 -->
+       <template v-if="ChooseTop === 'brand' && brandIsAccurate">
+         <div class="search-content" style="margin-bottom: 0.2rem;height: auto">
+           <div class="middle">
+             <div class="list clearfix" style="border-bottom: 1px solid #dcdcdc;padding-bottom: 0.1rem;line-height: 0.8rem;">
+               <img :src="'' || '/images/component/default.png'" class="pull-left">
+               <div class="name pull-left overHidden" style="max-width: 5rem;">{{resourceList.brand && resourceList.brand.nameEn}}</div>
+             </div>
+             <div class="list">
+               <div class="name">主打产品:</div>
+               <div class="text">
+                 {{resourceList.brand && resourceList.brand.series}}
+               </div>
+             </div>
+             <div class="list">
+               <div class="name">应用领域:</div>
+               <div class="text">
+                 {{resourceList.brand && resourceList.brand.application}}
+               </div>
+             </div>
+             <div class="list">
+               <div class="name">品牌介绍:</div>
+               <div class="text">
+                 {{resourceList.brand && resourceList.brand.brief}}
+               </div>
+             </div>
+             <div class="list">
+               <div class="name">官网地址:</div>
+               <div class="text" style="width: 4.5rem">
+                 <a :href="resourceList.brand && resourceList.brand.url" target="_blank">{{resourceList.brand && resourceList.brand.url}}</a>
+               </div>
+               <div class="pull-right lookMoreBtn" @click="showBrandDetails = true">
+                 查看更多
+               </div>
+             </div>
+           </div>
+         </div>
+       </template>
+       <div class="search-nav clearfix" v-if="brandIsAccurate || (!brandIsAccurate && ChooseTop !== 'brand')">
+        <span class="pull-left" :class="navType === 'hasStore' ? 'active' : ''" @click="getReloadList('hasStore')">
+          {{ChooseTop === 'component' ? '现货': '现货卖家'}}({{stockallTotal}})条
+        </span>
+         <span class="pull-left" :class="navType === 'noHasStore' ? 'active' : ''" @click="getReloadList('noHasStore')">
+          {{ChooseTop === 'component' ? '期货': '期货卖家'}}({{futuresallTotal}})条</span>
+       </div>
+       <div class="search-content" id="main-search-wrapper" :class="{'searchContent2' : ChooseTop === 'brand' && brandIsAccurate, 'searchContent3': ChooseTop === 'brand' && !brandIsAccurate}">
+         <!-- 品牌模糊查询 -->
+         <template v-if="!brandIsAccurate && ChooseTop === 'brand'">
+           <div class="middle" v-for="item in resourceList.content">
+             <div class="list clearfix" style="border-bottom: 1px solid #dcdcdc;padding-bottom: 0.1rem;line-height: 0.8rem;" @click="goToBrandAccurate(item)">
+               <img :src="item.logoUrl || '/images/component/default.png'" class="pull-left">
+               <div class="name pull-left overHidden" style="max-width: 5rem;">{{item.nameEn}}</div>
+               <div class="more_icon pull-right"><i class="iconfont icon-swiper-right"></i></div>
+             </div>
+             <div class="list">
+               <div class="name">主打产品:</div>
+               <div class="text">
+                 {{item.series}}
+               </div>
+             </div>
+             <div class="list">
+               <div class="name">应用领域:</div>
+               <div class="text">
+                 {{item.application}}
+               </div>
+             </div>
+             <div class="list">
+               <div class="name">品牌介绍:</div>
+               <div class="text">
+                 {{item.brief}}
+               </div>
+             </div>
+             <div class="list">
+               <div class="name">官网地址:</div>
+               <div class="text">
+                 <a :href="item.url" target="_blank">{{item.url}}</a>
+               </div>
+             </div>
+           </div>
+         </template>
+         <!-- /end 品牌模糊查询 -->
+         <template v-if="brandIsAccurate || (!brandIsAccurate && ChooseTop !== 'brand')">
+           <!-- 现货 -->
+           <template v-if="navType === 'hasStore'">
+             <!-- 型号结果 -->
+             <template v-if="ChooseTop === 'component'">
+               <div v-if="resourceList&&resourceList.stock&&resourceList.stock.content.length > 0">
+                 <div v-for="(item, index) in resourceList.stock.content">
+                   <!--@click="goProductDetail(item)"-->
+                   <div class="middle">
+                     <div class="list">
+                       <div class="name">品牌:</div>
+                       <div class="text overHidden">{{item.brand && item.brand.nameEn || '-'}}</div>
+                     </div>
+                     <div class="list">
+                       <div class="name">物料名称(类目):</div>
+                       <div class="text overHidden">{{item.kindNameCn || '-'}}</div>
+                     </div>
+                     <div class="list">
+                       <div class="name">型号:</div>
+                       <div class="text overHidden">{{item.code || '-'}}</div>
+                     </div>
+                     <div class="list">
+                       <div class="name">规格:</div>
+                       <div class="text overHidden">{{item.spec || '-'}}</div>
+                     </div>
+                     <div class="list">
+                       <div class="fl">
+                         <div class="name">包装:</div>
+                         <div class="text overHidden" style="width: 2.3rem">{{item.packaging || '无包装信息'}}</div>
+                       </div>
+                       <div class="fl">
+                         <div class="name">交期(天):</div>
+                         <div class="text overHidden" style="width: 1.8rem" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery != item.b2cMinDelivery)" v-text="item.b2cMinDelivery + '-'+ item.b2cMaxDelivery"></div>
+                         <div class="text overHidden" style="width: 1.8rem" v-if="item.b2cMaxDelivery && (item.b2cMaxDelivery == item.b2cMinDelivery)" v-text="item.b2cMinDelivery"></div>
+                       </div>
+                     </div>
+                     <div class="list">
+                       <div class="fl">
+                         <div class="name">生产日期:</div>
+                         <div class="text overHidden" style="width: 1.75rem" :title="item.produceDate">{{item.produceDate || '-'}}</div>
+                       </div>
+                       <div class="fl">
+                         <div class="name">库存:</div>
+                         <div class="text overHidden" style="width: 2.3rem">{{item.reserve || '-'}}</div>
+                       </div>
+                     </div>
+                     <div class="list">
+                       <div class="fl" @click.stop="goAttach(item.attach)">
+                         <div class="name">规格书:</div>
+                         <div class="text">
+                           <i class="iconfont icon-pdf" :class="{'active': item.attach && item.attach !== '' && item.attach !== '1'}"></i>
+                         </div>
+                       </div>
+                       <div class="fl">
+                         <div class="name">起拍:</div>
+                         <div class="text overHidden" style="width: 2.3rem">{{item.minBuyQty || '-'}}</div>
+                       </div>
+                     </div>
+                     <div class="list">
+                       <div class="name">卖家名称:</div>
+                       <div class="text overHidden">{{item.storeName}}</div>
+                     </div>
+                     <div class="list">
+                       <div class="name left">价格梯度<p>(pcs):</p></div>
+                       <div class="table left">
+                         <ul>
+                           <li class="title">
+                             <div>分段数量/PCS</div>
+                             <div>分段单价</div>
+                           </li>
+                           <li v-for="price in item.prices">
+                             <div>{{price.start}}+</div>
+                             <div v-if="item.currencyName == 'RMB'">¥{{price.rMBPrice}}</div>
+                             <div v-else>${{price.uSDPrice}}</div>
+                           </li>
+                         </ul>
+                       </div>
+                     </div>
+                     <div class="list clearfix">
+                       <div class="pull-left cancat" @click.stop="cancatSeller(item)">
+                         <i class="iconfont icon-kefu1"></i>联系卖家
+                       </div>
+                       <div class="pull-right clearfix">
+                         <div class="pull-left" @click="buy(item, false, $event)">加入购物车</div>
+                         <div class="pull-left" @click="buy(item, true, $event)">立即购买</div>
+                       </div>
+                     </div>
+                   </div>
+                 </div>
+               </div>
+             </template>
+             <!-- 卖家 物料名称 品牌-->
+             <template v-else-if="ChooseTop === 'kind' || ChooseTop === 'store' || ChooseTop === 'brand'">
+               <div v-if="resourceList&&resourceList.stock&&resourceList.stock.content.length > 0">
+                 <div class="middle" v-for="(item, index) in resourceList.stock.content">
+                   <nuxt-link :to="`/mobile/shop/${item.storeUuid}`" tag="div" class="list clearfix" style="border-bottom: 1px solid #dcdcdc;padding-bottom: 0.1rem">
+                     <div class="name pull-left">{{item.enName}}</div>
+                     <div class="more_icon pull-right"><i class="iconfont icon-swiper-right"></i></div>
+                   </nuxt-link>
+                   <div class="middle_bottom clearfix">
+                     <div class="middle_bottom-left">
+                       <img :src="item.storeLogoUrl || '/images/component/default.png'">
+                     </div>
+                     <div class="middle_bottom-left">
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">电话</div><label style="float: left">:</label>
+                         <div class="overHidden" style="width: 3.9rem">
+                           <a :href="'tel:' + AlertstoreInfo.enterprise.enTel" target="_blank" class="content-line" style="color: #2d8cf0">{{item.enTel}}</a>
+                         </div>
+                       </div>
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">邮箱</div><label style="float: left">:</label><div class="overHidden" style="width: 3.9rem">{{item.enEmail}}</div>
+                       </div>
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">执照号</div><label style="float: left">:</label><div class="overHidden" style="width: 3.9rem">{{item.enBusinesscode}}</div>
+                       </div>
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">地址</div><label style="float: left">:</label><div style="width: 3.9rem;">{{item.enAddress}}</div>
+                       </div>
+                     </div>
+                   </div>
+                 </div>
+               </div>
+             </template>
+           </template>
+           <!-- 期货 -->
+           <template v-else>
+             <!-- 型号结果 -->
+             <template v-if="ChooseTop === 'component'">
+               <div v-if="resourceList && resourceList.futures && resourceList.futures.content.length > 0">
+                 <div class="middle" v-for="(item, index) in resourceList.futures.content">
+                   <div class="list">
+                     <div class="name">品牌:</div>
+                     <div class="text overHidden">{{item.brandNameEn || '—'}}</div>
+                   </div>
+                   <div class="list">
+                     <div class="name">物料名称(类目):</div>
+                     <div class="text overHidden">{{item.kindNameCn || '-'}}</div>
+                   </div>
+                   <div class="list">
+                     <div class="name">型号:</div>
+                     <div class="text overHidden">{{item.code || '-'}}</div>
+                   </div>
+                   <div class="list">
+                     <div class="name">规格:</div>
+                     <div class="text overHidden">{{item.spec || '-'}}</div>
+                   </div>
+                   <div class="list">
+                     <div class="name">单位:</div>
+                     <div class="text overHidden">{{item.unit || 'PCS'}}</div>
+                   </div>
+                   <div class="list clearfix" style="overflow: inherit;">
+                     <div class="fl">
+                       <div class="name">卖家:</div>
+                       <div class="text overHidden" style="width: 4rem">{{item.storeName || '卖家名称'}}</div>
+                     </div>
+                     <div class="pull-right sayPriBtn" @click="publish(item)">立即询价</div>
+                   </div>
+                 </div>
+               </div>
+             </template>
+             <!-- 卖家 物料名称 品牌-->
+             <template v-else-if="ChooseTop === 'kind' || ChooseTop === 'store' || ChooseTop === 'brand'">
+               <div v-if="resourceList&&resourceList.futures &&resourceList.futures.content.length > 0">
+                 <div class="middle" v-for="(item, index) in resourceList.futures.content" @click="goSupplierDetail(item)">
+                   <div class="list clearfix" style="border-bottom: 1px solid #dcdcdc;padding-bottom: 0.1rem">
+                     <div class="name pull-left">{{item.enName}}</div>
+                     <div class="more_icon pull-right"><i class="iconfont icon-swiper-right"></i></div>
+                   </div>
+                   <div class="middle_bottom clearfix">
+                     <div class="middle_bottom-left">
+                       <img :src="item.storeLogoUrl || '/images/component/default.png'">
+                     </div>
+                     <div class="middle_bottom-left">
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">电话</div><label style="float: left">:</label>
+                         <div class="overHidden" style="width: 3.9rem">
+                           <a :href="'tel:' + AlertstoreInfo.enterprise.enTel" target="_blank" class="content-line" style="color: #2d8cf0">{{item.enTel}}</a>
+                         </div>
+                       </div>
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">邮箱</div><label style="float: left">:</label><div class="overHidden" style="width: 3.9rem">{{item.enEmail}}</div>
+                       </div>
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">执照号</div><label style="float: left">:</label><div class="overHidden" style="width: 3.9rem">{{item.enBusinesscode}}</div>
+                       </div>
+                       <div class="middle_bottom-leftitem clearfix">
+                         <div class="bottom-title">地址</div><label style="float: left">:</label><div style="width: 3.9rem;">{{item.enAddress}}</div>
+                       </div>
+                     </div>
+                   </div>
+                 </div>
+               </div>
+             </template>
+           </template>
+         </template>
+       </div>
+     </template>
+     <template v-if="allTotal === 0">
+       <div class="none-state">
+         <img src="/images/mobile/@2x/search-empty.png">
+         <p>暂无数据</p>
+         <nuxt-link to="/">返回首页</nuxt-link>
+       </div>
+     </template>
+   </div>
+   <!-- 联系卖买家 -->
+   <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
+     <div class="mobile-modal-box mobile-link-en">
+       <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
+       <div class="mobile-modal-content">
+         <div v-if="AlertstoreInfo.enterprise.enTel"><span >电话:</span><a :href="'tel:' + AlertstoreInfo.enterprise.enTel" target="_blank" class="content-line link-url">{{AlertstoreInfo.enterprise.enTel}}</a></div>
+         <div v-if="AlertstoreInfo.enterprise.enPhone"><span >手机:</span><a :href="'tel:' + AlertstoreInfo.enterprise.enPhone" target="_blank" class="content-line link-url">{{AlertstoreInfo.enterprise.enPhone}}</a></div>
+         <div v-if="AlertstoreInfo.enterprise.enWeixin"><span >微信:</span><span class="content-line">{{AlertstoreInfo.enterprise.enWeixin}}</span></div>
+         <div v-if="AlertstoreInfo.enterprise.enQQ"><span >Q&nbsp;Q:</span><span class="content-line">{{AlertstoreInfo.enterprise.enQQ}}</span></div>
+         <div v-if="!empty">暂无联系方式</div>
+       </div>
+     </div>
+   </div>
+   <!-- 询价 -->
+   <publish-supplier-seek :product="currentProduct" :showPublishBox="showPublishBox" @cancelAction="showPublishBox = false" @remindAction="setRemindText"></publish-supplier-seek>
+    <!-- 查看品牌更多信息 -->
+   <modal-wrapper :showModal="showBrandDetails" :title="currentBrandItem.nameEn" @closeAction="showBrandDetails=false">
+     <div class="store-info" >
+       <div class="store-description">
+         <h4>主营产品</h4>
+         <p class="content" v-if="currentBrandItem.series">
+           {{currentBrandItem.series}}
+         </p>
+         <div class="com-none-state" v-else>
+           <p>抱歉,暂无主营产品信息</p>
+         </div>
+       </div>
+       <div class="store-description">
+         <h4>应用领域</h4>
+         <p class="content" v-if="currentBrandItem.application">
+           {{currentBrandItem.application}}
+         </p>
+         <div class="com-none-state" v-else>
+           <p>抱歉,暂无应用领域信息</p>
+         </div>
+       </div>
+       <div class="store-description">
+         <h4>品牌介绍</h4>
+         <p class="content" v-if="currentBrandItem.brief">
+           {{currentBrandItem.brief}}
+         </p>
+         <div class="com-none-state" v-else>
+           <p>抱歉,暂无企业介绍</p>
+         </div>
+       </div>
+       <div class="contact-info">
+         <h4>联系我们</h4>
+         <ul class="list-unstyled clearfix">
+           <li>
+             <div>电&nbsp;&nbsp;话:</div>
+             <div v-if="currentBrandItem.userDefine.userTel"><a :href="'tel:' + currentBrandItem.userDefine.userTel" >{{currentBrandItem.userDefine.userTel}}</a></div>
+             <div v-else><span>-</span></div>
+           </li>
+           <!-- <li>
+              <div>店铺地址:</div>
+              <div v-if="store.enterprise.address">{{store.enterprise.address}}</div>
+              <div v-else><span>-</span></div>
+            </li>-->
+         </ul>
+       </div>
+     </div>
+   </modal-wrapper>
+   <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
+   <!--<loading v-if="isSearchSearchingMore"></loading>-->
+   <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox" :url="url"></login-box>
+   <pull-up :fixId="'main-search-wrapper'" :searchMore="isSearchSearchingMore" :allPage="allPage" :page="page" @pullUpAction="onPullUp" :FixedEl="true"></pull-up>
+ </div>
+</template>
+
+<script>
+  import { PublishSupplierSeek } from '~components/mobile/applyPurchase'
+  import { RemindBox, Loading, LoginBox, PullUp } from '~components/mobile/common'
+  import { ModalWrapper } from '~components/mobile/base'
+  import axios from '~plugins/axios'
+  export default {
+    layout: 'mobile',
+    data() {
+      return {
+        collectResult: '', // 提示性文字
+        timeoutCount: 0, // 弹出框计时数
+        isSearchSearchingMore: false, // 是否正在请求数据
+        showLoginBox: false, // 是否显示登录弹窗
+        url: '', // 登录后跳转回来的地址
+        keyword: '', // 关键字搜索
+        showStoreInfo: false, // 联系买卖家弹窗
+        AlertstoreInfo: { // 买卖家弹窗信息
+          enterprise: {}
+        },
+        navType: 'hasStore', // 现货 期货
+        ChooseTop: 'component', // 型号, 物料名称, 卖家, 品牌
+        page: 1,
+        currentProduct: {},
+        currentBrandItem: { // 查看品牌详情信息
+          userDefine: {}
+        }, // 存放当前点击的品牌内容
+        showBrandDetails: false, // 是否展示品牌详情
+        brandIsAccurate: false, // 品牌是否处于精确查找
+        showPublishBox: false, // 询价弹窗
+        resourceList: [],
+        futuresallTotal: 0,
+        stockallTotal: 0,
+        allPage: 0, // 总页数
+        allTotal: 0, // 总条数
+        associate: {
+          show: false
+        },
+        displayKeyword: ''
+      }
+    },
+    computed: {
+      getNowChooseType() {
+        if (this.ChooseTop === 'component') {
+          return '型号'
+        } else if (this.ChooseTop === 'kind') {
+          return '物料'
+        } else if (this.ChooseTop === 'store') {
+          return '卖家'
+        } else if (this.ChooseTop === 'brand') {
+          return '品牌'
+        }
+      },
+      empty () {
+        return this.checkInfo(this.AlertstoreInfo.enterprise.enTel) || this.checkInfo(this.AlertstoreInfo.enterprise.enPhone) || this.checkInfo(this.AlertstoreInfo.enterprise.enWeixin) || this.checkInfo(this.AlertstoreInfo.enterprise.enQQ)
+      },
+      placeholder() {
+        if (this.ChooseTop === 'component') {
+          return '请输入您要搜索的型号'
+        } else if (this.ChooseTop === 'kind') {
+          return '请输入您要搜索的物料名称'
+        } else if (this.ChooseTop === 'store') {
+          return '请输入您要搜索的卖家名称'
+        } else if (this.ChooseTop === 'brand') {
+          return '请输入您要搜索的品牌'
+        }
+      },
+      similarKeywords () {
+        return this.$store.state.search.keywords.data
+      }
+    },
+    async asyncData({store, route}) {
+      let ChooseTop = route.query.choosetype || 'component'
+      let keyword = route.query.keyword || ''
+      let brandIsAccurate = false
+      let { data } = await axios.get(`/search/201819`, {params: {count: 10, page: 1, keyword: keyword, type: ChooseTop}})
+      let allTotal = 0
+      let futuresallTotal = data.futures ? data.futures.total : 0
+      let stockallTotal = data.stock ? data.stock.total : 0
+      let allPage = 0
+      let currentBrandItem = {
+        userDefine: {}
+      }
+      if (ChooseTop === 'brand') {
+        if (data.futures && data.stock) {
+          // 品牌查询 精准查找
+          brandIsAccurate = true
+          currentBrandItem = data.brand
+          // 则总条数等于 现货 + 期货
+          allTotal = stockallTotal + futuresallTotal
+          allPage = Math.ceil(data.stock.total / 10)
+        } else {
+          allTotal = data.total || 0
+          allPage = Math.ceil(data.total / 10)
+        }
+      } else {
+        // 其他情况
+        allTotal = stockallTotal + futuresallTotal
+        allPage = Math.ceil(data.stock.total / 10)
+      }
+      return {
+        ChooseTop: ChooseTop,
+        keyword: keyword,
+        resourceList: data,
+        allPage: allPage,
+        stockallTotal: stockallTotal,
+        futuresallTotal: futuresallTotal,
+        allTotal: allTotal,
+        brandIsAccurate: brandIsAccurate,
+        currentBrandItem: currentBrandItem,
+        displayKeyword: keyword
+      }
+    },
+    methods: {
+      onPullUp() {
+        this.page++
+        this.ReloadList()
+      },
+      // 搜索点击事件
+      onClickSearchHander() {
+        if (!this.keyword) return
+        this.$router.push(`/mobile/search/newkeycode?choosetype=${this.ChooseTop}&keyword=${this.keyword}`)
+        // this.setChangelistHander(this.ChooseTop)
+        // window.location.href =
+      },
+      // 现货 期货切换
+      getReloadList(_tp) {
+        this.navType = _tp
+        this.page = 1
+        this.resourceList.futures.content = []
+        this.resourceList.stock.content = []
+        this.ReloadList()
+      },
+      // 刷新数据
+      ReloadList(param) {
+        // 如果有值,则代表 是品牌 模糊到精确
+        // 这里发送数据请求
+        this.isSearchSearchingMore = true
+        this.$http.get(`/search/201819`, {params: {count: 10, page: this.page, keyword: this.keyword, type: this.ChooseTop}}).then(res => {
+          this.isSearchSearchingMore = false
+          if (!this.brandIsAccurate && this.ChooseTop === 'brand') {
+            this.resourceList.content = [...this.resourceList.content, ...res.data.content]
+            return
+          }
+          if (this.navType === 'hasStore') {
+            this.resourceList.stock.content = [...this.resourceList.stock.content, ...res.data.stock.content]
+          } else {
+            this.resourceList.futures.content = [...this.resourceList.futures.content, ...res.data.futures.content]
+          }
+        }, err => {
+          this.isSearchSearchingMore = false
+        })
+      },
+      // 模糊品牌查询结果点击
+      goToBrandAccurate(item) {
+        this.currentBrandItem = item
+        this.keyword = item.nameEn
+        this.setChangelistHander(this.ChooseTop)
+      },
+      // 取消返回事件
+      cancelSearchHander() {
+        this.$router.replace('/')
+      },
+      // 购买 加入购物车
+      buy: function (item, flag, e) {
+        this.baseUtils.buyOrCar(flag, e, this, item, '/mobile/center/user/pay/')
+      },
+      // 联系买卖家
+      cancatSeller(item) {
+        this.$http.get(`/api/store-service/stores?uuid=${item.storeid}`).then(res => {
+          this.AlertstoreInfo = res.data
+          this.showStoreInfo = true
+        })
+      },
+      // 切换顶部一级标题
+      setChangelistHander(str) {
+        if (document.querySelector('#main-search-wrapper')) document.querySelector('#main-search-wrapper').scrollTop = 0
+        this.ChooseTop = str
+        this.page = 1
+        if (!this.keyword) return
+        this.displayKeyword = this.keyword
+        this.brandIsAccurate = false
+        this.isSearchSearchingMore = true
+        this.$http.get(`/search/201819`, {params: {count: 10, page: 1, keyword: this.keyword, type: this.ChooseTop}}).then(data => {
+          data = data.data
+          this.resourceList = data
+          this.futuresallTotal = data.futures ? data.futures.total : 0
+          this.stockallTotal = data.stock ? data.stock.total : 0
+          let allTotal = 0 // 总条数
+          if (this.ChooseTop === 'brand') {
+            if (data.futures && data.stock) {
+              // 品牌查询 精准查找
+              this.brandIsAccurate = true
+              // 则总条数等于 现货 + 期货
+              allTotal = this.stockallTotal + this.futuresallTotal
+              this.currentBrandItem = data.brand
+            } else {
+              allTotal = data.total || 0
+            }
+          } else {
+            // 其他情况
+            allTotal = this.stockallTotal + this.futuresallTotal
+          }
+          this.allTotal = allTotal
+          this.isSearchSearchingMore = false
+          if (!this.brandIsAccurate && this.ChooseTop === 'brand') {
+            // 品牌 模糊查找
+            this.allPage = Math.ceil(this.resourceList.total / 10) || 0
+          } else {
+            if (this.navType === 'hasStore') {
+              this.allPage = this.resourceList.stock && Math.ceil(this.resourceList.stock.total / 10) || 0
+            } else {
+              this.allPage = this.resourceList.futures && Math.ceil(this.resourceList.futures.total / 10) || 0
+            }
+          }
+          this.associate.show = false
+        })
+      },
+      // 供应商详情
+      goSupplierDetail: function (item) {
+        this.$http.get('/vendor/introduction/product/count', {params: {vendUU: item.enUU}})
+          .then(response => {
+            if (response.data.success && response.data.count > 0) {
+              this.$router.push(`/mobile/supplier/detail/${item.enUU}?isStore=${item.isStore}`)
+            } else {
+              this.setRemindText('供应商正在完善产品信息,暂时不能查看更多。')
+            }
+          })
+      },
+      checkInfo: function (str) {
+        return str && str.trim() !== ''
+      },
+      publish: function (product) {
+        if (this.user.logged) {
+          let item = {
+            cmpCode: product.code,
+            pbranden: product.brandNameEn,
+            brand: product.brandNameEn,
+            spec: product.spec,
+            kind: product.kindNameCn
+          }
+          this.currentProduct = item
+          this.showPublishBox = true
+        } else {
+          this.url = this.$route.fullPath
+          this.showLoginBox = true
+        }
+      },
+      setRemindText(str) {
+        this.timeoutCount++
+        this.collectResult = str
+      },
+      onAssociateClick (word) {
+        if (this.ChooseTop === 'component') {
+          this.keyword = word.code
+        } else if (this.ChooseTop === 'kind') {
+          this.keyword = word.nameCn
+        } else if (this.ChooseTop === 'store') {
+          this.keyword = word.name
+        } else if (this.ChooseTop === 'brand') {
+          this.keyword = word.nameEn
+        }
+        this.associate.show = false
+        this.setChangelistHander(this.ChooseTop)
+      },
+      Getsimilar(word) {
+        if (this.ChooseTop === 'component') {
+          return word.code
+        } else if (this.ChooseTop === 'kind') {
+          return word.nameCn
+        } else if (this.ChooseTop === 'store') {
+          return word.name
+        } else if (this.ChooseTop === 'brand') {
+          return word.nameEn
+        }
+      },
+      onChange () {
+        if (!this.keyword) {
+          this.associate.show = false
+          this.$store.dispatch('resetSearchKeywords')
+        } else {
+          this.searchKeywords()
+        }
+      },
+      changeKeyWord() {
+        this.associate.show = true
+        this.onChange()
+      },
+      searchKeywords () {
+        this.$store.dispatch('searchKeywords', {keyword: this.keyword, type: this.ChooseTop})
+      },
+      onClickTosearch(str) {
+        this.keyword = str
+        this.setChangelistHander(this.ChooseTop)
+      }
+    },
+    components: {
+      RemindBox,
+      Loading,
+      LoginBox,
+      PublishSupplierSeek,
+      ModalWrapper,
+      PullUp
+    },
+    watch: {
+      '$route' (to, from) {
+        this.keyword = to.query.keyword
+        this.displayKeyword = to.query.keyword
+        this.setChangelistHander(to.query.choosetype)
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+  .search-wrapper {
+    background: #f1f3f6;
+    width: 100%;
+    position: fixed;
+    z-index: 1000;
+    top: 0;
+    bottom: 0;
+    .main-search-header {
+      position: absolute;
+      background: #3e82f5;
+      line-height: .88rem;
+      margin-top: 0;
+      z-index: 1;
+      width: 100%;
+      input {
+        width: 4.88rem;
+        height: .62rem;
+        line-height: .62rem;
+        font-size: .26rem;
+        color: #999;
+        margin-left: 0.3rem;
+        /*padding-left: 1.26rem;*/
+        border: .04rem solid #fff;
+        background: #fff;
+        outline: none;
+        border-radius: 0;
+        float: left;
+        margin-top: .12rem;
+        -webkit-appearance: none;
+        border-top-left-radius: .14rem;
+        border-bottom-left-radius: .14rem;
+      }
+      span {
+        display: inline-block;
+        width: 1.02rem;
+        text-align: center;
+        height: .62rem;
+        line-height: .62rem;
+        color: #366df3;
+        font-size: .28rem;
+        margin-left: .02rem;
+        border-top-right-radius: .14rem;
+        border-bottom-right-radius: .14rem;
+        background: #fff;
+        float: left;
+        margin-top: .12rem;
+      }
+      a {
+        font-size: .28rem;
+        color: #fff;
+        margin-left: .2rem;
+      }
+      .main-search-header-controll {
+        background: #3e82f5;
+        width: 6.2rem;
+        span {
+          @include lineHeight(0.66rem);
+          font-size: 0.28rem;
+          color: #fff;
+          margin: 0;
+          background: rgba(0,0,0,0);
+          border-radius: 0;
+          width: 25%;
+          &.active a {
+            color: #fff;
+            border-bottom: 0.04rem solid #fff;
+          }
+          a {
+            margin-left: 0 !important;
+          }
+       }
+      }
+    }
+    .main-search-wrapper {
+      margin-top: 1.7rem;
+    }
+    .search-title {
+      font-size: 0.26rem;
+      text-align: center;
+      color: #999;
+      margin: 0 auto 0.2rem;
+      span {
+        color: #4290f7
+      }
+    }
+    .search-nav {
+      background: #fff;
+      @include lineHeight(1rem);
+      padding: 0 0.2rem;
+      span {
+        width: 50%;
+        color: #666;
+        font-size: 0.28rem;
+        text-align: center;
+        border-bottom: 0.04rem solid #dcdcdc;
+        @include lineHeight(0.7rem);
+        margin-top: 0.15rem;
+        &.active {
+          border-bottom: 0.04rem solid #4290f7;
+          color: #4290f7
+        }
+      }
+    }
+    .search-content {
+      padding-top: 0;
+      margin-top: 0.2rem;
+      height: calc(100vh - 3.43rem);
+      overflow-y: auto;
+      .middle {
+        background: #fff;
+        padding: 0.2rem;
+        .lookMoreBtn {
+          font-size: 0.28rem;
+          color: #2d8cf0
+        }
+        .more_icon {
+          font-size: 0.34rem;
+          color: #999;
+        }
+        .order-tag {
+          display: inline-block;
+          font-size: .18rem;
+          color: #fff;
+          font-weight: bold;
+          background: #ee1717;
+          height: .27rem;
+          width: .27rem;
+          line-height: .27rem;
+          text-align: center;
+          border-radius: .05rem;
+          position: relative;
+          top: -.05rem;
+          margin-right: .05rem;
+          &.reserve-tag {
+            background: #07bb1c;
+          }
+        }
+        text-align: left;
+        background: #fff;
+        /*border-radius: 5px;*/
+        margin-bottom: 0.2rem;
+        .overHidden {
+          @include overFlowHidden()
+        }
+        .pms {
+          color: #f57710;
+          border: 1px solid #f57710;
+          border-radius: 0.4rem;
+          background: #fff;
+          font-size: 0.24rem;
+          height: 0.4rem;
+          line-height: 0.4rem;
+          width: 0.8rem;
+          text-align: center;
+        }
+        .list {
+          @include overFlowHidden();
+          width: 100%;
+          .left {
+            float: left;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+          }
+          .textinfo {
+            font-size: 0.18rem;
+            margin-left: 0.1rem;
+            display: inline-block;
+            background: #3f84f6;
+            color: #fff;
+            font-weight: bold;
+            border-radius: 3px;
+            width: 0.8rem;
+            height: 0.32rem;
+            line-height: 0.32rem;
+            text-align: center
+          }
+          .button {
+            font-size: 0.3rem;
+            color: #1a58dd;
+            width: 0.92rem;
+            height: 0.43rem;
+            line-height: 0.43rem;
+            text-align: center;
+            border-radius: 5px;
+            border:1px solid #1a58dd;
+            display: inline-block;
+            margin-right: 0.2rem;
+          }
+          margin-bottom: 0.18rem;
+          &::after{
+            clear: both;
+            display: block;
+            content: ' ';
+            visibility: hidden;
+            zoom: 1;
+          }
+          .fl {
+            width: 3.5rem;
+            float: left;
+          }
+          .fr {
+            text-align: left;
+            width: 2.6rem;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+          }
+          &.list-long {
+            .fl {
+              width: 100% !important;
+            }
+          }
+          .name {
+            color: #666;
+            font-size: 0.28rem;
+            display: inline-block;
+          }
+          .text {
+            display: inline-block;
+            color: #333;
+            font-size: 0.28rem;
+            vertical-align: top;
+            width: 5.5rem;
+            @include overFlowHidden();
+          }
+          .table {
+            width: 5.85rem;
+            margin-bottom: 0;
+            margin-top: 0;
+            margin-left: 0.1rem;
+            li {
+              height: 0.43rem;
+              line-height: 0.43rem;
+              border-left: .01rem solid #c5c5c5;
+              font-size: .28rem;
+              &::after {
+                clear: both;
+                display: block;
+                content: ' ';
+                visibility: hidden;
+                zoom: 1;
+              }
+              div {
+                text-align: center;
+                width: 50%;
+                float: left;
+                border-right: .01rem solid #c5c5c5;
+                border-bottom: .01rem solid #c5c5c5;
+              }
+              &:nth-child(odd) {
+                background: #ddd;
+                color: #333;
+                font-size: 0.28rem;
+              }
+              &:nth-child(even) {
+                background: #fcfcfc;
+                color: #333;
+                font-size: 0.28rem;
+              }
+              &:nth-last-of-type(1){
+                color: #f31919;
+              }
+              &.title {
+                font-size: 0.28rem;
+                color: #333;
+              }
+            }
+          }
+          .pull-right {
+            div {
+              color: #3f84f6;
+              font-size: 0.28rem;
+              border-radius: 0.07rem;
+              border: 1px solid #3f84f6;
+              background: #fff;
+              width: 2rem;
+              line-height: 0.54rem;
+              height: 0.54rem;
+              text-align: center;
+            }
+            div:last-child {
+              margin-left: 0.2rem;
+              color: #fff;
+              background: #3f84f6;
+            }
+          }
+          i {
+            &.icon-pdf {
+              color: #929292;
+              font-size: 0.4rem;
+            }
+            &.active {
+              color: #eb062b;
+            }
+          }
+          .cancat {
+            height: 0.56rem;
+            line-height: 0.56rem;
+            border: 1px solid #3f84f6;
+            color: #3f84f6;
+            font-size: 0.26rem;
+            text-align: center;
+            border-radius: 3px;
+            padding: 0 0.1rem;
+            overflow: hidden;
+            width: auto;
+          }
+          img.pull-left {
+            width: 1.21rem;
+            height: 0.8rem;
+            border: 1px solid #dcdcdc;
+            border-radius: 0.07rem;
+            margin-top: 0;
+          }
+        }
+        .sayPriBtn {
+          width: 2rem;
+          @include lineHeight(0.54rem);
+          color: #fff;
+          font-size: 0.28rem;
+          background: #3f84f6;
+          border-radius: 3px;
+          text-align: center;
+          margin-top: -0.1rem;
+        }
+        .middle_bottom {
+          .middle_bottom-left {
+            float: left;
+            img {
+              width: 1.21rem;
+              height: 1.21rem;
+              border: 1px solid #3e82f5;
+              border-radius: 0.07rem;
+              overflow: hidden;
+            }
+            div.middle_bottom-leftitem {
+              line-height: 0.5rem;
+              font-size: 0.28rem;
+              div {
+                display: inline-block;
+                color: #666;
+                height: 100%;
+                float: left;
+                &.bottom-title {
+                  display: inline-block;
+                  text-align: justify;
+                  vertical-align: top;
+                  width: 1.5rem;
+                  height: 0.5rem;
+                  &::after {
+                    content: "";
+                    display: inline-block;
+                    width: 100%;
+                    overflow: hidden;
+                    height: 0;
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+    .searchContent2 {
+      height: calc(100vh - 7.3rem);
+    }
+    .searchContent3 {
+      height: calc(100vh - 2.25rem);
+    }
+    .store-info {
+      background: #f7f7f7;
+      h4{
+        width: 100%;
+        text-align: left;
+        font-size: 0.3rem;
+        line-height: 0.6rem;
+        height: 0.6rem;
+        letter-spacing: 0px;
+        color: #333;
+        font-weight: normal;
+        border-bottom: 1px solid #efeded;
+        padding-left: 0.11rem;
+        &:before{
+          content: '';
+          display: inline-block;
+          width: 0.08rem;
+          height: 0.26rem;
+          background-color: #145dee;
+          margin-right: 0.13rem;
+          position: relative;
+          top: 0.02rem;
+        }
+      }
+      .contact-info{
+        background: #fff;
+        margin: .2rem auto;
+        border-radius: .1rem;
+        ul{
+          padding: 0.22rem 0rem;
+          li{
+            div{
+              float: left;
+              font-size: .28rem;
+              color: #666;
+              line-height: .53rem;
+              width:80%;
+              text-align: left;
+              &:first-child{
+                width: 20%;
+                padding-left: 0.36rem;
+                text-align: justify;
+              }
+              a{
+                color: #145dee;
+              }
+              .click-tel, .click-phone{
+                color: #f44336;
+              }
+            }
+            /* &:last-child{
+               div{
+                 width: 74%;
+                 padding-right:.34rem;
+                 word-wrap: break-word;
+                 &:first-child{
+                   text-align: left;
+                   padding: 0rem 0rem 0rem .36rem;
+                   width: 26%;
+                 }
+               }
+             }*/
+          }
+        }
+      }
+      .store-description{
+        background: #fff;
+        /*width: 6.96rem;*/
+        margin: 0 auto .2rem;
+        border-radius: .1rem;
+        .content {
+          text-indent:2em;
+          background: #fff;
+          margin: .2rem auto 0;
+          padding: .04rem .34rem .4rem .34rem;
+          width: 100%;
+          font-size: .28rem;
+          color: #666;
+          text-align: left;
+          height: 95%;
+          /*box-shadow: 0 .03rem .01rem 0 #cdcbcb96;*/
+          line-height: .5rem;
+          word-break: break-all;
+        }
+      }
+    }
+    .none-state{
+      text-align: center;
+      padding:1.5rem 0;
+      background: #fff;
+      margin-top:.1rem;
+      width:100%;
+      img{
+        margin:0 auto;
+        width: 4.08rem;
+        height: 2.62rem;
+      }
+      p {
+        font-size: .32rem;
+        color: #999;
+        margin: 1.19rem 0 0 0;
+      }
+      a {
+        display: block;
+        font-size: .28rem;
+        color: #fff;
+        width: 1.88rem;
+        height: .54rem;
+        line-height: .54rem;
+        background: #418bf6;
+        margin: .7rem auto 0;
+        border-radius: .05rem;
+      }
+    }
+    .associate-list {
+      position: absolute;
+      width: 100%;
+      background: #fff;
+      top: 0.8rem;
+      border: 1px solid #dcdcdc;
+      z-index: 100;
+      height: 100%;
+      left: 0;
+      bottom: 0;
+      right: 0;
+      li {
+        height: 0.7rem;
+        line-height: .9rem;
+        margin: 0 .45rem;
+        border-bottom: .04rem solid #f1f0f0;
+        @include overFlowHidden();
+        i {
+          font-size: .36rem;
+          margin-right: .24rem;
+          color: #ddd;
+        }
+        span {
+          color: #999;
+          font-size: .28rem;
+          line-height: .58rem;
+          height: .58rem;
+          display: inline-block;
+        }
+        &:active, &:hover {
+          background: #eee;
+        }
+        &:last-child {
+          text-align: center;
+          font-size: .3rem;
+          color: #3976f4;
+          border-bottom: none;
+          &:active, &:hover {
+            background: #fff;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 1 - 1
pages/product/component/_uuid.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="detail">
-    <div v-if="componentDetail">
+    <div v-if="componentDetail && componentDetail.uuid">
       <component-menu/>
       <component-detail/>
       <store-info/>

+ 242 - 129
pages/search/_keyword.vue

@@ -1,29 +1,52 @@
 <template>
 <div class="container" id="searchResult">
-  <detail-brand></detail-brand>
-  <result-title :keyword="key" :page="nowPage"></result-title>
-    <kind @kindFilterEvent="listenKindFilter"
+  <!--<detail-brand></detail-brand>-->
+  <result-title :keyword="key" :page="nowPage" :count="count"></result-title>
+  <!--  <kind @kindFilterEvent="listenKindFilter"
           @brandFilterEvent="listenBrandFilter"
           @typeFilterEvent="listenTypeFilter"
           @crnameFilterEvent="listenCrnameFilter"
           @crnameFlagEvent="listenCrnameFlag"
-    ></kind>
-  <good-list @pageEvent="listenPage"
-             @sortEvent="listenSort"
-             @filterPriceEvent="listenPriceFilter"
-             :crname_click_flag="crname_click_flag"
-  ></good-list>
+    ></kind>-->
+  <brand-detail :supBrandObj="goods.brand" v-if="searchType == 'brand' && goods.brand"></brand-detail>
+  <div class="search-result-type" v-if="!goods.content">
+    <span class="inline-block" :class="{active: resultType == 'current'}" @click="setResultType('current')">现货({{stockTotal}}条)</span>
+    <span class="inline-block" :class="{active: resultType == 'forward'}" @click="setResultType('forward')">期货({{futureTotal}}条)</span>
+  </div>
+  <template v-if="searchType == 'component'">
+    <good-list v-if="resultType === 'current'"
+               @pageEvent="listenPage"
+               @sortEvent="listenSort"
+               @filterPriceEvent="listenPriceFilter"
+               :crname_click_flag="crname_click_flag"
+    ></good-list>
+    <forward-goods-list v-else></forward-goods-list>
+  </template>
+  <template v-if="searchType == 'kind' || searchType == 'store' || (searchType == 'brand' && goods.brand)">
+    <supplier-list :resultType="resultType"></supplier-list>
+  </template>
+  <template v-if="searchType == 'brand' && !goods.brand">
+    <brand-list></brand-list>
+  </template>
+  <page :total="currentCount" :page-size="pageSize"
+        :current="nowPage" @childEvent="listenPage"></page>
+  <div class="empty" v-if="currentCount === 0">
+    <img src="/images/all/empty-cart.png" alt="">
+    <span>暂无搜索结果</span>
+  </div>
 </div>
 </template>
 <script>
-  import { GoodList, Kind, ResultTitle } from '~components/search'
-  import DetailBrand from '~components/search/DetailBrand.vue'
+  import { GoodList, ResultTitle, ForwardGoodsList, SupplierList, BrandList } from '~components/search'
+  import { BrandDetail } from '~components/product'
+  import Page from '~components/common/page/pageComponent.vue'
+//  import DetailBrand from '~components/search/DetailBrand.vue'
   export default{
     layout: 'main',
     data () {
       return {
         key: this.$route.query.w,
-        pageSize: 15,
+        pageSize: 10,
         nowPage: 1,
         sorting: {},
         filter: {},
@@ -31,73 +54,120 @@
         crname_click_flag: {
           rmb_click_flag: false,
           usd_click_flag: false
-        }
+        },
+        // 现货:current, 期货:forward
+        resultType: 'current'
       }
     },
     fetch ({store, route}) {
       return Promise.all([
-        store.dispatch('searchData/searchForKinds', {collectList: 'goods_kind', keyword: route.query.w, paramJSON: {}}),
-        store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: route.query.w, paramJSON: {}}),
-        store.dispatch('searchData/searchForList', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {}}),
-        store.dispatch('searchData/searchForStoreType', {collectList: 'goods_store_type', keyword: route.query.w, paramJSON: {}}),
-        store.dispatch('searchData/searchForCrname', {collectList: 'goods_crname', keyword: route.query.w, paramJSON: {}})
+        store.dispatch('searchData/searchForListNew', {count: 10, keyword: route.query.w, page: 1, type: route.query.type || 'component'})
       ])
     },
     components: {
       ResultTitle,
-      Kind,
       GoodList,
-      DetailBrand
+      ForwardGoodsList,
+      SupplierList,
+      Page,
+      BrandList,
+      BrandDetail
+//      DetailBrand
     },
     watch: {
-      '$route.query.w': {
+      '$route.query': {
         handler: function (val) {
-          this.key = val
+          this.key = val.w
           this.reloadAll()
         },
         immediate: false
       }
     },
+    computed: {
+      // 搜索类型
+      searchType () {
+        return this.$route.query.type || 'component'
+      },
+      // 搜索结果
+      goods () {
+        return this.$store.state.searchData.searchList.listNew.data
+      },
+      // 现货数量
+      stockTotal () {
+        return this.goods.stock ? this.goods.stock.total : 0
+      },
+      // 期货数量
+      futureTotal () {
+        return this.goods.futures ? this.goods.futures.total : 0
+      },
+      // 当前分页数
+      currentCount () {
+        if (this.goods.content) {
+          return this.goods.total
+        } else {
+          return this.resultType === 'current' ? this.stockTotal : this.futureTotal
+        }
+      },
+      // 总数
+      count () {
+        if (this.goods.content) {
+          return this.goods.total
+        } else {
+          return this.stockTotal + this.futureTotal
+        }
+      }
+    },
     methods: {
+      initParams: function () {
+        this.resultType = 'current'
+        this.nowPage = 1
+      },
       reloadAll: function () {
         this.filter = {}
         this.sorting = {}
         this.paramJSON = {}
         this.reloadList()
-        this.reloadKind()
-        this.reloadBrand()
-        this.reloadStoreType()
-        this.reloadCrname()
+//        this.reloadKind()
+//        this.reloadBrand()
+//        this.reloadStoreType()
+//        this.reloadCrname()
       },
       reloadList: function () {
-        if (this.sorting === {}) {
-          this.sorting = {}
+        let params = {
+          count: this.pageSize,
+          keyword: this.$route.query.w,
+          page: this.nowPage,
+          type: this.searchType
         }
-        this.$store.dispatch('searchData/searchForList', {count: this.pageSize, filter: this.filter, keyword: this.$route.query.w, page: this.nowPage, sorting: this.sorting})
-      },
-      reloadKind: function () {
-        if (!this.filter.goods_kindId) {
-          this.$store.dispatch('searchData/searchForKinds', {collectList: 'goods_kind', keyword: this.$route.query.w, paramJSON: this.paramJSON})
-        }
-      },
-      reloadBrand: function () {
-        if (!this.filter.goods_brandId) {
-          this.$store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: this.$route.query.w, paramJSON: this.paramJSON})
-        }
-      },
-      reloadStoreType: function () {
-        if (!this.filter.goods_store_type) {
-          this.$store.dispatch('searchData/searchForStoreType', {collectList: 'goods_store_type', keyword: this.$route.query.w, paramJSON: this.paramJSON})
-        }
-      },
-      reloadCrname: function () {
-        if (!this.filter.goods_crname) {
-          this.$store.dispatch('searchData/searchForCrname', {collectList: 'goods_crname', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        if (this.searchType === 'component') {
+          params.filter = this.filter
+          params.sorting = this.sorting
         }
+        return this.$store.dispatch('searchData/searchForListNew', params)
       },
+//      reloadKind: function () {
+//        if (!this.filter.goods_kindId) {
+//          this.$store.dispatch('searchData/searchForKinds', {collectList: 'goods_kind', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
+//      reloadBrand: function () {
+//        if (!this.filter.goods_brandId) {
+//          this.$store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
+//      reloadStoreType: function () {
+//        if (!this.filter.goods_store_type) {
+//          this.$store.dispatch('searchData/searchForStoreType', {collectList: 'goods_store_type', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
+//      reloadCrname: function () {
+//        if (!this.filter.goods_crname) {
+//          this.$store.dispatch('searchData/searchForCrname', {collectList: 'goods_crname', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
       listenPage: function (nPage) {
         this.nowPage = nPage
-        this.reloadList()
+        return this.reloadList()
       },
       listenSort: function (sortType) {
         this.sorting = sortType
@@ -116,90 +186,133 @@
         }
         this.reloadList()
       },
-      listenKindFilter: function (kindarr) {
-        this.nowPage = 1
-        if (kindarr.length === 0) {
-          delete this.filter.goods_kindId
-          delete this.paramJSON.goods_kindid
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        } else {
-          this.filter.goods_kindId = kindarr
-          this.paramJSON.goods_kindid = kindarr
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        }
-      },
-      listenBrandFilter: function (brandarr) {
-        this.nowPage = 1
-        if (brandarr.length === 0) {
-          delete this.filter.goods_brandId
-          delete this.paramJSON.goods_brandid
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        } else {
-          this.filter.goods_brandId = brandarr
-          this.paramJSON.goods_brandid = brandarr
-          this.reloadKind()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        }
-      },
-      listenTypeFilter: function (typearr) {
-        this.nowPage = 1
-        if (typearr.length === 0) {
-          delete this.filter.goods_store_type
-          delete this.paramJSON.goods_store_type
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadCrname()
-        } else {
-          this.filter.goods_store_type = typearr
-          this.paramJSON.goods_store_type = typearr
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadCrname()
-        }
-      },
-      listenCrnameFilter: function (crnamearr) {
-        this.nowPage = 1
-        if (crnamearr.length === 0) {
-          delete this.filter.goods_crname
-          delete this.paramJSON.goods_crname
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-        } else {
-          this.filter.goods_crname = crnamearr
-          this.paramJSON.goods_crname = crnamearr
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-        }
-      },
-      listenCrnameFlag: function (obj) {
-        if (obj.rmb_click_flag && obj.usd_click_flag) {
-          this.crname_click_flag.rmb_click_flag = false
-          this.crname_click_flag.usd_click_flag = false
+//      listenKindFilter: function (kindarr) {
+//        this.nowPage = 1
+//        if (kindarr.length === 0) {
+//          delete this.filter.goods_kindId
+//          delete this.paramJSON.goods_kindid
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        } else {
+//          this.filter.goods_kindId = kindarr
+//          this.paramJSON.goods_kindid = kindarr
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        }
+//      },
+//      listenBrandFilter: function (brandarr) {
+//        this.nowPage = 1
+//        if (brandarr.length === 0) {
+//          delete this.filter.goods_brandId
+//          delete this.paramJSON.goods_brandid
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        } else {
+//          this.filter.goods_brandId = brandarr
+//          this.paramJSON.goods_brandid = brandarr
+//          this.reloadKind()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        }
+//      },
+//      listenTypeFilter: function (typearr) {
+//        this.nowPage = 1
+//        if (typearr.length === 0) {
+//          delete this.filter.goods_store_type
+//          delete this.paramJSON.goods_store_type
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadCrname()
+//        } else {
+//          this.filter.goods_store_type = typearr
+//          this.paramJSON.goods_store_type = typearr
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadCrname()
+//        }
+//      },
+//      listenCrnameFilter: function (crnamearr) {
+//        this.nowPage = 1
+//        if (crnamearr.length === 0) {
+//          delete this.filter.goods_crname
+//          delete this.paramJSON.goods_crname
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//        } else {
+//          this.filter.goods_crname = crnamearr
+//          this.paramJSON.goods_crname = crnamearr
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//        }
+//      },
+//      listenCrnameFlag: function (obj) {
+//        if (obj.rmb_click_flag && obj.usd_click_flag) {
+//          this.crname_click_flag.rmb_click_flag = false
+//          this.crname_click_flag.usd_click_flag = false
+//        } else {
+//          this.crname_click_flag.rmb_click_flag = obj.rmb_click_flag
+//          this.crname_click_flag.usd_click_flag = obj.usd_click_flag
+//        }
+//      },
+      setResultType: function (resultType) {
+        if (this.nowPage > 1) {
+          this.listenPage(1).then(() => {
+            this.resultType = resultType
+          })
         } else {
-          this.crname_click_flag.rmb_click_flag = obj.rmb_click_flag
-          this.crname_click_flag.usd_click_flag = obj.usd_click_flag
+          this.resultType = resultType
         }
+//        this.listenPage(1).then(() => {
+//          this.resultType = resultType
+//        })
       }
     }
   }
 </script>
+<style lang="scss" scoped>
+  #searchResult {
+    margin-bottom: 36px;
+    .search-result-type {
+      border-bottom: 2px solid #2e91f0;
+      span {
+        padding: 12px 37px;
+        color: #666;
+        font-size: 14px;
+        border: 1px solid #ccc;
+        cursor: pointer;
+        &.active {
+          color: #fff;
+          background: #2e91f0;
+          border-color: #2e91f0;
+        }
+      }
+    }
+    .empty {
+      text-align: center;
+      height: 200px;
+      line-height: 200px;
+      border: 1px solid #e8e8e8;
+      margin-bottom: 10px;
+      span {
+        color: #999;
+        margin-left: 10px;
+      }
+    }
+  }
+</style>
 

+ 8 - 1
plugins/mixin.js

@@ -100,7 +100,7 @@ Vue.mixin({
       }
     },
     login: function (url) {
-      this.$router.push(`/auth/login${url ? '?returnUrl=' + url : ''}`)
+      this.$router.push(`/auth/login${url ? '?returnUrl=' + encodeURIComponent(url) : ''}`)
     },
     goStoreApply: function () {
       if (this.user.logged) {
@@ -128,6 +128,13 @@ Vue.mixin({
     },
     authorityInterceptor: function (url, callback) {
       this.baseUtils.getAuthority(this, url, callback, this.isMobile)
+    },
+    authenticateInterceptor: function (callback) {
+      if (this.user.logged) {
+        callback.call(this)
+      } else {
+        this.login(window.location.href)
+      }
     }
   },
   filters: {

BIN
static/images/mobile/@2x/productDetail/Strand.png


BIN
static/images/mobile/@2x/productDetail/isStrand.png


+ 10 - 0
store/index.js

@@ -244,6 +244,16 @@ export const actions = {
         commit('search/GET_KEYWORDS_FAILURE', err)
       })
   },
+  // 搜索关键字列表
+  searchKeywordsList({ commit }, params = {}) {
+    commit('search/REQUEST_KEYWORDSLIST')
+    return axios.get('/search/201819', { params })
+      .then(response => {
+        commit('search/GET_KEYWORDSLIST_SUCCESS', response.data)
+      }, err => {
+        commit('search/GET_KEYWORDSLIST_FAILURE', err)
+      })
+  },
   resetSearchKeywords({ commit }) {
     commit('search/RESET_KEYWORDS')
   },

+ 28 - 1
store/option.js

@@ -37,7 +37,16 @@ export const state = () => ({
     data: {}
   },
   messageType: '',
-  showMobileFooter: true
+  showMobileFooter: true,
+  // 定义小球数量为5个。如果遇到问题,这个地方需要重新处理
+  ballsList: [
+    {show: false},
+    {show: false},
+    {show: false},
+    {show: false},
+    {show: false}
+  ],
+  dropBalls: []
 })
 
 export const mutations = {
@@ -123,5 +132,23 @@ export const mutations = {
   },
   SET_SHOW_MOBILE_FOOTER (state, result) {
     state.showMobileFooter = result
+  },
+  SET_BALLSLIST_SUCCESS(state, result) {
+    for (let i = 0; i < state.ballsList.length; i++) {
+      let ball = state.ballsList[i]
+      if (!ball.show) {
+        ball.show = true
+        ball.el = result
+        state.dropBalls.push(ball)
+        return
+      }
+    }
+  },
+  SET_BALLSLIST_SUCCESS_DROP(state, result) {
+    let ball = state.dropBalls.shift()
+    if (ball) {
+      ball.show = false
+      result.style.display = 'none'
+    }
   }
 }

+ 10 - 0
store/product.js

@@ -185,6 +185,16 @@ export const actions = {
         commit('common/GET_COLLECT_LIST_FAILURE', err)
       })
   },
+  // 获取搜索所有物料信息
+  loadPublishList ({ commit }, params = {}) {
+    commit('common/REQUEST_PUBLISH_MOBILE')
+    return axios.get(`/api/product/search/page`, { params })
+      .then(response => {
+        commit('common/GET_PUBLISH_MOBILE_SUCCESS', response.data)
+      }, err => {
+        commit('common/GET_PUBLISH_MOBILE_FAILURE', err)
+      })
+  },
   // 供应商维护
   loadSupplierInformation ({ commit }, params = {}) {
     let uuid = params.uuid

+ 14 - 0
store/product/common.js

@@ -14,6 +14,10 @@ export const state = () => ({
   collectListMobile: {
     fetching: false,
     data: []
+  },
+  publishMobile: {
+    fetching: false,
+    data: []
   }
 })
 
@@ -57,5 +61,15 @@ export const mutations = {
   GET_COLLECT_LIST_SUCCESS (state, result) {
     state.collectListMobile.fetching = false
     state.collectListMobile.data = result
+  },
+  REQUEST_PUBLISH_MOBILE (state) {
+    state.publishMobile.fetching = true
+  },
+  GET_PUBLISH_MOBILE_FAILURE (state) {
+    state.publishMobile.fetching = false
+  },
+  GET_PUBLISH_MOBILE_SUCCESS (state, result) {
+    state.publishMobile.fetching = false
+    state.publishMobile.data = result
   }
 }

+ 15 - 0
store/search.js

@@ -2,6 +2,11 @@ export const state = () => ({
   keywords: {
     fetching: false,
     data: []
+  },
+
+  keywordsList: {
+    fetching: false,
+    data: []
   }
 })
 
@@ -16,6 +21,16 @@ export const mutations = {
     state.keywords.fetching = false
     state.keywords.data = result
   },
+  REQUEST_KEYWORDSLIST (state) {
+    state.keywordsList.fetching = true
+  },
+  GET_KEYWORDSLIST_FAILURE (state) {
+    state.keywordsList.fetching = false
+  },
+  GET_KEYWORDSLIST_SUCCESS (state, result) {
+    state.keywordsList.fetching = false
+    state.keywordsList.data = result
+  },
   RESET_KEYWORDS (state) {
     state.keywords.data = []
   }

+ 10 - 0
store/searchData.js

@@ -118,6 +118,16 @@ export const actions = {
       }, err => {
         commit('searchHistory/GET_SEARCH_HISTORY_FAILURE', err)
       })
+  },
+  // 获取搜索历史
+  searchForListNew ({ commit }, params = {}) {
+    commit('searchList/REQUEST_LIST_NEW', params)
+    return axios.get(`/search/201819`, {params})
+      .then(response => {
+        commit('searchList/GET_LIST_NEW_SUCCESS', response.data)
+      }, err => {
+        commit('searchList/GET_LIST_NEW_FAILURE', err)
+      })
   }
 }
 

+ 14 - 0
store/searchData/searchList.js

@@ -2,6 +2,10 @@ export const state = () => ({
   lists: {
     fetching: false,
     data: []
+  },
+  listNew: {
+    fetching: false,
+    data: []
   }
 })
 
@@ -15,5 +19,15 @@ export const mutations = {
   GET_LIST_SUCCESS (state, result) {
     state.lists.fetching = false
     state.lists.data = result
+  },
+  REQUEST_LIST_NEW (state) {
+    state.listNew.fetching = true
+  },
+  GET_LIST_NEW_FAILURE (state) {
+    state.listNew.fetching = false
+  },
+  GET_LIST_NEW_SUCCESS (state, result) {
+    state.listNew.fetching = false
+    state.listNew.data = result
   }
 }

+ 122 - 0
utils/mixin.js

@@ -231,3 +231,125 @@ export const goodsPurchaseOperate = {
     }
   }
 }
+
+/*
+* 根据产品发布询价
+* */
+export const seekProduct = {
+  data () {
+    return {
+      applyObj: {
+        unitPrice: '',
+        currency: 'RMB',
+        encapsulation: '',
+        produceDate: '',
+        amount: '',
+        deadline: ''
+      },
+      validObj: {
+        unitPrice: true,
+        amount: true,
+        deadline: true
+      },
+      pickerOptions: {
+        disabledDate (time) {
+          // 大于等于今天 小于三个月后
+          return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
+        }
+      },
+      hasDialog: false
+    }
+  },
+  methods: {
+    // 时间格式化
+    setDeadLineValid: function () {
+      this.applyObj.deadline = this.baseUtils.formatDate(this.applyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
+      this.validObj.deadline = true
+    },
+    // 检查单价预算
+    checkUnitPrice () {
+      this.validObj.unitPrice = this.applyObj.unitPrice === '' ? true : this.applyObj.unitPrice > 0 && this.applyObj.unitPrice < 100000000
+      if (!this.validObj.unitPrice && this.applyObj.unitPrice <= 0) {
+        this.$message.error('单价必须是大于0的数字')
+      }
+      return this.validObj.unitPrice
+    },
+    // 检查采购数量
+    checkAmount () {
+      this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
+      return this.validObj.amount
+    },
+    // 检查时间是否有输入
+    checkDeadline () {
+      this.validObj.deadline = Boolean(this.applyObj.deadline)
+      return this.validObj.deadline
+    },
+    // 检查各个字段输入正常数据
+    checkAll () {
+      return this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
+    },
+    emptyForm () {
+      for (let attr in this.applyObj) {
+        this.applyObj[attr] = attr === 'currency' ? 'RMB' : ''
+      }
+    },
+    // 请求询价信息
+    goPublish () {
+      // let _this = this
+      // this.isClick = true
+      // setTimeout(function () {
+      //   _this.isClick = false
+      // }, 1000)
+      if (this.checkAll()) {
+        let inquiry = {}
+        let inquiryItem = {}
+        if (this.user.data.enterprise) {
+          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
+        inquiry.recorder = this.user.data.userName
+        inquiry.endDate = this.applyObj.deadline
+        inquiry.sourceapp = 'MALL'
+        inquiry.amount = 1
+        inquiryItem.userUU = this.user.data.userUU
+        inquiryItem.source = 'MALL'
+        inquiryItem.userName = this.user.data.userName
+        inquiryItem.userTel = this.user.data.userTel
+        inquiryItem.needquantity = this.applyObj.amount
+        inquiryItem.inbrand = this.productItem.brand
+        inquiryItem.currency = currency
+        inquiryItem.cmpCode = this.productItem.cmpCode.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.productItem.spec
+        inquiryItem.prodTitle = this.productItem.prodName
+        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(res => {
+            this.$message.success('发布成功')
+            this.emptyForm()
+            this.showObj.show = false
+          }, error => {
+            console.log(error)
+            this.$message.error('发布失败')
+          })
+      } else {
+        if (!this.validObj.deadline) {
+          this.$message.error('截止日期不能为空')
+        } else if (!this.validObj.amount) {
+          this.$message.error('请输入正确的数值')
+        }
+      }
+    }
+  }
+}