Browse Source

首页悬浮

gaoxm 7 years ago
parent
commit
888daf4f32
4 changed files with 34 additions and 3 deletions
  1. 8 2
      components/home/displayCard.vue
  2. 1 0
      pages/index.vue
  3. 14 0
      store/count.js
  4. 11 1
      store/index.js

+ 8 - 2
components/home/displayCard.vue

@@ -17,8 +17,8 @@
          <p v-else><span>0元</span></p>
        </div>
        <div>
-         <p v-if="allCount[1].count">
-           <span>{{allCount[1].count}}条</span>
+         <p v-if="inquirySheet.count">
+           <span>{{inquirySheet.count}}条</span>
          </p>
          <p v-else><span>0条</span></p>
        </div>
@@ -88,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

@@ -80,6 +80,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',

+ 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)
+      })
   }
 }