Authored by 李奇

容错处理

@@ -27,24 +27,6 @@ export default { @@ -27,24 +27,6 @@ export default {
27 } 27 }
28 return this.src; 28 return this.src;
29 } 29 }
30 - },  
31 - mounted() {  
32 -// let timer;  
33 -// let img = new Image();  
34 -// let maxRetry = 30 * 1000;  
35 -// let start = Date.now();  
36 -//  
37 -// timer = setInterval(() => {  
38 -// img.src = this.$refs.image.src;  
39 -//  
40 -// if (!img.src) {  
41 -// clearInterval(timer);  
42 -// }  
43 -//  
44 -// if (img.complete || Date.now() - start > maxRetry) {  
45 -// clearInterval(timer);  
46 -// }  
47 -// }, 3000);  
48 } 30 }
49 }; 31 };
50 </script> 32 </script>
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <scroller ref="scroller" @loading="loading" class="channel-scroll"> 13 <scroller ref="scroller" @loading="loading" class="channel-scroll">
14 <component 14 <component
15 :is="component.template_name" 15 :is="component.template_name"
16 - v-for="(component, index) in floors.filter(c => ['twoPicture', 'goods', 'tfGoodsList', 'focus', 'blkCategory', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )" 16 + v-for="(component, index) in (floors || []).filter(c => ['twoPicture', 'goods', 'tfGoodsList', 'focus', 'blkCategory', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )"
17 :value="component.data" 17 :value="component.data"
18 :key="index"></component> 18 :key="index"></component>
19 </scroller> 19 </scroller>
@@ -29,12 +29,12 @@ export function createChannel() { @@ -29,12 +29,12 @@ export function createChannel() {
29 gender: 'men', 29 gender: 'men',
30 men: { 30 men: {
31 sort: {}, 31 sort: {},
32 - floors: {}, 32 + floors: [],
33 isFetching: false 33 isFetching: false
34 }, 34 },
35 women: { 35 women: {
36 sort: {}, 36 sort: {},
37 - floors: {}, 37 + floors: [],
38 isFetching: false 38 isFetching: false
39 }, 39 },
40 fethingHome: false, 40 fethingHome: false,