Browse Source

器件详情

hangb 8 years ago
parent
commit
3346d413cf

+ 11 - 3
components/product/brand/BrandComponent.vue

@@ -39,13 +39,13 @@
       </tbody>
     </table>
     <div style="float: right;">
-      <!--<page :total="totalCount" :page-size="pageSize" :current="nowPage"
-            v-on:childEvent="listenPage"></page>-->
+      <page :total="totalCount" :page-size="pageSize" :current="nowPage"
+            v-on:childEvent="listenPage"></page>
     </div>
   </div>
 </template>
 <script>
-  // import Page from '~components/common/page/pageComponent.vue'
+  import Page from '~components/common/page/pageComponent.vue'
   export default {
     name: 'BrandComponent',
     data () {
@@ -54,6 +54,9 @@
         nowPage: 1
       }
     },
+    components: {
+      Page
+    },
     computed: {
       lists () {
         let components = this.$store.state.brandComponent.component
@@ -64,6 +67,11 @@
         console.log(this.lists.data)
         return this.lists.data
       }
+    },
+    methods: {
+      listenChild: function (parm) {
+        this.$emit('childEvent', parm)
+      }
     }
   }
 </script>

+ 41 - 40
components/product/component/StoreInfo.vue

@@ -3,13 +3,12 @@
     <div class="form-group">
       <div class="storeIns">
         <div class="sign">选择商家:</div>
-        <div class="storeInList">
-          <!--<div>-->
-          <!--<a>-->
-          <!--&lt;!&ndash;<img ng-src="{{storeIn.logoUrl || 'static/img/all/default.png'}}" alt="storeIn.storeName" title="{{storeIn.storeName}}">&ndash;&gt;-->
-          <!--<img  src="/images/component/store.jpg" alt="" title=""/>-->
-          <!--</a>-->
-          <!--</div>-->
+        <div class="storeInList" v-for="item in store">
+          <div :class="{'storeIn-active' : item.isSelected, 'item' : !item.isSelected}">
+          <a>
+            <img :src="item.logoUrl || '/images/component/default.png'" :alt="item.storeName" :title="item.storeName">
+          </a>
+          </div>
         </div>
         <!--<div class="storeInList" ng-if="storeIns.length == 0" style="font-size: 14px">-->
         <div class="storeInList" style="font-size: 14px">
@@ -21,12 +20,11 @@
       <div>
         <div style="font-size: 14px">
           <span>产品匹配:</span>
-
-          <!--<input type="checkbox" ng-checked="!ignoreUMall" ng-click="toggleUMall()" ng-if="Storeexist && Umallexist">-->
-          <!--<span ng-if="Umallexist">&nbsp;库存寄售</span>-->
-          <!--<input type="checkbox" ng-checked="!ignoreStore" ng-click="toggleStore()" ng-if="Storeexist && Umallexist">-->
-          <!--<span ng-if="Storeexist">&nbsp;店铺自营</span>-->
-          <!--<span ng-if="storeIns.length==0">暂无可匹配的信息</span>-->
+          <input type="checkbox">
+          <span>&nbsp;库存寄售</span>
+          <input type="checkbox">
+          <span>&nbsp;店铺自营</span>
+          <!--<span v-if="storeIns.length==0">暂无可匹配的信息</span>-->
           <span>暂无可匹配的信息</span>
         </div>
       </div>
@@ -36,55 +34,55 @@
       <table class="table">
         <thead>
           <tr class="height54">
-            <th class="text-center" width="100">制造商型号</th>
-            <th class="text-center" width="120">生产日期</th>
-            <th class="text-center" width="80">包装方式</th>
-            <th class="text-center" width="150">库存</th>
-            <th class="text-center" width="80">数量</th>
-            <th class="text-center" width="100">香港交货<span style="font-size: 12px;">($)</span></th>
-            <th class="text-center" width="130">大陆交货<span style="font-size: 12px;">(¥)</span></th>
-            <th class="text-center" width="120">交期</span></th>
-            <th class="text-center" width="150">操作</th>
+            <th class="text-center" width="115">制造商型号</th>
+            <th class="text-center" width="138">生产日期</th>
+            <th class="text-center" width="92">包装方式</th>
+            <th class="text-center" width="173">库存</th>
+            <th class="text-center" width="92">数量</th>
+            <th class="text-center" width="116">香港交货<span style="font-size: 12px;">($)</span></th>
+            <th class="text-center" width="150">大陆交货<span style="font-size: 12px;">(¥)</span></th>
+            <th class="text-center" width="139">交期</span></th>
+            <th class="text-center" width="175">操作</th>
           </tr>
         </thead>
         <tbody class="text-center">
-          <tr style="cursor: pointer;">
-            <td>RT0805BRB0718K2L</td>
-            <td>2017-4-17</td>
-            <td>暂无包装方式</td>
+          <tr style="cursor: pointer;" v-for="list in storeList">
+            <td>{{list.code}}</td>
+            <td>{{list.produceDate}}</td>
+            <td>{{list.packaging || '暂无包装方式'}}</td>
             <td style="text-align: left;padding-left: 25px;">
               <div>
                 <span>库存:</span>
-                <span>xxx</span>
+                <span>{{list.reserve}}</span>
               </div>
               <div>
                 <span>起拍:</span>
-                <span>xxx</span>
+                <span>{{list.minBuyQty}}</span>
               </div>
               <div>
                 <span>倍数:</span>
-                <span>xxx</span>
+                <span>{{list.minPackQty}}</span>
               </div>
             </td>
             <td>
-              <div>
-                <span>xxx</span>+
+              <div v-for="price in list.prices">
+                <span>{{price.start}}</span>+
               </div>
             </td>
             <td>
-              <div>
-                <span>xxx</span>
+              <div v-for="price in list.prices">
+                <span>{{price.rMBPrice | formateNumber : 6 || ''}}</span>
               </div>
             </td>
             <td>
-              <div>
-                <span>xxx</span>
+              <div v-for="price in list.prices">
+                <span>{{price.rMBPrice | formateNumber : 6 || ''}}</span>
               </div>
             </td>
             <td>
-              <div>
+              <div v-show="list.b2cMinDelivery">
                 <span>香港:</span>
-                <span>xxx</span>-<span>xxx</span>
+                <span>{{list.b2cMinDelivery}}</span>-<span>{{list.b2cMaxDelivery}}</span>
               </div>
             </td>
             <td>
@@ -92,9 +90,10 @@
               <button class="btn btn-default">加入购物车</button>
             </td>
           </tr>
-          <!--<tr>-->
-            <!--<td colspan="10" class="text-center" style="line-height: 40px; font-size: 14px;"><i class="fa fa-smile-o fa-lg"></i> 暂无现货</td>-->
-          <!--</tr>-->
+          <!--<tr ng-if="$data.length == 0">-->
+          <tr>
+            <td colspan="10" class="text-center" style="line-height: 40px; font-size: 14px;"><i class="fa fa-smile-o fa-lg"></i> 暂无现货</td>
+          </tr>
         </tbody>
       </table>
     </div>
@@ -215,6 +214,8 @@
   }
   .container .height54{
     height: 54px;
+    background: none;
+    color: #333;
   }
   .container .height54 th{
     line-height: 54px;

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

@@ -4,7 +4,7 @@
       <brand-detail/>
       <div class="comm-list">
         <categories-list/>
-        <brand-component/>
+        <brand-component v-on:childEvent="listenChild"/>
       </div>
     </div>
   </div>
@@ -20,8 +20,14 @@
     },
     fetch ({ store, params }) {
       return Promise.all([
-        store.dispatch('loadBrandDetail', {id: params.code})
+        store.dispatch('loadBrandDetail', {id: params.code}),
+        store.dispatch('brandComponent', {page: 1})
       ])
+    },
+    methods: {
+      listenChild: function (parm) {
+        this.store.dispatch('brandComponent', {page: parm})
+      }
     }
   }
 </script>

+ 2 - 1
pages/product/component/_uuid.vue

@@ -18,7 +18,8 @@
       console.log(route.params.uuid)
       return Promise.all([
         store.dispatch('loadComponentDetail', {id: route.params.uuid}),
-        store.dispatch('loadComponentInformation', {count: 10, filter: { uuid: route.params.uuid.uuid, ignoreUMall: route.params.uuid.ignoreUMall, ignoreStore: route.params.uuid.ignoreStore, storeIds: route.params.uuid.storeIds }, page: 1, sorting: {minPriceRMB: route.params.uuid.minPriceRMB}})
+        store.dispatch('loadComponentStore', {id: route.params.uuid}),
+        store.dispatch('loadComponentInformation', {count: 10, filter: { uuid: 332233434, ignoreUMall: false, ignoreStore: true, storeIds: route.params.uuid.storeIds }, page: 1, sorting: {minPriceRMB: route.params.uuid.minPriceRMB}})
       ])
     },
     created () {

+ 9 - 2
store/index.js

@@ -177,7 +177,7 @@ export const actions = {
   },
   // 器件详情页选择商家
   loadComponentStore ({commit}, params = {}) {
-    let sid = params.id
+    let sid = params.uuid
     commit('componentStore/REQUEST_STORE', params)
     return axios.get(`/api/store-service/stores/uuid/${sid}`)
       .then(response => {
@@ -188,7 +188,14 @@ export const actions = {
       })
   },
   // 器件详情页商家信息列表
-  loadComponentInformation ({commit}, params = {}) {
+  loadComponentInformation ({commit}, uuid = '', ignoreUMALL = '', pageParams = { page: 1, count: 10 }) {
+    // let params = { uuid: uuid.uuid, ignoreUMALL: 'uuid.ignoreUMALL', ignoreStore: uuid.ignoreStore, storeIds: uuid.storeId, minPriceRMB: uuid.minPriceRMB }
+    let params = {}
+    console.log('ComponentInformation', params)
+    console.log('ComponentInformation', uuid)
+    console.log('ComponentInformation', ignoreUMALL)
+    params.page = pageParams.page
+    params.count = pageParams.count
     commit('componentInformation/REQUEST_INFORMATION', params)
     return axios.get('/api/commodity/goods/page', { params })
       .then(response => {