浏览代码

Merge remote-tracking branch 'origin/feature/yc-pc_mobile-0516' into feature/yc-pc_mobile-0516

# Conflicts:
#	components/mobile/common/userHeader.vue
#	nuxt.config.js
shenjj 7 年之前
父节点
当前提交
b97b96a660

+ 5 - 0
assets/scss/common.scss

@@ -730,3 +730,8 @@ img.new-animate{
 .clear-float {
   clear: both;
 }
+
+.inline-block {
+  display: inline-block;
+  vertical-align: middle;
+}

+ 3 - 3
components/applyPurchase/ApplyInfo.vue

@@ -4,7 +4,7 @@
       <p>最新求购信息</p>
       <span>海量求购,一网打尽</span>
       <div>
-        <input type="text" class="form-control" v-model="keyWord" @keyup.13="searchList" :placeholder="user.logged ? '型号/品牌/店铺' : '型号/品牌'" />
+        <input type="text" class="form-control" v-model="keyWord" @keyup.13="searchList" :placeholder="user.logged ? '型号/品牌/公司' : '型号/品牌'" />
         <span @click="searchList">查询</span>
       </div>
     </div>
@@ -592,8 +592,8 @@ export default {
                     float: left;
                   }
                   &.size-middle {
-                    width: 136px;
-                    margin-right: 37px;
+                    width: 198px;
+                    margin-right: 0;
                     .content {
                       width: 86px;
                     }

+ 5 - 5
components/applyPurchase/BatchPublish.vue

@@ -29,7 +29,7 @@
           <td>
             <div class="prod-items">
               <div class="prod-item prod-item-large" :title="item.kind">
-                <span class="pi-title">类目:</span>
+                <span class="pi-title">类目(产品名称):</span>
                 <div class="pi-content over-ell">{{item.kind || '-'}}</div>
               </div>
               <div class="prod-item prod-item-large" :title="item.code">
@@ -141,7 +141,7 @@
           <td>
             <div class="prod-items">
               <div class="prod-item prod-item-large">
-                <span class="pi-title">类目:</span>
+                <span class="pi-title">类目(产品名称):</span>
                 <input type="text" class="form-control" v-model="modifyObj.kind" @input="onProdTitleInput">
               </div>
               <div class="prod-item prod-item-large">
@@ -1135,7 +1135,7 @@
                       width: 226px;
                     }
                     .pi-title {
-                      width: 62px;
+                      width: 113px;
                     }
                   }
                   &.prod-item-small {
@@ -1150,7 +1150,7 @@
                     line-height: normal;
                     position: absolute;
                     top: 31px;
-                    left: 62px;
+                    left: 113px;
                     background: #fff;
                     border: 1px solid #b5b5b5;
                     z-index: 1;
@@ -1158,7 +1158,7 @@
                     overflow-y: auto;
                     overflow-x: hidden;
                     border-radius: 2px;
-                    width: 228px;
+                    width: 226px;
                     li {
                       height: 30px;
                       line-height: 30px;

+ 3 - 2
components/applyPurchase/PublishApply.vue

@@ -443,8 +443,9 @@
           }
         } else if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 50) {
           this.applyObj.brand = cutOutString(this.applyObj.brand, 50)
+        } else {
+          this.getSimilarBrand()
         }
-        this.getSimilarBrand()
       },
       onAmountInput: function () {
         if (!(/^[0-9]*$/).test(this.applyObj.amount)) {
@@ -592,7 +593,7 @@
               line-height: normal;
               position: absolute;
               top: 19px;
-              left: 79px;
+              left: 108px;
               background: #fff;
               border: 1px solid #b5b5b5;
               z-index: 1;

+ 52 - 18
components/mobile/MobileFooter.vue

@@ -10,41 +10,53 @@
         <i :class="activeType=='shops'?'iconfont icon-dianpu':'iconfont icon-dianpu1'"></i><p>店铺</p>
       </nuxt-link>
     </span>-->
-    <span class="seek" @click="goSayPrice">
+    <!--<span class="seek" @click="goSayPrice">
       <a>
         <img src="/images/mobile/@2x/applyPurchase/home/seek-footer.png" alt="">
         <p>发布求购</p>
       </a>
+    </span>-->
+    <span :class="{'active': activeType == 'userCenter'}">
+      <a @click="goWithLogin('/mobile/center?type=buyer')">
+        <img :src="`/images/mobile/@2x/home/userCenter${activeType === 'userCenter' ? '-active' : ''}.png`" alt="">
+        <p>买家中心</p>
+      </a>
+    </span>
+    <span :class="{'active': activeType == 'vendorCenter'}">
+      <a @click="goWithLogin('/mobile/center?type=saler', true)">
+        <img :src="`/images/mobile/@2x/home/vendorCenter${activeType === 'vendorCenter' ? '-active' : ''}.png`" alt="">
+        <p>卖家中心</p>
+      </a>
     </span>
     <span :class="activeType=='user'?'active':''">
-      <a @click="goCollect">
+      <a @click="goWithLogin('/mobile/user?type=buyer')">
         <i :class="activeType=='user'?'iconfont icon-icon':'iconfont icon-wo'"></i><p>我</p>
       </a>
     </span>
     <a @click="toTop" v-show="!hideToTop"><i class="iconfont icon-arrow-up icon-xlg"></i></a>
     <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
-    <publish-seek :showSayPriceBox="showSayPriceBox" @cancelAction="showSayPriceBox = false" @reloadAction="onReload" @remindAction="onRemind"></publish-seek>
+    <!--<publish-seek :showSayPriceBox="showSayPriceBox" @cancelAction="showSayPriceBox = false" @reloadAction="onReload" @remindAction="onRemind"></publish-seek>-->
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 <script>
   import { scrollTo } from '~utils/scroll'
   import {LoginBox, RemindBox} from '~components/mobile/common'
-  import PublishSeek from './applyPurchase/PublishSeek.vue'
+//  import PublishSeek from './applyPurchase/PublishSeek.vue'
   export default{
     name: 'MobileFooter',
     data () {
       return {
         hideToTop: true,
         showLoginBox: false,
-        showSayPriceBox: false,
+//        showSayPriceBox: false,
         remindText: '',
         timeoutCount: 0
       }
     },
     components: {
       LoginBox,
-      PublishSeek,
+//      PublishSeek,
       RemindBox
     },
     computed: {
@@ -52,7 +64,22 @@
         return this.$store.state.mobile.InputGetFocus
       },
       activeType () {
-        return this.$route.path === '/' ? 'home' : this.$route.path === '/mobile/shop' ? 'shops' : this.$route.path === '/mobile/user' ? 'user' : ''
+        let path = this.$route.path
+        if (path === '/') {
+          return 'home'
+        } else if (path === '/mobile/shop') {
+          return 'shops'
+        } else if (path === '/mobile/user') {
+          return 'user'
+        } else if (path === '/mobile/center') {
+          if (this.$route.query.type === 'saler') {
+            return 'vendorCenter'
+          } else {
+            return 'userCenter'
+          }
+        } else {
+          return ''
+        }
       },
       user () {
         return this.$store.state.option.user
@@ -75,21 +102,25 @@
       toTop () {
         scrollTo('body', 300)
       },
-      goCollect: function () {
+      goWithLogin: function (url, isSelf) { // 是否拦截个人
         if (this.user.logged) {
-          this.$router.push('/mobile/user?type=buyer')
+          if (isSelf && !this.user.data.enterprise.uu) {
+            this.onRemind('请先前往pc端开通卖家中心')
+          } else {
+            this.$router.push(url)
+          }
         } else {
           this.showLoginBox = true
         }
       },
-      onReload: function () {
-        const path = this.$route.path
-        if (path === '/') {
-          this.$store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: 1, pageSize: 5, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
-        } else if (path === '/mobile/applyPurchase/list') {
-          this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
-        }
-      },
+//      onReload: function () {
+//        const path = this.$route.path
+//        if (path === '/') {
+//          this.$store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: 1, pageSize: 5, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
+//        } else if (path === '/mobile/applyPurchase/list') {
+//          this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
+//        }
+//      },
       goSayPrice: function () {
         if (this.user.logged) {
           this.showSayPriceBox = true
@@ -120,7 +151,7 @@
   }
   .mobile-footer > span{
     display: inline-block;
-    width: 2rem;
+    width: 25%;
     font-size:.32rem;
     color:#b0b0b0;
     padding-top:.1rem;
@@ -136,6 +167,9 @@
   .mobile-footer > span a p{
     font-size:.22rem;
   }
+  .mobile-footer > span a img{
+    width: .46rem;
+  }
 
   .mobile-footer > span.active a{
     color:#3976f4;

+ 90 - 5
components/mobile/applyPurchase/PublishSeek.vue

@@ -1,15 +1,23 @@
 <template>
   <div class="mobile-modal" v-if="showSayPriceBox" @click="setShowCurrencyList(false)">
     <div class="mobile-modal-box">
-      <div class="mobile-modal-header">发布求购<i class="icon-guanbi iconfont" @click="cancel"></i></div>
+      <div class="mobile-modal-header">
+        <i class="icon-guanbi iconfont" @click="cancel"></i>
+      </div>
       <div class="publish-seek">
         <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><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>
@@ -34,7 +42,7 @@
           </ul>
         </div>-->
         <div class="content-line">
-          <span>数量:</span>
+          <span>数量(PCS):</span>
           <input type="text" v-model="applyObj.amount" @blur="checkAmount" @input="onAmountInput">
         </div>
         <!--<div class="content-line">
@@ -69,7 +77,11 @@
           amount: true,
           deadline: true
         },
-        showCurrencyList: false
+        showCurrencyList: false,
+        showSimilarCodeList: false,
+        showSimilarBrandList: false,
+        similarCode: [],
+        similarBrand: []
       }
     },
     computed: {
@@ -88,6 +100,7 @@
     watch: {
       showSayPriceBox: function (val, old) {
         if (val) {
+          this.emptyForm()
           document.body.style.position = 'fixed'
           document.body.style.left = '0'
           document.body.style.right = '0'
@@ -96,6 +109,13 @@
         }
       }
     },
+    mounted () {
+      let _this = this
+      document.body.onclick = function () {
+        _this.showSimilarCodeList = false
+        _this.showSimilarBrandList = false
+      }
+    },
     methods: {
       cancel: function () {
         this.$emit('cancelAction')
@@ -228,6 +248,28 @@
           this.applyObj.produceDate = cutOutString(this.applyObj.produceDate, 12)
         }
       },
+      getSimilarCode: function () {
+        if (this.applyObj.code) {
+          this.$http.get('/search/similarComponents', {params: {keyword: this.applyObj.code}})
+            .then(response => {
+              this.similarCode = response.data
+              this.showSimilarCodeList = response.data.length > 0
+            })
+        } else {
+          this.showSimilarCodeList = false
+        }
+      },
+      getSimilarBrand: function () {
+        if (this.applyObj.brand) {
+          this.$http.get('/search/similarBrands', {params: {keyword: this.applyObj.brand}})
+            .then(response => {
+              this.similarBrand = response.data
+              this.showSimilarBrandList = response.data.length > 0
+            })
+        } else {
+          this.showSimilarBrandList = false
+        }
+      },
       onCodeChange: function () {
         this.applyObj.code = this.applyObj.code.trim()
         if ((/[^\x00-\xff]/g).test(this.applyObj.code)) {
@@ -241,6 +283,8 @@
           this.applyObj.code = cutOutString(this.applyObj.code, chineseIndex)
         } else if (this.applyObj.code && getRealLen(this.applyObj.code) > 100) {
           this.applyObj.code = cutOutString(this.applyObj.code, 100)
+        } else {
+          this.getSimilarCode()
         }
       },
       onBrandChange: function () {
@@ -258,6 +302,8 @@
           }
         } else if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 50) {
           this.applyObj.brand = cutOutString(this.applyObj.brand, 50)
+        } else {
+          this.getSimilarBrand()
         }
       },
       onAmountInput: function () {
@@ -273,6 +319,14 @@
         } else if (this.applyObj.amount.length > 9) {
           this.applyObj.amount = cutOutString(this.applyObj.amount, 9)
         }
+      },
+      setCode: function (code) {
+        this.applyObj.code = code
+        this.showSimilarCodeList = false
+      },
+      setBrand: function (brand) {
+        this.applyObj.brand = brand
+        this.showSimilarBrandList = false
       }
     }
   }
@@ -289,8 +343,16 @@
       z-index: 1000;
       margin-top: -3.7rem;
       margin-left: -2.96rem;
+      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;
+        }
       }
       .publish-seek {
         background: #fff;
@@ -332,7 +394,30 @@
             height: .06rem;
             margin-left: .04rem;
           }
-          > ul {
+          .similar {
+            position: absolute;
+            width: 3.52rem;
+            max-height: 2.5rem;
+            overflow-y: auto;
+            z-index: 12;
+            border: 1px solid #7e7e7e;
+            border-radius: .05rem;
+            left: 1.75rem;
+            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;
+              }
+            }
+          }
+          /*> ul {
             position: absolute;
             top: .6rem;
             left: 1.16rem;
@@ -353,7 +438,7 @@
                 background: #dedede;
               }
             }
-          }
+          }*/
         }
         > a {
           display: block;

+ 2 - 1
components/mobile/applyPurchase/PublishSupplierSeek.vue

@@ -14,7 +14,7 @@
           <input type="date" v-model="applyObj.deadline" :min="minDay" :max="maxDay" @blur="deadlineChange">
         </div>
         <div class="content-line">
-          <span>数量:</span>
+          <span>数量(PCS):</span>
           <input type="text" v-model="applyObj.amount" @blur="checkAmount" @input="onAmountInput">
         </div>
         <a @click="goPublish">确认</a>
@@ -63,6 +63,7 @@
 //      },
       product: {
         handler (val, oldVal) {
+          console.log(val)
           if (val) {
             let isStandard = val.standard === 1
             this.applyObj.code = val.cmpCode

+ 2 - 1
components/mobile/applyPurchase/index.js

@@ -1,5 +1,6 @@
 import SayPriceInfo from './SayPriceInfo.vue'
 import SayPrice from './SayPrice.vue'
 import PublishSupplierSeek from './PublishSupplierSeek.vue'
+import PublishSeek from './PublishSeek.vue'
 
-export { SayPriceInfo, SayPrice, PublishSupplierSeek }
+export { SayPriceInfo, SayPrice, PublishSupplierSeek, PublishSeek }

+ 47 - 23
components/mobile/common/userHeader.vue

@@ -6,10 +6,11 @@
         <p v-text="userInfo.data.userName"></p>
         <p>
           <span class="en-name">{{enterpriseInfo.enName}}</span>
+        </p>
+        <div class="switch" v-if="isShow">
           <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
           <span class="vir">|</span>
           <a class="exit" @click="showLogout = true">退出</a>
-        </p>
         <ul class="en-list" v-show="showEnterpriseToggle">
           <li class="menu-item"
               v-for="en in sortEnterprises"
@@ -21,6 +22,7 @@
             <a @click="switchEnterprise({uu: 0})"><span v-text="userInfo.data.userName"></span>(个人账户)</a>
           </li>
         </ul>
+        </div>
       </div>
     </div>
     <div class="deleteKuang" v-if="showLogout">
@@ -45,12 +47,28 @@
         showLogout: false  // 退出登录提示框
       }
     },
+    props: {
+      isShow: {
+        default: true,
+        type: Boolean
+      }
+    },
+    mounted () {
+      this.$nextTick(() => {
+        document.body.addEventListener('click', () => {
+          this.setShowEnterpriseToggle(false)
+        }, false)
+      })
+    },
     methods: {
       // 切换当前企业
       switchEnterprise(en) {
         this.showEnterpriseToggle = false
         this.$http.get(`/user/authentication/${en.uu}`).then(() => {
-          this.$store.dispatch('loadUserInfo')
+          // this.$store.dispatch('loadUserInfo')
+          this.$store.dispatch('loadUserInfo').then(() => {
+            this.$emit('switchEnAction')
+          })
           this.$store.dispatch('loadStoreStatus', { op: 'check' }).then(() => {
             this.$emit('updateLoad')
           })
@@ -161,30 +179,36 @@
             }
           }
         }
-        .en-list {
+        .switch {
           position: absolute;
-          max-width: 5rem;
-          max-height: 3rem;
-          overflow-y: auto;
-          border-radius: .05rem;
-          background: rgba(0, 0, 0, .6);
-          z-index: 10;
-          .menu-item {
-            height: .6rem;
-            line-height: .6rem;
-            font-size: .3rem;
-            padding: 0 .2rem;
-            overflow: hidden;
-            white-space: nowrap;
-            text-overflow: ellipsis;
-            &:active, &:focus, &:hover {
-              background: #7d7d7d;
-            }
-            a {
-              color: #fff;
+          right: 1rem;
+          top: .7rem;
+          .en-list {
+            position: absolute;
+            max-width: 3rem;
+            max-height: 3rem;
+            overflow-y: auto;
+            border-radius: .05rem;
+            background: rgba(0, 0, 0, 0.6);
+            z-index: 10;
+            left: -1rem;
+            .menu-item {
+              height: .6rem;
+              line-height: .6rem;
+              font-size: .3rem;
+              padding: 0 .2rem;
+              overflow: hidden;
+              white-space: nowrap;
+              text-overflow: ellipsis;
+              &:active, &:focus, &:hover {
+                background: #7d7d7d;
+              }
+              a {
+                color: #fff;
+              }
             }
-          }
 
+          }
         }
       }
       > a {

+ 18 - 14
components/mobile/search/MainSearch.vue

@@ -8,7 +8,7 @@
           <li @click="setSearchType(searchType == 'product' ? 'store' : 'product', $event)">{{searchType == 'product' ? '店铺' : '产品'}}</li>
         </ul>
       </div>
-      <input type="text" id="search-box" v-model="keyword" :placeholder="searchType == 'product' ? '请输入您要查找的型号/品牌/类目' : '请输入您要查找的店铺'" @keyup.13="onSearch()">
+      <input type="text" id="search-box" v-model="keyword" @keyup.13="onSearch()">
       <span @click="onSearch()">搜索</span>
       <a @click="cancelSearch">取消</a>
     </div>
@@ -188,13 +188,14 @@
       padding-left: .3rem;
       line-height: .88rem;
       margin-top: 2rem;
+      z-index: 1;
       input {
         width: 4.88rem;
         height: .62rem;
         line-height: .62rem;
         font-size: .26rem;
         color: #999;
-        padding-left: .92rem;
+        padding-left: 1.26rem;
         border: .04rem solid #fff;
         background: #fff;
         outline: none;
@@ -228,12 +229,13 @@
       .options {
         position: absolute;
         left: .3rem;
-        font-size: .26rem;
-        width: .9rem;
-        padding-left: .15rem;
-        background: url('/images/mobile/@2x/search/select-arrow.png') no-repeat;
+        width: 1.25rem;
+        padding-left: .25rem;
+        background: url(/images/mobile/@2x/search/select-arrow-blue.jpg) no-repeat;
         background-size: .14rem .12rem;
-        background-position: .68rem .36rem;
+        background-position: .92rem .36rem;
+        color: #3e82f5;
+        font-size: .3rem;
         i {
           height: .46rem;
           width: .01rem;
@@ -245,15 +247,17 @@
         ul {
           position: absolute;
           left: 0;
+          top: .54rem;
+          z-index: -1;
           li {
-            width: 1rem;
-            height: .7rem;
-            border-radius: .02rem;
-            background: rgba(0, 0, 0, .6);
-            font-size: .26rem;
-            color: rgba(255, 255, 255, .89);
+            width: 1.25rem;
+            height: .99rem;
+            border-radius: .05rem;
+            background: #666;
+            color: rgba(255, 255, 255, 0.89);
             text-align: center;
-            line-height: .7rem;
+            line-height: 1.2rem;
+            font-size: .3rem;
           }
         }
       }

+ 1 - 1
pages/mobile/applyPurchase/list/businessOpportunity.vue

@@ -16,7 +16,7 @@
     <seek-list v-if="purchaseManListData && purchaseManListData.length" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
     <div class="com-none-state" v-else>
       <img src="/images/mobile/@2x/car@2x.png">
-      <p>对个人物料库进行维护后,可获得更多的商机哦!</p>
+      <p>上传物料至个人物料库,可获得更多的商机哦!</p>
       <nuxt-link to="/">返回首页</nuxt-link>
     </div>
     <loading v-show="isSearchSearchingMore"></loading>

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

@@ -99,7 +99,7 @@
         this.reloadData()
       },
       reloadData: function () {
-        this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.page, pageSize: this.size, sorting: {'releaseDate': 'DESC'}, keyword: this.seekKeyword, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null})
+        this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.page, pageSize: this.size, sorting: {'releaseDate': 'DESC'}, keyword: this.seekKeyword, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, isLogin: this.user.logged ? '1' : '0'})
       },
       goLastPage: function () {
         window.history.back(-1)

+ 122 - 53
pages/mobile/usercenter/index.vue → pages/mobile/center/index.vue

@@ -1,29 +1,16 @@
 <template>
   <div class="user-content mobile-content">
-    <div class="user-name">
-      <img src="/images/component/default.png"/>
-      <div class="user-info">
-        <p v-text="userInfo.data.userName"></p>
-        <p>
-          <span class="en-name">{{enterpriseInfo.enName}}</span>
-          <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
-          <span class="vir">|</span>
-          <a class="exit" @click="showLogout = true">退出</a>
-        </p>
-        <ul class="en-list" v-show="showEnterpriseToggle">
-          <li class="menu-item"
-              v-for="en in sortEnterprises"
-              v-if="en.uu != enterpriseInfo.uu"
-              v-bind:key="en.uu">
-            <a @click="switchEnterprise(en)">{{ en.enName }}</a>
-          </li>
-          <li class="menu-item"  v-if="enterpriseInfo.uu">
-            <a @click="switchEnterprise({uu: 0})"><span v-text="userInfo.data.userName"></span>(个人账户)</a>
-          </li>
-        </ul>
-      </div>
-      <a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
+    <user-header @switchEnAction="onSwitchEn" :isShow="false"></user-header>
+
+    <div class="seek-area" v-if="userType != 'saler'">
+      <img src="/images/mobile/@2x/banner.jpg" alt="">
+      <p class="sa-title inline-block">我要求购&nbsp;&nbsp;<span>满足你所需</span>
+        <br/>
+        <span class="sa-text">让订单飞起来</span>
+      </p>
+      <a class="sa-pub" @click="goSayPrice">发布求购</a>
     </div>
+
     <ul class="switch-list" v-if="userType !== 'saler'">
       <li :class="{active: activeType == 'seek'}" @click="activeType = 'seek'" v-text="userType === 'saler' ? '求购询价' : '我的求购'"></li>
       <li :class="{active: activeType == 'comp'}" @click="activeType = 'comp'">器件收藏</li>
@@ -53,7 +40,11 @@
         <i class="iconfont icon-sousuo"></i>
         </span>
       </div>
-      <seek-list :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
+      <seek-list v-if="!(userType == 'saler' && seekType == 'wait' && !purchaseManListData.length)" :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
+      <div class="com-none-state" v-else>
+        <img src="/images/mobile/@2x/car@2x.png">
+        <p>上传物料至个人物料库,可获得更多的商机哦!</p>
+      </div>
     </div>
     <!-- /end 买家中心 我的求购 -->
 
@@ -82,6 +73,7 @@
           <p>品牌:<span>{{item.componentinfo.brand.nameCn}}</span></p>
           <p>产品描述:<span>{{item.componentinfo.kind.nameCn}}</span></p>
           <i class="iconfont icon-shoucang" @click="cancelFocus('product', item, $event)"></i>
+          <a class="sa-pub" @click="compInquiry(item, $event)">立即询价</a>
         </div>
       </a>
     </div>
@@ -358,13 +350,16 @@
       </div>
     </div>
     <!-- /end 企业产品库 查看信息 -->
+    <publish-seek :showSayPriceBox="showSayPriceBox" @cancelAction="showSayPriceBox = false" @reloadAction="onPublishFinish" @remindAction="onRemind"></publish-seek>
+    <publish-supplier-seek :product="componentSeekObj" :showPublishBox="showPublishBox" @cancelAction="showPublishBox = false" @remindAction="onRemind"></publish-supplier-seek>
   </div>
 </template>
 
 <script>
   import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
-  import {RemindBox, Loading} from '~components/mobile/common'
+  import {RemindBox, Loading, userHeader} from '~components/mobile/common'
   import PageLoading from '~components/common/loading/PageLoading.vue'
+  import { PublishSeek, PublishSupplierSeek } from '~components/mobile/applyPurchase'
   export default {
     layout: 'mobile',
     middleware: 'authenticated',
@@ -388,7 +383,6 @@
         seekSize: 10,
         purchaseManListData: [],
         isDataChange: false,
-        showEnterpriseToggle: false,
         providerType: 'enterprise',
         GetEnterpriseListData: [],
         isUploadpro: 1, // 是否存在已上架信息
@@ -397,14 +391,26 @@
         vendorlist: [], // 查看更多信息
         showMoreinfn: false, // 是否打开更多信息
         chooseItem: {},
-        showLogout: false  // 退出登录提示框
+        showLogout: false,  // 退出登录提示框,
+        showSayPriceBox: false, // 发布求购框
+        componentSeekObj: {
+          standard: 1,
+          cmpCode: '',
+          pbranden: '',
+          spec: null,
+          kind: ''
+        },
+        showPublishBox: false
       }
     },
     components: {
       RemindBox,
       SeekList,
       PageLoading,
-      Loading
+      Loading,
+      userHeader,
+      PublishSeek,
+      PublishSupplierSeek
     },
     fetch ({ store, route }) {
       let user = store.state.option.user.data
@@ -427,15 +433,18 @@
       return Promise.all([
         store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
         store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 }),
-        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadVendorPushList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params),
-        store.dispatch('loadStoreStatus', { op: 'check' })
+        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadVendorPushList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
       ])
     },
     watch: {
       '$route.query': {
         handler: function (val, old) {
           this.switchSeek('wait')
-        }
+          if (val.type === 'saler' && !this.shopuuid.uuid) {
+            this.$store.dispatch('loadStoreStatus', { op: 'check' })
+          }
+        },
+        immediate: true
       },
       'activeType': {
         handler: function (val, old) {
@@ -454,32 +463,17 @@
     mounted: function () {
       this.$nextTick(() => {
         window.addEventListener('scroll', this.scroll, false)
-        document.body.addEventListener('click', () => {
-          this.setShowEnterpriseToggle(false)
-        }, false)
       })
     },
     methods: {
-      // 切换当前企业
-      switchEnterprise (en) {
-        this.showEnterpriseToggle = false
-        this.$http.get(`/user/authentication/${en.uu}`).then(() => {
+      onSwitchEn: function () {
+        if (this.$route.query.type === 'saler' && !this.user.data.enterprise.uu) {
+          this.$router.push('/')
+        } else {
           this.isChange = true
-          this.$store.dispatch('loadUserInfo').then(() => {
-            if (this.userType === 'saler') {
-              this.$router.push('/mobile/user?type=buyer')
-            } else {
-              this.reloadData()
-            }
-          })
+          this.reloadData()
           this.$store.dispatch('loadStoreStatus', { op: 'check' })
-        })
-      },
-      setShowEnterpriseToggle (flag, e) {
-        if (e) {
-          e.stopPropagation()
         }
-        this.showEnterpriseToggle = flag
       },
       cancelFocus: function (type, item, event) {
         event.stopPropagation()
@@ -757,6 +751,33 @@
             window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
           }
         })
+      },
+      goSayPrice: function () {
+        if (this.user.logged) {
+          this.showSayPriceBox = true
+        } else {
+          this.showLoginBox = true
+        }
+      },
+      onRemind: function (str) {
+        this.collectResult = str
+        this.timeoutCount ++
+      },
+      onPublishFinish: function () {
+        this.isChange = true
+        this.seekPage = 1
+        this.reloadData()
+      },
+      compInquiry: function (item, e) {
+        if (e) {
+          e.stopPropagation()
+        }
+        this.componentSeekObj.cmpCode = item.componentinfo.code
+        this.componentSeekObj.pbranden = item.componentinfo.brand.nameCn
+        this.componentSeekObj.spec = null
+        this.componentSeekObj.kind = item.componentinfo.kind.nameCn
+        this.componentSeekObj = JSON.parse(JSON.stringify(this.componentSeekObj))
+        this.showPublishBox = true
       }
     },
     computed: {
@@ -866,6 +887,16 @@
 <style scoped lang="scss">
   .user-content{
     margin-bottom: .98rem;
+    .sa-pub {
+      display: inline-block;
+      width: 1.41rem;
+      height: .47rem;
+      line-height: .47rem;
+      text-align: center;
+      color: #fff;
+      background: #3f84f6;
+      border-radius: .14rem;
+    }
     .none-state{
       text-align: center;
       padding:1.5rem 0;
@@ -1082,7 +1113,7 @@
           display:block;
           position:absolute;
           top:.2rem;
-          right:.1rem;
+          right:.4rem;
           font-size:.5rem;
           color:#ff7800;
           width: .6rem;
@@ -1090,6 +1121,11 @@
           line-height: .6rem;
           text-align: center;
         }
+        .sa-pub {
+          position: absolute;
+          right: 0;
+          bottom: .2rem;
+        }
       }
       div.active{
         background: #d4d;
@@ -1175,6 +1211,39 @@
         line-height: .46rem;
       }
     }
+    .seek-area {
+      height: 1.26rem;
+      line-height: 1.26rem;
+      border-top: .19rem solid #f6f5f5;
+      border-bottom: .19rem solid #f6f5f5;
+      overflow: hidden;
+      /*padding: .32rem 0;*/
+      img {
+        height: .78rem;
+        margin-right: .2rem;
+        vertical-align: top;
+        margin-top: .1rem;
+      }
+      .sa-title {
+        font-size: .38rem;
+        color: #3f84f6;
+        line-height: .32rem;
+        vertical-align: top;
+        margin-top: .1rem;
+        span {
+          color: #494949;
+        }
+        .sa-text {
+          font-size: .26rem;
+          color: #999;
+        }
+      }
+      .sa-pub {
+        margin-left: .86rem;
+        vertical-align: top;
+        margin-top: .23rem;
+      }
+    }
   }
   .providerList {
     border-top: 1px solid #e0e0e4;
@@ -1217,7 +1286,7 @@
         }
       }
       .person-flag {
-        width: .55rem;
+        width: .75rem;
         position: absolute;
         right: 0;
       }

+ 9 - 1
pages/mobile/search/_keycode.vue

@@ -90,6 +90,14 @@
         }, false)
       })
     },
+    watch: {
+      '$route.query.w': {
+        handler: function (val) {
+          this.reloadData()
+        },
+        immediate: true
+      }
+    },
     fetch ({store, route}) {
       return Promise.all([
         store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {'RESERVE': 'DESC'}}),
@@ -103,7 +111,7 @@
     },
     computed: {
       productList () {
-        let list = this.$store.state.searchData.searchList.lists.data
+        let list = JSON.parse(JSON.stringify(this.$store.state.searchData.searchList.lists.data))
         if (this.isChange) {
           this.searchLists = []
           this.page = 1

二进制
static/images/mobile/@2x/applyPurchase/pub.png


二进制
static/images/mobile/@2x/banner.jpg


二进制
static/images/mobile/@2x/home/userCenter-active.png


二进制
static/images/mobile/@2x/home/userCenter.png


二进制
static/images/mobile/@2x/home/vendorCenter-active.png


二进制
static/images/mobile/@2x/home/vendorCenter.png


二进制
static/images/mobile/@2x/search/select-arrow-blue.jpg