Browse Source

添加求购分享手机端页面

shenjj@usoftchina.com 7 years ago
parent
commit
661e7afcb8
48 changed files with 2891 additions and 378 deletions
  1. 17 14
      .eslintrc.js
  2. 3 0
      .vscode/settings.json
  3. 3 0
      Dockerfile
  4. 1 1
      app.html
  5. 111 4
      assets/scss/mobileCommon.scss
  6. 2 2
      components/applyPurchase/ApplyInfo.vue
  7. 3 1
      components/applyPurchase/SayPrice.vue
  8. 2 2
      components/default/Header.vue
  9. 74 247
      components/mobile/Home.vue
  10. 288 0
      components/mobile/HomeOld.vue
  11. 57 13
      components/mobile/MobileFooter.vue
  12. 23 5
      components/mobile/MobileHeader.vue
  13. 446 0
      components/mobile/applyPurchase/PublishSeek.vue
  14. 384 0
      components/mobile/applyPurchase/SayPrice.vue
  15. 294 0
      components/mobile/applyPurchase/SayPriceInfo.vue
  16. 256 0
      components/mobile/applyPurchase/SeekList.vue
  17. 4 0
      components/mobile/applyPurchase/index.js
  18. 2 2
      components/mobile/common/RemindBox.vue
  19. 4 1
      nuxt.config.js
  20. 2 1
      package.json
  21. 6 3
      pages/index.vue
  22. 19 0
      pages/mobile/applyPurchase/list/_id.vue
  23. 133 0
      pages/mobile/applyPurchase/list/index.vue
  24. 19 0
      pages/mobile/applyPurchase/sayPrice/_id.vue
  25. 394 0
      pages/mobile/share/purChase/_uuid.vue
  26. 201 82
      pages/mobile/user/index.vue
  27. 21 0
      plugins/vue-filter.js
  28. BIN
      static/images/mobile/@2x/applyPurchase/add-btn.png
  29. BIN
      static/images/mobile/@2x/applyPurchase/currency-arrow-down.png
  30. BIN
      static/images/mobile/@2x/applyPurchase/currency-arrow-up.png
  31. BIN
      static/images/mobile/@2x/applyPurchase/home/arrow-right.png
  32. BIN
      static/images/mobile/@2x/applyPurchase/home/brand.png
  33. BIN
      static/images/mobile/@2x/applyPurchase/home/home-bg.png
  34. BIN
      static/images/mobile/@2x/applyPurchase/home/phone.png
  35. BIN
      static/images/mobile/@2x/applyPurchase/home/seek-footer.png
  36. BIN
      static/images/mobile/@2x/applyPurchase/home/seek-title.png
  37. BIN
      static/images/mobile/@2x/applyPurchase/home/seek.png
  38. BIN
      static/images/mobile/@2x/applyPurchase/home/shop.png
  39. BIN
      static/images/mobile/@2x/applyPurchase/say-price-accept.png
  40. BIN
      static/images/mobile/@2x/applyPurchase/say-price-check.png
  41. BIN
      static/images/mobile/@2x/applyPurchase/say-price-default.png
  42. BIN
      static/images/mobile/@2x/applyPurchase/sub-btn.png
  43. BIN
      static/images/mobile/@2x/purChase/banner.png
  44. BIN
      static/images/mobile/@2x/purChase/money_icon.png
  45. BIN
      static/images/mobile/@2x/purChase/purChase_bg.png
  46. BIN
      static/images/mobile/@2x/purChase/time.png
  47. 66 0
      store/applyPurchase.js
  48. 56 0
      store/applyPurchase/purchaseManList.js

+ 17 - 14
.eslintrc.js

@@ -1,16 +1,19 @@
 module.exports = {
-	root: true,
-	parser: 'babel-eslint',
-	env: {
-		browser: true,
-		node: true
-	},
-	extends: 'standard',
-	// required to lint *.vue files
-	plugins: [
-		'html'
-	],
-	// add your custom rules here
-	rules: {},
-	globals: {}
+  root: true,
+  parser: 'babel-eslint',
+  env: {
+    browser: true,
+    node: true
+  },
+  extends: 'standard',
+  // required to lint *.vue files
+  plugins: [
+    'html'
+  ],
+  // add your custom rules here
+  rules: {
+    "space-before-function-paren": [0, "ignore"],
+    "indent": 'off'
+  },
+  globals: {}
 }

+ 3 - 0
.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+  "eslint.autoFixOnSave": true
+}

+ 3 - 0
Dockerfile

@@ -7,6 +7,9 @@ COPY . /app
 
 RUN chmod +x run.sh
 
+RUN export SASS_BINARY_PATH=linux_musl-x64-57_binding.node
+RUN export PATH=$PATH:$SASS_BINARY_PATH
+
 RUN cnpm install
 RUN npm run build
 

+ 1 - 1
app.html

@@ -5,7 +5,7 @@
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css"/>
   <!--<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>-->
-  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_crpyz8n3b4qxs9k9.css">
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_fhw1qsxh5yfa8aor.css">
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css"/>
   {{ HEAD }}
   <script>

+ 111 - 4
assets/scss/mobileCommon.scss

@@ -94,16 +94,18 @@ ins, a {
 .mobile-modal {
   position: fixed;
   top: 0;
-  width: 100%;
-  height: 100%;
+  bottom: 0;
+  left: 0;
+  right: 0;
   z-index: 999;
   background: rgba(0,0,0,.3);
   .mobile-modal-box {
-    position: fixed;
-    width: 5.92rem;
+    position: absolute;
+    /*width: 5.92rem;*/
     font-size: .28rem;
     top: 27%;
     left: 11%;
+    right: 11%;
     z-index: 1000;
     .mobile-modal-header {
       line-height: .96rem;
@@ -190,6 +192,11 @@ input {
   -webkit-appearance: none;
   -moz-appearance: none;
   appearance: none;
+  outline: none;
+  -webkit-box-shadow: none;
+  -moz-box-shadow: none;
+  box-shadow: none;
+  border: none;
 }
 
 /*loading优先级*/
@@ -199,4 +206,104 @@ input {
 
 .mobile-content {
   padding-top: .88rem !important;
+  margin-bottom: 1rem;
+}
+
+/*求购title*/
+.seek-title {
+  height: .96rem;
+  line-height: .96rem;
+  text-align: center;
+  position: relative;
+  border-bottom: .04rem solid rgb(219, 219, 219);
+  > img {
+    width: .36rem;
+    height: .38rem;
+    margin-right: .16rem;
+    vertical-align: middle;
+    margin-bottom: .16rem;
+  }
+  > span {
+    font-size: .35rem;
+    color: #666;
+  }
+  > a {
+    position: absolute;
+    right: .1rem;
+    top: 0;
+    font-size: .24rem;
+    color: #999;
+    margin-right: .1rem;
+    img {
+      width: .25rem;
+      height: .25rem;
+      margin-bottom: .04rem;
+    }
+  }
+}
+
+/*search*/
+.search-content {
+  padding-top: .15rem;
+  input {
+    width: 6.48rem;
+    height: .58rem;
+    border-radius: .14rem;
+    margin: 0 0 0 .11rem;
+    font-size: .23rem;
+    padding: 0 0 0 .21rem;
+  }
+  span {
+    display: inline-block;
+    height: .58rem;
+    line-height: .58rem;
+    position: relative;
+    top: .04rem;
+    width: .68rem;
+    color: #376ff3;
+    border-left: .02rem solid #376ff3;
+    margin-left: -.68rem;
+    text-align: center;
+    i {
+      font-size: .3rem;
+    }
+  }
+  img {
+    width: .44rem;
+    height: .44rem;
+    float: right;
+    margin-right: .2rem;
+    margin-top: .1rem;
+  }
+}
+/*报价info*/
+.base-info {
+  //width: 7.17rem;
+  margin: 0 auto .18rem;
+  background: #fff;
+  padding: 0 .29rem;
+  .content-line {
+    height: .5rem;
+    line-height: .5rem;
+    font-size: .28rem;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    span {
+      color: #666;
+    }
+  }
+}
+
+.say-price-btn {
+  display: block;
+  width: 6.7rem;
+  height: .74rem;
+  line-height: .74rem;
+  text-align: center;
+  color: #fff !important;
+  background: #3f84f6;
+  border-radius: .08rem;
+  font-size: .32rem;
+  margin: 0 auto;
 }

+ 2 - 2
components/applyPurchase/ApplyInfo.vue

@@ -157,13 +157,13 @@
         return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
       },
       phone: function (str) {
-        return str.substring(0, 3) + '****' + str.substring(7, 11)
+        return str ? (str.substring(0, 3) + '****' + str.substring(7, 11)) : '-'
       },
       enterpriseFilter (str) {
         return str ? str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str : '-'
       },
       userNameFilter (str) {
-        return str ? str.substring(0, 1) + '**' : '-'
+        return str ? (str.substring(0, 1) + '**') : '-'
       }
     },
     computed: {

+ 3 - 1
components/applyPurchase/SayPrice.vue

@@ -140,7 +140,7 @@
           purchaseMan.leadtime = this.sayPriceObj.leadtime
           purchaseMan.replies = this.sayPriceObj.replies
           purchaseMan.vendUU = this.user.data.enterprise.uu
-          purchaseMan.vendorUserUU = this.user.data.userUU
+          purchaseMan.vendUserUU = this.user.data.userUU
           purchaseMan.qutoApp = 'MALL'
           if (!purchaseMan.currency) {
             purchaseMan.currency = this.sayPriceObj.currency
@@ -285,6 +285,8 @@
     width: 476px;
     top: 30%;
     left: 33%;
+    bottom: 3%;
+    overflow-y: auto;
     /*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
     /*-moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
     /*box-shadow: 0 5px 15px rgba(0,0,0,.5);*/

+ 2 - 2
components/default/Header.vue

@@ -159,8 +159,8 @@
           window.location.href = '/personalMaterial'
         } else {
           if (tempEnterprise.isVendor === 313) {
-            window.location.href = '/vendor'
-            // window.location.href = '/vendor#/index'
+            // window.location.href = '/vendor'
+            window.location.href = '/vendor#/index'
           } else {
             window.location.href = '/register-saler'
           }

+ 74 - 247
components/mobile/Home.vue

@@ -1,288 +1,115 @@
 <template>
-  <div class="home">
+  <div>
+    <div class="home" v-if="!showMainSearch">
+      <div class="header">
+        <div class="search-content">
+          <input type="text" placeholder="请输入您要查找的型号或品牌" @click="onHomeSearchClick()">
+          <span>
+        <i class="iconfont icon-sousuo"></i>
+      </span>
+          <img src="/images/mobile/@2x/applyPurchase/home/phone.png" alt="" @click="showStoreInfo = true">
+        </div>
+      </div>
+      <ul class="link-list">
+        <li>
+          <nuxt-link to="/mobile/shop">
+            <img src="/images/mobile/@2x/applyPurchase/home/shop.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>
+          </nuxt-link>
+        </li>
+        <li>
+          <nuxt-link to="/mobile/applyPurchase/list">
+            <img src="/images/mobile/@2x/applyPurchase/home/seek.png" alt="">
+            <span>求购询价</span>
+          </nuxt-link>
+        </li>
+      </ul>
+      <div class="seek-title">
+        <img src="/images/mobile/@2x/applyPurchase/home/seek-title.png" alt="">
+        <span>最新求购信息</span>
+        <nuxt-link to="/mobile/applyPurchase/list">查看更多 <img src="/images/mobile/@2x/applyPurchase/home/arrow-right.png" alt=""></nuxt-link>
+      </div>
+      <seek-list :purchaseManList="purchaseManList"></seek-list>
+    </div>
     <div class="mobile-modal" v-if="showStoreInfo">
       <div class="mobile-modal-box">
         <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
         <div class="mobile-modal-content">
-          <div>商家地址:深圳市南山区英唐大厦6楼</div>
-         <!-- <div class="content-line link-url">在线咨询</div>-->
+          <div>商家地址:深圳市南山区英唐大厦1楼</div>
+          <!-- <div class="content-line link-url">在线咨询</div>-->
           <div>致电:<a href="tel:4008301818" target="_blank" class="content-line link-url">4008301818</a></div>
           <div>邮件:<a href="mailto:yrsc@usoftchina.com" target="_blank" class="content-line link-url">yrsc@usoftchina.com</a></div>
         </div>
       </div>
     </div>
-    <div v-if="!showMainSearch">
-      <div class="home-header" :style="'background:url(' + bgUrl + ')no-repeat center center/100% 6.14rem'">
-        <!--<a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>-->
-        <div class="home-search">
-          <!--<ul>-->
-          <!--<li :class="activeType=='model'?'active':''" @click="activeType='model'"><span>型号</span></li>-->
-          <!--<li :class="activeType=='brand'?'active':''" @click="activeType='brand'"><span>品牌</span></li>-->
-          <!--<li :class="activeType=='shops'?'active':''" @click="activeType='shops'"><span>商家</span></li>-->
-          <!--</ul>-->
-          <div class="home-input">
-            <input type="text" placeholder="请输入您要查找的型号或品牌"
-                   @click="onHomeSearchClick()"/>
-            <i class="iconfont icon-sousuo"></i>
-          </div>
-          <!--<p style="color:#e45803;line-height:.4rem;margin-top:.1rem;width:4.2rem;margin-left:1rem;">搜品牌、搜现货 、搜好店 、搜规格书 就上优软商城</p>-->
-        </div>
-      </div>
-      <div class="home-main">
-        <nuxt-link to="/mobile/shop" class="home-main-content">
-          <div>
-            <img src="/images/mobile/@2x/home/shopbrand@2x.png">
-          </div>
-          <p>店铺列表</p>
-        </nuxt-link>
-        <nuxt-link to="/mobile/brand/brandCenter/ABCD" class="home-main-content">
-          <div>
-            <!--<i class="icon-pinpai iconfont"></i>-->
-            <img src="/images/mobile/@2x/home/brand@2x.png" alt="">
-          </div>
-          <!--<h2>
-            {{numbrand[0]}}
-          </h2>-->
-          <p>品牌列表</p>
-        </nuxt-link>
-        <a @click="goCollect" class="home-main-content">
-          <div>
-            <img src="/images/mobile/@2x/home/storebrand@2x.png">
-          </div>
-          <p>我的收藏</p>
-        </a>
-        <a @click="showStoreInfo = true" class="home-main-content">
-          <div>
-            <img src="/images/mobile/@2x/home/phonebrand@2x.png">
-          </div>
-          <p>联系我们</p>
-        </a>
-        <!--<a class="home-main-content">
-          <div>
-            <i class="icon-xinghao iconfont"></i>
-          </div>
-          <h2>
-            {{numbrand[1]}}
-          </h2>
-          <p>型号</p>
-        </a>
-        <a class="home-main-content">
-          <div>
-            <i class="icon-biaoguigeshuomingshu iconfont"></i>
-          </div>
-          <h2>
-            {{numbrand[2]}}
-          </h2>
-          <p>规格书</p>
-        </a>-->
-      </div>
-    </div>
-    <main-search v-else @cancelSearchAction="onCancelSearch"></main-search>
-    <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
+    <main-search v-if="showMainSearch" @cancelSearchAction="onCancelSearch"></main-search>
   </div>
 </template>
-
 <script>
+  import SeekList from './applyPurchase/SeekList.vue'
   import MainSearch from '~/components/mobile/search/MainSearch.vue'
-  import {LoginBox} from '~components/mobile/common'
   export default {
-    name: 'home',
     data () {
       return {
-        activeType: 'model',
-        showMainSearch: false,
         showStoreInfo: false,
-        isMore: false,
-        isShow: false,
-        len: 0,
-        bgUrl: '/images/mobile/@2x/home/background@2x.png',
-        showLoginBox: false
+        showMainSearch: false
       }
     },
     components: {
-      MainSearch,
-      LoginBox
+      SeekList,
+      MainSearch
+    },
+    computed: {
+      purchaseManList () {
+        return this.$store.state.applyPurchase.purchaseManList.purchaseHomeList.data.content
+      }
     },
     methods: {
       onHomeSearchClick () {
         this.showMainSearch = true
         this.$store.dispatch('searchData/getSearchHistory')
       },
-      matNumber (num) {
-        if (num > 99999999) {
-          this.isShow = true
-          let str2 = num.toString()
-          num = Math.floor(num / 100000000)
-          if (parseInt(str2.charAt(str2.length - 8)) > 8) {
-            num = num + 1
-          }
-          num += '亿'
-        }
-        if (num > 9999) {
-          this.isMore = true
-          let str = num.toString()
-          num = Math.floor(num / 10000)
-          if (parseInt(str.charAt(str.length - 4)) > 4) {
-            num = num + 1
-          }
-          num += '万'
-        } else {
-          num += '个'
-        }
-        return num
-      },
-      forNum (numbers) {
-        let num = []
-        for (let i = 0; i < numbers.length; i++) {
-          num.push(this.matNumber(numbers[i].count))
-        }
-        return num
-      },
       onCancelSearch: function () {
         this.showMainSearch = false
-      },
-      goCollect: function () {
-        if (this.user.logged) {
-          this.$router.push('/mobile/user')
-        } else {
-          this.showLoginBox = true
-        }
-      },
-      goLastPage: function () {
-        window.history.back(-1)
-      }
-    },
-    computed: {
-      numbrand () {
-        return this.forNum(this.counts)
-      },
-      counts () {
-        return this.$store.state.product.common.counts.data
-      },
-      user () {
-        return this.$store.state.option.user
       }
     }
   }
 </script>
-
 <style lang="scss" scoped>
-  .home{
-    font-size: .28rem;
-    background: #f7fbff;
-    position: fixed;
-    top: 0;
-    bottom: .98rem;
-    width: 100%;
-    overflow-y: auto;
-    .home-header{
-      width:100%;
-      height:6.12rem;
-      >a{
-        font-size:.28rem;
-        color:#fff;
-        position: absolute;
-        left: .1rem;
-        top: .2rem;
-        i{
-          font-size: .48rem;
-          margin-right: -.1rem;
-          color: #666;
-        }
-      }
-      .home-search{
-        width:6rem;
-        line-height: .3rem;
-        margin:0 auto;
+  .home {
+    padding-bottom: 1rem;
+    .header {
+      background: url('/images/mobile/@2x/applyPurchase/home/home-bg.png') no-repeat;
+      background-size: cover;
+      height: 3.26rem;
+    }
+    .link-list {
+      background: #f3f3f7;
+      height: 1.36rem;
+      li {
+        display: inline-block;
+        width: 33.3%;
         text-align: center;
-        padding-top: 1.74rem;
-        ul{
-          display:inline-flex;
-        li{
-          flex:1;
-          text-align:center;
-          >span{
-             display:inline-block;
-             width:.72rem;
-             line-height:.33rem;
-             height:.33rem;
-             background: #fff;
-             color:#000;
-             border-radius: .05rem .05rem 0 0 ;
-           }
-          }
-          li.active span{
-              background: #3c7cf5;
-              color:#fff;
-              cursor:pointer;
-          }
+        float: left;
+        height: 1.36rem;
+        img {
+          width: .63rem;
+          height: .63rem;
+          margin-top: .2rem;
         }
-        .home-input{
-          width: 6rem;
-          input{
-            width:5.17rem;
-            display: inline-block;
-            padding: 0 1rem 0 .16rem;
-            margin-right:-.83rem;
-            font-size:.24rem;
-            border:.04rem solid #3c7cf5;
-            border-radius:.05rem;
-            height: .68rem;
-          }
-          i{
-             display:inline-block;
-             text-align: center;
-             width:.83rem;
-             font-size:.33rem;
-             border-left:none;
-             color: #999;
-            vertical-align: middle;
-          }
+        span {
+          font-size: .22rem;
+          color: #666;
+          display: block;
+          margin-top: .15rem;
         }
       }
     }
-    }
-    .home-main{
-      text-align: center;
-      padding-top: .46rem;
-    }
-    .home-main a.home-main-content {
-      width:50%;
-      margin-bottom:.52rem;
-      display: inline-block;
-    }
-    .home-main .home-main-content div{
-      border-radius: .2rem;
-      width:1.14rem;
-      height:1.14rem;
-      margin:0 auto;
-    }
-    .home-main .home-main-content div>img{
-      width: 100%;
-      height:100%;
-    }
-  .home-main .home-main-content div>i {
-    font-size: .8rem;
   }
-  .home-main .home-main-content:nth-child(3) div>i {
-    color: #ff3064;
-  }
-  /*.home-main .home-main-content:nth-child(5) div>i {
-    color: #fa6743;
-  }
-  .home-main .home-main-content:nth-child(6) div>i {
-    color: #fcb836;
-  }*/
-    .home-main .home-main-content p{
-      font-size:.28rem;
-      color:rgb(51,51,51);
-      line-height: .52rem;
-    }
-    .home-main .home-main-content h2{
-      font-size:.3rem;
-      color:#ff7800;
-      line-height: .32rem;
-      margin:0;
-      margin-top:.1rem;
-    }
 </style>

+ 288 - 0
components/mobile/HomeOld.vue

@@ -0,0 +1,288 @@
+<template>
+  <div class="home">
+    <div class="mobile-modal" v-if="showStoreInfo">
+      <div class="mobile-modal-box">
+        <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
+        <div class="mobile-modal-content">
+          <div>商家地址:深圳市南山区英唐大厦6楼</div>
+         <!-- <div class="content-line link-url">在线咨询</div>-->
+          <div>致电:<a href="tel:4008301818" target="_blank" class="content-line link-url">4008301818</a></div>
+          <div>邮件:<a href="mailto:yrsc@usoftchina.com" target="_blank" class="content-line link-url">yrsc@usoftchina.com</a></div>
+        </div>
+      </div>
+    </div>
+    <div v-if="!showMainSearch">
+      <div class="home-header" :style="'background:url(' + bgUrl + ')no-repeat center center/100% 6.14rem'">
+        <!--<a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>-->
+        <div class="home-search">
+          <!--<ul>-->
+          <!--<li :class="activeType=='model'?'active':''" @click="activeType='model'"><span>型号</span></li>-->
+          <!--<li :class="activeType=='brand'?'active':''" @click="activeType='brand'"><span>品牌</span></li>-->
+          <!--<li :class="activeType=='shops'?'active':''" @click="activeType='shops'"><span>商家</span></li>-->
+          <!--</ul>-->
+          <div class="home-input">
+            <input type="text" placeholder="请输入您要查找的型号或品牌"
+                   @click="onHomeSearchClick()"/>
+            <i class="iconfont icon-sousuo"></i>
+          </div>
+          <!--<p style="color:#e45803;line-height:.4rem;margin-top:.1rem;width:4.2rem;margin-left:1rem;">搜品牌、搜现货 、搜好店 、搜规格书 就上优软商城</p>-->
+        </div>
+      </div>
+      <div class="home-main">
+        <nuxt-link to="/mobile/shop" class="home-main-content">
+          <div>
+            <img src="/images/mobile/@2x/home/shopbrand@2x.png">
+          </div>
+          <p>店铺列表</p>
+        </nuxt-link>
+        <nuxt-link to="/mobile/brand/brandCenter/ABCD" class="home-main-content">
+          <div>
+            <!--<i class="icon-pinpai iconfont"></i>-->
+            <img src="/images/mobile/@2x/home/brand@2x.png" alt="">
+          </div>
+          <!--<h2>
+            {{numbrand[0]}}
+          </h2>-->
+          <p>品牌列表</p>
+        </nuxt-link>
+        <a @click="goCollect" class="home-main-content">
+          <div>
+            <img src="/images/mobile/@2x/home/storebrand@2x.png">
+          </div>
+          <p>我的收藏</p>
+        </a>
+        <a @click="showStoreInfo = true" class="home-main-content">
+          <div>
+            <img src="/images/mobile/@2x/home/phonebrand@2x.png">
+          </div>
+          <p>联系我们</p>
+        </a>
+        <!--<a class="home-main-content">
+          <div>
+            <i class="icon-xinghao iconfont"></i>
+          </div>
+          <h2>
+            {{numbrand[1]}}
+          </h2>
+          <p>型号</p>
+        </a>
+        <a class="home-main-content">
+          <div>
+            <i class="icon-biaoguigeshuomingshu iconfont"></i>
+          </div>
+          <h2>
+            {{numbrand[2]}}
+          </h2>
+          <p>规格书</p>
+        </a>-->
+      </div>
+    </div>
+    <main-search v-else @cancelSearchAction="onCancelSearch"></main-search>
+    <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
+  </div>
+</template>
+
+<script>
+  import MainSearch from '~/components/mobile/search/MainSearch.vue'
+  import {LoginBox} from '~components/mobile/common'
+  export default {
+    name: 'home',
+    data () {
+      return {
+        activeType: 'model',
+        showMainSearch: false,
+        showStoreInfo: false,
+        isMore: false,
+        isShow: false,
+        len: 0,
+        bgUrl: '/images/mobile/@2x/home/background@2x.png',
+        showLoginBox: false
+      }
+    },
+    components: {
+      MainSearch,
+      LoginBox
+    },
+    methods: {
+      onHomeSearchClick () {
+        this.showMainSearch = true
+        this.$store.dispatch('searchData/getSearchHistory')
+      },
+      matNumber (num) {
+        if (num > 99999999) {
+          this.isShow = true
+          let str2 = num.toString()
+          num = Math.floor(num / 100000000)
+          if (parseInt(str2.charAt(str2.length - 8)) > 8) {
+            num = num + 1
+          }
+          num += '亿'
+        }
+        if (num > 9999) {
+          this.isMore = true
+          let str = num.toString()
+          num = Math.floor(num / 10000)
+          if (parseInt(str.charAt(str.length - 4)) > 4) {
+            num = num + 1
+          }
+          num += '万'
+        } else {
+          num += '个'
+        }
+        return num
+      },
+      forNum (numbers) {
+        let num = []
+        for (let i = 0; i < numbers.length; i++) {
+          num.push(this.matNumber(numbers[i].count))
+        }
+        return num
+      },
+      onCancelSearch: function () {
+        this.showMainSearch = false
+      },
+      goCollect: function () {
+        if (this.user.logged) {
+          this.$router.push('/mobile/user')
+        } else {
+          this.showLoginBox = true
+        }
+      },
+      goLastPage: function () {
+        window.history.back(-1)
+      }
+    },
+    computed: {
+      numbrand () {
+        return this.forNum(this.counts)
+      },
+      counts () {
+        return this.$store.state.product.common.counts.data
+      },
+      user () {
+        return this.$store.state.option.user
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .home{
+    font-size: .28rem;
+    background: #f7fbff;
+    position: fixed;
+    top: 0;
+    bottom: .98rem;
+    width: 100%;
+    overflow-y: auto;
+    .home-header{
+      width:100%;
+      height:6.12rem;
+      >a{
+        font-size:.28rem;
+        color:#fff;
+        position: absolute;
+        left: .1rem;
+        top: .2rem;
+        i{
+          font-size: .48rem;
+          margin-right: -.1rem;
+          color: #666;
+        }
+      }
+      .home-search{
+        width:6rem;
+        line-height: .3rem;
+        margin:0 auto;
+        text-align: center;
+        padding-top: 1.74rem;
+        ul{
+          display:inline-flex;
+        li{
+          flex:1;
+          text-align:center;
+          >span{
+             display:inline-block;
+             width:.72rem;
+             line-height:.33rem;
+             height:.33rem;
+             background: #fff;
+             color:#000;
+             border-radius: .05rem .05rem 0 0 ;
+           }
+          }
+          li.active span{
+              background: #3c7cf5;
+              color:#fff;
+              cursor:pointer;
+          }
+        }
+        .home-input{
+          width: 6rem;
+          input{
+            width:5.17rem;
+            display: inline-block;
+            padding: 0 1rem 0 .16rem;
+            margin-right:-.83rem;
+            font-size:.24rem;
+            border:.04rem solid #3c7cf5;
+            border-radius:.05rem;
+            height: .68rem;
+          }
+          i{
+             display:inline-block;
+             text-align: center;
+             width:.83rem;
+             font-size:.33rem;
+             border-left:none;
+             color: #999;
+            vertical-align: middle;
+          }
+        }
+      }
+    }
+    }
+    .home-main{
+      text-align: center;
+      padding-top: .46rem;
+    }
+    .home-main a.home-main-content {
+      width:50%;
+      margin-bottom:.52rem;
+      display: inline-block;
+    }
+    .home-main .home-main-content div{
+      border-radius: .2rem;
+      width:1.14rem;
+      height:1.14rem;
+      margin:0 auto;
+    }
+    .home-main .home-main-content div>img{
+      width: 100%;
+      height:100%;
+    }
+  .home-main .home-main-content div>i {
+    font-size: .8rem;
+  }
+  .home-main .home-main-content:nth-child(3) div>i {
+    color: #ff3064;
+  }
+  /*.home-main .home-main-content:nth-child(5) div>i {
+    color: #fa6743;
+  }
+  .home-main .home-main-content:nth-child(6) div>i {
+    color: #fcb836;
+  }*/
+    .home-main .home-main-content p{
+      font-size:.28rem;
+      color:rgb(51,51,51);
+      line-height: .52rem;
+    }
+    .home-main .home-main-content h2{
+      font-size:.3rem;
+      color:#ff7800;
+      line-height: .32rem;
+      margin:0;
+      margin-top:.1rem;
+    }
+</style>

+ 57 - 13
components/mobile/MobileFooter.vue

@@ -5,10 +5,16 @@
         <i :class="activeType=='home'?'iconfont icon-shouye':'iconfont icon-shouye1'"></i><p>首页</p>
       </nuxt-link>
     </span>
-    <span :class="activeType=='shops'?'active':''">
+    <!--<span :class="activeType=='shops'?'active':''">
       <nuxt-link to="/mobile/shop">
         <i :class="activeType=='shops'?'iconfont icon-dianpu':'iconfont icon-dianpu1'"></i><p>店铺</p>
       </nuxt-link>
+    </span>-->
+    <span class="seek" @click="goSayPrice">
+      <a>
+        <img src="/images/mobile/@2x/applyPurchase/home/seek-footer.png" alt="">
+        <p>发布求购</p>
+      </a>
     </span>
     <span :class="activeType=='user'?'active':''">
       <a @click="goCollect">
@@ -17,21 +23,29 @@
     </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>
+    <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
       }
     },
     components: {
-      LoginBox
+      LoginBox,
+      PublishSeek,
+      RemindBox
     },
     computed: {
       activeType () {
@@ -60,15 +74,34 @@
       },
       goCollect: function () {
         if (this.user.logged) {
-          this.$router.push('/mobile/user')
+          this.$router.push('/mobile/user?type=buyer')
+        } 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})
+        }
+      },
+      goSayPrice: function () {
+        if (this.user.logged) {
+          this.showSayPriceBox = true
         } else {
           this.showLoginBox = true
         }
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount ++
       }
     }
   }
 </script>
-<style scoped>
+<style scoped lang="scss">
   .mobile-footer{
     position:fixed;
     bottom:0;
@@ -79,29 +112,29 @@
     background: #ffffff;
     z-index: 10;
   }
-  .mobile-footer span{
+  .mobile-footer > span{
     display: inline-block;
-    width: 2.5rem;
+    width: 2rem;
     font-size:.32rem;
     color:#b0b0b0;
     padding-top:.1rem;
   }
 
-  .mobile-footer span a{
+  .mobile-footer > span a{
     color:#b0b0b0;
   }
 
-  .mobile-footer span a i{
+  .mobile-footer > span a i{
     font-size:.45rem;
   }
-  .mobile-footer span a p{
+  .mobile-footer > span a p{
     font-size:.22rem;
   }
 
-  .mobile-footer span.active a{
+  .mobile-footer > span.active a{
     color:#3976f4;
   }
-  .mobile-footer >a {
+  .mobile-footer > a {
     position: absolute;
     right: .1rem;
     top: -1rem;
@@ -115,4 +148,15 @@
   .mobile-footer >a i{
     font-size: .46rem;
   }
+  .mobile-footer > span.seek {
+    width: 3.5rem;
+    position: relative;
+  }
+  .mobile-footer > span.seek img {
+    position: absolute;
+    width: 1.3rem;
+    height: 1.3rem;
+    top: -1.3rem;
+    right: 1.1rem;
+  }
 </style>

+ 23 - 5
components/mobile/MobileHeader.vue

@@ -89,11 +89,11 @@
     watch: {
       $route: function (val, oldVal) {
         this.showMainSearch = false
-        this.title = this.initHeader(val.path)
+        this.title = this.initHeader(val.path, val.query)
       }
     },
     created () {
-      this.title = this.initHeader(this.$route.path)
+      this.title = this.initHeader(this.$route.path, this.$route.query)
     },
     computed: {
       brandDetail () {
@@ -129,7 +129,7 @@
       goLastPage: function () {
         window.history.back(-1)
       },
-      initHeader: function (val) {
+      initHeader: function (val, query) {
 //        if (val !== '/' || !val || val === '') {
 //          this.showHeader = true
 //          this.showSearch = !val.startsWith('/mobile/search')
@@ -137,7 +137,7 @@
 //          this.showHeader = false
 //          this.showSearch = false
 //        }
-        this.showHeader = val !== '/' || !val || val === ''
+        this.showHeader = val && val !== '/' && val !== '/mobile/applyPurchase/list'
 //        this.showSearch = val !== '/' && !this.startWith(val, '/mobile/search')
         let title = '优软商城'
         if (this.startWith(val, '/mobile/brand/componentDetail/')) {
@@ -168,11 +168,23 @@
           title = '店铺列表'
 //          this.rightIcon = 'phone'
         } else if (this.startWith(val, '/mobile/user')) {
-          title = '我的收藏'
+          if (this.$route.query.type === 'saler') {
+            title = '卖家中心'
+          } else {
+            title = '买家中心'
+          }
 //          this.rightIcon = 'phone'
         } else if (this.startWith(val, '/mobile/search')) {
           title = '搜索结果'
 //          this.rightIcon = 'share'
+        } else if (this.startWith(val, '/mobile/applyPurchase/sayPrice')) {
+          title = '编辑报价'
+        } else if (this.startWith(val, '/mobile/applyPurchase/list')) {
+          if (query.status === '1') {
+            title = '已采纳'
+          } else {
+            title = '已报价'
+          }
         } else if (val === '' || val === '/' || !val) {
           title = '优软商城'
 //          this.rightIcon = 'phone'
@@ -316,4 +328,10 @@
   .hide {
     display: none;
   }
+  .search-content {
+    margin-left: .5rem;
+    input {
+      color: #333;
+    }
+  }
 </style>

+ 446 - 0
components/mobile/applyPurchase/PublishSeek.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="mobile-modal" v-if="showSayPriceBox">
+    <div class="mobile-modal-box">
+      <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="请勿填中文符号">
+        </div>
+        <div class="content-line">
+          <span><i>*</i>品牌:</span>
+          <input type="text" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" placeholder="请勿填中文符号">
+        </div>
+        <div class="content-line">
+          <span><i>*</i>截止日期:</span>
+          <input type="date" v-model="applyObj.deadline" :min="minDay" :max="maxDay" @blur="deadlineChange">
+          <!--<el-date-picker-->
+            <!--v-model="applyObj.deadline"-->
+            <!--type="date"-->
+            <!--:editable="false"-->
+            <!--:clearable="true"-->
+            <!--size="mini">-->
+          <!--</el-date-picker>-->
+        </div>
+        <div class="content-line">
+          <span>币种:</span>
+          <a v-text="applyObj.currency" @click="showCurrencyList = !showCurrencyList"></a>
+          <img v-if="!showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-down.png" alt="">
+          <img v-if="showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-up.png" alt="">
+          <ul v-if="showCurrencyList">
+            <li @click="setCurrency('不限')">不限</li>
+            <li @click="setCurrency('RMB')">RMB</li>
+            <li @click="setCurrency('USD')">USD</li>
+          </ul>
+        </div>
+        <div class="content-line">
+          <span>数量:</span>
+          <input type="text" v-model="applyObj.amount" @blur="checkAmount" @input="onAmountInput">
+        </div>
+        <div class="content-line">
+          <span>生产日期:</span>
+          <input type="text" v-model="applyObj.produceDate" @input="onProduceDateChange">
+        </div>
+        <a @click="goPublish">确认发布</a>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  let formatDate = function (date, fmt) {
+    if (typeof date === 'string') {
+      date = new Date(Date.parse(date.replace(/-/g, '/')))
+    }
+    let o = {
+      'M+': date.getMonth() + 1, // 月份
+      'd+': date.getDate(), // 日
+      'h+': 23, // 小时
+      'm+': 59, // 分
+      's+': 59, // 秒
+      'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+      'S': date.getMilliseconds() // 毫秒
+    }
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
+    }
+    for (let k in o) {
+      if (new RegExp('(' + k + ')').test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+      }
+    }
+    return fmt
+  }
+  let getRealLen = function (str) {
+    let len = 0
+    for (let i = 0; i < str.length; i++) {
+      if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+        len += 2
+      } else {
+        len++
+      }
+    }
+    return len
+  }
+  let cutOutString = function (str, length) {
+    for (let i = 1; i <= str.length; i++) {
+      if (getRealLen(str.substr(0, i)) > length) {
+        str = str.substr(0, i - 1)
+        break
+      }
+    }
+    return str
+  }
+  export default {
+    props: ['showSayPriceBox'],
+    data () {
+      return {
+        applyObj: {
+          code: '',
+          brand: '',
+          unitPrice: '',
+          currency: '不限',
+          encapsulation: '',
+          produceDate: '',
+          amount: '',
+          deadline: ''
+        },
+        validObj: {
+          code: true,
+          brand: true,
+          unitPrice: true,
+          amount: true,
+          deadline: true
+        },
+        showCurrencyList: false
+      }
+    },
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      },
+      minDay: function () {
+        return formatDate(new Date(), 'yyyy-MM-dd')
+      },
+      maxDay: function () {
+        let deadDate = new Date()
+        deadDate.setMonth(deadDate.getMonth() + 3)
+        deadDate.setDate(deadDate.getDate() + 1)
+        deadDate = formatDate(deadDate, 'yyyy-MM-dd')
+        return deadDate
+      }
+    },
+    watch: {
+      showSayPriceBox: 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'
+        }
+      }
+    },
+    methods: {
+      cancel: function () {
+        this.$emit('cancelAction')
+      },
+      emptyForm: function () {
+        for (let attr in this.applyObj) {
+          this.applyObj[attr] = attr === 'currency' ? '不限' : ''
+        }
+      },
+      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'
+          inquiry.amount = 1
+          inquiryItem.prodTitle = this.applyObj.code
+          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.currency = this.applyObj.currency === '不限' ? null : this.applyObj.currency
+          inquiryItem.cmpCode = (this.applyObj.code).toUpperCase()
+          inquiryItem.unitPrice = this.applyObj.unitPrice
+          inquiryItem.produceDate = this.applyObj.produceDate
+          inquiryItem.date = date
+          inquiryItem.endDate = endDate
+          inquiryItem.encapsulation = this.applyObj.encapsulation
+          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.code) {
+            this.setRemindText('型号不能为空')
+          } else if (!this.validObj.brand) {
+            this.setRemindText('品牌不能为空')
+          } else if (!this.validObj.deadline) {
+            this.setRemindText('截止日期不能为空')
+          } else if (!this.validObj.amount) {
+            this.setRemindText('请输入正确的数值')
+          }
+        }
+      },
+      setCurrency: function (type) {
+        this.applyObj.currency = type
+        this.showCurrencyList = false
+      },
+      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.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkAmount()
+      },
+      checkCode: function () {
+        this.validObj.code = this.applyObj.code && this.applyObj.code !== ''
+        if (!this.validObj.code) {
+          this.setRemindText('型号不能为空')
+        }
+        return this.validObj.code
+      },
+      checkBrand: function () {
+        this.validObj.brand = this.applyObj.brand && this.applyObj.brand !== ''
+        if (!this.validObj.brand) {
+          this.setRemindText('品牌不能为空')
+        }
+        return this.validObj.brand
+      },
+      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
+      },
+      onProduceDateChange: function () {
+        if (this.applyObj.produceDate && getRealLen(this.applyObj.produceDate) > 12) {
+          this.applyObj.produceDate = cutOutString(this.applyObj.produceDate, 12)
+        }
+      },
+      onCodeChange: function () {
+        this.applyObj.code = this.applyObj.code.trim()
+        if ((/[^\x00-\xff]/g).test(this.applyObj.code)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.applyObj.code.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.applyObj.code.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          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)
+        }
+      },
+      onBrandChange: function () {
+        this.applyObj.brand = this.applyObj.brand.trim()
+        if ((/[^\x00-\xff]/g).test(this.applyObj.brand)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.applyObj.brand.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.applyObj.brand.charAt(i)) && !(/[\u4e00-\u9fa5]/).test(this.applyObj.brand.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          if (chineseIndex > -1) {
+            this.applyObj.brand = this.applyObj.brand.substring(0, chineseIndex)
+          }
+        } else if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 50) {
+          this.applyObj.brand = cutOutString(this.applyObj.brand, 50)
+        }
+      },
+      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;
+      .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;
+          border-bottom: .02rem solid #b7d5fe;
+          input {
+            width: 3.49rem;
+            height: .52rem;
+            line-height: normal;
+            padding: .1rem .19rem;
+            /*padding-left: .19rem;*/
+            border: .02rem solid #7e7e7e;
+            font-size: .26rem;
+            vertical-align: middle;
+            background: #fff;
+          }
+          > 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;
+          }
+          > ul {
+            position: absolute;
+            top: .6rem;
+            left: 1.16rem;
+            z-index: 1;
+            width: 1.75rem;
+            background: #fff;
+            text-align: center;
+            border-radius: .1rem;
+            border: .02rem solid #dfdfdf;
+            -webkit-box-shadow: 0 0 .12rem .02rem #e2d9d975;
+            -moz-box-shadow:  0 0 .12rem .02rem #e2d9d975;
+            box-shadow:  0 0 .12rem .02rem #e2d9d975;
+            li {
+              height: .52rem;
+              line-height: .52rem;
+              border-bottom: .02rem solid #dfdfdf;
+              &:hover, &:active {
+                background: #dedede;
+              }
+            }
+          }
+        }
+        > a {
+          display: block;
+          width: 5.19rem;
+          height: .84rem;
+          text-align: center;
+          line-height: .84rem;
+          font-size: .38rem;
+          margin: .3rem auto 0;
+          background: #3f84f6;
+          color: #fff;
+          border-radius: .08rem;
+        }
+      }
+    }
+  }
+  .datepicker-overlay {
+    z-index: 9999;
+    .cov-date-body {
+      width: 4rem;
+      font-size: .16rem;
+      .cov-date-monthly {
+        height: 1.5rem;
+        div {
+          height: 1.5rem;
+        }
+        .cov-date-caption {
+          font-size: .24rem;
+          padding: .5rem 0 !important;
+        }
+        .cov-date-next {
+          text-indent: -3rem;
+        }
+      }
+      .cov-date-box {
+        .cov-picker-box {
+          padding: .25rem;
+          width: 4rem;
+          height: 2.8rem;
+          .week {
+            ul {
+              margin: 0 0 .08rem;
+            }
+          }
+          .day {
+            height: .34rem;
+            line-height: .34rem;
+          }
+        }
+      }
+    }
+    .button-box {
+      height: .5rem;
+      line-height: .5rem;
+      padding-right: .2rem;
+      span {
+        padding: .1rem .2rem;
+      }
+    }
+  }
+</style>

+ 384 - 0
components/mobile/applyPurchase/SayPrice.vue

@@ -0,0 +1,384 @@
+<template>
+  <div class="mobile-modal" v-if="showSayPriceBox">
+    <div class="mobile-modal-box">
+      <div class="mobile-modal-header">编辑报价<i class="icon-guanbi iconfont" @click="cancel"></i></div>
+      <div class="say-price">
+        <div class="base-info">
+          <div class="content-line">
+            型号:<span>{{purchaseDetail.cmpCode || '-'}}</span>
+          </div>
+          <div class="content-line">
+            品牌:<span>{{purchaseDetail.inbrand || '-'}}</span>
+          </div>
+          <div class="content-line">
+            规格:<span>{{purchaseDetail.spec || '-'}}</span>
+          </div>
+          <div class="content-line">
+            采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
+          </div>
+          <div class="content-line">
+            币种:<span>{{purchaseDetail.currency || '不限'}}</span>
+          </div>
+          <div class="content-line">
+            截止日期:<span>{{purchaseDetail.endDate | date}}</span>
+          </div>
+        </div>
+        <div class="form-list">
+          <div class="form-title">
+            <span class="fl">价格梯度<span>(PCS)</span></span>
+            <span class="fr">
+          <!--<span v-text="sayPriceObj.currency" @click="setShowCurrencyList($event)"></span>-->
+          <span v-if="!purchaseDetail.currency" v-text="sayPriceObj.currency" @click="setShowCurrencyList($event)"></span>
+          <span v-if="purchaseDetail.currency" v-text="purchaseDetail.currency"></span>
+          <img v-if="!purchaseDetail.currency && !showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-down.png" alt="">
+          <img v-if="!purchaseDetail.currency && showCurrencyList" src="/images/mobile/@2x/applyPurchase/currency-arrow-up.png" alt="">
+          <ul v-if="showCurrencyList">
+            <li @click="setCurrency('RMB')">RMB</li>
+            <li @click="setCurrency('USD')">USD</li>
+          </ul>
+        </span>
+          </div>
+          <div class="form-item" v-for="(reply, index) in sayPriceObj.replies">
+            <input type="text" placeholder="梯度" class="fl" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty">
+            <input type="text" placeholder="单价" class="fr" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" v-model="reply.price">
+            <i class="iconfont icon-minus" v-if="index > 0" @click="setReplies('sub', index)"></i>
+            <i class="iconfont icon-add" v-if="index == 0 && sayPriceObj.replies.length < 5" @click="setReplies('add', index)"></i>
+          </div>
+          <div class="date">
+            <span>交期(天)</span>
+            <input type="text" placeholder="最大值" @input="onLeadtimeInput" @blur="onLeadtimeBlur" v-model="sayPriceObj.leadtime" class="fr">
+          </div>
+          <a class="say-price-btn" @click="commitSayPrice">确定</a>
+        </div>
+        <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import {RemindBox} from '~components/mobile/common'
+  export default {
+    data () {
+      return {
+        showCurrencyList: false,
+        sayPriceObj: {
+          currency: 'RMB',
+          leadtime: '',
+          replies: [
+            {
+              lapQty: '',
+              price: ''
+            }
+          ]
+        },
+        validSayPrice: {
+          leadtime: false,
+          repliesPrice: false,
+          repliesLapQty: false
+        },
+        remindText: '',
+        timeoutCount: 0
+      }
+    },
+    props: ['showSayPriceBox'],
+    components: {
+      RemindBox
+    },
+    watch: {
+      showSayPriceBox: 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'
+        }
+      }
+    },
+    mounted () {
+      this.$nextTick(() => {
+        document.addEventListener('click', this.checkCurrencySelect)
+      })
+    },
+    filters: {
+      date: function (date) {
+        if (date) {
+          const d = new Date(Number(date))
+          const year = d.getFullYear()
+          const monthTemp = d.getMonth() + 1
+          const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+          const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
+          return year + '-' + month + '-' + day
+        } else {
+          return '-'
+        }
+      }
+    },
+    computed: {
+      purchaseDetail () {
+        return this.$store.state.applyPurchase.purchaseManList.purchaseManDetail.data
+      },
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    methods: {
+      cancel: function () {
+        this.$emit('cancelSayPriceAction', false)
+      },
+      checkCurrencySelect: function () {
+        this.showCurrencyList = false
+      },
+      setShowCurrencyList: function (event) {
+        event.stopPropagation()
+        this.showCurrencyList = !this.showCurrencyList
+      },
+      setCurrency: function (type) {
+        this.sayPriceObj.currency = type
+        this.showCurrencyList = false
+      },
+      resetSayPrice: function () {
+        this.sayPriceObj = {
+          currency: 'RMB',
+          leadtime: '',
+          replies: [
+            {
+              lapQty: '',
+              price: ''
+            }
+          ]
+        }
+      },
+      setReplies: function (type, index) {
+        if (type === 'add' && this.sayPriceObj.replies.length < 5) {
+          this.sayPriceObj.replies.splice(this.sayPriceObj.replies.length, 0, {
+            lapQty: '',
+            price: ''
+          })
+        } else if (type === 'sub' && this.sayPriceObj.replies.length > 1) {
+          this.sayPriceObj.replies.splice(index, 1)
+        }
+      },
+      commitSayPrice: function () {
+        if (this.checkValid()) {
+          let purchaseMan = JSON.parse(JSON.stringify(this.purchaseDetail))
+//          this.showLoading = true
+          purchaseMan.leadtime = this.sayPriceObj.leadtime
+          purchaseMan.replies = this.sayPriceObj.replies
+          purchaseMan.vendUU = this.user.data.enterprise.uu
+          purchaseMan.vendUserUU = this.user.data.userUU
+          purchaseMan.qutoApp = 'MALL'
+          if (!purchaseMan.currency) {
+            purchaseMan.currency = this.sayPriceObj.currency
+          }
+          this.$http.post('/inquiry/sale/item/save', purchaseMan).then(response => {
+            this.showLoading = false
+            if (response.data.success === false) {
+              this.onRemind('response.data.message')
+            } else {
+//              this.onRemind('报价成功')
+              this.resetSayPrice()
+              this.$emit('cancelSayPriceAction', true, JSON.parse(response.data).quteId)
+            }
+          }, error => {
+            console.log(error)
+            this.onRemind('请勿重复报价或报价自己的求购')
+//            this.showLoading = false
+          })
+        } else {
+          this.onRemind('请输入正确的报价信息')
+        }
+      },
+      onLeadtimeInput: function () {
+        this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.replace(/[^\-?\d.]/g, '')
+        if (this.sayPriceObj.leadtime.length > 3) {
+          this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.substring(0, 3)
+        }
+      },
+      onLeadtimeBlur: function () {
+        if (!this.sayPriceObj.leadtime || this.sayPriceObj.leadtime < 1 || this.sayPriceObj.leadtime >= 1000 || this.sayPriceObj.leadtime.toString().indexOf('.') !== -1) {
+          this.validSayPrice.leadtime = false
+          this.onRemind('交期请填写1-999之间的正整数')
+        } else {
+          this.validSayPrice.leadtime = true
+        }
+      },
+      onReplyPriceInput: function (index) {
+        this.sayPriceObj.replies[index].price = this.sayPriceObj.replies[index].price.replace(/[^\-?\d.]/g, '')
+        let price = this.sayPriceObj.replies[index].price
+        if (price >= 10000) {
+          this.sayPriceObj.replies[index].price = price.substring(0, 4)
+        } else if (price.indexOf('.') > -1) {
+          let arr = price.split('.')
+          if (arr[0].length > 4) {
+            this.sayPriceObj.replies[index].price = Number(arr[0].substring(0, 4) + '.' + arr[1])
+          } else if (arr[1].length > 6) {
+            this.sayPriceObj.replies[index].price = Number(arr[0] + '.' + arr[1].substring(0, 6))
+          }
+        }
+      },
+      onReplyPriceBlur: function (index) {
+        let price = this.sayPriceObj.replies[index].price
+        if (!price) {
+          this.sayPriceObj.replies[index].price = ''
+          this.onRemind('价格不能为空')
+          this.validSayPrice.repliesPrice = false
+        } else if (price <= 0) {
+          this.sayPriceObj.replies[index].price = ''
+          this.onRemind('输入值必须为正整数')
+          this.validSayPrice.repliesPrice = false
+        } else {
+          this.validSayPrice.repliesPrice = true
+        }
+      },
+      onReplyLapQtyBlur: function (index) {
+        let lapQty = Number(this.sayPriceObj.replies[index].lapQty)
+        let limitDownObj = this.getLimitDownQty()
+        if (!lapQty || lapQty < 1) {
+          this.sayPriceObj.replies[index].lapQty = ''
+          this.onRemind('输入值必须为正整数')
+          this.validSayPrice.repliesLapQty = false
+        } else if (limitDownObj.index !== index && limitDownObj.lapQty > lapQty) {
+          this.onRemind('输入值必须大于#该梯度的下限#')
+          this.sayPriceObj.replies[index].lapQty = ''
+          this.validSayPrice.repliesLapQty = false
+        } else if ((index - 1 >= 0 && this.sayPriceObj.replies[index - 1].lapQty && this.sayPriceObj.replies[index - 1].lapQty >= lapQty) || (index + 1 < this.sayPriceObj.replies.length && this.sayPriceObj.replies[index + 1].lapQty && this.sayPriceObj.replies[index + 1].lapQty <= lapQty)) {
+          this.onRemind('输入值会导致梯度重叠,请重新修改')
+          this.sayPriceObj.replies[index].lapQty = ''
+          this.validSayPrice.repliesLapQty = false
+        } else {
+          this.validSayPrice.repliesLapQty = true
+        }
+      },
+      onReplyLapQtyInput: function (index) {
+        this.sayPriceObj.replies[index].lapQty = this.sayPriceObj.replies[index].lapQty.replace(/[^\-?\d.]/g, '')
+        let lapQty = this.sayPriceObj.replies[index].lapQty
+        if (lapQty.length > 9) {
+          this.sayPriceObj.replies[index].lapQty = lapQty.substring(0, 9)
+        }
+      },
+      getLimitDownQty: function () {
+        for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
+          if (this.sayPriceObj.replies[i].lapQty) {
+            return {
+              lapQty: this.sayPriceObj.replies[i].lapQty,
+              index: i
+            }
+          }
+        }
+        return {index: -1}
+      },
+      checkValid: function () {
+        for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
+          if (!this.sayPriceObj.replies[i].lapQty || !this.sayPriceObj.replies[i].price) {
+            return false
+          }
+        }
+        return this.validSayPrice.leadtime && this.validSayPrice.repliesLapQty && this.validSayPrice.repliesPrice
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount ++
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .mobile-modal {
+    .mobile-modal-box {
+      top: 5%;
+      left: 3%;
+      right: 3%;
+      width: auto;
+      bottom: 3%;
+      .say-price {
+        background: #f3f3f3;
+        padding: .18rem 0;
+        width: 100%;
+        overflow-y: auto;
+        height: 90%;
+        .form-list {
+          height: 7.53rem;
+          background: #fff;
+          padding-top: .2rem;
+          > div {
+            height: .7rem;
+            line-height: .7rem;
+            width: 6.12rem;
+            font-size: .28rem;
+            margin: 0 auto .2rem;
+            input {
+              height: .7rem;
+              text-align: center;
+              border: .02rem solid #666;
+              border-radius: .05rem;
+            }
+            &.form-title {
+              border: .02rem solid #666;
+              border-radius: .05rem;
+              padding: 0 .07rem 0 .17rem;
+              .fl {
+                span {
+                  color: #666;
+                }
+              }
+              .fr {
+                position: relative;
+                img {
+                  width: .12rem;
+                  height: .06rem;
+                  margin-left: .04rem;
+                }
+                > ul {
+                  position: absolute;
+                  top: .6rem;
+                  right: -.4rem;
+                  z-index: 1;
+                  width: 1.75rem;
+                  background: #fff;
+                  text-align: center;
+                  border-radius: .1rem;
+                  border: .02rem solid #dfdfdf;
+                  -webkit-box-shadow: 0 0 .12rem .02rem #e2d9d975;
+                  -moz-box-shadow:  0 0 .12rem .02rem #e2d9d975;
+                  box-shadow:  0 0 .12rem .02rem #e2d9d975;
+                  li {
+                    height: .52rem;
+                    line-height: .52rem;
+                    border-bottom: .02rem solid #dfdfdf;
+                    &:hover, &:active {
+                      background: #dedede;
+                    }
+                  }
+                }
+              }
+            }
+            &.form-item {
+              position: relative;
+              input {
+                width: 2.93rem;
+              }
+              i {
+                position: absolute;
+                right: -.42rem;
+                top: 0;
+                font-size: .36rem;
+                &.icon-add {
+                  color: #4768f3;
+                }
+                &.icon-minus {
+                  color: #8d8d8d;
+                }
+              }
+            }
+            &.date {
+              input {
+                width: 4.8rem;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 294 - 0
components/mobile/applyPurchase/SayPriceInfo.vue

@@ -0,0 +1,294 @@
+<template>
+  <div class="mobile-modal">
+    <div class="mobile-modal-box">
+      <div class="mobile-modal-header">{{agreed == 1 ? '已采纳' : '已报价'}}<i class="icon-guanbi iconfont" @click="cancel"></i></div>
+      <div class="say-price-info">
+        <div v-if="isBuyer">
+          <div class="base-info">
+            <div class="content-line">
+              型号:<span>{{purchaseDetail.cmpCode || '-'}}</span>
+            </div>
+            <div class="content-line">
+              品牌:<span>{{purchaseDetail.inbrand || '-'}}</span>
+            </div>
+            <div class="content-line">
+              规格:<span>{{purchaseDetail.spec || '-'}}</span>
+            </div>
+            <div class="content-line">
+              采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
+            </div>
+            <div class="content-line">
+              币种:<span>{{purchaseDetail.currency || '不限'}}</span>
+            </div>
+            <div class="content-line">
+              截止日期:<span>{{purchaseDetail.endDate | date}}</span>
+            </div>
+          </div>
+          <div class="base-info">
+            <div class="content-line">
+              买家:<span>{{purchaseDetail.inquiry.enterprise.enName || purchaseDetail.userName}}</span>
+            </div>
+            <div class="content-line">
+              联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
+            </div>
+          </div>
+          <div class="base-info say-info" v-for="(item, index) in purchaseDetail.qutations" @click="selectQutation(index)">
+            <img v-if="agreed != 1 && (!item.agreed || item.agreed !== 1) && activeIndex == index" src="/images/mobile/@2x/applyPurchase/say-price-check.png" alt="">
+            <img v-if="agreed != 1 && (!item.agreed || item.agreed !== 1) && activeIndex != index" src="/images/mobile/@2x/applyPurchase/say-price-default.png" alt="">
+            <img v-if="item.agreed == 1" src="/images/mobile/@2x/applyPurchase/say-price-accept.png" alt="">
+            <div class="content-line">
+              {{item.vendName}}
+            </div>
+            <div class="content-line">
+              报价人:<span v-if="item.user">{{item.user.userName | userNameFilter}}</span>
+              <span v-else>-</span>
+            </div>
+            <div class="content-line">
+              电话:<span v-if="item.user">{{item.user.userTel}}</span>
+              <span v-else>-</span>
+            </div>
+            <div class="content-line date">
+              交期(天):<span>{{item.leadtime}}</span>
+            </div>
+            <p>{{item.offerTime | date}}</p>
+            <div class="price-level">
+              <p>价格梯度:<span>(pcs)</span></p>
+              <ul>
+                <li v-for="replie in item.replies">
+                  <span>{{replie.lapQty ? replie.lapQty + '+' : '-'}}</span>
+                  <span>{{replie.price ? (purchaseDetail.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
+                </li>
+              </ul>
+            </div>
+          </div>
+          <a class="say-price-btn" v-if="purchaseDetail.agreed != 1" @click="acceptQutation">采纳报价</a>
+        </div>
+        <div v-if="!isBuyer">
+          <div class="base-info">
+            <div class="content-line">
+              型号:<span>{{purchaseDetail.cmpCode || '-'}}</span>
+            </div>
+            <div class="content-line">
+              品牌:<span>{{purchaseDetail.inbrand || '-'}}</span>
+            </div>
+            <div class="content-line">
+              规格:<span>{{purchaseDetail.spec || '-'}}</span>
+            </div>
+            <div class="content-line">
+              采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
+            </div>
+            <div class="content-line">
+              币种:<span>{{purchaseDetail.currency || '不限'}}</span>
+            </div>
+            <div class="content-line">
+              截止日期:<span>{{purchaseDetail.endDate | date}}</span>
+            </div>
+            <div class="content-line">
+              买家:<span>{{purchaseDetail.inquiry.enterprise.enName || purchaseDetail.userName}}</span>
+            </div>
+            <div class="content-line">
+              联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
+            </div>
+          </div>
+          <div class="base-info">
+            <div class="content-line">
+              报价人:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userName | userNameFilter}}</span>
+              <span v-else>-</span>
+            </div>
+            <div class="content-line">
+              联系电话:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userTel || '-'}}</span>
+              <span v-else>-</span>
+            </div>
+          </div>
+          <div class="base-info say-info">
+            <div class="content-line date">
+              交期(天):<span>{{purchaseDetail.leadtime}}</span>
+            </div>
+            <p>{{purchaseDetail.offerTime | date}}</p>
+            <div class="price-level vendor">
+              <p>价格梯度:<span>(pcs)</span></p>
+              <ul>
+                <li v-for="replie in purchaseDetail.replies">
+                  <span>{{replie.lapQty ? replie.lapQty + '+' : '-'}}</span>
+                  <span>{{replie.price ? (purchaseDetail.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
+                </li>
+              </ul>
+            </div>
+          </div>
+        </div>
+        <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import {RemindBox} from '~components/mobile/common'
+  export default {
+    data () {
+      return {
+        activeIndex: -1,
+        remindText: '',
+        timeoutCount: 0
+      }
+    },
+    components: {
+      RemindBox
+    },
+    props: ['agreed'],
+    filters: {
+      date: function (date) {
+        if (date) {
+          const d = new Date(Number(date))
+          const year = d.getFullYear()
+          const monthTemp = d.getMonth() + 1
+          const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+          const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
+          return year + '-' + month + '-' + day
+        } else {
+          return '-'
+        }
+      },
+      userNameFilter (str) {
+        return str ? str.substring(0, 1) + '**' : '-'
+      }
+    },
+    computed: {
+      purchaseDetail () {
+        return this.isBuyer ? this.$store.state.applyPurchase.purchaseManList.buyerInquiryDetail.data : this.$store.state.applyPurchase.purchaseManList.vendorInquiryDetail.data
+      },
+      user () {
+        return this.$store.state.option.user
+      },
+      isBuyer () {
+        return this.$route.query.type === 'buyer'
+      }
+    },
+    methods: {
+      cancel: function () {
+        this.$emit('cancelSayPriceInfoAction', false)
+      },
+      selectQutation: function (index) {
+        this.activeIndex = this.activeIndex === index ? -1 : index
+      },
+      acceptQutation: function () {
+        if (this.activeIndex > -1) {
+          let obj = this.purchaseDetail.qutations[this.activeIndex]
+          this.$http.post('/inquiry/buyer/decide?id=' + obj.id + '&status=1')
+            .then(response => {
+//              this.$message.success('采纳成功')
+//              this.onRemind('采纳成功')
+              this.$emit('cancelSayPriceInfoAction', true)
+//              this.$route.query.type === 'saler' ? this.$store.dispatch('applyPurchase/loadVendorInquiryDetail', {id: this.$route.params.id}) : this.$store.dispatch('applyPurchase/loadBuyerInquiryDetail', {id: this.$route.params.id})
+            }, err => {
+              console.log(err)
+//              this.$message.success('系统错误')
+              this.onRemind('系统错误')
+            })
+        } else {
+//          this.$message.success('请选择报价信息')
+          this.onRemind('请选择报价信息')
+        }
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount ++
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .mobile-modal {
+    .mobile-modal-box {
+      top: 5%;
+      left: 3%;
+      right: 3%;
+      bottom: 5%;
+      width: auto;
+      .say-price-info {
+        background: #f3f3f3;
+        padding: .18rem 0;
+        width: 100%;
+        overflow-y: auto;
+        height: 90%;
+        .base-info {
+          &.say-info {
+            /*height: 4.54rem;*/
+            position: relative;
+            > img {
+              position: absolute;
+              right: 0;
+              top: 0;
+              width: 1rem;
+              height: 1rem;
+            }
+            .content-line {
+              width: 4.55rem;
+              span {
+                color: #333;
+              }
+              &.date {
+                span {
+                  color: #ef5042;
+                }
+              }
+            }
+            > p {
+              font-size: .24rem;
+              color: #999;
+            }
+            .price-level {
+              font-size: .26rem;
+              /*position: absolute;*/
+              /*top: 1.3rem;*/
+              /*right: .3rem;*/
+              position: relative;
+              bottom: .3rem;
+              width: 4rem;
+              text-align: center;
+              margin-left: 2rem;
+              p {
+                margin-bottom: .1rem;
+                span {
+                  color: #666;
+                }
+              }
+              ul {
+                li {
+                  height: .52rem;
+                  span {
+                    height: .52rem;
+                    line-height: .52rem;
+                    padding-left: .22rem;
+                    text-align: left;
+                    display: inline-block;
+                    border-top: .02rem solid #7e7e7e;
+                    border-left: .02rem solid #7e7e7e;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                    white-space: nowrap;
+                    &:first-child {
+                      width: 45%;
+                    }
+                    &:last-child {
+                      width: 55%;
+                      border-right: .02rem solid #7e7e7e;
+                    }
+                  }
+                  &:last-child {
+                    border-bottom: .02rem solid #7e7e7e;
+                  }
+                }
+              }
+              &.vendor {
+                margin: .15rem auto 0;
+              }
+            }
+          }
+        }
+        .say-price-btn {
+          margin: .37rem auto .7rem;
+        }
+      }
+    }
+  }
+</style>

+ 256 - 0
components/mobile/applyPurchase/SeekList.vue

@@ -0,0 +1,256 @@
+<template>
+  <div>
+    <ul class="seek-list">
+      <li v-for="(item, index) in purchaseManList">
+        <p>
+          <span v-if="item.inquiry.enterprise && item.inquiry.enterprise.enName">{{item.inquiry.enterprise.enName | enterpriseFilter}}</span>
+          <span v-else>{{item.userName | userNameFilter}}</span>
+        </p>
+        <div>
+          <div class="fl">
+            <div>
+              型号:<span>{{item.cmpCode || '-'}}</span>
+            </div>
+            <div>
+              品牌:<span>{{item.inbrand || '-'}}</span>
+            </div>
+            <div>
+              规格:<span>{{item.spec || '-'}}</span>
+            </div>
+            <div>
+              截止日期:<span class="date">{{item.endDate | date}}</span>
+            </div>
+          </div>
+          <div class="fr">
+            <p v-if="item.remainingTime > 0">剩余&nbsp;:
+              <span v-if="getDay(item.remainingTime) > 0" v-text="getDay(item.remainingTime)"></span>
+              <i v-if="getDay(item.remainingTime) > 0">&nbsp;天&nbsp;</i>
+              <span v-if="getDay(item.remainingTime) <= 0" v-text="getHours(item.remainingTime)"></span>
+              <i v-if="getDay(item.remainingTime) <= 0" >&nbsp;小时</i>
+            </p>
+            <p v-else>已截止</p>
+            <!--<a v-if="!userType && item.quoted == 1">已报价</a>-->
+            <a v-if="!userType && item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && (user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise)))" class="self-publish" @click="onRemind('此为贵公司的求购')">我要报价</a>
+            <a v-if="!(userType == 'saler' && seekType  && seekType != 'wait') && (item.remainingTime > 0 && (!item.quoted || item.quoted != 1) && !(user.logged && ((item.inquiry.enterprise && user.data.enterprise && (item.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && item.userUU == user.data.userUU  && !item.inquiry.enterprise))))"  @click="goSayPrice(item.id, index)">我要报价</a>
+            <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>
+      </li>
+    </ul>
+    <div class="none-state" v-if="!purchaseManList || !purchaseManList.length && !isDataChange">
+      <img src="/images/mobile/@2x/car@2x.png">
+      <p v-text="'抱歉,暂无求购信息'"></p>
+    </div>
+    <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
+    <say-price :showSayPriceBox="showSayPriceBox" @cancelSayPriceAction="onSayPriceCancel"></say-price>
+    <say-price-info v-if="showSayPriceInfoBox" :agreed="agreed" @cancelSayPriceInfoAction="onSayPriceInfoCancel"></say-price-info>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+  </div>
+</template>
+<script>
+  import {LoginBox, RemindBox} from '~components/mobile/common'
+  import {SayPrice, SayPriceInfo} from '~components/mobile/applyPurchase'
+  export default {
+    components: {
+      LoginBox,
+      SayPrice,
+      RemindBox,
+      SayPriceInfo
+    },
+    data () {
+      return {
+        showLoginBox: false,
+        showSayPriceBox: false,
+        showSayPriceInfoBox: false,
+        activeIndex: -1,
+        remindText: '',
+        timeoutCount: 0,
+        agreed: 0
+      }
+    },
+    props: ['userType', 'seekType', 'purchaseManList', 'isDataChange'],
+    filters: {
+      date: function (date) {
+        if (date) {
+          const d = new Date(Number(date))
+          const year = d.getFullYear()
+          const monthTemp = d.getMonth() + 1
+          const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+          const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
+          return year + '-' + month + '-' + day
+        } else {
+          return '-'
+        }
+      },
+      enterpriseFilter (str) {
+        return str && str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str || '-'
+      },
+      userNameFilter (str) {
+        return str ? str.substring(0, 1) + '**' : '-'
+      }
+    },
+    computed: {
+//      purchaseManList () {
+//        return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
+//      },
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    methods: {
+      getDay: function (timeStamp) {
+        return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
+      },
+      getHours: function (timeStamp) {
+        return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
+      },
+      goSayPrice: function (id, index) {
+        if (this.user.logged) {
+//          this.$router.push('/mobile/applyPurchase/sayPrice/' + path)
+          this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {itemId: id, enuu: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null})
+          this.showSayPriceBox = true
+          this.activeIndex = index
+        } else {
+          this.showLoginBox = true
+        }
+      },
+      goSayPriceInfo: function (id, agreed, index) {
+        this.userType === 'buyer' ? this.$store.dispatch('applyPurchase/loadBuyerInquiryDetail', {id: id}) : this.$store.dispatch('applyPurchase/loadVendorInquiryDetail', {id: id})
+        this.agreed = agreed
+        this.showSayPriceInfoBox = true
+        this.activeIndex = index
+//        '/mobile/applyPurchase/list/' + (userType ? (item.quteId || item.id) + '?type=' + userType : (item.quteId || item.id)) + (userType ? '&' : '?') + 'status=' + item.agreed
+      },
+      onSayPriceCancel: function (flag, quteId) {
+        if (flag) {
+          this.purchaseManList[this.activeIndex].quoted = 1
+          this.purchaseManList[this.activeIndex].quteId = quteId
+          this.onRemind('报价成功')
+        }
+        this.showSayPriceBox = false
+      },
+      onSayPriceInfoCancel: function (flag) {
+        if (flag) {
+          this.purchaseManList[this.activeIndex].agreed = 1
+          this.onRemind('采纳成功')
+        }
+        this.showSayPriceInfoBox = false
+      },
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount ++
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .seek-list {
+    width: 7.26rem;
+    margin: .13rem auto 0;
+
+    li {
+      border: .04rem solid #e0e0e4;
+      height: 3.32rem;
+      margin-bottom: .2rem;
+
+      >
+      p {
+        font-size: .32rem;
+        color: #3a3a3a;
+        background: #f8f7fa;
+        height: .92rem;
+        line-height: .92rem;
+
+        span {
+          display: block;
+          width: 6.9rem;
+          border-bottom: .04rem dashed #9f9f9f;
+          margin: 0 auto;
+        }
+
+      }
+      >
+      div {
+        font-size: .3rem;
+        display: inline-block;
+
+        .fl {
+          color: #666;
+          width: 4.8rem;
+          height: 1.74rem;
+          margin: .27rem 0 .29rem .18rem;
+          line-height: .46rem;
+          border-right: .04rem dashed #9f9f9f;
+
+          > div {
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+
+            span {
+              color: #333;
+
+              &.date {
+                color: #e6353d;
+              }
+
+            }
+
+          }
+
+        }
+        .fr {
+          width: 2.2rem;
+          padding: .66rem 0 0 .2rem;
+
+          p {
+            font-size: .28rem;
+
+            span {
+              font-size: .35rem;
+              color: #ff3208;
+            }
+
+            i {
+              font-style: normal;
+            }
+
+          }
+          a {
+            display: block;
+            width: 1.64rem;
+            height: .58rem;
+            line-height: .58rem;
+            text-align: center;
+            font-size: .32rem;
+            color: #e62f36;
+            border: .02rem solid #ea494f;
+            margin-top: .34rem;
+            border-radius: .06rem;
+
+            &.self-publish {
+              background: rgb(204, 203, 203);
+              color: #fff;
+              border-color: #fff;
+            }
+          }
+
+        }
+      }
+    }
+
+  }
+  .none-state {
+    text-align: center;
+    margin-top: 1.1rem;
+    img {
+      width: 4.08rem;
+      height: 2.62rem;
+    }
+    p {
+      font-size: .32rem;
+      color: #999;
+      margin: 1.19rem 0 0 0;
+    }
+  }
+</style>

+ 4 - 0
components/mobile/applyPurchase/index.js

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

+ 2 - 2
components/mobile/common/RemindBox.vue

@@ -30,7 +30,7 @@
         if (_this.title === '收藏成功' || _this.title === '取消成功') {
           timeout = 1000
         } else {
-          timeout = 2000
+          timeout = 1500
         }
         _this.timer = setTimeout(function () {
           _this.showBox = false
@@ -46,7 +46,7 @@
     left: 0;
     right: 0;
     margin-top: -.6rem;
-    z-index: 100;
+    z-index: 10000;
     div {
       background: rgba(0,0,0,.6);
       color: #fff;

+ 4 - 1
nuxt.config.js

@@ -105,6 +105,9 @@ module.exports = {
   }, {
     src: '~plugins/jsonp.js',
     ssr: false
+  }, {
+    src: '~plugins/vue-filter.js',
+    ssr: false
   }],
   // proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/release/**', '/auth/store/**', '/produce/**', '/file**', '/rate/**', '/log/**', '/help-service/**', '/keyword/**', '/tip/**', '/UASBatchPutOnProperty**', '/UASBatchPutOnProperty/**']
   /**
@@ -122,7 +125,7 @@ module.exports = {
     '/register/**': baseUrl,
     '/logout/**': baseUrl,
     '/static/**': baseUrl,
-    // '/vendor**': baseUrl,
+    '/vendor**': baseUrl,
     '/trade/**': baseUrl,
     '/recommendation/**': baseUrl,
     '/store-service/**': baseUrl,

+ 2 - 1
package.json

@@ -19,7 +19,8 @@
     "nuxt": "0.10.6",
     "qrcode": "^1.2.0",
     "vue-awesome-swiper": "^2.5.4",
-    "vue2-filters": "^0.1.9"
+    "vue2-filters": "^0.1.9",
+    "node-sass": "^4.5.3"
   },
   "scripts": {
     "dev": "nodemon --exec node server.js",

+ 6 - 3
pages/index.vue

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

+ 19 - 0
pages/mobile/applyPurchase/list/_id.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="mobile-content">
+    <say-price-info></say-price-info>
+  </div>
+</template>
+<script>
+  import {SayPriceInfo} from '~components/mobile'
+  export default {
+    layout: 'mobile',
+    components: {
+      SayPriceInfo
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        route.query.type === 'buyer' ? store.dispatch('applyPurchase/loadBuyerInquiryDetail', {id: route.params.id}) : store.dispatch('applyPurchase/loadVendorInquiryDetail', {id: route.params.id})
+      ])
+    }
+  }
+</script>

+ 133 - 0
pages/mobile/applyPurchase/list/index.vue

@@ -0,0 +1,133 @@
+<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">
+        <span @click="searchSeek">
+        <i class="iconfont icon-sousuo"></i>
+        </span>
+      </div>
+    </div>
+    <div class="seek-title">
+      <img src="/images/mobile/@2x/applyPurchase/home/seek-title.png" alt="">
+      <span>最新求购信息</span>
+    </div>
+    <seek-list :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
+    <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/loadPurchaseManList', {pageNumber: 1, pageSize: 10, sorting: {'releaseDate': 'DESC'}, keyword: this.seekKeyword, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null})
+      ])
+    },
+    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()
+        }
+      },
+      getMoreSearch: function () {
+        this.page++
+        this.isSearchSearchingMore = true
+        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})
+      },
+      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: .08rem;
+        input {
+          color: #333;
+        }
+      }
+    }
+  }
+</style>

+ 19 - 0
pages/mobile/applyPurchase/sayPrice/_id.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="mobile-content">
+    <say-price></say-price>
+  </div>
+</template>
+<script>
+  import {SayPrice} from '~components/mobile'
+  export default {
+    layout: 'mobile',
+    components: {
+      SayPrice
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('applyPurchase/loadPurchaseManDetail', {itemId: route.params.id, enuu: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null})
+      ])
+    }
+  }
+</script>

+ 394 - 0
pages/mobile/share/purChase/_uuid.vue

@@ -0,0 +1,394 @@
+<template>
+	<div class="purchase">
+		<div class="purchase-top">
+			<div class="purchase-top-bg">
+				<div class="clearfix">
+					<div class="title fl">{{purchaseDetail.inquiry.enName}}</div>
+					<div class="time fr">{{purchaseDetail.endDate | date}}</div>
+				</div>
+				<div class="desc">{{purchaseDetail.prodTitle}}</div>
+				<div class="brand">品牌:
+					<span>{{purchaseDetail.inbrand || '-'}}</span>
+				</div>
+				<div class="size">规格:
+					<span>{{purchaseDetail.spec || '-'}}</span>
+				</div>
+			</div>
+			<div class="purchase-top-control clearfix">
+				<div class="time fl">
+					<span class="icon"></span>
+					<template v-if="purchaseDetail.remainingTime > 0">剩余:
+						<span class="timetext" v-if="getDay(purchaseDetail.remainingTime) > 0">
+							<a class="number">{{getDay(purchaseDetail.remainingTime)}}</a>
+							<a>天</a>
+						</span>
+						<span class="timetext" v-if="getDay(purchaseDetail.remainingTime) <= 0">
+							<a class="number">{{getHours(purchaseDetail.remainingTime)}}</a>
+							<a>小时</a>
+						</span>
+					</template>
+					<span class="timetext" v-else>已截止</span>
+					<!-- <span class="timetext">剩余时间:<a class="number">8</a><a>小时</a></span> -->
+				</div>
+				<div v-if="!userType && purchaseDetail.remainingTime > 0 && (!purchaseDetail.quoted || purchaseDetail.quoted != 1) && (user.logged && ((purchaseDetail.inquiry.enterprise && user.data.enterprise && (purchaseDetail.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseDetail.userUU == user.data.userUU  && !purchaseDetail.inquiry.enterprise)))" class="goprice fr" @click="onRemind('此为贵公司的求购')">我要报价</div>
+				<div class="goprice fr" v-if="!(userType == 'saler' && seekType  && seekType != 'wait') && (purchaseDetail.remainingTime > 0 && (!purchaseDetail.quoted || purchaseDetail.quoted != 1) && !(user.logged && ((purchaseDetail.inquiry.enterprise && user.data.enterprise && (purchaseDetail.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseDetail.userUU == user.data.userUU  && !purchaseDetail.inquiry.enterprise))))" @click="goSayPrice(purchaseDetail.id)">我要报价</div>
+				<div class="goprice fr" v-if="((!userType || userType == 'buyer') && (seekType  && seekType != 'wait')) || (userType == 'saler' && seekType  && seekType != 'wait') || purchaseDetail.quoted == 1" @click="goSayPriceInfo(purchaseDetail.quteId || purchaseDetail.id, purchaseDetail.agreed)">查看报价</div>
+			</div>
+		</div>
+		<div class="purcharse_banner">
+			<div class="banner"></div>
+		</div>
+		<div class="seek-title">
+			<img src="/images/mobile/@2x/applyPurchase/home/seek-title.png" alt="">
+			<span>最新求购信息</span>
+		</div>
+		<div class="purcharseListContent">
+			<seek-list :purchaseManList="purchaseManListData" :isDataChange="true"></seek-list>
+
+			<nuxt-link to="/mobile/applyPurchase/list" class="purchase_btn_look" tag="div">查看更多</nuxt-link>
+			<div class="purchse_btn_more_title">
+				<a href="https://www.usoftmall.com">优软商城首页</a>
+			</div>
+		</div>
+
+		<div class="mobile_footer company">
+			<div class="hr"></div>
+			<img src="/images/mobile/@2x/shareStore/logo.png" alt="">
+			<div class="hr right"></div>
+			<p>此页面由深圳市优软商城科技有限公司提供</p>
+			<a href="https://www.usoftmall.com">www.usoftmall.com</a>
+		</div>
+
+		<div class="purcharse_kong"></div>
+		<div class="purcharse_fixed clearfix" @click="sendApplyPurchase()">
+			<div class="money_icon fl"></div>
+			<span class="fl">发布求购</span>
+		</div>
+		<login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
+		<say-price :showSayPriceBox="showSayPriceBox" @cancelSayPriceAction="onSayPriceCancel"></say-price>
+		<remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+		<say-price-info v-if="showSayPriceInfoBox" :agreed="agreed" @cancelSayPriceInfoAction="onSayPriceInfoCancel"></say-price-info>
+		<publish-seek :showSayPriceBox="showsendApplyBox" @cancelAction="showsendApplyBox = false" @reloadAction="onReload" @remindAction="onRemind"></publish-seek>
+	</div>
+</template>
+
+<script>
+import { SayPrice, SayPriceInfo } from '~components/mobile/applyPurchase'
+import { LoginBox, RemindBox } from '~components/mobile/common'
+import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
+import PublishSeek from '~components/mobile/applyPurchase/PublishSeek.vue'
+export default {
+  layout: 'mobileStore',
+  props: ['userType', 'seekType', 'purchaseManList'],
+  fetch({ store, params, redirect }) {
+    if (!params.uuid) {
+      return redirect('/error')
+    }
+    return Promise.all([
+      store.dispatch('applyPurchase/loadPurchaseManDetail', {
+        itemId: params.uuid,
+        enuu: store.state.option.user.data.enterprise
+          ? store.state.option.user.data.enterprise.uu
+          : null
+      }),
+      store.dispatch('applyPurchase/loadPurchaseManList', {
+        pageNumber: 1,
+        pageSize: 10,
+        sorting: { releaseDate: 'DESC' },
+        keyword: '',
+        enUU: store.state.option.user.data.enterprise
+          ? store.state.option.user.data.enterprise.uu
+          : null
+      })
+    ])
+  },
+  data() {
+    return {
+      showLoginBox: false,
+      showSayPriceBox: false,
+      showSayPriceInfoBox: false,
+      remindText: '',
+      timeoutCount: 0,
+      agreed: 0,
+      showsendApplyBox: false
+    }
+  },
+  components: {
+    SayPrice,
+    SayPriceInfo,
+    LoginBox,
+    RemindBox,
+    SeekList,
+    PublishSeek
+  },
+  computed: {
+    purchaseDetail() {
+      return this.$store.state.applyPurchase.purchaseManList.purchaseManDetail
+        .data
+    },
+    user() {
+      return this.$store.state.option.user
+    },
+    purchaseManListData() {
+      return this.$store.state.applyPurchase.purchaseManList.purchaseManList
+        .data.content
+    }
+  },
+  methods: {
+    getDay: function(timeStamp) {
+      return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
+    },
+    getHours: function(timeStamp) {
+      return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
+    },
+    onSayPriceCancel: function(flag, quteId) {
+      if (flag) {
+        this.purchaseDetail.quoted = 1
+        this.purchaseDetail.quteId = quteId
+        this.onRemind('报价成功')
+      }
+      this.showSayPriceBox = false
+    },
+    onRemind: function(str) {
+      this.remindText = str
+      this.timeoutCount++
+    },
+    onSayPriceInfoCancel: flag => {
+      flag && ((this.purchaseDetail.agreed = 1), this.onRemind('采纳成功'))
+      this.showSayPriceInfoBox = false
+    },
+    goSayPriceInfo: (id, agreed) => {
+      this.userType === 'buyer'
+        ? this.$store.dispatch('applyPurchase/loadBuyerInquiryDetail', {
+            id: id
+          })
+        : this.$store.dispatch('applyPurchase/loadVendorInquiryDetail', {
+            id: id
+          })
+      this.agreed = agreed
+      this.showSayPriceInfoBox = true
+    },
+    goSayPrice: function(id) {
+      if (this.user.logged) {
+        this.$store.dispatch('applyPurchase/loadPurchaseManDetail', {
+          itemId: id,
+          enuu: this.$store.state.option.user.data.enterprise
+            ? this.$store.state.option.user.data.enterprise.uu
+            : null
+        })
+        this.showSayPriceBox = true
+      } else {
+        this.showLoginBox = true
+      }
+    },
+    sendApplyPurchase() {
+      if (this.user.logged) {
+        this.showsendApplyBox = true
+      } 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
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.clearfix {
+  &::after {
+    clear: both;
+    visibility: hidden;
+    zoom: 1;
+    display: block;
+    content: ' ';
+  }
+}
+.purchase {
+  background: rgb(246, 245, 248);
+  .purchase-top {
+    background: #fff;
+    padding: 0.28rem 0.32rem 0.18rem 0.32rem;
+    margin-bottom: 0.18rem;
+    .purchase-top-bg {
+      background: url('/images/mobile/@2x/purChase/purChase_bg.png');
+      background-size: 100%;
+      width: 6.82rem;
+      height: 3rem;
+      margin: 0 auto;
+      position: relative;
+      color: #fff;
+      padding-left: 0.35rem;
+      padding-top: 0.32rem;
+      .title {
+        font-size: 0.28rem;
+      }
+      .time {
+        font-size: 0.24rem;
+        margin-right: 0.2rem;
+      }
+      .desc {
+        font-size: 0.38rem;
+        margin: 0.38rem 0;
+      }
+      .brand,
+      .size {
+        font-size: 0.28rem;
+        margin-bottom: 0.38rem;
+      }
+    }
+    .purchase-top-control {
+      margin-top: 0.32rem;
+      .time {
+        margin-top: 0.2rem;
+        margin-left: 0.38rem;
+        .icon {
+          background-image: url('/images/mobile/@2x/purChase/time.png');
+          background-size: 100%;
+          width: 0.28rem;
+          height: 0.28rem;
+          display: inline-block;
+          vertical-align: middle;
+          margin-right: 0.05rem;
+        }
+        .timetext {
+          color: #09061e;
+          font-size: 0.24rem;
+          margin-left: 0.1rem;
+          a {
+            font-size: 0.24rem;
+            color: #fa7701;
+            &.number {
+              font-size: 0.36rem;
+            }
+          }
+        }
+      }
+      .goprice {
+        font-size: 0.28rem;
+        width: 1.78rem;
+        height: 0.68rem;
+        background: linear-gradient(to right, #fb6d03, #fb9400);
+        color: #fff;
+        line-height: 0.68rem;
+        text-align: center;
+        border-radius: 4px;
+      }
+    }
+  }
+  .purcharse_banner {
+    background: #fff;
+    margin: 0 auto;
+    text-align: center;
+    padding: 0.24rem 0 0.36rem 0;
+    margin-bottom: 0.18rem;
+    .banner {
+      background: url('/images/mobile/@2x/purChase/banner.png');
+      background-size: 100%;
+      width: 6.8rem;
+      margin: 0 auto;
+      height: 0.84rem;
+    }
+  }
+  .purcharse_kong {
+    width: 100%;
+    height: 1rem;
+    position: relative;
+  }
+  .purcharse_fixed {
+    background: linear-gradient(to right, #4f44fd, #7188ff);
+    width: 100%;
+    height: 0.88rem;
+    line-height: 0.88rem;
+    text-align: center;
+    color: #fff;
+    font-size: 0.32rem;
+    position: fixed;
+    bottom: 0px;
+    .money_icon {
+      background: url('/images/mobile/@2x/purChase/money_icon.png');
+      width: 0.39rem;
+      height: 0.39rem;
+      background-size: 100%;
+      margin-top: 0.22rem;
+      margin-right: 0.2rem;
+      margin-left: 2.8rem;
+    }
+  }
+  .purcharseListContent {
+		padding-top: 0.3rem;
+    padding-bottom: 0.37rem;
+    background: #fff;
+    .seek-title {
+      background: #fff;
+    }
+    .purchase_btn_look {
+      font-size: 0.26rem;
+      color: #6a63ea;
+      width: 1.37rem;
+      height: 0.48rem;
+      text-align: center;
+      border-radius: 4px;
+      text-align: center;
+      border: 1px solid #6a63ea;
+      line-height: 0.48rem;
+      margin: 0.31rem auto;
+    }
+    .purchse_btn_more_title {
+      font-size: 0.22rem;
+      color: #6a63ea;
+      text-align: center;
+      a {
+        color: #6a63ea;
+      }
+    }
+  }
+  .company {
+    position: relative;
+    height: 1.36rem;
+    background: #f4f4f4;
+    text-align: center;
+    img {
+      width: 1.15rem;
+      height: 0.23rem;
+      margin-top: 0.24rem;
+    }
+    p {
+      font-size: 0.21rem;
+      color: #aaa;
+      margin: 0.13rem 0 0 0;
+    }
+    a {
+      margin-top: 0.12rem;
+      font-size: 0.18rem;
+      color: #bbb;
+    }
+    .hr {
+      width: 1.09rem;
+      height: 0.02rem;
+      background: #d9d9d9;
+      position: absolute;
+      left: 1.94rem;
+      top: 0.35rem;
+      &.right {
+        right: 1.94rem;
+        left: auto;
+      }
+    }
+  }
+}
+</style>

+ 201 - 82
pages/mobile/user/index.vue

@@ -6,17 +6,28 @@
         <p v-text="userInfo.data.userName"></p>
         <p v-text="enterpriseInfo.enName"></p>
       </div>
-      <span @click="onclick()">{{listName}}<i class="iconfont icon-arrow-down"></i></span>
-      <ul class="supdown" v-if="down">
-        <li @click="onDown('1')" v-show="!isDevice || !isShop">全部收藏</li>
-        <li @click="onDown('-1')" v-show="isDevice || !isShop">店铺关注</li>
-        <li @click="onDown('0')" v-show="!isDevice || isShop">器件收藏</li>
-      </ul>
+      <a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
     </div>
-    <div class="collect-list-type" v-if="focusPage.totalElements > 0 && isShop">
-      <p>店铺</p>
+    <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>
+      <li :class="{active: activeType == 'store'}" @click="activeType = 'store'">店铺关注</li>
+    </ul>
+    <div class="seek" v-if="activeType == 'seek'">
+      <ul class="seek-type">
+        <li :class="{active: seekType == 'wait'}" @click="switchSeek('wait')"><div>待报价</div></li>
+        <li :class="{active: seekType == 'done'}" @click="switchSeek('done')"><div>已报价</div></li>
+        <!--<li :class="{active: seekType == 'accept'}" @click="switchSeek('accept')"><div>已采纳</div></li>-->
+      </ul>
+      <div class="search-content">
+        <input type="text" placeholder="请输入您要查找的型号或品牌" v-model="seekKeyword" @keyup.13="searchSeek">
+        <span @click="searchSeek">
+        <i class="iconfont icon-sousuo"></i>
+        </span>
+      </div>
+      <seek-list :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
     </div>
-    <div class="shop-list" v-if="isShop" v-for="item in focusPage.content" @click="goStoreDetail(item.storeInfo.uuid)">
+    <div class="shop-list" v-bind:key="item" v-if="activeType == 'store'" v-for="item in focusPage.content" @click="goStoreDetail(item.storeInfo.uuid)">
       <h3>{{item.storeName}}</h3>
       <div class="list-item">
         <div class="item-img">
@@ -24,17 +35,14 @@
           <img :src="item.storeInfo.logoUrl || '/images/component/default.png'">
         </div>
         <div class="list-item-phone">
-          <p>电话:<span>{{item.storeInfo.enterprise.enTel}}</span></p>
-          <p>传真:<span>{{item.storeInfo.enterprise.enFax}}</span></p>
+          <p>电话:<span>{{item.storeInfo.enterprise ? item.storeInfo.enterprise.enTel : '-'}}</span></p>
+          <p>传真:<span>{{item.storeInfo.enterprise ? item.storeInfo.enterprise.enFax : '-'}}</span></p>
           <p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>
           <i class="iconfont icon-shoucang" @click="cancelFocus('store', item, $event)"></i>
         </div>
       </div>
     </div>
-    <div class="collect-list-type" v-if="collectSave.totalElements > 0 && isDevice">
-      <p>器件</p>
-    </div>
-    <div class="detail-brand" v-for="(item, index) in collectSave.content" v-if="isDevice" @click="goComponentDetail(item.componentinfo.uuid)">
+    <div class="detail-brand" v-bind:key="index" v-for="(item, index) in collectSave.content" v-if="activeType == 'comp'" @click="goComponentDetail(item.componentinfo.uuid)">
       <a>
         <div class="brand-item">
           <p>型号:<span>{{item.componentinfo.code}}</span></p>
@@ -44,7 +52,7 @@
         </div>
       </a>
     </div>
-    <div class="none-state" v-if="(collectSave.totalElements == 0 && !isShop) || (focusPage.totalElements == 0 && !isDevice) || (collectSave.totalElements == 0 && focusPage.totalElements == 0)">
+    <div class="none-state" v-if="(activeType != 'seek') && ((collectSave.totalElements == 0 && activeType == 'comp') || (focusPage.totalElements == 0 && activeType == 'store') || (collectSave.totalElements == 0 && focusPage.totalElements == 0))">
       <img src="/images/mobile/@2x/empty-collect.png">
       <p v-text="getRemindText()"></p>
       <nuxt-link to="/">返回首页</nuxt-link>
@@ -61,62 +69,60 @@
         </div>
       </div>
     </div>
+    <page-loading v-show="showLoading"></page-loading>
+    <loading v-show="isSearchSearchingMore"></loading>
+    <div v-if="purchaseManList && false"></div>
+    <div v-if="purchaseManListFetching && false"></div>
   </div>
 </template>
 
 <script>
-  import RemindBox from '~components/mobile/common/RemindBox.vue'
+  import SeekList from '~components/mobile/applyPurchase/SeekList.vue'
+  import {RemindBox, Loading} from '~components/mobile/common'
+  import PageLoading from '~components/common/loading/PageLoading.vue'
   export default {
     layout: 'mobile',
     data () {
       return {
         userName: '',
-        down: false,
         count: '',
         page: '',
         type: '',
-        listName: '全部收藏',
-        isShop: true,
-        isDevice: true,
+        activeType: 'seek',
         collectResult: '取消成功',
         timeoutCount: 0,
         showStoreInfo: false,
-        storeInfo: {}
+        storeInfo: {},
+        seekType: 'wait',
+        showLoading: false,
+        seekKeyword: '',
+        isSearchSearchingMore: false,
+        isChange: false,
+        seekPage: 1,
+        seekSize: 10,
+        purchaseManListData: [],
+        isDataChange: false
       }
     },
     components: {
-      RemindBox
+      RemindBox,
+      SeekList,
+      PageLoading,
+      Loading
     },
-    fetch ({ store }) {
+    fetch ({ store, route }) {
       return Promise.all([
         store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
-        store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 })
+        store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 }),
+        store.dispatch(route.query.type === 'saler' ? 'applyPurchase/loadPurchaseManList' : 'applyPurchase/loadBuyerUnSayPricePurchaseManList', {pageNumber: 1, pageSize: 10, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : store.state.option.user.data.userUU, state: (!route.query.type || route.query.type === 'buyer') ? 'todo' : null})
       ])
     },
+    mounted: function () {
+      this.$nextTick(() => {
+        window.addEventListener('scroll', this.scroll, false)
+      })
+    },
     methods: {
-      onclick () {
-        this.down = !this.down
-      },
-      onDown (type) {
-        if (type === '-1') {
-          this.listName = '店铺关注'
-          this.isShop = true
-          this.isDevice = false
-          this.down = false
-        }
-        if (type === '0') {
-          this.listName = '器件收藏'
-          this.isDevice = true
-          this.isShop = false
-          this.down = false
-        }
-        if (type === '1') {
-          this.listName = '全部收藏'
-          this.isDevice = true
-          this.isShop = true
-          this.down = false
-        }
-      },
       cancelFocus: function (type, item, event) {
         event.stopPropagation()
         if (type === 'store') {
@@ -154,12 +160,10 @@
         this.$router.push('/mobile/brand/componentDetail/' + uuid)
       },
       getRemindText: function () {
-        if (this.isDevice && !this.isShop) {
+        if (this.activeType === 'comp') {
           return '抱歉,暂无器件收藏'
-        } else if (!this.isDevice && this.isShop) {
+        } else if (this.activeType === 'store') {
           return '抱歉,暂无店铺关注'
-        } else {
-          return '抱歉,暂无收藏记录'
         }
       },
       selectStoreInfo: function (store, event) {
@@ -169,6 +173,54 @@
       },
       checkInfo: function (str) {
         return str && str.trim() !== ''
+      },
+      switchSeek: function (type) {
+        this.seekType = type
+        this.showLoading = true
+        this.seekKeyword = ''
+        this.isChange = true
+        this.seekPage = 1
+        this.reloadData()
+      },
+      switchType: function () {
+        this.seekType = 'wait'
+        this.seekKeyword = ''
+        this.$router.push('/mobile/user' + (this.userType === 'saler' ? '?type=buyer' : '?type=saler'))
+      },
+      searchSeek: function () {
+        this.isChange = true
+        this.reloadData()
+      },
+      reloadData: function () {
+        let type = this.seekType
+        if (this.userType !== 'saler') {
+          if (type === 'wait') {
+            this.$store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, keyword: this.seekKeyword, state: 'todo'})
+          } else if (type === 'done') {
+            this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
+          } else {
+            this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise ? this.$store.state.option.user.data.enterprise.uu : null, _state: 'done', keyword: this.seekKeyword})
+          }
+        } else {
+          if (type === 'wait') {
+            this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, enUU: this.$store.state.option.user.data.enterprise.uu, keyword: this.seekKeyword})
+          } else if (type === 'done') {
+            this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
+          } else {
+            this.$store.dispatch('applyPurchase/loadVendorPurchaseManList', {pageNumber: this.seekPage, pageSize: this.seekSize, _state: 'done', filter: {vendUU: this.$store.state.option.user.data.enterprise.uu, fromDate: null, endDate: null, keyword: this.seekKeyword}})
+          }
+        }
+      },
+      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.seekPage < this.allPage) {
+          this.getMoreSearch()
+        }
+      },
+      getMoreSearch: function () {
+        this.seekPage++
+        this.isSearchSearchingMore = true
+        this.reloadData()
       }
     },
     computed: {
@@ -180,11 +232,6 @@
       },
       enterpriseInfo () {
         let ens = this.userInfo.data.enterprises
-//        if (ens && ens.length) {
-//          return ens.find(item => item.current) || {enName: this.userInfo.data.userName + '(个人账户)'}
-//        } else {
-//          return {enName: this.userInfo.data.userName + '(个人账户)'}
-//        }
         if (ens && ens.length) {
           for (let i = 0; i < ens.length; i++) {
             if (ens[i].current) {
@@ -194,8 +241,39 @@
         }
         return {enName: this.userInfo.data.userName + '(个人账户)'}
       },
+      isVendor () {
+        return this.enterpriseInfo.isVendor === 313
+      },
+      userType () {
+        return this.$route.query.type
+      },
       focusPage () {
         return this.$store.state.shop.storeInfo.focusPage.data
+      },
+      purchase () {
+        return this.$store.state.applyPurchase.purchaseManList.purchaseManList
+      },
+      purchaseManList () {
+        let list = this.purchase.data.content
+        if (this.isChange) {
+          this.purchaseManListData = []
+          this.seekPage = 1
+          this.isChange = false
+          this.isDataChange = true
+        } else {
+          this.purchaseManListData = this.purchaseManListData.concat(list)
+          this.isSearchSearchingMore = false
+          this.isDataChange = false
+        }
+//        console.log(this.purchaseManListData)
+        return this.purchase.data.content
+      },
+      allPage () {
+        return Math.floor(this.purchase.data.totalElements / this.purchase.data.size) + Math.floor(this.purchase.data.totalElements % this.purchase.data.size > 0 ? 1 : 0)
+      },
+      purchaseManListFetching () {
+        this.showLoading = false
+        return this.purchase.fetching
       }
     }
   }
@@ -204,8 +282,6 @@
 <style scoped lang="scss">
   .user-content{
     margin-bottom: .98rem;
-    background: #dfe2e4;
-
     .none-state{
       text-align: center;
       padding:1.5rem 0;
@@ -239,24 +315,6 @@
       background:#fff;
       width:100%;
       position:relative;
-      border-bottom: .1rem solid #dfe2e4;
-      .supdown{
-        position:absolute;
-        top:.8rem;
-        right:.3rem;
-        z-index:10;
-        width:1.7rem;
-        background:#616264;
-        border-radius:.1rem;
-        li{
-          font-size: .28rem;
-          color:#ffffff;
-          height: .32rem;
-          line-height: .32rem;
-          margin: .4rem 0;
-          text-align: center;
-        }
-      }
       img{
         display: inline-block;
         width:1.25rem;
@@ -284,11 +342,15 @@
           }
         }
       }
-      span{
-        font-size:.28rem;
-        color:#53a0f7;
-        position: relative;
-        bottom: .3rem;
+      > a {
+        font-size: .24rem;
+        position: absolute;
+        top: .45rem;
+        right: .1rem;
+        color: #3f84f6;
+        border: .02rem solid #3f84f6;
+        border-radius: .2rem;
+        padding: .06rem .12rem;
       }
     }
     .shop-list {
@@ -414,5 +476,62 @@
         border-bottom: .06rem solid #418bf6;
       }
     }
+    ul.switch-list {
+      li {
+        display: inline-block;
+        width: 2.5rem;
+        height: .63rem;
+        line-height: .63rem;
+        text-align: center;
+        font-size: .28rem;
+        color: #666;
+        background: #fff;
+        border: .02rem solid #b4b4b4;
+        border-right: none;
+        &.active {
+          background: #0067e7;
+          border: .02rem solid #0067e7;
+          color: #fff;
+        }
+        &:first-child {
+          border-left: none;
+        }
+        &:last-child {
+          border-right: none;
+        }
+      }
+    }
+    .seek {
+      ul.seek-type {
+        margin-top: .06rem;
+        li {
+          font-size: .28rem;
+          color: #666;
+          display: inline-block;
+          width: 50%;
+          text-align: center;
+          div {
+            width: 2rem;
+            border-bottom: .02rem solid #c1c4c9;
+            margin: 0 auto;
+            height: .6rem;
+            line-height: .6rem;
+          }
+          &.active {
+            color: #3f84f6;
+            div {
+              border-color: #3f84f6;
+            }
+          }
+        }
+      }
+      .search-content {
+        text-align: center;
+        padding: .25rem 0 0 0;
+        input {
+          border: .02rem solid #376ff3;
+        }
+      }
+    }
   }
 </style>

+ 21 - 0
plugins/vue-filter.js

@@ -0,0 +1,21 @@
+import Vue from 'vue'
+
+const filters = {
+  date: (date) => {
+    if (date) {
+      const d = new Date(Number(date))
+      const year = d.getFullYear()
+      const monthTemp = d.getMonth() + 1
+      const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+      const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
+      return year + '-' + month + '-' + day
+    } else {
+      return '-'
+    }
+  }
+}
+
+for (let key in filters) {
+  Vue.filter(key, filters[key])
+}
+

BIN
static/images/mobile/@2x/applyPurchase/add-btn.png


BIN
static/images/mobile/@2x/applyPurchase/currency-arrow-down.png


BIN
static/images/mobile/@2x/applyPurchase/currency-arrow-up.png


BIN
static/images/mobile/@2x/applyPurchase/home/arrow-right.png


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


BIN
static/images/mobile/@2x/applyPurchase/home/home-bg.png


BIN
static/images/mobile/@2x/applyPurchase/home/phone.png


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


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


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


BIN
static/images/mobile/@2x/applyPurchase/home/shop.png


BIN
static/images/mobile/@2x/applyPurchase/say-price-accept.png


BIN
static/images/mobile/@2x/applyPurchase/say-price-check.png


BIN
static/images/mobile/@2x/applyPurchase/say-price-default.png


BIN
static/images/mobile/@2x/applyPurchase/sub-btn.png


BIN
static/images/mobile/@2x/purChase/banner.png


BIN
static/images/mobile/@2x/purChase/money_icon.png


BIN
static/images/mobile/@2x/purChase/purChase_bg.png


BIN
static/images/mobile/@2x/purChase/time.png


+ 66 - 0
store/applyPurchase.js

@@ -28,6 +28,16 @@ import axios from '~plugins/axios'
 // }
 
 export const actions = {
+  // 获取手机端首页求购数据
+  loadMobileHomeList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_MOBILE_HOME_SEEK')
+    return axios.get('/inquiry/public', {params})
+      .then(response => {
+        commit('purchaseManList/GET_MOBILE_HOME_SEEK_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_MOBILE_HOME_SEEK_FAILURE', err)
+      })
+  },
 // 采购商列表
   loadPurchaseManList ({ commit }, params = {}) {
     commit('purchaseManList/REQUEST_PURCHASEMAN')
@@ -45,6 +55,62 @@ export const actions = {
         commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
       })
   },
+  loadPurchaseManDetail ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN_DETAIL')
+    return axios.get('/inquiry/public/findItemByItemId', {params})
+      .then(response => {
+        commit('purchaseManList/GET_PURCHASEMAN_DETAIL_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_PURCHASEMAN_DETAIL_FAILURE', err)
+      })
+  },
+  /* 获取卖家报价信息 */
+  loadVendorInquiryDetail ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_VENDOR_INQUIRY_DETAIL')
+    return axios.get('/inquiry/public/quotation/one', {params})
+      .then(response => {
+        commit('purchaseManList/GET_VENDOR_INQUIRY_DETAIL_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_VENDOR_INQUIRY_DETAIL_FAILURE', err)
+      })
+  },
+  /* 获取卖家报价信息 */
+  loadBuyerInquiryDetail ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_BUYER_INQUIRY_DETAIL')
+    return axios.get('/inquiry/buyer/quotation', {params})
+      .then(response => {
+        commit('purchaseManList/GET_BUYER_INQUIRY_DETAIL_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_BUYER_INQUIRY_DETAIL_FAILURE', err)
+      })
+  },
+  loadBuyerPurchaseManList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN')
+    return axios.get('/inquiry/buyer/quotations', {params})
+      .then(response => {
+        commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
+      })
+  },
+  loadBuyerUnSayPricePurchaseManList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN')
+    return axios.get('/inquiry/buyer/list', {params})
+      .then(response => {
+        commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
+      })
+  },
+  loadVendorPurchaseManList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN')
+    return axios.get('/inquiry/public/quotation/list', {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)

+ 56 - 0
store/applyPurchase/purchaseManList.js

@@ -1,11 +1,37 @@
 export const state = () => ({
+  purchaseHomeList: {
+    fetching: false,
+    data: []
+  },
   purchaseManList: {
     fetching: false,
     data: []
+  },
+  purchaseManDetail: {
+    fetching: false,
+    data: []
+  },
+  vendorInquiryDetail: {
+    fetching: false,
+    data: []
+  },
+  buyerInquiryDetail: {
+    fetching: false,
+    data: []
   }
 })
 
 export const mutations = {
+  REQUEST_MOBILE_HOME_SEEK (state) {
+    state.purchaseHomeList.fetching = true
+  },
+  GET_MOBILE_HOME_SEEK_FAILURE (state) {
+    state.purchaseHomeList.fetching = false
+  },
+  GET_MOBILE_HOME_SEEK_SUCCESS (state, result) {
+    state.purchaseHomeList.fetching = false
+    state.purchaseHomeList.data = result
+  },
   REQUEST_PURCHASEMAN (state) {
     state.purchaseManList.fetching = true
   },
@@ -15,6 +41,36 @@ export const mutations = {
   GET_PURCHASEMAN_SUCCESS (state, result) {
     state.purchaseManList.fetching = false
     state.purchaseManList.data = result
+  },
+  REQUEST_PURCHASEMAN_DETAIL (state) {
+    state.purchaseManDetail.fetching = true
+  },
+  GET_PURCHASEMAN_DETAIL_FAILURE (state) {
+    state.purchaseManDetail.fetching = false
+  },
+  GET_PURCHASEMAN_DETAIL_SUCCESS (state, result) {
+    state.purchaseManDetail.fetching = false
+    state.purchaseManDetail.data = result
+  },
+  REQUEST_VENDOR_INQUIRY_DETAIL (state) {
+    state.vendorInquiryDetail.fetching = true
+  },
+  GET_VENDOR_INQUIRY_DETAIL_FAILURE (state) {
+    state.vendorInquiryDetail.fetching = false
+  },
+  GET_VENDOR_INQUIRY_DETAIL_SUCCESS (state, result) {
+    state.vendorInquiryDetail.fetching = false
+    state.vendorInquiryDetail.data = result
+  },
+  REQUEST_BUYER_INQUIRY_DETAIL (state) {
+    state.buyerInquiryDetail.fetching = true
+  },
+  GET_BUYER_INQUIRY_DETAIL_FAILURE (state) {
+    state.buyerInquiryDetail.fetching = false
+  },
+  GET_BUYER_INQUIRY_DETAIL_SUCCESS (state, result) {
+    state.buyerInquiryDetail.fetching = false
+    state.buyerInquiryDetail.data = result
   }
 }