Browse Source

页面链接 分页 获取数据

hangb 8 years ago
parent
commit
be73241678
3 changed files with 11 additions and 22 deletions
  1. 8 5
      components/product/brand/BrandComponent.vue
  2. 0 4
      pages/product/brand/_code.vue
  3. 3 13
      store/index.js

+ 8 - 5
components/product/brand/BrandComponent.vue

@@ -72,9 +72,6 @@
       },
       },
       brand () {
       brand () {
         return this.$store.state.brandDetail.detail.data
         return this.$store.state.brandDetail.detail.data
-      },
-      totalCount () {
-        return this.list.totalElements
       }
       }
     },
     },
     methods: {
     methods: {
@@ -96,8 +93,6 @@
         this.pageParams.page = page
         this.pageParams.page = page
         this.pageParams.filter.brandid = this.brand.id
         this.pageParams.filter.brandid = this.brand.id
         this.pageCmpGoods(this.pageParams)
         this.pageCmpGoods(this.pageParams)
-      listenPage: function (parm) {
-        this.$emit('childEvent', parm)
       }
       }
     }
     }
   }
   }
@@ -147,6 +142,14 @@
   .component-list table tbody tr{
   .component-list table tbody tr{
     text-align: center;
     text-align: center;
   }
   }
+  .component-list .table>tbody>tr>td{
+    vertical-align: middle;
+    border-top: #e8e8e8 1px solid;
+  }
+  .component-list table tbody tr td a{
+    color: #337ab7;
+    font-size: 12px;
+  }
   .component-list .btn-default {
   .component-list .btn-default {
     color: #214797;
     color: #214797;
     font-size: 12px;
     font-size: 12px;

+ 0 - 4
pages/product/brand/_code.vue

@@ -25,14 +25,10 @@
     },
     },
     fetch ({ store, params }) {
     fetch ({ store, params }) {
       return Promise.all([
       return Promise.all([
-        store.dispatch('loadBrandDetail', {id: params.code}),
-        store.dispatch('loadBrandComponent', {page: 1})
         store.dispatch('loadBrandDetail', { id: params.code })
         store.dispatch('loadBrandDetail', { id: params.code })
       ])
       ])
     },
     },
     methods: {
     methods: {
-      listenChild: function (parm) {
-        this.store.dispatch('loadBrandComponent', {page: parm})
       listenChild: function (brand) {
       listenChild: function (brand) {
         this.$store.dispatch('loadBrandPages', {count: 10, filter: { brandid: brand.id }, page: brand.page})
         this.$store.dispatch('loadBrandPages', {count: 10, filter: { brandid: brand.id }, page: brand.page})
       }
       }

+ 3 - 13
store/index.js

@@ -193,6 +193,7 @@ export const actions = {
     commit('componentInformation/REQUEST_INFORMATION')
     commit('componentInformation/REQUEST_INFORMATION')
     return axios.get('/api/commodity/goods/page', { params })
     return axios.get('/api/commodity/goods/page', { params })
       .then(response => {
       .then(response => {
+        console.log(response.data)
         commit('componentInformation/GET_INFORMATION_SUCCESS', response.data)
         commit('componentInformation/GET_INFORMATION_SUCCESS', response.data)
       }, err => {
       }, err => {
         commit('componentInformation/GET_INFORMATION_FAILURE', err)
         commit('componentInformation/GET_INFORMATION_FAILURE', err)
@@ -206,12 +207,11 @@ export const actions = {
     return axios.get(`/api/product/brand/${id}`)
     return axios.get(`/api/product/brand/${id}`)
       .then(response => {
       .then(response => {
         let brand = response.data || {}
         let brand = response.data || {}
+        console.log('loadBrandDetail', response.data !== null)
         commit('brandDetail/GET_DETAIL_SUCCESS', response.data)
         commit('brandDetail/GET_DETAIL_SUCCESS', response.data)
         return Promise.all([
         return Promise.all([
-          loadBrandCategories({ commit }, { id: brand.id }),
-          loadBrandComponent({ commit }, {count: 10, filter: { brandid: brand.id }, page: 1})
           loadBrandCategories({ commit }, {id: brand.id}),
           loadBrandCategories({ commit }, {id: brand.id}),
-          loadBrandComponent({ commit }, {count: 10, filter: { brandid: brand.id }})
+          loadBrandComponent({ commit }, {count: 10, filter: { brandid: brand.id }, page: 1})
         ])
         ])
       }, err => {
       }, err => {
         commit('brandDetail/GET_DETAIL_FAILURE', err)
         commit('brandDetail/GET_DETAIL_FAILURE', err)
@@ -238,16 +238,6 @@ export const actions = {
         commit('brandComponent/GET_COMPONENT_FAILURE', err)
         commit('brandComponent/GET_COMPONENT_FAILURE', err)
       })
       })
   },
   },
-  // 获取品牌详情分页信息
-  loadBrandPages ({commit}, params = {}) {
-    commit('brandPages/REQUEST_PAGES', params)
-    return axios.get('/api/product/PAGES/list', { params })
-      .then(response => {
-        commit('brandPages/GET__SUCCESS', response.data)
-      }, err => {
-        commit('brandPages/GET_COMPONENT_FAILURE', err)
-      })
-  },
   // 获取帮助中心信息
   // 获取帮助中心信息
   loadHelpSnapsho ({ commit }, params = {}) {
   loadHelpSnapsho ({ commit }, params = {}) {
     commit('help/REQUEST_SNAPSHO')
     commit('help/REQUEST_SNAPSHO')