Browse Source

第一次验收调整

yangc 8 years ago
parent
commit
2f881f8121

+ 12 - 5
components/common/buyOrCar/buyComponent.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
-    <button class="btn btn-primary btn-buy-now"  @click="buyNow(true)"><span class="watch">立即购买</span></button>
-    <button class="btn btn-add-cart"  @click="buyNow(false)"><span class="watch">加入购物车</span></button>
+    <button class="btn btn-primary btn-buy-now" :disabled="disabledFlag"  @click="buyNow(true)"><span class="watch">立即购买</span></button>
+    <button class="btn btn-add-cart" :disabled="disabledFlag"  @click="buyNow(false)"><span class="watch">加入购物车</span></button>
   </div>
 </template>
 
 <script>
   export default {
-    props: ['item'],
+    props: ['item', 'disabledFlag'],
     methods: {
       buyNow: function (isBuy) {
         if (!this.$store.state.option.user.logged) {
@@ -45,7 +45,7 @@
                     }
                   } else {
                     if (response.data.data && response.data.data.unvailable === 1) {
-                      this.$message.error('产品信息已失效,请刷新面')
+                      this.$message.error('产品信息已失效,请刷新面')
                     } else {
                       this.$message.error(response.data.message)
                     }
@@ -81,7 +81,9 @@
                       })
                     }
                   } else {
-                    if (response.data.message === '该产品已失效') {
+                    if (response.data.code === 2) {
+                      this.$message.error('库存已不满足起订量')
+                    } else if (response.data.message === '该产品已失效') {
                       this.$message.error(response.data.message + ',请刷新页面')
                     } else {
                       this.$message.error(response.data.message)
@@ -191,4 +193,9 @@
     background-color: #5078CB;
     color: #fff;
   }
+  .btn-buy-now[disabled], .btn-add-cart[disabled] {
+    background-color: #d1d2d3!important;
+    border-color: #d1d2d3!important;
+    color: #fff!important;
+  }
 </style>

+ 9 - 2
components/search/GoodList.vue

@@ -57,7 +57,8 @@
             <td>
               <nuxt-link class="component-img-box" :to="item.batchCode?`/store/${item.storeId}/${item.batchCode}`:`/product/component/${item.uuid}`">
       <!--          <img :src="item.img?item.img:item.brand&&item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">-->
-                <img :src="item.batchCode?item.img?item.img:'/images/component/default.png':item.brand&&item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">
+                <img class="component-img" :src="item.batchCode?item.img?item.img:'/images/component/default.png':item.brand&&item.brand.logoUrl?item.brand.logoUrl:'/images/component/default.png'">
+                <img v-if="item.status === 602" class="sellout-flag" src="/images/search/sellout-search.png" alt="">
               </nuxt-link>
             </td>
             <td class="brand-code">
@@ -424,8 +425,14 @@
   .product-list tbody>tr .component-img-box {
     width: 80px;
     height: 80px;
+    position: relative;
+  }
+  .product-list tbody>tr .component-img-box .sellout-flag {
+    position: absolute;
+    right: -29px;
+    bottom: -55px;
   }
-  .product-list tbody>tr img {
+  .product-list tbody>tr .component-img-box .component-img {
     border: 1px solid #e8e8e8;
     margin: 10px 0 5px 0;
     max-width: 80px;

+ 15 - 6
components/store/CommodityList.vue

@@ -46,6 +46,7 @@
             <td class="commodity-icon">
               <a :href="'/store/' + commodity.storeid + '/' + commodity.batchCode" target="_blank">
                 <div class="img"><img :src="commodity.img || '/images/store/common/default.png'"/></div>
+                <img class="sellout-store-commodity" v-if="commodity.status === 602" src="/images/search/sellout-search.png" alt="">
               </a>
             </td>
             <td class="brand-code">
@@ -60,17 +61,17 @@
               <div class="date" v-if='commodity.produceDate' v-text="commodity.produceDate">2016-12-01</div>
             </td>
             <td style="text-align: left;vertical-align: middle;">
-              <div class="goods" v-if="commodity.reserve">
-                库存:<span v-text="commodity.reserve">31500</span>
+              <div class="goods" v-if="commodity.reserve || commodity.status === 602">
+                库存:<span v-text="commodity.reserve"></span>
               </div>
-              <div v-if="!commodity.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
-              <div class="from" v-if="commodity.reserve && commodity.reserve>0">
+              <div v-if="!commodity.reserve && commodity.status !== 602" style="text-align: center;margin-left: 0;"><span>—</span></div>
+              <div class="from" v-if="commodity.reserve && commodity.reserve>0 || commodity.status === 602">
                 起拍:<span v-if="commodity.minBuyQty" v-text="commodity.minBuyQty">300</span>
               </div>
               <!--<div class="multiple">
                 倍数:<span>1</span>
               </div>-->
-              <div class="can-div-sell" v-if="commodity.reserve" v-text="commodity.breakUp?'可拆卖':'不可拆卖'"></div>
+              <div class="can-div-sell" v-if="commodity.reserve || commodity.status === 602" v-text="commodity.breakUp?'可拆卖':'不可拆卖'"></div>
             </td>
             <td>
               <div v-for="price in commodity.prices" v-text="price.start + '+'"></div>
@@ -96,7 +97,7 @@
               <div v-if="!commodity.b2cMinDelivery"><span>—</span></div>
             </td>
             <td>
-              <buy :item="commodity"></buy>
+              <buy :item="commodity" :disabledFlag="commodity.status === 602"></buy>
             </td>
           </tr>
           <tr v-if="!commodities.content || commodities.content.length == 0">
@@ -429,6 +430,9 @@ export default {
 	#goods-list-fragment .goodslist tbody>tr {
 		border: 1px solid #e8e8e8;
 	}
+  #goods-list-fragment .goodslist tbody>tr td.commodity-icon {
+    position: relative;
+  }
 	#goods-list-fragment .goodslist tbody>tr td.commodity-icon .img{
 		border: 1px solid #e8e8e8;
 		margin: 10px;
@@ -441,6 +445,11 @@ export default {
 		width: 80px;
 		height: 80px;
 	}
+  #goods-list-fragment .goodslist tbody>tr td.commodity-icon .sellout-store-commodity {
+    position: absolute;
+    right: -16px;
+    bottom: -9px;
+  }
 	#goods-list-fragment .goodslist td {
 		font-size: 12px;
 		color: #333;

+ 11 - 1
components/store/RecommendProduct.vue

@@ -3,7 +3,11 @@
     <div class="recommend-list">
       <ul>
         <li v-for="commodity in commodities">
-          <div class="img"><a href="javascript:void(0);"><img :src="commodity.comImg.startsWith('static')?'/'+commodity.comImg:commodity.comImg"/></a></div>
+          <div class="img">
+            <a href="javascript:void(0);">
+              <img :src="commodity.comImg.startsWith('static')?'/'+commodity.comImg:commodity.comImg"/>
+            </a>
+          </div>
           <div class="content">
             <p v-text="commodity.comCode">MRFE6S9045NF001</p>
             <p class="color666" v-text="commodity.brandNameCn">PANFAEFQ</p>
@@ -21,6 +25,7 @@
             <div class="by-cart"><button title="加入购物车" @click="buyNow(false, commodity)"><img src="/images/store/icon/cart-blue.png"/></button></div>
             <div class="buy-now"><button title="立即购买" @click="buyNow(true, commodity)">立即购买</button></div>
           </div>
+          <!--<img class="recommend-sellout" src="/images/store/isSellOut.png" alt="">-->
         </li>
       </ul>
     </div>
@@ -391,4 +396,9 @@
     text-align: center;
     height: 260px;
   }
+  #recommend-fragment ul li .recommend-sellout {
+    position: absolute;
+    right: 0;
+    bottom: 0;
+  }
 </style>

BIN
static/images/search/sellout-search.png