Authored by zhangwenxue

商品详情: 添加资源位数据异常处理

... ... @@ -14,7 +14,7 @@ export default {
return this.productDetail.goods_list[0].image_list;
},
resource() {
return this.productDetail.resource;
return this.productDetail.resource || {};
},
activity() {
return this.productDetail.activity;
... ...
... ... @@ -30,7 +30,7 @@
</div>
<div class="info-name"><div>{{productDetail.product_name}}</div></div>
</div>
<a class="banner" v-show="resource" @click.prevent="gotoNewPage">
<a class="banner" v-if="resource.src" @click.prevent="gotoNewPage">
<img-size ref="resourceImg" :src="sizeImg(resource.src)"/>
</a>
<div class="info">
... ...
... ... @@ -27,7 +27,7 @@ export default {
let [detail, resource, activity, recommend] = await Promise.all(queryTasks);
resource = get(resource, '[0].data[0]', null);
resource = get(resource, '[0].data[0]', {});
commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(detail.product_info, {
resource,
... ...