Browse Source

Merge branch 'feature/yc-apply_mobile-0508'

# Conflicts:
#	nuxt.config.js
#	pages/mobile/user/index.vue
yangc 7 years ago
parent
commit
d00908cdc8
39 changed files with 1270 additions and 85 deletions
  1. 31 0
      assets/scss/mobileCommon.scss
  2. 51 21
      components/mobile/Home.vue
  3. 1 1
      components/mobile/MobileHeader.vue
  4. 3 1
      components/mobile/applyPurchase/PublishSeek.vue
  5. 269 0
      components/mobile/applyPurchase/PublishSupplierSeek.vue
  6. 5 5
      components/mobile/applyPurchase/SeekList.vue
  7. 2 1
      components/mobile/applyPurchase/index.js
  8. 86 20
      components/mobile/search/MainSearch.vue
  9. 1 1
      components/mobile/store/StoreDetail.vue
  10. 160 0
      components/mobile/supplier/List.vue
  11. 285 0
      components/mobile/supplier/SupplierDetail.vue
  12. 3 0
      components/mobile/supplier/index.js
  13. 1 1
      layouts/error.vue
  14. 1 1
      nuxt.config.js
  15. 0 1
      pages/index.vue
  16. 157 0
      pages/mobile/applyPurchase/list/businessOpportunity.vue
  17. 1 1
      pages/mobile/applyPurchase/list/index.vue
  18. 9 7
      pages/mobile/search/_keycode.vue
  19. 24 17
      pages/mobile/shop/index.vue
  20. 49 0
      pages/mobile/supplier/detail/_uu.vue
  21. 17 0
      pages/mobile/supplier/index.vue
  22. 13 7
      pages/mobile/user/index.vue
  23. BIN
      static/images/mobile/@2x/applyPurchase/opportunity.png
  24. BIN
      static/images/mobile/@2x/home/brand.png
  25. BIN
      static/images/mobile/@2x/home/seek.png
  26. BIN
      static/images/mobile/@2x/home/store.png
  27. BIN
      static/images/mobile/@2x/home/supplier.png
  28. BIN
      static/images/mobile/@2x/search/select-arrow.png
  29. BIN
      static/images/mobile/supplier/address.png
  30. BIN
      static/images/mobile/supplier/business.png
  31. BIN
      static/images/mobile/supplier/email.png
  32. BIN
      static/images/mobile/supplier/house.png
  33. BIN
      static/images/mobile/supplier/is-open.png
  34. BIN
      static/images/mobile/supplier/phone.png
  35. BIN
      static/images/mobile/supplier/tag.png
  36. 10 0
      store/applyPurchase.js
  37. 10 0
      store/shop.js
  38. 34 0
      store/supplier.js
  39. 47 0
      store/supplier/data.js

+ 31 - 0
assets/scss/mobileCommon.scss

@@ -312,6 +312,7 @@ html {
   text-align: center;
   position: relative;
   border-bottom: .02rem solid rgb(219, 219, 219);
+  background: #fff;
   > img {
     width: .36rem;
     height: .38rem;
@@ -337,3 +338,33 @@ html {
     }
   }
 }
+
+/*空状态*/
+.com-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;
+  }
+}

+ 51 - 21
components/mobile/Home.vue

@@ -14,7 +14,7 @@
           <div class="swiper-pagination swiper-pagination-bullets"></div>
         </div>
         <div class="search-content">
-          <input type="text" placeholder="请输入您要查找的型号或品牌" @click="onHomeSearchClick()">
+          <input type="text" placeholder="请输入您要查找的型号、品牌或店铺" @click="onHomeSearchClick()">
           <span>
         <i class="iconfont icon-sousuo"></i>
       </span>
@@ -23,23 +23,28 @@
       </div>
       <ul class="link-list">
         <li>
-          <nuxt-link to="/mobile/shop">
-            <img src="/images/mobile/@2x/applyPurchase/home/shop.png" alt="">
-            <span>店铺列表</span>
-            <i></i>
+          <nuxt-link to="/mobile/supplier">
+            <img src="/images/mobile/@2x/home/supplier.png" alt="">
+            <span>供应商</span>
           </nuxt-link>
         </li>
         <li>
-          <nuxt-link to="/mobile/brand/brandCenter/ABCD">
-            <img src="/images/mobile/@2x/applyPurchase/home/brand.png" alt="">
-            <span>品牌列表</span>
-            <i></i>
+          <a @click="goOpportunity">
+            <img src="/images/mobile/@2x/home/seek.png" alt="">
+            <span>我的商机</span>
+          </a>
+        </li>
+        <li>
+          <nuxt-link to="/mobile/shop">
+            <img src="/images/mobile/@2x/home/store.png" alt="">
+            <span>店铺列表</span>
+           <!-- <i></i>-->
           </nuxt-link>
         </li>
         <li>
-          <nuxt-link to="/mobile/applyPurchase/list">
-            <img src="/images/mobile/@2x/applyPurchase/home/seek.png" alt="">
-            <span>求购询价</span>
+          <nuxt-link to="/mobile/brand/brandCenter/ABCD">
+            <img src="/images/mobile/@2x/home/brand.png" alt="">
+            <span>品牌中心</span>
           </nuxt-link>
         </li>
       </ul>
@@ -62,11 +67,14 @@
       </div>
     </div>
     <main-search v-if="showMainSearch" @cancelSearchAction="onCancelSearch"></main-search>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+    <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
   </div>
 </template>
 <script>
   import SeekList from './applyPurchase/SeekList.vue'
   import MainSearch from '~/components/mobile/search/MainSearch.vue'
+  import { RemindBox, LoginBox } from '~components/mobile/common'
   export default {
     data () {
       return {
@@ -85,12 +93,17 @@
           loop: true,
           prevButton: '.swiper-button-prev',
           nextButton: '.swiper-button-next'
-        }
+        },
+        remindText: '',
+        timeoutCount: 0,
+        showLoginBox: false
       }
     },
     components: {
       SeekList,
-      MainSearch
+      MainSearch,
+      RemindBox,
+      LoginBox
     },
     computed: {
       purchaseManList () {
@@ -104,6 +117,21 @@
       },
       onCancelSearch: function () {
         this.showMainSearch = false
+      },
+      goOpportunity () {
+        if (this.user.logged) {
+          if (this.user.data.enterprise.uu) {
+            this.$router.push('/mobile/applyPurchase/list/businessOpportunity')
+          } else if (this.user.data.enterprise.isVendor !== 313) {
+            this.onRemind('抱歉,您暂未开通卖家中心,可前往PC端开通')
+          }
+        } else {
+          this.showLoginBox = true
+        }
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount ++
       }
     }
   }
@@ -111,6 +139,7 @@
 <style lang="scss">
   .home {
     padding-bottom: 1rem;
+    background: #f3f3f7;
     .header {
       height: 3.26rem;
       position: relative;
@@ -140,22 +169,23 @@
       }
     }
     .link-list {
-      background: #f3f3f7;
-      height: 1.36rem;
+      background: #fff;
+      height: 1.56rem;
+      margin-bottom: .2rem;
       li {
         position: relative;
         display: inline-block;
-        width: 33.3%;
+        width: 25%;
         text-align: center;
         float: left;
-        height: 1.36rem;
+        height: 1.56rem;
         img {
-          width: .63rem;
-          height: .63rem;
+          width: .7rem;
+          height: .7rem;
           margin-top: .2rem;
         }
         span {
-          font-size: .22rem;
+          font-size: .26rem;
           color: #666;
           display: block;
           margin-top: .15rem;

+ 1 - 1
components/mobile/MobileHeader.vue

@@ -137,7 +137,7 @@
 //          this.showHeader = false
 //          this.showSearch = false
 //        }
-        this.showHeader = val && val !== '/' && val !== '/mobile/applyPurchase/list'
+        this.showHeader = val && val !== '/' && val !== '/mobile/applyPurchase/list' && !this.startWith(val, '/mobile/supplier')
 //        this.showSearch = val !== '/' && !this.startWith(val, '/mobile/search')
         let title = '优软商城'
         if (this.startWith(val, '/mobile/brand/componentDetail/')) {

+ 3 - 1
components/mobile/applyPurchase/PublishSeek.vue

@@ -333,6 +333,9 @@
       z-index: 1000;
       margin-top: -3.7rem;
       margin-left: -2.96rem;
+      .mobile-modal-header {
+        font-size: .38rem;
+      }
       .publish-seek {
         background: #fff;
         padding-top: .1rem;
@@ -343,7 +346,6 @@
           line-height: .8rem;
           font-size: .26rem;
           text-align: left;
-          border-bottom: 1px solid #d0e3fd;
           input {
             width: 3.49rem;
             height: .52rem;

+ 269 - 0
components/mobile/applyPurchase/PublishSupplierSeek.vue

@@ -0,0 +1,269 @@
+<template>
+  <div class="mobile-modal" v-if="showPublishBox">
+    <div class="mobile-modal-box">
+      <div class="mobile-modal-header">我要询价<i class="icon-guanbi iconfont" @click="cancel"></i></div>
+      <div class="props">
+        <div class="prop">型号:{{applyObj.code || '-'}}</div>
+        <div class="prop">品牌:{{applyObj.brand || '-'}}</div>
+        <div class="prop">类目:{{applyObj.prodTitle || '-'}}</div>
+        <div class="prop">规格:{{applyObj.spec || '-'}}</div>
+      </div>
+      <div class="publish-seek">
+        <div class="content-line">
+          <span><i>*</i>截止日期:</span>
+          <input type="date" v-model="applyObj.deadline" :min="minDay" :max="maxDay" @blur="deadlineChange">
+        </div>
+        <div class="content-line">
+          <span>数量:</span>
+          <input type="text" v-model="applyObj.amount" @blur="checkAmount" @input="onAmountInput">
+        </div>
+        <a @click="goPublish">确认</a>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import { formatDate, cutOutString } from '~utils/baseUtils'
+  export default {
+    props: ['showPublishBox', 'product'],
+    data () {
+      return {
+        applyObj: {
+          code: '',
+          brand: '',
+          amount: '',
+          deadline: '',
+          prodTitle: ''
+        },
+        validObj: {
+          amount: true,
+          deadline: true
+        }
+      }
+    },
+    computed: {
+      minDay: function () {
+        return formatDate(new Date(), 'yyyy-MM-dd')
+      },
+      maxDay: function () {
+        let deadDate = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30 * 3)
+        deadDate = formatDate(deadDate, 'yyyy-MM-dd')
+        return deadDate
+      }
+    },
+    watch: {
+//      showPublishBox: function (val, old) {
+//        if (val) {
+//          document.body.style.position = 'fixed'
+//          document.body.style.left = '0'
+//          document.body.style.right = '0'
+//        } else {
+//          document.body.style.position = 'relative'
+//        }
+//      },
+      product: {
+        handler (val, oldVal) {
+          if (val) {
+            let isStandard = val.standard === 1
+            this.applyObj.code = val.cmpCode
+            this.applyObj.brand = isStandard ? val.pbranden : val.brand
+            this.applyObj.spec = val.spec
+//            this.applyObj.unit = val.unit || 'PCS'
+            this.applyObj.prodTitle = isStandard ? val.kind : val.prodName
+          }
+        },
+        immediate: true
+      }
+    },
+    methods: {
+      cancel: function () {
+        this.$emit('cancelAction')
+      },
+      emptyForm: function () {
+        for (let attr in this.applyObj) {
+          this.applyObj[attr] = ''
+        }
+      },
+      setRemindText: function (str) {
+        this.$emit('remindAction', str)
+      },
+      goPublish: function () {
+        if (this.checkAll()) {
+          let inquiry = {}
+          let inquiryItem = {}
+          if (this.user.data.enterprise) {
+            inquiry.enUU = this.user.data.enterprise.uu
+          }
+          let date = new Date()
+          let endDate = formatDate(this.applyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
+          inquiry.recorderUU = this.user.data.userUU
+          inquiry.code = 'MALL' + date.getTime()
+          inquiry.date = date
+          inquiry.recorder = this.user.data.userName
+          inquiry.endDate = endDate
+          inquiry.sourceapp = 'MALL'
+          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.applyObj.brand
+          inquiryItem.cmpCode = (this.applyObj.code).toUpperCase()
+          inquiryItem.prodTitle = this.applyObj.prodTitle
+          inquiryItem.date = date
+          inquiryItem.endDate = endDate
+          let inquiryItems = []
+          inquiryItems.push(inquiryItem)
+          inquiry.inquiryItems = inquiryItems
+          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('发布失败')
+            })
+        } else {
+          if (!this.validObj.deadline) {
+            this.setRemindText('截止日期不能为空')
+          } else if (!this.validObj.amount) {
+            this.setRemindText('请输入正确的数值')
+          }
+        }
+      },
+      isValidDate: function (date) {
+        let now = new Date(formatDate(new Date(), 'yyyy-MM-dd')).getTime()
+        let time = new Date(date).getTime()
+        return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 91)
+      },
+      deadlineChange: function () {
+        if (!this.isValidDate(this.applyObj.deadline)) {
+          this.setRemindText('日期需不小于今天且在90天以内')
+          this.applyObj.deadline = ''
+          this.validObj.deadline = false
+        } else {
+          this.validObj.deadline = true
+        }
+      },
+      checkAll: function () {
+        return this.checkDeadline() && this.checkAmount()
+      },
+      checkAmount: function () {
+        this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
+        return this.validObj.amount
+      },
+      checkDeadline: function () {
+        this.validObj.deadline = Boolean(this.applyObj.deadline)
+        return this.validObj.deadline
+      },
+      onAmountInput: function () {
+        if (!(/^[0-9]*$/).test(this.applyObj.amount)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.applyObj.amount.length; i++) {
+            if (!(/^[0-9]*$/).test(this.applyObj.amount.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          this.applyObj.amount = cutOutString(this.applyObj.amount, chineseIndex)
+        } else if (this.applyObj.amount.length > 9) {
+          this.applyObj.amount = cutOutString(this.applyObj.amount, 9)
+        }
+      }
+    }
+  }
+</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;
+      background: #f3f3f3;
+      .mobile-modal-header {
+        border-radius: 0;
+      }
+      .publish-seek {
+        background: #fff;
+        padding-top: .1rem;
+        padding-bottom: .4rem;
+        .content-line {
+          position: relative;
+          height: .8rem;
+          line-height: .8rem;
+          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: 1.76rem;
+            text-align: right;
+            i {
+              color: #ff0000;
+              margin-right: .05rem;
+              font-style: normal;
+            }
+          }
+          > a {
+            font-size: .26rem;
+            color: #666;
+          }
+          > img {
+            width: .12rem;
+            height: .06rem;
+            margin-left: .04rem;
+          }
+        }
+        > 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;
+        }
+      }
+      .props {
+        font-size: .28rem;
+        background: #fff;
+        margin: .2rem 0;
+        padding-left: .29rem;
+        .prop {
+          padding-top: .2rem;
+          &:last-child {
+            padding-bottom: .2rem;
+          }
+          span {
+            color: #666;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 5 - 5
components/mobile/applyPurchase/SeekList.vue

@@ -3,7 +3,7 @@
     <ul class="seek-list">
       <li v-for="(item, index) in purchaseManListData">
         <p>
-          <span v-if="item.inquiry.enterprise && item.inquiry.enterprise.enName">{{[item.inquiry.enterprise.enName, user.logged] | enterpriseFilter}}</span>
+          <span v-if="item.inquiry && item.inquiry.enterprise && item.inquiry.enterprise.enName">{{[item.inquiry.enterprise.enName, user.logged] | enterpriseFilter}}</span>
           <span v-else>{{[item.userName, user.logged] | userNameFilter}}</span>
         </p>
         <div>
@@ -42,8 +42,8 @@
             </p>
             <p class="over-deadline" v-else>已截止</p>
             <!--<a v-if="!userType && item.quoted == 1">已报价</a>-->
-            <a v-if="!userType && item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && (user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise)))" class="self-publish" @click="onRemind('此为贵公司的求购')">我要报价</a>
-            <a v-if="!(userType == 'saler' && seekType  && seekType != 'wait') && (item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && !(user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU))))" @click="goSayPrice(item.id, index)">我要报价</a>
+            <a v-if="!userType && item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && (user.logged && ((item.inquiry && item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise)))" class="self-publish" @click="onRemind('此为贵公司的求购')">我要报价</a>
+            <a v-if="!(userType == 'saler' && seekType  && seekType != 'wait') && (item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && !(user.logged && ((item.inquiry && item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU))))" @click="goSayPrice(item.id, index)">我要报价</a>
             <a v-if="((!userType || userType == 'buyer') && (seekType  && seekType != 'wait')) || (userType == 'saler' && seekType  && seekType != 'wait') || item.quoted == 1" @click="goSayPriceInfo(item.quteId || item.id, item.agreed, index)">查看报价</a>
           </div>
         </div>
@@ -198,8 +198,8 @@ export default {
 </script>
 <style lang="scss" scoped>
   .seek-list {
-    width: 7.26rem;
-    margin: .13rem auto 0;
+    padding: .13rem .12rem 0;
+    background: #fff;
 
     li {
       border: 1px solid #e0e0e4;

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

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

+ 86 - 20
components/mobile/search/MainSearch.vue

@@ -1,7 +1,14 @@
 <template>
-  <div class="main-search" @touchstart="cancelFocus" id="main-search">
+  <div class="main-search" @touchstart="cancelFocus" @click="setShowSearchType(false)" id="main-search">
     <div class="main-search-header">
-      <input type="text" id="search-box" v-model="keyword" placeholder="请输入您要查找的型号或品牌" @keyup.13="onSearch()">
+      <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" :placeholder="searchType == 'product' ? '请输入您要查找的型号/品牌/类目' : '请输入您要查找的店铺'" @keyup.13="onSearch()">
       <span @click="onSearch()">搜索</span>
       <a @click="cancelSearch">取消</a>
     </div>
@@ -16,7 +23,7 @@
       <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.keyword)">
+          <li v-for="item in searchHistory" @click="onSearch(item)">
             <a>{{item.keyword}}</a>
           </li>
         </ul>
@@ -40,7 +47,9 @@
         keyword: '',
         associate: {
           show: false
-        }
+        },
+        searchType: 'product',
+        showSearchType: false
       }
     },
     props: {
@@ -68,12 +77,22 @@
 //      }
 //    },
     methods: {
-      onSearch (key) {
-        if (key && key !== '') {
-          this.keyword = key
-        }
-        if (this.keyword) {
-          this.$router.push({path: '/mobile/search?w=' + encodeURIComponent(this.keyword)})
+      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))
+            }
+          }
         }
       },
       onChange () {
@@ -88,8 +107,10 @@
         }
       },
       searchKeywords () {
-        this.$store.dispatch('searchKeywords', { keyword: this.keyword })
-        this.associate.show = true
+        if (this.searchType === 'product') {
+          this.$store.dispatch('searchKeywords', { keyword: this.keyword })
+          this.associate.show = true
+        }
       },
       onAssociateClick (word) {
         this.keyword = word
@@ -105,6 +126,18 @@
         this.$http.delete('/search/searchHistory').then(response => {
           this.$store.dispatch('searchData/getSearchHistory')
         })
+      },
+      setSearchType (type, $event) {
+        $event.stopPropagation()
+        this.searchType = type
+        this.setShowSearchType(false)
+        this.associate.show = false
+      },
+      setShowSearchType (flag, e) {
+        if (e) {
+          e.stopPropagation()
+        }
+        this.showSearchType = flag
       }
     },
     created () {
@@ -148,18 +181,19 @@
     top: -2rem;
     bottom: 0;
     .main-search-header {
+      position: relative;
       height: .88rem;
       background: #3e82f5;
-      padding-left: .5rem;
+      padding-left: .3rem;
       line-height: .88rem;
       margin-top: 2rem;
       input {
-        width: 4.78rem;
+        width: 4.88rem;
         height: .62rem;
         line-height: .62rem;
-        font-size: .28rem;
+        font-size: .26rem;
         color: #999;
-        padding-left: .2rem;
+        padding-left: .92rem;
         border: .04rem solid #fff;
         background: #fff;
         outline: none;
@@ -167,8 +201,8 @@
         float: left;
         margin-top: .12rem;
         -webkit-appearance: none;
-        border-top-left-radius: .05rem;
-        border-bottom-left-radius: .05rem;
+        border-top-left-radius: .14rem;
+        border-bottom-left-radius: .14rem;
       }
       span {
         display: inline-block;
@@ -179,8 +213,8 @@
         color: #366df3;
         font-size: .28rem;
         margin-left: .02rem;
-        border-top-right-radius: .05rem;
-        border-bottom-right-radius: .05rem;
+        border-top-right-radius: .14rem;
+        border-bottom-right-radius: .14rem;
         background: #fff;
         float: left;
         margin-top: .12rem;
@@ -190,6 +224,38 @@
         color: #fff;
         margin-left: .2rem;
       }
+      .options {
+        position: absolute;
+        left: .3rem;
+        font-size: .26rem;
+        width: .9rem;
+        padding-left: .15rem;
+        background: url('/images/mobile/@2x/search/select-arrow.png') no-repeat;
+        background-size: .14rem .12rem;
+        background-position: .68rem .36rem;
+        i {
+          height: .46rem;
+          width: .01rem;
+          background: #eceef0;
+          display: block;
+          float: right;
+          margin-top: .18rem;
+        }
+        ul {
+          position: absolute;
+          left: 0;
+          li {
+            width: 1rem;
+            height: .7rem;
+            border-radius: .02rem;
+            background: rgba(0, 0, 0, .6);
+            font-size: .26rem;
+            color: rgba(255, 255, 255, .89);
+            text-align: center;
+            line-height: .7rem;
+          }
+        }
+      }
     }
     .associate-list {
       background: #fff;

+ 1 - 1
components/mobile/store/StoreDetail.vue

@@ -74,7 +74,7 @@
       </table>
       <div v-if="!commodities.content || commodities.content.length == 0" class="no-product">
         <img src="/images/mobile/@2x/car@2x.png" alt="">
-        <div>抱歉,暂无产品信息</div>
+        <div>抱歉,暂无上架产品信息</div>
       </div>
     </div>
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>

+ 160 - 0
components/mobile/supplier/List.vue

@@ -0,0 +1,160 @@
+<template>
+  <div class="supplier-list mobile-content">
+    <div class="mobile-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <div class="search-content">
+        <input type="text" v-model="keyword" placeholder="请输入您要查找的供应商" @keyup.13="search">
+        <span @click="search">
+        <i class="iconfont icon-sousuo"></i>
+        </span>
+      </div>
+    </div>
+    <ul>
+      <li v-for="item in listData">
+        <nuxt-link :to="`/mobile/supplier/detail/${item.enUU}?isStore=${item.isStore}`">
+        <img v-if="item.isStore == 1" class="open" src="/images/mobile/supplier/is-open.png" alt="">
+        <span>{{item.enName}}</span>
+        <img class="tag" src="/images/mobile/supplier/tag.png" alt="">
+        </nuxt-link>
+      </li>
+    </ul>
+  </div>
+</template>
+<script>
+  export default {
+    data () {
+      return {
+        keyword: '',
+        isSearchSearchingMore: false,
+        page: 1,
+        size: 10,
+        listData: [],
+        isChange: false,
+        isDataChange: false
+      }
+    },
+    mounted: function () {
+      this.$nextTick(() => {
+        window.addEventListener('scroll', this.scroll, false)
+      })
+    },
+    watch: {
+      'list': {
+        handler (val, oldVal) {
+          if (this.isChange) {
+            this.listData = val.content
+            this.page = 1
+            this.isChange = false
+            this.isDataChange = true
+          } else {
+            this.listData = this.listData.concat(val.content)
+            this.isSearchSearchingMore = false
+            this.isDataChange = false
+          }
+        },
+        immediate: true
+      }
+    },
+    computed: {
+      list () {
+        return this.$store.state.supplier.data.list.data
+      },
+      allPage () {
+        return Math.floor(this.list.totalElements / this.list.size) + Math.floor(this.list.totalElements % this.list.size > 0 ? 1 : 0)
+      }
+    },
+    methods: {
+      goLastPage: function () {
+        window.history.back(-1)
+      },
+      scroll: function () {
+        let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
+        if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
+          this.getMoreSearch()
+        }
+      },
+      getMoreSearch: function () {
+        this.page++
+        this.isSearchSearchingMore = true
+        this.reloadData()
+      },
+      reloadData: function () {
+        this.$store.dispatch('supplier/getSupplierList', {keyword: this.keyword, page: this.page, size: this.size})
+      },
+      search: function () {
+        this.page = 1
+        this.isChange = true
+        this.reloadData()
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+    .supplier-list {
+      height: 100%;
+      background: #29a9f9;
+      .mobile-header {
+        position: fixed;
+        top: 0;
+        z-index: 10;
+        width:100%;
+        height:.88rem;
+        line-height: .88rem;
+        background: #3e82f5;
+        padding:0 .2rem 0 .1rem;
+        color:#fff;
+        > a {
+          font-size:.28rem;
+          color:#fff;
+          position: absolute;
+          i {
+            font-size: .48rem;
+            margin-right: -.1rem;
+          }
+        }
+        .search-content {
+          margin-left: .5rem;
+          line-height: normal;
+          padding-top: .14rem;
+          input {
+            color: #333;
+            width: 6.48rem;
+            line-height: normal;
+          }
+          span {
+            height: .46rem;
+            line-height: .46rem;
+          }
+        }
+      }
+      ul {
+        margin: .26rem auto 0;
+        width: 6.91rem;
+        li {
+          position: relative;
+          height: 1.21rem;
+          background: #fff;
+          line-height: 1.21rem;
+          padding-left: .74rem;
+          font-size: .32rem;
+          margin-bottom: .14rem;
+          border-radius: .05rem;
+          .open {
+            width: 1.35rem;
+            position: absolute;
+            top: -.08rem;
+            left: -.1rem;
+          }
+          .tag {
+            width: 1.08rem;
+            position: absolute;
+            right: -.1rem;
+            top: .16rem;
+          }
+          span {
+            color: #333;
+          }
+        }
+      }
+    }
+</style>

+ 285 - 0
components/mobile/supplier/SupplierDetail.vue

@@ -0,0 +1,285 @@
+<template>
+  <div class="supplier-detail">
+    <img v-if="$route.query.isStore === '1'" class="open" src="/images/mobile/supplier/is-open.png" alt="">
+    <div class="detail">
+      <h1>{{enInfo.enName}} <nuxt-link v-if="$route.query.isStore === '1'" :to="`/mobile/shop/${storeInfo.uuid}`"><i class="iconfont icon-xiangyou"></i></nuxt-link></h1>
+      <div class="line">
+        <div class="img-wrap">
+          <img src="/images/mobile/supplier/business.png" alt="">
+        </div>
+        <span>营业执照号:</span>
+        <span>{{enInfo.enBussinessCode || '-'}}</span>
+      </div>
+      <div class="line">
+        <div class="img-wrap">
+          <img src="/images/mobile/supplier/address.png" alt="">
+        </div>
+        <span>地址:</span>
+        <span>{{enInfo.enAddress || '-'}}</span>
+      </div>
+      <div class="line">
+        <div class="img-wrap">
+          <img src="/images/mobile/supplier/email.png" alt="">
+        </div>
+        <span>邮箱:</span>
+        <span>{{enInfo.enEmail || '-'}}</span>
+      </div>
+      <div class="line">
+        <div class="img-wrap">
+          <img src="/images/mobile/supplier/phone.png" alt="">
+        </div>
+        <span>电话:</span>
+        <span>{{enInfo.enTel || '-'}}</span>
+      </div>
+      <div class="line">
+        <div class="img-wrap">
+          <img src="/images/mobile/supplier/house.png" alt="">
+        </div>
+        <span>行业:</span>
+        <span>{{enInfo.enIndustry || '-'}}</span>
+      </div>
+    </div>
+    <div class="list">
+      <div class="search-content">
+        <input type="text" placeholder="请输入您要查找的型号或品牌" @keyup.13="search" v-model="key">
+        <span @click="search" >
+        <i class="iconfont icon-sousuo"></i>
+        </span>
+      </div>
+      <ul>
+        <li v-for="product in productListData">
+          <div class="prop">
+            <span class="head">型号/品牌:</span>
+            <span class="item">{{product.cmpCode || '—'}}</span>
+            <span class="item">{{(product.standard == 1 ? product.pbranden : product.brand) || '—'}}</span>
+          </div>
+          <div class="prop">
+            <span class="head">类目/规格:</span>
+            <span class="item">{{(product.standard == 1 ? product.kind : product.prodName) || '—'}}</span>
+            <span class="item">{{product.spec || '—'}}</span>
+          </div>
+          <div class="prop">
+            <span class="head">单位:</span>
+            <span class="item">{{product.unit || 'PCS'}}</span>
+          </div>
+          <a class="seek-btn" @click="publish(product)">立即询价</a>
+        </li>
+      </ul>
+    </div>
+    <publish-supplier-seek :product="currentProduct" :showPublishBox="showPublishBox" @cancelAction="showPublishBox = false" @remindAction="onRemind"></publish-supplier-seek>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+    <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
+  </div>
+</template>
+<script>
+  import { PublishSupplierSeek } from '~components/mobile/applyPurchase'
+  import { RemindBox, LoginBox } from '~components/mobile/common'
+  export default {
+    data () {
+      return {
+        key: '',
+        isSearchSearchingMore: false,
+        page: 1,
+        size: 10,
+        productListData: [],
+        isChange: false,
+        isDataChange: false,
+        showPublishBox: false,
+        remindText: '',
+        timeoutCount: 0,
+        currentProduct: {},
+        showLoginBox: false
+      }
+    },
+    components: {
+      PublishSupplierSeek,
+      RemindBox,
+      LoginBox
+    },
+    mounted: function () {
+      this.$nextTick(() => {
+        window.addEventListener('scroll', this.scroll, false)
+      })
+    },
+    watch: {
+      '$store.state.supplier.data.productList.data': {
+        handler (val, oldVal) {
+          if (this.isChange) {
+            this.productListData = val.content
+            this.page = 1
+            this.isChange = false
+            this.isDataChange = true
+          } else {
+            this.productListData = this.productListData.concat(val.content)
+            this.isSearchSearchingMore = false
+            this.isDataChange = false
+          }
+        },
+        immediate: true
+      }
+    },
+    computed: {
+      enInfo () {
+        return this.$store.state.supplier.data.enterpriseData.data
+      },
+      productList () {
+        return this.$store.state.supplier.data.productList.data
+      },
+      allPage () {
+        return Math.floor(this.productList.totalElements / this.productList.size) + Math.floor(this.productList.totalElements % this.productList.size > 0 ? 1 : 0)
+      },
+      storeInfo () {
+        return this.$store.state.shop.storeInfo.store.data
+      }
+    },
+    methods: {
+      scroll: function () {
+        let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
+        if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
+          this.getMoreSearch()
+        }
+      },
+      getMoreSearch: function () {
+        this.page++
+        this.isSearchSearchingMore = true
+        this.reloadData()
+      },
+      reloadData: function () {
+        this.$store.dispatch('supplier/getSupplierProductList', { vendUU: this.$route.params.uu, page: this.page, size: this.size, keyword: this.key })
+      },
+      search: function () {
+        this.page = 1
+        this.isChange = true
+        this.reloadData()
+      },
+      publish: function (product) {
+        if (this.user.logged) {
+          this.currentProduct = product
+          this.showPublishBox = true
+        } else {
+          this.showLoginBox = true
+        }
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount ++
+      },
+      goLastPage: function () {
+        window.history.back(-1)
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .supplier-detail {
+    background: #29a9f9;
+    padding: .38rem .19rem;
+    position: relative;
+    margin-bottom: 1rem;
+    .open {
+      position: absolute;
+      height: .58rem;
+      left: -.1rem;
+      top: .15rem;
+    }
+    .detail {
+      height: 4.46rem;
+      padding: 0 .31rem;
+      background: #fff;
+      overflow: hidden;
+      border-radius: .05rem;
+      h1 {
+        height: 1.11rem;
+        line-height: 1.11rem;
+        text-align: center;
+        font-size: .44rem;
+        border-bottom: 1px solid rgba(0, 0, 0, .26);
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        i {
+          color: #3f84f6;
+          font-size: .31rem;
+          float: right;
+        }
+      }
+      .line {
+        margin-top: .26rem;
+        font-size: .28rem;
+        color: #666;
+        padding: 0 .15rem;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        .img-wrap {
+          width: .3rem;
+          text-align: center;
+          display: inline-block;
+          margin-right: .31rem;
+          img {
+            height: .25rem;
+          }
+        }
+      }
+    }
+    .list {
+      background: #f2f2f2;
+      margin-top: .21rem;
+      border-radius: .05rem;
+      .search-content {
+        padding-top: .15rem;
+        padding-bottom: .15rem;
+        text-align: center;
+        input {
+          border: 1px solid #3f84f6;
+        }
+      }
+      ul {
+        li {
+          &:nth-child(odd) {
+            background: #fff;
+          }
+          position: relative;
+          padding: .29rem 0 .16rem .22rem;
+          overflow: hidden;
+          .prop {
+            margin-bottom: .11rem;
+            font-size: .28rem;
+            &:last-child {
+              margin-bottom: 0;
+            }
+            .head {
+              color: #666;
+            }
+            .item {
+              display: inline-block;
+              width: 1.68rem;
+              overflow: hidden;
+              text-overflow: ellipsis;
+              white-space: nowrap;
+              margin-right: .18rem;
+              vertical-align: middle;
+              &:last-child {
+                margin-right: 0;
+              }
+            }
+          }
+          .seek-btn {
+            position: absolute;
+            right: .17rem;
+            top: .67rem;
+            display: block;
+            width: 1.5rem;
+            height: .44rem;
+            line-height: .44rem;
+            text-align: center;
+            color: #fff;
+            background: #3f84f6;
+            border-radius: .22rem;
+            font-size: .26rem;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 3 - 0
components/mobile/supplier/index.js

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

+ 1 - 1
layouts/error.vue

@@ -15,7 +15,7 @@
   export default {
     props: ['error'],
     layout (context) {
-      return context.store.state.option.isMobile ? 'login' : 'default'
+      return context.store.state.option.isMobile ? 'none' : 'default'
     },
     computed: {
       isMobile () {

+ 1 - 1
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://10.1.51.125:8080/platform-b2c')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://192.168.253.121:9090/platform-b2c')
 const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 const materialUrl = process.env.MATERIAL_URL || (isProdMode ? 'https://api-product.usoftmall.com/' : 'http://218.17.158.219:24000/')
 

+ 0 - 1
pages/index.vue

@@ -105,7 +105,6 @@
         store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 50, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null}),
         store.dispatch('loadStoreStatus', { op: 'check' })
       ]) : Promise.all([
-        store.dispatch('loadStoreStatus', { op: 'check' }),
         store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: 1, pageSize: 5, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null})
       ])
     },

+ 157 - 0
pages/mobile/applyPurchase/list/businessOpportunity.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="mobile-content">
+    <div class="mobile-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <div class="search-content">
+        <input type="text" v-model="seekKeyword" placeholder="请输入您要查找的型号或品牌" @keyup.13="searchSeek" ref="searchSeekInput" @focus="inputGetFocus()" @blur="blur()">
+        <span @click="searchSeek">
+        <i class="iconfont icon-sousuo"></i>
+        </span>
+      </div>
+    </div>
+    <div class="seek-title">
+      <img src="/images/mobile/@2x/applyPurchase/opportunity.png" alt="">
+      <span>我的商机</span>
+    </div>
+    <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>
+      <nuxt-link to="/">返回首页</nuxt-link>
+    </div>
+    <loading v-show="isSearchSearchingMore"></loading>
+    <div v-if="purchaseManList && false"></div>
+  </div>
+</template>
+<script>
+  import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
+  import {Loading} from '~components/mobile/common'
+  export default {
+    layout: 'mobile',
+    components: {
+      SeekList,
+      Loading
+    },
+    data () {
+      return {
+        isSearchSearchingMore: false,
+        page: 1,
+        size: 10,
+        purchaseManListData: [],
+        showSeekSearch: true,
+        seekKeyword: '',
+        isChange: false,
+        isDataChange: false
+      }
+    },
+    mounted: function () {
+      this.$nextTick(() => {
+        window.addEventListener('scroll', this.scroll, false)
+      })
+    },
+//    watch: {
+//      $route: function (val, oldVal) {
+//        window.removeEventListener('scroll', this.scroll, false)
+//      }
+//    },
+    fetch ({store}) {
+      return Promise.all([
+          store.dispatch('applyPurchase/loadVendorPushList', {pageNumber: 1, pageSize: 10, sorting: {'releaseDate': 'DESC'}, enuu: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null, useruu: store.state.option.user.data.userUU})
+      ])
+    },
+    computed: {
+      purchaseManList () {
+        let list = this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
+        if (this.isChange) {
+          this.purchaseManListData = []
+          this.seekPage = 1
+          this.isChange = false
+          this.isDataChange = true
+        } else {
+          this.purchaseManListData = this.purchaseManListData.concat(list.content || [])
+          this.isSearchSearchingMore = false
+          this.isDataChange = false
+        }
+        return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
+      },
+      allPage () {
+        return Math.floor(this.purchaseManList.totalElements / this.purchaseManList.size) + Math.floor(this.purchaseManList.totalElements % this.purchaseManList.size > 0 ? 1 : 0)
+      }
+    },
+    methods: {
+      scroll: function () {
+        let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
+        if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
+          this.getMoreSearch()
+        }
+        if (this.$refs.searchSeekInput && this.$store.state.mobile.InputGetFocus) {
+          this.$refs.searchSeekInput.blur()
+        }
+      },
+      blur: function() {
+        // setTimeout(() => {
+        this.$store.dispatch('mobile/SetInputGetFocus', false)
+        // }, 300)
+      },
+      inputGetFocus: function() {
+        setTimeout(() => {
+          this.$store.dispatch('mobile/SetInputGetFocus', true)
+        }, 300)
+      },
+      getMoreSearch: function () {
+        this.page++
+        this.isSearchSearchingMore = true
+        this.reloadData()
+      },
+      reloadData: function () {
+        this.$store.dispatch('applyPurchase/loadVendorPushList', {pageNumber: this.page, pageSize: this.size, sorting: {'releaseDate': 'DESC'}, keyword: this.seekKeyword, enuu: this.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, useruu: this.user.data.userUU})
+      },
+      goLastPage: function () {
+        window.history.back(-1)
+      },
+      searchSeek: function () {
+        this.page = 1
+        this.isChange = true
+        this.reloadData()
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .mobile-content {
+    .mobile-header {
+      position: fixed;
+      top: 0;
+      z-index: 10;
+      width:100%;
+      height:.88rem;
+      line-height: .88rem;
+      background: #3e82f5;
+      padding:0 .2rem 0 .1rem;
+      color:#fff;
+      > a {
+        font-size:.28rem;
+        color:#fff;
+        position: absolute;
+        i {
+          font-size: .48rem;
+          margin-right: -.1rem;
+        }
+      }
+      .search-content {
+        margin-left: .5rem;
+        line-height: normal;
+        padding-top: .14rem;
+        input {
+          color: #333;
+          width: 6.48rem;
+          line-height: normal;
+        }
+        span {
+          height: .46rem;
+          line-height: .46rem;
+        }
+      }
+    }
+  }
+</style>

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

@@ -139,7 +139,7 @@
         padding-top: .14rem;
         input {
           color: #333;
-          width: 5.78rem;
+          width: 6.48rem;
           line-height: normal;
         }
         span {

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

@@ -30,13 +30,15 @@
       </div>
     </div>
 
-    <div class="detail-brand" v-for="(item, index) in searchLists" :style="index == 0 ? 'padding-top: .2rem;' : ''" v-if="searchLists.length > 0">
-      <div class="brand-item" @click="goComponent(item.uuid)">
-        <p>店铺:<span>{{item.storeName || '-'}}</span></p>
-        <p>型号:<span>{{item.code || '-'}}</span></p>
-        <p>品牌:<span>{{item.brandEn || item.brand.nameCn || '-'}}</span></p>
-        <p>产品描述:<span>{{item.description || '-'}}</span></p>
-        <i class="iconfont icon-shoucang" :style="(item.isFocus)?'color:#ff7800':'color:#bbb'" @click="collect(item, $event)"></i>
+    <div v-if="searchLists && searchLists.length > 0" >
+      <div class="detail-brand" v-for="(item, index) in searchLists" :style="index == 0 ? 'padding-top: .2rem;' : ''" v-if="item">
+        <div class="brand-item" @click="goComponent(item.uuid)">
+          <p>店铺:<span>{{item.storeName || '-'}}</span></p>
+          <p>型号:<span>{{item.code || '-'}}</span></p>
+          <p>品牌:<span>{{item.brandEn || item.brand.nameCn || '-'}}</span></p>
+          <p>产品描述:<span>{{item.description || '-'}}</span></p>
+          <i class="iconfont icon-shoucang" :style="(item.isFocus)?'color:#ff7800':'color:#bbb'" @click="collect(item, $event)"></i>
+        </div>
       </div>
     </div>
 

+ 24 - 17
pages/mobile/shop/index.vue

@@ -11,22 +11,29 @@
         <li @click="onDown('CONSIGNMENT')" v-show="downName !== '寄售'">寄售</li>
       </ul>
     </div>
-    <div class="shop-list" v-for="item in searchLists" @click="goStoreDetail(item.uuid)" v-if="item">
-      <h3>{{item.storeName}}</h3>
-      <div class="list-item">
-        <div class="item-img">
-          <i :style="'background:url(' + isType(item.type) + ')no-repeat 0 0/.65rem .33rem;'"></i>
-          <img :src="item.logoUrl || '/images/component/default.png'">
-        </div>
-        <div class="list-item-phone">
-          <p>电话:<span>{{item.enterprise.enTel}}</span></p>
-          <p>传真:<span>{{item.enterprise.enFax}}</span></p>
-          <!--<p>商家介绍: <nuxt-link :to="'/mobile/merchantDescription/'+item.uuid">点击查看</nuxt-link></p>-->
-          <p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>
-          <i class="iconfont icon-shoucang" :style="item.isFocus=='true'?'color:#ff7800':'color:#bbb'" @click="focusStore(item, $event)"></i>
+    <div v-if="searchLists && searchLists.length">
+      <div class="shop-list" v-for="item in searchLists" @click="goStoreDetail(item.uuid)">
+        <h3>{{item.storeName}}</h3>
+        <div class="list-item">
+          <div class="item-img">
+            <i :style="'background:url(' + isType(item.type) + ')no-repeat 0 0/.65rem .33rem;'"></i>
+            <img :src="item.logoUrl || '/images/component/default.png'">
+          </div>
+          <div class="list-item-phone">
+            <p>电话:<span>{{item.enterprise.enTel}}</span></p>
+            <p>传真:<span>{{item.enterprise.enFax}}</span></p>
+            <!--<p>商家介绍: <nuxt-link :to="'/mobile/merchantDescription/'+item.uuid">点击查看</nuxt-link></p>-->
+            <p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>
+            <i class="iconfont icon-shoucang" :style="item.isFocus=='true'?'color:#ff7800':'color:#bbb'" @click="focusStore(item, $event)"></i>
+          </div>
         </div>
       </div>
     </div>
+    <div class="com-none-state" v-else>
+      <img src="/images/mobile/@2x/search-empty.png">
+      <p>抱歉,暂无搜索结果</p>
+      <nuxt-link to="/">返回首页</nuxt-link>
+    </div>
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
     <loading v-show="isSearchingMore"></loading>
     <div class="mobile-modal" v-if="showStoreInfo">
@@ -71,9 +78,9 @@
       Loading,
       LoginBox
     },
-    fetch ({ store }) {
+    fetch ({ store, query }) {
       return Promise.all([
-        store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT' })
+        store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: query.keyword || null })
       ])
     },
     computed: {
@@ -115,7 +122,7 @@
         if (!this.isSearchingMore) {
           this.page++
           this.isSearchingMore = true
-          this.$store.dispatch('provider/findStoreListInMobil', { page: this.page, count: this.count, types: this.types })
+          this.$store.dispatch('provider/findStoreListInMobil', { page: this.page, count: this.count, types: this.types, keyword: this.$route.query.keyword || null })
         }
       },
       isType (type) {
@@ -149,7 +156,7 @@
         } else if (type === 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT') {
           this.downName = '全部'
         }
-        this.$store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: type })
+        this.$store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: type, keyword: this.$route.query.keyword || null })
       },
       focusStore: function (item, $event) {
 //        item.isFocus = item.isFocus === 'false' ? 'true' : 'false'

+ 49 - 0
pages/mobile/supplier/detail/_uu.vue

@@ -0,0 +1,49 @@
+<template>
+  <div>
+    <div class="sl-title">
+      供应商详情<i class="iconfont icon-fanhui" @click="goLast"></i>
+    </div>
+    <supplier-detail></supplier-detail>
+  </div>
+</template>
+<script>
+  import { SupplierDetail } from '~components/mobile/supplier'
+  export default {
+    layout: 'mobile',
+    fetch ({ store, params, query }) {
+      let promises = [
+        store.dispatch('supplier/getSupplierEnInfo', {uu: params.uu}),
+        store.dispatch('supplier/getSupplierProductList', { vendUU: params.uu, page: 1, size: 10 })
+      ]
+      if (query.isStore === '1') {
+        promises.push(store.dispatch('shop/findStoreInfoFromEnUU', {enUU: params.uu, filter: 'enUU'}))
+      }
+      return Promise.all(promises)
+    },
+    components: {
+      SupplierDetail
+    },
+    methods: {
+      goLast: function () {
+        window.history.back(-1)
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .sl-title {
+    position: relative;
+    height: .72rem;
+    font-size: .35rem;
+    color: #fff;
+    background: #3f84f6;
+    text-align: center;
+    line-height: .72rem;
+    i {
+      position: absolute;
+      left: .32rem;
+      top: 0;
+    }
+  }
+</style>
+

+ 17 - 0
pages/mobile/supplier/index.vue

@@ -0,0 +1,17 @@
+<template>
+  <list></list>
+</template>
+<script>
+  import { List } from '~components/mobile/supplier'
+  export default {
+    layout: 'mobile',
+    fetch ({ store }) {
+      return Promise.all([
+        store.dispatch('supplier/getSupplierList', {page: 1, size: 10})
+      ])
+    },
+    components: {
+      List
+    }
+  }
+</script>

+ 13 - 7
pages/mobile/user/index.vue

@@ -382,20 +382,26 @@
     },
     fetch ({ store, route }) {
       let user = store.state.option.user.data
+      let isSaler = route.query.type === 'saler'
       let params = {
         pageNumber: 1,
         pageSize: 10,
-        state: (!route.query.type || route.query.type === 'buyer') ? 'todo' : null
+        state: !isSaler ? 'todo' : null
       }
-      if (user.enterprise.uu) {
-        params.enUU = user.enterprise.uu
+      if (!isSaler) {
+        if (user.enterprise.uu) {
+          params.enUU = user.enterprise.uu
+        } else {
+          params.userUU = user.userUU
+        }
       } else {
-        params.userUU = user.userUU
+        params.enuu = user.enterprise.uu
+        params.useruu = user.userUU
       }
       return Promise.all([
         store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
         store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 }),
-        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadPurchaseManList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params),
+        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadVendorPushList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', params),
         store.dispatch('loadStoreStatus', { op: 'check' })
       ])
     },
@@ -548,7 +554,7 @@
             this.getResourceProvidor()
           } else {
             if (type === 'wait') {
-              this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise.uu, keyword: this.seekKeyword})
+              this.$store.dispatch('applyPurchase/loadVendorPushList', {pageNumber: this.seekPage, pageSize: this.seekSize, enuu: this.user.data.enterprise.uu, useruu: this.user.data.userUU, keyword: this.seekKeyword})
             } else if (type === 'done') {
               this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}, overdue: 1})
             } else {
@@ -751,7 +757,7 @@
         return this.$store.state.applyPurchase.purchaseManList.purchaseManList
       },
       purchaseManList () {
-        let list = this.purchase.data.content.slice()
+        let list = this.purchase.data.content ? this.purchase.data.content.slice() : []
         if (this.isChange) {
           this.purchaseManListData = []
           this.seekPage = 1

BIN
static/images/mobile/@2x/applyPurchase/opportunity.png


BIN
static/images/mobile/@2x/home/brand.png


BIN
static/images/mobile/@2x/home/seek.png


BIN
static/images/mobile/@2x/home/store.png


BIN
static/images/mobile/@2x/home/supplier.png


BIN
static/images/mobile/@2x/search/select-arrow.png


BIN
static/images/mobile/supplier/address.png


BIN
static/images/mobile/supplier/business.png


BIN
static/images/mobile/supplier/email.png


BIN
static/images/mobile/supplier/house.png


BIN
static/images/mobile/supplier/is-open.png


BIN
static/images/mobile/supplier/phone.png


BIN
static/images/mobile/supplier/tag.png


+ 10 - 0
store/applyPurchase.js

@@ -122,6 +122,16 @@ export const actions = {
         commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
       })
   },
+  // 卖家精准推送求购列表
+  loadVendorPushList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN')
+    return axios.get('/inquiry/sale/remind', {params})
+      .then(response => {
+        commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
+      })
+  },
   // 求购排行榜
   loadPurchaseApplyRank ({ commit }, params = {}) {
     commit('purchaseApplyRank/REQUEST_PURCHASERANK', params)

+ 10 - 0
store/shop.js

@@ -131,5 +131,15 @@ export const actions = {
       }, err => {
         commit('storeInfo/GET_FOCUSPAGE_FAILURE', err)
       })
+  },
+  // 获取某店铺信息
+  findStoreInfoFromEnUU ({ commit }, params = {}) {
+    commit('storeInfo/REQUEST_STORE_INFO')
+    return axios.get('/api/store-service/stores', { params })
+      .then(response => {
+        commit('storeInfo/GET_STORE_INFO_SUCCESS', response.data)
+      }, err => {
+        commit('storeInfo/GET_STORE_INFO_FAILURE', err)
+      })
   }
 }

+ 34 - 0
store/supplier.js

@@ -0,0 +1,34 @@
+import axios from '~/plugins/axios'
+
+export const actions = {
+  // 获取浏览记录
+  getSupplierList ({ commit }, params = {}) {
+    commit('data/REQUEST_LIST')
+    return axios.get('/vendor/introduction/vendor/list', {params})
+      .then(response => {
+        commit('data/GET_LIST_SUCCESS', response.data)
+      }, err => {
+        commit('data/GET_LIST_FAILURE', err)
+      })
+  },
+  // 根据uu获取供应商企业信息
+  getSupplierEnInfo ({ commit }, params = {}) {
+    commit('data/REQUEST_EN')
+    return axios.get(`/basic/enterprise/${params.uu}/info`, {params})
+      .then(response => {
+        commit('data/GET_EN_SUCCESS', response.data)
+      }, err => {
+        commit('data/GET_EN_FAILURE', err)
+      })
+  },
+  // 获取供应商物料列表
+  getSupplierProductList ({ commit }, params = {}) {
+    commit('data/REQUEST_PRODUCT_LIST')
+    return axios.get(`/vendor/introduction/product/list`, {params})
+      .then(response => {
+        commit('data/GET_PRODUCT_LIST_SUCCESS', response.data)
+      }, err => {
+        commit('data/GET_PRODUCT_LIST_FAILURE', err)
+      })
+  }
+}

+ 47 - 0
store/supplier/data.js

@@ -0,0 +1,47 @@
+export const state = () => ({
+  list: {
+    fetching: false,
+    data: []
+  },
+  enterpriseData: {
+    fetching: false,
+    data: []
+  },
+  productList: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_LIST (state) {
+    state.list.fetching = true
+  },
+  GET_LIST_FAILURE (state) {
+    state.list.fetching = false
+  },
+  GET_LIST_SUCCESS (state, result = []) {
+    state.list.fetching = false
+    state.list.data = result
+  },
+  REQUEST_EN (state) {
+    state.enterpriseData.fetching = true
+  },
+  GET_EN_FAILURE (state) {
+    state.enterpriseData.fetching = false
+  },
+  GET_EN_SUCCESS (state, result = []) {
+    state.enterpriseData.fetching = false
+    state.enterpriseData.data = result
+  },
+  REQUEST_PRODUCT_LIST (state) {
+    state.productList.fetching = true
+  },
+  GET_PRODUCT_LIST_FAILURE (state) {
+    state.productList.fetching = false
+  },
+  GET_PRODUCT_LIST_SUCCESS (state, result = []) {
+    state.productList.fetching = false
+    state.productList.data = result
+  }
+}