yangc %!s(int64=7) %!d(string=hai) anos
pai
achega
81de288e02

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

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

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

+ 19 - 15
components/mobile/MobileFooter.vue

@@ -23,7 +23,7 @@
       </a>
     </span>
     <span :class="{'active': activeType == 'vendorCenter'}">
-      <a @click="goWithLogin('/mobile/center?type=saler')">
+      <a @click="goWithLogin('/mobile/center?type=saler', true)">
         <img :src="`/images/mobile/@2x/home/vendorCenter${activeType === 'vendorCenter' ? '-active' : ''}.png`" alt="">
         <p>卖家中心</p>
       </a>
@@ -36,28 +36,28 @@
     <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>-->
-    <!--<remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>-->
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 <script>
   import { scrollTo } from '~utils/scroll'
-  import {LoginBox} from '~components/mobile/common'
+  import {LoginBox, RemindBox} from '~components/mobile/common'
 //  import PublishSeek from './applyPurchase/PublishSeek.vue'
   export default{
     name: 'MobileFooter',
     data () {
       return {
         hideToTop: true,
-        showLoginBox: false
+        showLoginBox: false,
 //        showSayPriceBox: false,
-//        remindText: '',
-//        timeoutCount: 0
+        remindText: '',
+        timeoutCount: 0
       }
     },
     components: {
-      LoginBox
+      LoginBox,
 //      PublishSeek,
-//      RemindBox
+      RemindBox
     },
     computed: {
       InputGetFocus() {
@@ -78,7 +78,7 @@
             return 'userCenter'
           }
         } else {
-          return 'home'
+          return ''
         }
       },
       user () {
@@ -102,9 +102,13 @@
       toTop () {
         scrollTo('body', 300)
       },
-      goWithLogin: function (url) {
+      goWithLogin: function (url, isSelf) { // 是否拦截个人
         if (this.user.logged) {
-          this.$router.push(url)
+          if (isSelf && !this.user.data.enterprise.uu) {
+            this.onRemind('请先前往pc端开通卖家中心')
+          } else {
+            this.$router.push(url)
+          }
         } else {
           this.showLoginBox = true
         }
@@ -123,11 +127,11 @@
         } else {
           this.showLoginBox = true
         }
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount ++
       }
-//      onRemind: function (str) {
-//        this.remindText = str
-//        this.timeoutCount ++
-//      }
     }
   }
 </script>

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

+ 7 - 0
components/mobile/common/userHeader.vue

@@ -45,6 +45,13 @@
         showLogout: false  // 退出登录提示框
       }
     },
+    mounted () {
+      this.$nextTick(() => {
+        document.body.addEventListener('click', () => {
+          this.setShowEnterpriseToggle(false)
+        }, false)
+      })
+    },
     methods: {
       // 切换当前企业
       switchEnterprise(en) {

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

+ 109 - 6
pages/mobile/center/index.vue

@@ -1,6 +1,16 @@
 <template>
   <div class="user-content mobile-content">
     <user-header @switchEnAction="onSwitchEn"></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>
@@ -59,6 +69,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>
@@ -335,6 +346,8 @@
       </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>
 
@@ -342,6 +355,7 @@
   import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
   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',
@@ -373,7 +387,16 @@
         vendorlist: [], // 查看更多信息
         showMoreinfn: false, // 是否打开更多信息
         chooseItem: {},
-        showLogout: false  // 退出登录提示框
+        showLogout: false,  // 退出登录提示框,
+        showSayPriceBox: false, // 发布求购框
+        componentSeekObj: {
+          standard: 1,
+          cmpCode: '',
+          pbranden: '',
+          spec: null,
+          kind: ''
+        },
+        showPublishBox: false
       }
     },
     components: {
@@ -381,7 +404,9 @@
       SeekList,
       PageLoading,
       Loading,
-      userHeader
+      userHeader,
+      PublishSeek,
+      PublishSupplierSeek
     },
     fetch ({ store, route }) {
       let user = store.state.option.user.data
@@ -404,15 +429,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) {
@@ -719,6 +747,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: {
@@ -828,6 +883,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;
@@ -1044,7 +1109,7 @@
           display:block;
           position:absolute;
           top:.2rem;
-          right:.1rem;
+          right:.4rem;
           font-size:.5rem;
           color:#ff7800;
           width: .6rem;
@@ -1052,6 +1117,11 @@
           line-height: .6rem;
           text-align: center;
         }
+        .sa-pub {
+          position: absolute;
+          right: 0;
+          bottom: .2rem;
+        }
       }
       div.active{
         background: #d4d;
@@ -1137,6 +1207,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;

+ 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

BIN=BIN
static/images/mobile/@2x/applyPurchase/pub.png


BIN=BIN
static/images/mobile/@2x/banner.jpg


BIN=BIN
static/images/mobile/@2x/search/select-arrow-blue.jpg