Browse Source

品牌详情代理商列表获取数据

hangb 8 years ago
parent
commit
97634b6489

+ 28 - 2
components/product/brand/BrandComponent.vue

@@ -40,7 +40,11 @@
         </tr>
       </tbody>
     </table>
-    <table class="table" v-if="activeTab == 1">
+    <div style="float: right;" v-if="activeTab == 0">
+      <page :total="list.totalElements" :page-size="pageParams.count"
+            :current="pageParams.page" @childEvent="handleCurrentChange"></page>
+    </div>
+    <table class="table supper-table" v-if="activeTab == 1">
       <thead>
       <tr class="bgf7">
         <th width="100"></th>
@@ -84,7 +88,7 @@
       </tr>
       </tbody>
     </table>
-    <div style="float: right;">
+    <div style="float: right;" v-if="activeTab == 1">
       <page :total="list.totalElements" :page-size="pageParams.count"
             :current="pageParams.page" @childEvent="handleCurrentChange"></page>
     </div>
@@ -117,6 +121,10 @@
       },
       brand () {
         return this.$store.state.brandDetail.detail.data
+      },
+      supplier () {
+        console.log(this.$store.state.supplierInformation.information)
+        return this.$store.state.supplierInformation.information.data
       }
     },
     methods: {
@@ -258,4 +266,22 @@
     font-size: 14px;
     color: #5078cb;
   }
+  .component-list .supper-table thead th.text-left{
+    text-align: left;
+  }
+  .component-list .supper-table tbody tr{
+    height: 74px;
+    vertical-align:middle ;
+  }
+  .component-list .supper-table tbody tr td{
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    max-width: 100px;
+  }
+  .component-list .supper-table tbody tr img{
+    width: 98px;
+    height: 49px;
+    border: 1px solid #dcdcdc;
+  }
 </style>

+ 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://www.usoftmall.com/' : 'http://192.168.253.60:9090/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://www.usoftmall.com/' : 'http://192.168.253.118:8080/platform-b2c/')
 
 module.exports = {
   router: {

+ 2 - 1
pages/product/brand/_code.vue

@@ -25,7 +25,8 @@
     },
     fetch ({ store, params }) {
       return Promise.all([
-        store.dispatch('loadBrandDetail', { id: params.code })
+        store.dispatch('loadBrandDetail', { id: params.code }),
+        store.dispatch('product/loadSupplierInformation', { uuid: params.code, count: 10, page: 1 })
       ])
     },
     methods: {

+ 16 - 0
store/product.js

@@ -134,5 +134,21 @@ export const actions = {
       }, err => {
         commit('common/GET_COLLECTLIST_FAILURE', err)
       })
+  },
+  // 供应商维护
+  loadSupplierInformation ({ commit }, params = {}) {
+    let uuid = params.uuid
+    let param = {
+      page: params.page,
+      count: params.count
+    }
+    commit('supplierInformation/REQUEST_INFORMATION')
+    return axios.get(`api/produce/vendorlist/${uuid}`, {params: param})
+      .then(response => {
+        console.log(response.data)
+        commit('supplierInformation/GET_INFORMATION_SUCCESS', response.data)
+      }, err => {
+        commit('supplierInformation/GET_INFORMATION_FAILURE', err)
+      })
   }
 }

+ 18 - 0
store/product/supplierInformation.js

@@ -0,0 +1,18 @@
+export const state = () => ({
+  information: {
+    fetching: false,
+    data: []
+  }
+})
+export const mutations = {
+  REQUEST_INFORMATION (state) {
+    state.information.fetching = true
+  },
+  GET_INFORMATION_FAILURE (state) {
+    state.information.fetching = false
+  },
+  GET_INFORMATION_SUCCESS (state, result) {
+    state.information.fetching = false
+    state.information.data = result
+  }
+}