Browse Source

Merge remote-tracking branch 'origin/release-201819-wangcz' into release-201819-wangcz

shenjj 7 years ago
parent
commit
7689575c94

+ 4 - 1
components/main/Search.vue

@@ -208,8 +208,8 @@
           if (route.path === '/search') {
             this.newSearchType = route.query.type || 'component'
             this.keyword = route.query.w || ''
+            this.isInit = true
           }
-          this.isInit = true
         },
         immediate: true
       }
@@ -248,10 +248,12 @@
       },
       onChange () {
         this.associate.activeIndex = null
+        console.log(this.isInit)
         if (!this.keyword) {
           this.associate.show = false
           this.$store.dispatch('resetSearchKeywords')
         } else {
+          console.log(1)
           if (!this.isInit) {
             this.searchKeywords()
           } else {
@@ -295,6 +297,7 @@
       },
       setNewSearchType (type) {
         this.newSearchType = type
+        this.onSearch()
       }
     },
     created () {

+ 5 - 5
components/search/ForwardGoodsList.vue

@@ -15,7 +15,7 @@
           <td>
             <div class="line">
               <span class="title inline-block">型号</span>
-              <span class="content inline-block" :title="item.code" v-text="item.code || '-'"></span>
+              <span class="content inline-block" :title="item.cmpCode" v-text="item.cmpCode || '-'"></span>
             </div>
             <div class="line">
               <span class="title inline-block">品牌</span>
@@ -25,7 +25,7 @@
           <td class="single">
             <div class="line">
               <span class="title inline-block">卖家</span>
-              <span class="content inline-block" :title="item.storeName">{{item.storeName || '-'}}</span>
+              <span class="content inline-block" :title="item.enName">{{item.enName || '-'}}</span>
             </div>
           </td>
           <td>
@@ -75,9 +75,9 @@
     },
     methods: {
       goSeek: function (item) {
-        this.productItem.cmpCode = item.code
-        this.productItem.brand = item.brand.nameEn
-        this.productItem.prodName = item.kind.nameCn
+        this.productItem.cmpCode = item.cmpCode
+        this.productItem.brand = item.pbrand || item.pbranden
+        this.productItem.prodName = item.kind || item.kinden
         this.productItem.spec = item.spec
         this.showSeekObj.show = true
       }

+ 6 - 7
components/search/GoodList.vue

@@ -64,12 +64,12 @@
           <!--</td>-->
             <td class="brand-code">
               <img v-if="item.status === 602" class="sellout-flag" src="/images/search/sellout-search.png" alt="">
-              <div class="brand" v-if="item.branduuid"><nuxt-link :to="`/product/brand/${item.branduuid}`" class="text-num" v-text="item.brandNameCn || item.brandNameEn || '-'"></nuxt-link></div>
-              <div class="brand" v-if="!item.brand||!item.brand.nameEn">{{item.brandEn||'—'}}</div>
-              <div class="brand" v-if="item.kindUuid"><nuxt-link :to="`/product/kind/${item.kindUuid}`" v-text="item.kindNameCn"></nuxt-link></div>
+              <div class="brand" v-if="item.branduuid"><a @click.stop="goRouter(`/product/brand/${item.branduuid}`)" class="text-num" v-text="item.brandNameCn || item.brandNameEn || '-'"></a></div>
+              <div class="brand" v-if="!item.branduuid">{{item.brandNameCn || item.brandNameEn || '-'}}</div>
+              <div class="brand" v-if="item.kindUuid"><a @click.stop="goRouter(`/product/kind/${item.kindUuid}`)" v-text="item.kindNameCn"></a></div>
               <div class="brand" v-if="!item.kindUuid">{{item.kindNameCn || '—'}}</div>
               <div class="code"  v-if="item.code">
-                <nuxt-link v-if="item.uuid" :to="`/product/component/${item.uuid}`" class="f16 text-bold text-num" v-text="item.code"></nuxt-link>
+                <a v-if="item.uuid" @click.stop="goRouter(`/product/component/${item.uuid}`)" class="f16 text-bold text-num" v-text="item.code"></a>
                 <span v-if="!item.uuid">{{item.code}}</span>
               </div>
               <div class="brand" v-if="!item.code">—</div>
@@ -82,8 +82,7 @@
             </td>
             <td>
               <div v-if="item.storeName">
-                <nuxt-link :to="'/store/' + item.storeId" v-text="item.storeName">
-                </nuxt-link>
+                <a @click.stop="goRouter('/store/' + item.storeId)" v-text="item.storeName"></a>
               </div>
               <div v-if="!item.storeName">—</div>
             </td>
@@ -135,7 +134,7 @@
               </div>
             </td>
             <td>
-              <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"><a @click.stop="goAttach(item.attach, $event)"><img src="/images/store/common/pdf.png" alt=""/></a></span>
               <span v-if="!item.attach">—</span>
             </td>
             <td>

+ 1 - 1
components/search/SupplierList.vue

@@ -14,7 +14,7 @@
             <span>地址:</span><span :title="item.enAddress">{{item.enAddress || '暂无信息'}}</span>
           </p>
           <p>
-            <span>邮箱:</span><span :title="item.enEmail">{{item.enEmail || '暂无信息'}}</span>
+            <span>邮箱:</span><span :title="item.enEmail">{{baseUtils.isEmptyStr(item.enEmail) ? '暂无信息' : item.enEmail}}</span>
             <span class="split_line">|</span>
             <span>电话:</span><span :title="item.enTel">{{item.enTel || '暂无信息'}}</span>
             <span class="split_line">|</span>

+ 1 - 1
nuxt.config.js

@@ -1,7 +1,7 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
 // b2c后台
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://192.168.253.121:9090/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://192.168.253.3:36002/')
 // 公共询价
 const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 // 公共物料

+ 2 - 2
pages/index.vue

@@ -58,8 +58,8 @@
         store.dispatch('loadNewsSnapshot', { page: 1, pageSize: 10 }),
         store.dispatch('supplier/loadVendorAll', {page: 1, size: 20}),
         store.dispatch('loadAllCount', {_status: 'actived', usedFor: 'mall_home_banner'}),
-        store.dispatch('loadInquirySheet', {year: nowYear, month: nowMonth}),
-        store.dispatch('loadInquirySheetLast', {year: nowYear, month: LastMonth}),
+        store.dispatch('loadInquirySheet'),
+//        store.dispatch('loadInquirySheetLast', {year: nowYear, month: LastMonth}),
         store.dispatch('provider/findSimilarStoreList', {page: 1, count: 10, type: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: ''}),
         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' })

+ 3 - 0
plugins/mixin.js

@@ -135,6 +135,9 @@ Vue.mixin({
       } else {
         this.login(window.location.href)
       }
+    },
+    goRouter (url) {
+      this.$router.push(url)
     }
   },
   filters: {

+ 6 - 2
store/count.js

@@ -32,7 +32,9 @@ export const mutations = {
   },
   GET_INQUIRYSHEET_SUCCESS (state, result) {
     state.inquirySheet.fetching = false
-    state.inquirySheet.data = result
+    state.inquirySheet.data = {
+      count: result
+    }
   },
   REQUEST_INQUIRYSHEETLAST (state) {
     state.inquirySheetLast.fetching = true
@@ -42,6 +44,8 @@ export const mutations = {
   },
   GET_INQUIRYSHEETLAST_SUCCESS (state, result) {
     state.inquirySheetLast.fetching = false
-    state.inquirySheetLast.data = result
+    state.inquirySheetLast.data = {
+      count: result
+    }
   }
 }

+ 3 - 10
store/index.js

@@ -453,19 +453,12 @@ export const actions = {
   // 获取首页悬浮计数器询价单
   loadInquirySheet ({commit}, params) {
     commit('count/REQUEST_INQUIRYSHEET')
-    return axios.get('/inquiry/public/getPurcInquiryItemCountByMonth', {params})
+    return axios.get('/inquiry/public/getCountOfLastAndThisMonth', {params})
       .then(res => {
-        commit('count/GET_INQUIRYSHEET_SUCCESS', res.data)
+        commit('count/GET_INQUIRYSHEET_SUCCESS', res.data.current || 0)
+        commit('count/GET_INQUIRYSHEETLAST_SUCCESS', res.data.last || 0)
       }, (err) => {
         commit('count/GET_INQUIRYSHEET_FAILURE', err)
-      })
-  },
-  loadInquirySheetLast ({commit}, params) {
-    commit('count/REQUEST_INQUIRYSHEETLAST')
-    return axios.get('/inquiry/public/getPurcInquiryItemCountByMonth', {params})
-      .then(res => {
-        commit('count/GET_INQUIRYSHEETLAST_SUCCESS', res.data)
-      }, (err) => {
         commit('count/GET_INQUIRYSHEETLAST_FAILURE', err)
       })
   },

+ 6 - 1
utils/baseUtils.js

@@ -456,6 +456,10 @@ const _onFileUpload = ($this, file) => {
   }
 }
 
+const _isEmptyStr = (str) => {
+  return !str || !str.trim()
+}
+
 export default {
   // 获取字符串字符长度
   getRealLen: _getRealLen,
@@ -497,5 +501,6 @@ export default {
   // 统一通知框
   setMessage: _setMessage,
   // 文件上传
-  onFileUpload: _onFileUpload
+  onFileUpload: _onFileUpload,
+  isEmptyStr: _isEmptyStr
 }