Explorar o código

Merge remote-tracking branch 'origin/feature/yc-mobile_maimai-0525' into feature/yc-mobile_maimai-0525

yangc %!s(int64=7) %!d(string=hai) anos
pai
achega
c4569ba7d8

+ 1 - 1
components/home/Partner.vue

@@ -21,7 +21,7 @@
           href: 'http://www.worldshine.net/',
           img: '/images/partners/8.jpg'
         }, {
-          href: 'http://www.tidal.cn/docc/default.html',
+          href: 'http://www.fantem.cn/',
           img: '/images/partners/2.jpg'
         }, {
           href: 'http://www.huansujt.com',

+ 33 - 11
components/home/displayCard.vue

@@ -9,14 +9,22 @@
          <p><span>{{all}}家</span></p>
        </div>
        <div>
-         <p v-if="payMoney"><span>{{payMoney}}</span><span v-if="isShow">亿</span><span v-if="isMore">万</span></p>
-         <p v-else><span>0</span></p>
+         <p v-if="payMoney">
+           <span>{{payMoney}}</span>
+           <span v-text="isMore?'万':'元'" v-if="!isShow"></span>
+           <span v-if="isShow">亿</span>
+         </p>
+         <p v-else><span>0元</span></p>
        </div>
        <div>
-         <p v-if="allCount[1].count"><span>{{allCount[1].count}}条</span></p>
-         <p v-else><span>0</span></p>
+         <p v-if="inquirySheet.count">
+           <span>{{inquirySheet.count}}条</span>
+         </p>
+         <p v-else><span>0条</span></p>
        </div>
-       <a class="enter" @click="onRegisterClick"><img src="/images/all/enter.png"></a>
+       <a class="enter" @click="goStoreApply()">
+         <img src="/images/all/enter.png">
+       </a>
      </div>
   </div>
 </template>
@@ -39,6 +47,10 @@
         this.cardShow = false
       },
       formatNumber (num) {
+        if (num.toString().indexOf('E') !== -1) {
+          let arr = num.toString().split('E')
+          num = arr[0] * Math.pow(10, arr[1])
+        }
         if (num > 99999999) {
           this.isShow = true
           let str2 = num.toString()
@@ -47,7 +59,7 @@
             num = num + 1
           }
         }
-        if (num > 9999 && num < 99999999) {
+        if (num > 9999) {
           this.isMore = true
           let str = num.toString()
           num = Math.floor(num / 10000)
@@ -57,12 +69,16 @@
         }
         return num
       },
-      onRegisterClick () {
-        this.$http.get('/register/page').then(response => {
-          if (response.data) {
-            window.location.href = response.data.content
+      goStoreApply: function () {
+        if (this.user.logged) {
+          if (this.enterprise && this.enterprise.isVendor === 313) {
+            window.location.href = '/vendor#/store-apply'
+          } else {
+            this.$router.push('/register-saler')
           }
-        })
+        } else {
+          this.$router.push('/auth/login')
+        }
       }
     },
     computed: {
@@ -72,10 +88,16 @@
       payMoney () {
         return this.formatNumber(this.allCount[0].count)
       },
+      inquirySheet () {
+        return this.$store.state.count.inquirySheet.data
+      },
       all () {
         let count = this.$store.state.supplier.merchant.merchantAll.data
         let supplierCount = count.content ? count.totalElements + '' : '0'
         return supplierCount
+      },
+      enterprise () {
+        return this.user.data.enterprise
       }
     }
   }

+ 1 - 0
pages/index.vue

@@ -81,6 +81,7 @@
         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'),
         store.dispatch('loadBatchCommodities', {batchCodeList: store.state.option.url === 'http://www.usoftmall.com' ? [
           'BT2018013000000043',
           'BT2018013000000026',

BIN=BIN
static/images/all/displayCard.png


+ 14 - 0
store/count.js

@@ -2,6 +2,10 @@ export const state = () => ({
   allCount: {
     fetching: false,
     data: []
+  },
+  inquirySheet: {
+    fetching: false,
+    data: []
   }
 })
 
@@ -15,5 +19,15 @@ export const mutations = {
   GET_ALLCOUNT_SUCCESS (state, result) {
     state.allCount.fetching = false
     state.allCount.data = result
+  },
+  REQUEST_INQUIRYSHEET (state) {
+    state.inquirySheet.fetching = true
+  },
+  GET_INQUIRYSHEET_FAILURE (state) {
+    state.inquirySheet.fetching = false
+  },
+  GET_INQUIRYSHEET_SUCCESS (state, result) {
+    state.inquirySheet.fetching = false
+    state.inquirySheet.data = result
   }
 }

+ 11 - 1
store/index.js

@@ -437,7 +437,7 @@ export const actions = {
         commit('option/REQUEST_STORE_STATUS_FAILURE', err)
       })
   },
-  // 获取首页悬浮计数器
+  // 获取首页悬浮计数器交易金额
   loadAllCount ({commit}, params) {
     commit('count/REQUEST_ALLCOUNT')
     return axios.get('/api/product/commoncount', {params})
@@ -446,6 +446,16 @@ export const actions = {
       }, (err) => {
         commit('count/GET_ALLCOUNT_FAILURE', err)
       })
+  },
+  // 获取首页悬浮计数器询价单
+  loadInquirySheet ({commit}) {
+    commit('count/REQUEST_INQUIRYSHEET')
+    return axios.get('/inquiry/public/getPurcInquiryItemCount')
+      .then(res => {
+        commit('count/GET_INQUIRYSHEET_SUCCESS', res.data)
+      }, (err) => {
+        commit('count/GET_INQUIRYSHEET_FAILURE', err)
+      })
   }
 }