Browse Source

Merge remote-tracking branch 'origin/master'

gaoxm 7 năm trước cách đây
mục cha
commit
db3f56e5ba

+ 2 - 2
components/applyPurchase/ApplyInfo.vue

@@ -159,10 +159,10 @@
         return str.substring(0, 3) + '****' + str.substring(7, 11)
       },
       enterpriseFilter (str) {
-        return str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str
+        return str ? str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str : '-'
       },
       userNameFilter (str) {
-        return str.substring(0, 1) + '**'
+        return str ? str.substring(0, 1) + '**' : '-'
       }
     },
     computed: {

+ 1 - 1
components/applyPurchase/BatchPublish.vue

@@ -338,7 +338,7 @@
           str = str.substring(0, str.length - 1)
           param.spIds = str
         }
-        this.$http.post('/seek/confirmBom', param)
+        this.$http.post('/seek/confirmBom?bomId=' + Number(this.$route.params.id))
           .then(response => {
             if (response.data.success) {
 //              this.showRemindBox = true

+ 6 - 3
components/applyPurchase/PublishApply.vue

@@ -13,7 +13,7 @@
     </div>
     <div class="publish-area">
       <div class="publish-form-area">
-        <p>单个发布</p>
+        <p>单个求购</p>
         <div>
           <div class="form-item">
             <span>
@@ -81,7 +81,7 @@
         <a @click="goPublish()">发布求购</a>
       </div>
       <div class="publish-upload">
-        <h1>批量发布</h1>
+        <h1>批量求购</h1>
         <h2>3秒一键配单采购</h2>
         <label>
           <img src="/images/applyPurchase/upload.png" alt="" />
@@ -442,7 +442,9 @@
         }
       },
       onSuccess: function (data) {
-        if (data.success) {
+        if (!this.user.logged) {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        } else if (data.success) {
           window.open('/applyPurchase/' + data.data)
         } else {
           this.$message.error(data.message)
@@ -685,6 +687,7 @@
         }
         .download-line {
           cursor: pointer;
+          color: #b47200;
         }
         .apply-logo {
           position: absolute;

+ 8 - 2
components/default/Header.vue

@@ -79,7 +79,13 @@
       enterprise () {
         let ens = this.user.data.enterprises
         if (ens && ens.length) {
-          return ens.find(item => item.current) || {enName: '个人账户'}
+          for (let i = 0; i < ens.length; i++) {
+            if (ens[i].current) {
+              return ens[i]
+            }
+          }
+          return {enName: '个人账户'}
+//          return ens.find(item => item.current) || {enName: '个人账户'}
         } else {
           return {enName: '个人账户'}
         }
@@ -154,7 +160,7 @@
           if (tempEnterprise.isVendor === 313) {
             window.location.href = '/vendor#/index'
           } else {
-            window.location.href = '/register_saler'
+            window.location.href = '/register-saler'
           }
         }
       }

+ 16 - 4
components/main/Search.vue

@@ -84,16 +84,28 @@
       hotSearchData () {
         let list = this.$store.state.floor.list_v3.data
         let obj = {}
-        if (list && list.length > 0) {
-          obj = list.find(item => item.floorNumber === 2) || {}
+        if (list && list.length) {
+          for (let i = 0; i < list.length; i++) {
+            if (list[i].floorNumber === 2) {
+              obj = list[i]
+            }
+          }
+//          obj = list.find(item => item.floorNumber === 2) || {}
         }
         return obj
       },
       ifFloorsHotSearchInValid () {
         let obj = this.hotSearchData
+        let tmp = false
         if (obj.items && obj.items.length) {
-          let result = obj.items.find(item => !item.body || item.body === '') || true
-          return result !== true
+          for (let i = 0; i < obj.items.length; i++) {
+            if (!obj.items[i].body || obj.items[i].body === '') {
+              tmp = obj.items[i]
+              break
+            }
+          }
+//          let result = obj.items.find(item => !item.body || item.body === '') || true
+          return tmp || true
         }
         return true
       }

+ 0 - 2
components/personalMaterial/PersonalMaterial.vue

@@ -199,8 +199,6 @@
     }
     > a {
       line-height: 71px;
-      position: relative;
-      right: 105px;
     }
     .personal-material-header {
       height: 111px;

+ 18 - 2
components/search/GoodList.vue

@@ -134,8 +134,8 @@
               </div>
             </td>
             <td>
-              <span v-if="item.attach && item.attach !=='1'"><a :href="item.attach" target="_blank"><img src="/images/store/common/pdf.png" alt=""/></a></span>
-              <span v-show="!item.attach || item.attach =='1'">—</span>
+              <span v-if="item.attach"><a @click="goAttach(item.attach, $event)"><img src="/images/store/common/pdf.png" alt=""/></a></span>
+              <span v-if="!item.attach">—</span>
             </td>
             <td>
               <div v-show="!item.reserve">
@@ -241,6 +241,22 @@
       }
     },
     methods: {
+      goAttach: function (url, event) {
+        event.stopPropagation()
+        if (this.user.logged) {
+          if (url && url !== '1') {
+            window.open(url)
+          } else {
+            this.$message.error('规格书地址错误')
+          }
+        } else {
+          this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+            if (response.data) {
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+            }
+          })
+        }
+      },
       listenPage: function (changedPage) {
         this.nowPage = changedPage
         this.$emit('pageEvent', this.nowPage)

+ 7 - 3
components/store/CommodityInfo.vue

@@ -512,14 +512,18 @@
         }
       },
       toAttach: function (url) {
-        if (url === '1') {
+        if (this.user.logged) {
+          if (url && url !== '1') {
+            window.open(url)
+          } else {
+            this.$message.error('规格书地址错误')
+          }
+        } else {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
               window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
             }
           })
-        } else {
-          window.open(url)
         }
       }
     }

+ 18 - 2
components/store/CommodityList.vue

@@ -104,9 +104,9 @@
             </td>
             <td>
               <div v-if="commodity.attach">
-                <a :href="commodity.attach && commodity.attach !== '1'" target="_blank"><img src="/images/store/common/pdf.png" alt=""/></a>
+                <a @click="goAttach(commodity.attach, $event)" target="_blank"><img src="/images/store/common/pdf.png" alt=""/></a>
               </div>
-              <div v-show="!commodity.attach || commodity.attach == '1'">—</div>
+              <div v-if="!commodity.attach">—</div>
             </td>
             <td>
               <buy :item="commodity" :disabledFlag="commodity.status === 602"></buy>
@@ -227,6 +227,22 @@ export default {
     }
   },
   methods: {
+    goAttach: function (url, event) {
+      event.stopPropagation()
+      if (this.user.logged) {
+        if (url && url !== '1') {
+          window.open(url)
+        } else {
+          this.$message.error('规格书地址错误')
+        }
+      } else {
+        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+          if (response.data) {
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+          }
+        })
+      }
+    },
     isSpecificPriceTag: function (tag) {
       return tag && tag.indexOf('特价') !== -1
     },

+ 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://10.1.51.90:8080/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://192.168.253.121:9090/platform-b2c/')
 const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 
 module.exports = {

BIN
static/images/applyPurchase/download.png


BIN
static/images/applyPurchase/publish-apply-bg.png


BIN
static/images/applyPurchase/upload.png