Browse Source

求购优化

yangc 8 years ago
parent
commit
6cf40ce43b

+ 18 - 0
assets/scss/common.scss

@@ -673,3 +673,21 @@ input[type="number"]{
 .fr {
   float: right;
 }
+/*new 标签*/
+@keyframes newAnimate {
+  0% {
+    transform: translate(0px, 0px);
+  }
+  50% {
+    transform: translate(0px, -3px);
+  }
+  100% {
+    transform: translate(0px, 0px);
+  }
+}
+
+img.new-animate{
+  position: relative;
+  top: -7px;
+  animation: newAnimate 1s infinite;
+}

+ 30 - 7
components/applyPurchase/ApplyInfo.vue

@@ -33,7 +33,7 @@
         </span>
         <span>操作</span>
       </p>
-      <ul>
+      <ul v-if="purchaseManList.content && purchaseManList.content.length">
         <li v-for="(purchaseMan, index) in purchaseManList.content" :class="{'active': purchaseMan.active}">
           <div>{{purchaseMan.date| date}}</div>
           <div v-if="purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName">{{purchaseMan.inquiry.enterprise.enName | enterpriseFilter}}</div>
@@ -53,7 +53,7 @@
           <div class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</div>
           <div class="btn-content">
             <!--<a @click="setLinkBoxIndex(index)">联系买家</a>-->
-            <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && user && user.data.enterprise && ((!purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.uu == user.data.enterprise.uu) || purchaseMan.userUU == user.data.userUU)" style="background: #cccbcb;">我要报价</a>
+            <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && (user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (purchaseMan.userUU == user.data.uu)))" style="background: #cccbcb;">我要报价</a>
             <a v-else @click="sayPrice(purchaseMan, index)">我要报价</a>
             <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt="">
             </div>
@@ -97,6 +97,10 @@
           </div>-->
         </li>
       </ul>
+      <div class="empty" v-else>
+        <img src="/images/all/empty-cart.png">
+        <span>暂无搜索结果</span>
+      </div>
     </div>
     <say-price :current="currentSayPriceIndex"
                :purchase="purchaseManList"
@@ -268,12 +272,12 @@
       }
       >div {
         float: right;
-        height: 25px;
-        line-height: 25px;
+        height: 32px;
+        line-height: 32px;
         >input {
           width: 241px;
-          height: 25px;
-          line-height: 25px;
+          height: 32px;
+          line-height: 32px;
           font-size: 13px;
           border: {
             top-right-radius: 0;
@@ -287,6 +291,7 @@
           background: #3975f4;
           text-align: center;
           margin: 0 6px 0 -1px;
+          vertical-align: middle;
           border: {
             top-right-radius: 3px;
             bottom-right-radius: 3px;
@@ -531,6 +536,8 @@
           }
           .expand-content {
             display: none;
+            position: absolute;
+            top: 67px;
             justify-content: space-between;
             padding: 0 236px 0 36px;
             background: #fffbf0;
@@ -545,9 +552,14 @@
             }
           }
           &:hover {
-            box-shadow: 1.5px 3px 7px 0 rgb( 178, 178, 179 );
+            border: 1px solid #4290f7;
             .expand-content {
               display: flex;
+              width: 1190px;
+              z-index: 1;
+              border: 1px solid #4290f7;
+              left: -1px;
+              border-top: none;
             }
           }
           .say-price {
@@ -678,6 +690,17 @@
           }
         }
       }
+      .empty{
+        text-align: center;
+        height: 200px;
+        line-height: 200px;
+        border: 1px solid #e8e8e8;
+        margin-bottom: 10px;
+        span {
+          color: #999;
+          margin-left: 10px;
+        }
+      }
     }
     .page-wrap {
       text-align: right;

+ 15 - 13
components/applyPurchase/BatchPublish.vue

@@ -134,23 +134,23 @@
       <a class="modify-btn delete-btn" @click="submitBOM">确认发布</a>
     </div>
     <!--提示框-->
-    <div class="modal-wrap" v-if="showRemindBox">
+    <!--<div class="modal-wrap" v-if="showRemindBox">
       <div class="apply-del-box">
         <div class="title">
-          <!--<a @click="showRemindBox = false"><i class="fa fa-close fa-lg"></i></a>-->
+          &lt;!&ndash;<a @click="showRemindBox = false"><i class="fa fa-close fa-lg"></i></a>&ndash;&gt;
         </div>
         <div class="content">
-          <!--<p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>-->
-          <!--<p style="line-height: 20px;">前往<a @click="goBrandApply()"  target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>-->
+          &lt;!&ndash;<p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>&ndash;&gt;
+          &lt;!&ndash;<p style="line-height: 20px;">前往<a @click="goBrandApply()"  target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>&ndash;&gt;
           <p><img src="/images/applyPurchase/check.png" alt="">成功发布{{successResult.successAmount || 0}}个</p>
           <p v-if="successResult.goodsAmount && successResult.goodsAmount > 0 ">其中<span>{{successResult.goodsAmount || 0}}</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
           <div>
-            <!--<a @click="showRemindBox = false">继续发布</a>-->
+            &lt;!&ndash;<a @click="showRemindBox = false">继续发布</a>&ndash;&gt;
             <a href="/user#/seekPurchase" target="_blank">前往我的求购</a>
           </div>
         </div>
       </div>
-    </div>
+    </div>-->
   </div>
 </template>
 <script>
@@ -204,7 +204,7 @@
         pageSize: 10,
         nowPage: 1,
         isCheckAll: false,
-        showRemindBox: false,
+//        showRemindBox: false,
         modifyObj: {
           code: '',
           brand: '',
@@ -232,7 +232,7 @@
           amount: true,
           deadline: true
         },
-        successResult: 0,
+//        successResult: 0,
         showSimilarCodeList: false,
         showSimilarBrandList: false
       }
@@ -338,12 +338,14 @@
         this.$http.post('/seek/confirmBom', param)
           .then(response => {
             if (response.data.success) {
-              this.showRemindBox = true
-              this.successResult = response.data.data
-              this.listenPage(1)
-              this.$store.dispatch('applyPurchase/loadBOMNumber', {bomId: this.$route.params.id})
+//              this.showRemindBox = true
+//              this.successResult = response.data.data
+//              this.listenPage(1)
+//              this.$store.dispatch('applyPurchase/loadBOMNumber', {bomId: this.$route.params.id})
+              this.$router.push('/applyPurchase/result?status=success&count=' + response.data.data.successAmount)
             } else {
-              this.$message.error(response.data.message)
+//              this.$message.error(response.data.message)
+              this.$router.push('/applyPurchase/result?status=error')
             }
           }, err => {
             console.log(err)

+ 8 - 22
components/applyPurchase/PublishApply.vue

@@ -105,30 +105,21 @@
         <thead>
           <tr>
             <th width="62">排名</th>
-            <th width="90">买家</th>
-            <th width="90">卖家</th>
-            <th width="72">状态</th>
+            <th width="160">型号</th>
+            <th width="92">求购次数</th>
           </tr>
         </thead>
         <tbody>
-          <tr v-for="(rank, index) in purchaseRank.content">
+          <tr v-for="(rank, index) in purchaseRank">
             <td><div>NO.<span>{{index + 1}}</span><i>|</i></div></td>
             <td>
               <div>
-                <span v-if="rank.inquiry.enterprise">{{rank.inquiry.enterprise.enName | enterpriseFilter}}</span>
-                <span v-if="!rank.inquiry.enterprise && rank.userName">{{rank.userName | userNameFilter}}</span>
-                <!--<span v-if="!rank.inquiry.userName && !rank.inquiry.enterprise">-</span>-->
+                <span v-if="rank.id_cmpcode" :title="rank.id_cmpcode">{{rank.id_cmpcode}}</span>
+                <span v-if="!rank.id_cmpcode">-</span>
                 <i>|</i>
               </div>
             </td>
-            <td>
-              <div>
-                <span v-if="rank.vendName">{{rank.vendName | enterpriseFilter}}</span>
-                <span v-if="!rank.vendName">-</span>
-                <i>|</i>
-              </div>
-            </td>
-            <td><div>已采纳</div></td>
+            <td><div>{{rank.seekAmount || 0}}</div></td>
           </tr>
         </tbody>
       </table>
@@ -748,17 +739,12 @@
               }
               &:nth-child(2) {
                 >div {
-                  width: 90px;
+                  width: 160px;
                 }
               }
               &:nth-child(3) {
                 >div {
-                  width: 87px;
-                }
-              }
-              &:nth-child(4) {
-                >div {
-                  width: 72px;
+                  width: 92px;
                 }
               }
               >div {

+ 2 - 2
components/default/Header.vue

@@ -238,8 +238,8 @@
         .item {
           color: $grey;
           display: inline-block;
-          height: $nav-height;
-          line-height: $nav-height;
+          height: 35px;
+          line-height: 35px;
         }
 
         a {

+ 10 - 17
components/home/floor/FloorList.vue

@@ -10,7 +10,7 @@
           <li>
             <div class="banner-cuxiao">
               <div class="wrap">
-                <p class="title"><span>最新求购</span><img src="/images/all/banner-cuxiao03.jpg" alt="">
+                <p class="title"><span>最新求购</span><img class="new-animate" src="/images/all/banner-cuxiao03.jpg" alt="">
                   <nuxt-link to="/applyPurchase">查看更多</nuxt-link>
                 </p>
                 <div class="list-head">
@@ -29,6 +29,7 @@
                     <div :title="purchaseMan.cmpCode">{{purchaseMan.cmpCode}}</div>
                     <div>
                       <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt=""></div>
+                      <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && (user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (purchaseMan.userUU == user.data.uu)))" class="is-same">我要报价</a>
                       <a v-else @click="sayPrice(purchaseMan, index)">我要报价</a>
                     </div>
                   </li>
@@ -237,17 +238,6 @@
   .floor-list .container > a > img {
     margin-top: 30px;
   }
-  @keyframes myfirst {
-    0% {
-      transform: translate(0px, 0px);
-    }
-    50% {
-      transform: translate(0px, -3px);
-    }
-    100% {
-      transform: translate(0px, 0px);
-    }
-  }
   .banner{
     width:1190px;
     height: 253px;
@@ -274,11 +264,6 @@
           font-weight: bold;
           padding: 10px 30px;
           margin: 0;
-          img{
-            position: relative;
-            top: -7px;
-            animation: myfirst 1s infinite;
-          }
           a {
             font-size: 14px;
             color: #f57a2e;
@@ -360,6 +345,14 @@
                   -moz-box-shadow: 0 3px 5px #f57a2e; /* 老的 Firefox */
                   box-shadow: 0 3px 10px #f57a2e;
                 }
+                &.is-same {
+                  background: #cccbcb;
+                  border: none;
+                  color: #fff;
+                  -webkit-box-shadow: none;
+                  -moz-box-shadow: none;
+                  box-shadow: none;
+                }
               }
               .is-say-price {
                 color: #39ae05;

+ 1 - 0
components/main/Nav.vue

@@ -27,6 +27,7 @@
       </nuxt-link>
       <nuxt-link to="/applyPurchase" class="item">
         <span>求购询价</span>
+        <img class="new-animate" src="/images/all/banner-cuxiao03.jpg" alt="">
       </nuxt-link>
     </div>
   </nav>

+ 1 - 1
nuxt.config.js

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

+ 145 - 0
pages/applyPurchase/result.vue

@@ -0,0 +1,145 @@
+<template>
+  <div class="result">
+    <div class="container" v-if="state == 'success'">
+      <p>发布求购</p>
+      <img src="/images/applyPurchase/batch-success.png" alt="">
+      <h1>发布成功</h1>
+      <h2>成功发布 <span>{{count}}</span> 条求购</h2>
+      <div class="footer1">前往 <a href="/user#/seekPurchase">买家中心-我的求购</a> <span>{{timer}}s</span></div>
+      <div class="footer2">返回 <nuxt-link to="/">商城首页</nuxt-link> | <nuxt-link to="/applyPurchase">求购首页</nuxt-link></div>
+    </div>
+    <div class="container" v-else>
+      <p>发布求购</p>
+      <img src="/images/applyPurchase/batch-error.png" alt="">
+      <h1>上传失败</h1>
+      <h2>请完善型号和品牌信息</h2>
+      <div class="footer1">立刻
+        <label>
+          <input type="file" @change="upload" accept="*.xls, *.xlsx">
+          <a>重新上传</a>
+        </label>
+      </div>
+      <div class="footer2">返回 <nuxt-link to="/">商城首页</nuxt-link> | <nuxt-link to="/applyPurchase">求购首页</nuxt-link></div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    data () {
+      return {
+        timer: 5
+      }
+    },
+    mounted () {
+      if (this.state === 'success') {
+        setInterval(() => {
+          this.timer--
+          if (this.timer === 0) {
+//            window.location.href = '/user#/seekPurchase'
+          }
+        }, 1000)
+      }
+    },
+    computed: {
+      state () {
+        return this.$route.query.status
+      },
+      count () {
+        return this.$route.query.count || 0
+      },
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    methods: {
+      upload: function (e) {
+        let file = e.target.files[0]
+        if (file) {
+          let param = new FormData()
+          param.append('file', file, file.name)
+          param.append('chunk', '0')
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/seek/importBom', param, config)
+            .then(response => {
+              if (response.data.success) {
+                window.open('/applyPurchase/' + response.data.data)
+              } else {
+                this.$message.error(response.data.message)
+              }
+            }, err => {
+              console.log(err)
+              if (!this.user.logged) {
+                this.$router.push('/auth/login?returnUrl=' + window.location.href)
+              } else {
+                this.$message.error('上传失败, 系统错误')
+              }
+            })
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .result {
+    background: #f5f5f5;
+    padding: 20px 0 103px 0;
+    .container {
+      background: #fff;
+      text-align: center;
+      height: 400px;
+      > p {
+        height: 40px;
+        line-height: 40px;
+        background: #e5edfc;
+        margin: 0;
+        font-weight: bold;
+        font-size: 14px;
+        padding-left: 22px;
+        text-align: left;
+      }
+      > img {
+        margin: 61px 0 25px 0;
+      }
+      > h1 {
+        font-size: 18px;
+        color: #fd4e4e;
+        margin: 0 0 8px 0;
+      }
+      > h2 {
+        font-size: 14px;
+        margin: 0;
+        span {
+          color: #fd4e4e;
+        }
+      }
+      .footer1 {
+        margin-top: 38px;
+        font-size: 16px;
+        color: #666;
+        label {
+          input {
+            display: none;
+          }
+        }
+        a {
+          color: #007aff;
+          font-weight: normal;
+        }
+        span {
+          color: #fd4e4e;
+          margin-left: 10px;
+        }
+      }
+      .footer2 {
+        margin-top: 21px;
+        a {
+          &:first-child {
+            color: #4290f7;
+          }
+        }
+      }
+    }
+  }
+</style>

BIN
static/images/applyPurchase/batch-error.png


BIN
static/images/applyPurchase/batch-success.png


+ 1 - 1
store/applyPurchase.js

@@ -48,7 +48,7 @@ export const actions = {
   // 求购排行榜
   loadPurchaseApplyRank ({ commit }, params = {}) {
     commit('purchaseApplyRank/REQUEST_PURCHASERANK', params)
-    return axios.get(`/inquiry/public/quotationList?_state=agreed&pageNumber=1&pageSize=5`)
+    return axios.get(`/inquiry/public/findCodeRankingList`)
       .then(response => {
         commit('purchaseApplyRank/GET_PURCHASERANK_SUCCESS', response.data)
       }, err => {