Authored by shuaiguo

feat(product-detail): 商品详情展示配置视频 reviewed by 张文文

... ... @@ -8,7 +8,7 @@ export default {
return state.products[productId];
},
async fetchProductInfo({ commit, state, rootGetters }, { productId }) {
const queryUrls = ['', '/resource', '/activity', '/recommend']
const queryUrls = ['', '/resource', '/activity', '/recommend', '/vedioImage']
if(rootGetters.getLogin) {
queryUrls.push('/limit/info')
}
... ... @@ -29,8 +29,11 @@ export default {
});
});
let [detail, resource, activity, recommend, limitInfo] = await Promise.all(queryTasks);
let [detail, resource, activity, recommend, vedioResource, limitInfo] = await Promise.all(queryTasks);
if(vedioResource) {
}
// 视频资源位
const videoResourceInfo = resource.find(r=> /(\.mp4)/.test(r.data[0].url));
const videoResource = get(videoResourceInfo, 'data[0]', {});
... ... @@ -224,5 +227,5 @@ export default {
});
return result;
}
},
};
... ...
... ... @@ -166,5 +166,15 @@ module.exports = {
product_id: {type: Number},
brand_id: {type: Number}
}
},
// 获取sku配置的视频连接
'/api/ufo/product/vedioImage': {
ufo: true,
auth: false,
api: 'ufo.product.vedioImage',
params: {
product_id: {type: Number},
}
}
};
... ...