Browse Source

Merge branch 'master' into feature/yc-apply_purchase_new-0126

# Conflicts:
#	nuxt.config.js
yangc 8 years ago
parent
commit
fce00d3f5b

+ 1 - 1
components/common/upload/upload.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="preview">
-      <img :src="qualifications.url==''?'images/all/upload-apply.png': isPdf?'/images/all/timg.png':qualifications.url" class="previewImage"/>
+      <img :src="qualifications.url==''?'/images/all/upload-apply.png': isPdf?'/images/all/timg.png':qualifications.url" class="previewImage"/>
       <input type="file" v-if="!qualifications.url" class="com-input" @change="update" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" />
     </div>
     <div class="hover-show" v-if="qualifications.url">

+ 2 - 2
components/default/RightBar.vue

@@ -203,7 +203,7 @@
               obj.type = 'LIST'
               if (!(/^1\d{10}$/).test(this.user.data.userTel)) {
                 this.$http.get('/basic/enterprise/' + obj.enUU + '/admin').then(response => {
-                  obj.userPhone = response.userTel
+                  obj.userPhone = response.data.userTel
                   this.openWebChat(newTab, obj)
                 }, err => {
                   console.log(err)
@@ -219,7 +219,7 @@
               obj.type = 'LIST'
               if (!(/^1\d{10}$/).test(this.user.data.userTel)) {
                 this.$http.get('/basic/enterprise/' + obj.enUU + '/admin').then(response => {
-                  obj.userPhone = response.userTel
+                  obj.userPhone = response.data.userTel
                   this.openWebChat(newTab, obj)
                 }, err => {
                   console.log(err)

+ 1 - 1
components/product/ComponentGoods.vue

@@ -54,7 +54,7 @@
           <!--<div class="multiple" v-if="compGoods.reserve > 0">
             倍数:<span>{{compGoods.minPackQty}}</span>
           </div>-->
-          <div class="can-div-sell" v-if="compGoods.reserve" v-text="compGoods.breakUp?'可拆卖':'不可拆卖'"></div>
+          <div class="can-div-sell" v-if="compGoods.reserve && compGoods.breakUp" v-text="compGoods.breakUp?'可拆卖':'不可拆卖'"></div>
         </td>
         <td>
           <div v-if="!compGoods.prices">

+ 1 - 1
components/product/component/StoreInfo.vue

@@ -71,7 +71,7 @@
                   <span>起拍:</span>
                   <span v-if="list.minBuyQty">{{list.minBuyQty}}</span>
                 </div>
-                <div class="can-div-sell" v-text="list.breakUp?'可拆卖':'不可拆卖'"></div>
+                <div class="can-div-sell" v-if="list.breakUp" v-text="list.breakUp?'可拆卖':'不可拆卖'"></div>
 
                 <!--<div>-->
                   <!--<span>倍数:</span>-->

+ 1 - 1
components/search/GoodList.vue

@@ -97,7 +97,7 @@
              <!-- <div class="multiple" v-if="item.reserve > 0">
                 倍数:<span v-text="item.minPackQty"></span>
               </div>-->
-              <div v-if="item.reserve" v-text="item.breakUp?'可拆卖':'不可拆卖'"></div>
+              <div v-if="item.reserve && item.breakUp" v-text="item.breakUp?'可拆卖':'不可拆卖'"></div>
             </td>
             <td>
               <div v-show="!item.prices">

+ 15 - 1
components/store/CommodityInfo.vue

@@ -14,6 +14,7 @@
     <div id="commodity-info-fragment">
       <div class="commodity-detail">
         <div class="img">
+          <img src="/images/floor/specificPrice-store.png" alt="" class="specific-price" v-if="isConsignment && isSpecificPriceTag(commodity.tag)">
           <img :src="commodity.img || '/images/store/common/default.png'" style="width: 256px;height: 256px;"/>
           <div class="box">
             <img v-if="commodity.status === 602" src="/images/store/isSellOut.png" alt="">
@@ -50,7 +51,7 @@
             <div class="com-info">
               <span class="name">库&nbsp;存</span>:<span v-text="commodity.reserve || 0"></span><em style="margin-left: 3px;">PCS</em>
               (<span v-text="commodity.minBuyQty || 1"></span>个起订)
-              <span :class="commodity.breakUp?'div-sell can-div-sell':'div-sell not-div-sell'" v-text="commodity.breakUp?'可拆卖':'不可拆卖'" ></span>
+              <span :class="commodity.breakUp?'div-sell can-div-sell':'div-sell not-div-sell'" v-if="commodity.breakUp">可拆卖</span>
             </div>
             <div class="com-info">
               <span class="name">交&nbsp;期</span>:
@@ -227,6 +228,9 @@
       },
       user () {
         return this.$store.state.option.user
+      },
+      isConsignment () {
+        return this.storeInfo.type === 'CONSIGNMENT'
       }
     },
     mounted () {
@@ -235,6 +239,9 @@
       })
     },
     methods: {
+      isSpecificPriceTag: function (tag) {
+        return tag && tag.indexOf('特价') !== -1
+      },
       onInput () {
         let prices = this.commodity.prices
         if (prices && prices.length) {
@@ -534,11 +541,18 @@
     float: left;
     width: 258px;
     height: 320px;
+    position: relative;
   }
 
   .commodity-detail .img >img {
       border: 1px solid #D6D3CE;
   }
+  .commodity-detail .img .specific-price {
+    position: absolute;
+    left: 0;
+    top: 0;
+    border: none;
+  }
 
   .commodity-detail .img  .box {
     height: 62px;

+ 1 - 1
components/store/CommodityList.vue

@@ -73,7 +73,7 @@
               <!--<div class="multiple">
                 倍数:<span>1</span>
               </div>-->
-              <div class="can-div-sell" v-if="commodity.reserve || commodity.status === 602" v-text="commodity.breakUp?'可拆卖':'不可拆卖'"></div>
+              <div class="can-div-sell" v-if="(commodity.reserve || commodity.status === 602) && commodity.breakUp">可拆卖</div>
             </td>
             <td>
               <div v-for="price in commodity.prices" v-text="price.start + '+'"></div>

+ 3 - 3
components/store/RecommendProduct.vue

@@ -15,14 +15,14 @@
             <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>
             <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</p>
           </div>
-          <div class="hover-show" :href="commodity.batchCode ? '/store/productDetail/'  + commodity.batchCode : ''">
-            <a :href="commodity.batchCode ? '/store/productDetail/' + commodity.batchCode : ''" class="href">
+          <div class="hover-show">
+            <nuxt-link :to="commodity.batchCode ? '/store/productDetail/' + commodity.batchCode : ''" class="href">
               <div class="title" v-text="commodity.comCode">MRFE6S9045NF001</div>
               <div class="type" v-text="commodity.brandNameCn">PANFAEFQ</div>
               <div class="hr"><span>抢购价</span></div>
               <div class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</div>
               <div class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</div>
-            </a>
+            </nuxt-link>
             <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>

+ 12 - 7
layouts/shop.vue

@@ -38,14 +38,19 @@
     },
     computed: {
       isInFrame () {
-        let cookies = this.$store.state.option.cookies
-        let cookieArr = cookies.split(';')
-        let cookieObj = {}
-        for (let i = 0; i < cookieArr.length; i++) {
-          let tmpArr = cookieArr[i].split('=')
-          cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+        if (this.$route.query.type === 'erp') {
+          this.$store.commit('option/ADD_COOKIES', 'type=erp;')
+          return true
+        } else {
+          let cookies = this.$store.state.option.cookies
+          let cookieArr = cookies.split(';')
+          let cookieObj = {}
+          for (let i = 0; i < cookieArr.length; i++) {
+            let tmpArr = cookieArr[i].split('=')
+            cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+          }
+          return cookieObj.type === 'erp'
         }
-        return cookieObj.type === 'erp'
       },
       title () {
         let path = this.$route.path

+ 8 - 4
pages/mobile/search/_keycode.vue

@@ -32,8 +32,9 @@
 
     <div class="detail-brand" v-for="(item, index) in searchLists" :style="index == 0 ? 'padding-top: .2rem;' : ''" v-if="searchLists.length > 0">
       <div class="brand-item" @click="goComponent(item.uuid)">
-        <p>型号:<span>{{item.code}}</span></p>
-        <p>品牌:<span>{{item.brandEn || item.brand.nameCn}}</span></p>
+        <p>店铺:<span>{{item.storeName || '-'}}</span></p>
+        <p>型号:<span>{{item.code || '-'}}</span></p>
+        <p>品牌:<span>{{item.brandEn || item.brand.nameCn || '-'}}</span></p>
         <p>产品描述:<span>{{item.description || '-'}}</span></p>
         <i class="iconfont icon-shoucang" :style="(item.isFocus)?'color:#ff7800':'color:#bbb'" @click="collect(item, $event)"></i>
       </div>
@@ -387,10 +388,13 @@
         }
         p{
           font-size:.28rem;
-          line-height:.4rem;
+          line-height:.5rem;
           color:#333;
           margin:0;
-          span{}
+          width: 5.8rem;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
         }
         i{
           display:block;

+ 5 - 5
server.js

@@ -5,7 +5,7 @@ const cookiejar = require('cookiejar')
 const host = process.env.HOST || '127.0.0.1'
 const port = process.env.PORT || 3000
 process.noDeprecation = true
-const url = require('url')
+// const url = require('url')
 
 app.set('port', port)
 
@@ -22,10 +22,10 @@ if (proxyTable) {
     res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE')
     res.header('Access-Control-Allow-Headers', 'Content-Type')
     res.header('Access-Control-Allow-Credentials', 'true')
-    const refer = res.req.headers.referer
-    if (refer && url.parse(refer, true).query.type === 'erp') {
-      res.cookie('type', 'erp')
-    }
+    // const refer = res.req.headers.referer
+    // if (refer && url.parse(refer, true).query.type === 'erp') {
+    //   res.cookie('type', 'erp')
+    // }
     next()
   })
   const defaultOptions = {