Kaynağa Gözat

器件详情店铺信息

yangc 8 yıl önce
ebeveyn
işleme
f99d268075

+ 50 - 10
components/mobile/brand/ComponentDetail.vue

@@ -39,17 +39,17 @@
           </tr>
         </thead>
         <tbody>
-          <tr>
-            <td>优软商城</td>
+          <tr v-for="store in storeList.content">
+            <td>{{store.storeName || '-'}}</td>
             <td>
-              <div>盒装</div>
-              <div>可拆卖</div>
-              <div>2016+</div>
+              <div v-if="!store.packaging && !store.breakUp && !store.produceDate">-</div>
+              <div>{{store.packaging}}</div>
+              <div>{{store.breakUp?'可拆卖':'不可拆卖'}}</div>
+              <div>{{store.produceDate}}</div>
             </td>
             <td>
-              <div>盒装</div>
-              <div>可拆卖</div>
-              <div>2016+</div>
+              <div v-if="!store.prices || store.prices.length == 0">-</div>
+              <div v-for="price in store.prices">{{price.start}}+</div>
             </td>
             <td>
               <div>盒装</div>
@@ -63,19 +63,59 @@
           </tr>
         </tbody>
       </table>
-    </div>
+    </div>{{storeList}}
   </div>
 </template>
 <script>
   export default {
     data () {
       return {
-        activeType: 'store'
+        activeType: 'store',
+        storeIds: [],
+        UmallExist: false,
+        storeExist: false,
+        params: {
+          count: 10,
+          page: 1,
+          sorting: {'minPriceRMB': 'ASC'},
+          filter: {
+            uuid: this.$route.params.uuid,
+            ignoreUMall: false,
+            ignoreStore: false,
+            storeIds: ''
+          }
+        }
       }
     },
     computed: {
       component () {
         return this.$store.state.componentDetail.detail.data
+      },
+//      stores () {
+//        console.log(this.$store.state.componentStore.store.data)
+//        return this.$store.state.componentStore.store.data
+//      },
+      storeList () {
+        let storeList = this.$store.state.componentInformation.information.data
+        let _self = this
+        if (storeList.content) {
+          storeList.content.forEach(function (item) {
+            _self.storeIds.push(item.storeid)
+          })
+        }
+        if (this.storeIds.length > 0) {
+          if (this.storeIds.indexOf(this.storeId) === -1) {
+            this.storeExist = true
+          } else {
+            this.storeIds.splice(this.storeIds.indexOf(this.storeId), 1)
+            if (this.storeIds.length > 0) {
+              this.storeExist = true
+            }
+            this.UmallExist = true
+          }
+        }
+        console.log(storeList)
+        return storeList
       }
     }
   }

+ 12 - 1
pages/mobile/brand/componentDetail/_uuid.vue

@@ -11,7 +11,18 @@
     fetch ({ store, params }) {
       return Promise.all([
         store.dispatch('loadComponentDetail', {id: params.uuid}),
-        store.dispatch('loadComponentStore', {uuid: params.uuid})
+//        store.dispatch('loadComponentStore', {uuid: params.uuid}),
+        store.dispatch('loadComponentInformation',
+          {
+            count: 10,
+            page: 1,
+            sorting: {'minPriceRMB': 'ASC'},
+            filter: {
+              uuid: params.uuid,
+              ignoreUMall: false,
+              ignoreStore: false,
+              storeIds: ''
+            }})
       ])
     }
   }