Browse Source

品牌中心新增代理商信息

hangb 8 years ago
parent
commit
8076eba229
3 changed files with 19 additions and 34 deletions
  1. 17 26
      components/product/brand/BrandComponent.vue
  2. 1 6
      pages/product/brand/_code.vue
  3. 1 2
      store/product.js

+ 17 - 26
components/product/brand/BrandComponent.vue

@@ -52,35 +52,28 @@
         <th width="200">地址</th>
         <th width="110">电话</th>
         <th width="110">传真</th>
-        <th width="120">邮箱/网址</th>
+        <th width="110">邮箱</th>
+        <th width="120">网址</th>
       </tr>
       </thead>
       <tbody>
-      <tr class="text-center">
-        <td><img src="/images/brandList/empty-cart.png" alt=""></td>
-        <td>深圳市华商龙商务互联科技有限公司</td>
-        <td>深圳市南山区
-          科技园科技南五路英唐大厦一楼...
-        </td>
-        <td>
-          0755-26038000
-        </td>
-        <td>
-          0755-26038000
-        </td>
-        <td>
-          123456789@qq.com...
-          http://www.worldshine.net...
-        </td>
+      <tr class="text-center" v-for="item in supplier.content">
+        <td><img :src="item.img || '/images/store/common/default.png'" alt="" class="showImg"></td>
+        <td v-show="item.vendorName">深圳市华商龙商务互联科技有限公司</td>
+        <td v-show="item.detailAddress">深圳市南山区 科技园科技南五路英唐大厦一楼...</td>
+        <td v-show="item.tel">0755-26038000 </td>
+        <td v-show="item.fax"> 0755-26038000 </td>
+        <td v-show="item.email"> 123456789@qq.com... </td>
+        <td v-show="item.website"> http://www.worldshine.net... </td>
       </tr>
-      <tr v-if="!list.content || list.content.length === 0">
+      <tr v-if="!supplier.content || supplier.content.length === 0">
         <td colspan="10" class="text-center">
           <div class="empty">
             <div class="empty-img">
               <img src="/images/brandList/empty-cart.png">
             </div>
             <div class="empty-info">
-              <p class="grey f16"> 暂无器件信息 </p>
+              <p class="grey f16"> 暂无供应商信息 </p>
               <i class="fa fa-mail-reply fa-xs"></i>&nbsp;<a href="javascript:history.go(-1)">返回上一页</a>
             </div>
           </div>
@@ -88,10 +81,6 @@
       </tr>
       </tbody>
     </table>
-    <div style="float: right;" v-if="activeTab == 1">
-      <page :total="list.totalElements" :page-size="pageParams.count"
-            :current="pageParams.page" @childEvent="handleCurrentChange"></page>
-    </div>
   </div>
 </template>
 <script>
@@ -123,8 +112,7 @@
         return this.$store.state.brandDetail.detail.data
       },
       supplier () {
-        console.log(this.$store.state.supplierInformation.information)
-        return this.$store.state.supplierInformation.information.data
+        return this.$store.state.product.supplierInformation.information.data
       }
     },
     methods: {
@@ -150,6 +138,9 @@
         this.pageParams.page = page
         this.pageParams.filter.brandid = this.brand.id
         this.pageCmpGoods(this.pageParams)
+      },
+      listenChild: function (brand) {
+        this.$store.dispatch('loadBrandPages', {count: 10, filter: { brandid: brand.id }, page: brand.page})
       }
     }
   }
@@ -279,7 +270,7 @@
     white-space: nowrap;
     max-width: 100px;
   }
-  .component-list .supper-table tbody tr img{
+  .component-list .supper-table tbody tr img.showImg{
     width: 98px;
     height: 49px;
     border: 1px solid #dcdcdc;

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

@@ -26,13 +26,8 @@
     fetch ({ store, params }) {
       return Promise.all([
         store.dispatch('loadBrandDetail', { id: params.code }),
-        store.dispatch('product/loadSupplierInformation', { uuid: params.code, count: 10, page: 1 })
+        store.dispatch('product/loadSupplierInformation', { uuid: params.code, count: 5, page: 1 })
       ])
-    },
-    methods: {
-      listenChild: function (brand) {
-        this.$store.dispatch('loadBrandPages', {count: 10, filter: { brandid: brand.id }, page: brand.page})
-      }
     }
   }
 </script>

+ 1 - 2
store/product.js

@@ -143,9 +143,8 @@ export const actions = {
       count: params.count
     }
     commit('supplierInformation/REQUEST_INFORMATION')
-    return axios.get(`api/produce/vendorlist/${uuid}`, {params: param})
+    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)