Authored by shuaiguo

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

@@ -8,7 +8,7 @@ export default { @@ -8,7 +8,7 @@ export default {
8 return state.products[productId]; 8 return state.products[productId];
9 }, 9 },
10 async fetchProductInfo({ commit, state, rootGetters }, { productId }) { 10 async fetchProductInfo({ commit, state, rootGetters }, { productId }) {
11 - const queryUrls = ['', '/resource', '/activity', '/recommend'] 11 + const queryUrls = ['', '/resource', '/activity', '/recommend', '/vedioImage']
12 if(rootGetters.getLogin) { 12 if(rootGetters.getLogin) {
13 queryUrls.push('/limit/info') 13 queryUrls.push('/limit/info')
14 } 14 }
@@ -29,8 +29,11 @@ export default { @@ -29,8 +29,11 @@ export default {
29 }); 29 });
30 }); 30 });
31 31
32 - let [detail, resource, activity, recommend, limitInfo] = await Promise.all(queryTasks); 32 + let [detail, resource, activity, recommend, vedioResource, limitInfo] = await Promise.all(queryTasks);
  33 +
  34 + if(vedioResource) {
33 35
  36 + }
34 // 视频资源位 37 // 视频资源位
35 const videoResourceInfo = resource.find(r=> /(\.mp4)/.test(r.data[0].url)); 38 const videoResourceInfo = resource.find(r=> /(\.mp4)/.test(r.data[0].url));
36 const videoResource = get(videoResourceInfo, 'data[0]', {}); 39 const videoResource = get(videoResourceInfo, 'data[0]', {});
@@ -224,5 +227,5 @@ export default { @@ -224,5 +227,5 @@ export default {
224 }); 227 });
225 228
226 return result; 229 return result;
227 - } 230 + },
228 }; 231 };
@@ -166,5 +166,15 @@ module.exports = { @@ -166,5 +166,15 @@ module.exports = {
166 product_id: {type: Number}, 166 product_id: {type: Number},
167 brand_id: {type: Number} 167 brand_id: {type: Number}
168 } 168 }
  169 + },
  170 +
  171 + // 获取sku配置的视频连接
  172 + '/api/ufo/product/vedioImage': {
  173 + ufo: true,
  174 + auth: false,
  175 + api: 'ufo.product.vedioImage',
  176 + params: {
  177 + product_id: {type: Number},
  178 + }
169 } 179 }
170 }; 180 };