Authored by 邱骏

Merge branch 'feature/2019/1230-community-article' of http://git.yoho.cn/fe/xian…

…yu-ufo-app-web into feature/2019/1230-community-article
1 <template> 1 <template>
2 - <LayoutApp :show-back="true" title="社区详情"> 2 + <LayoutApp class="article-detail-container" :show-back="true" title="社区详情">
3 <div class="detail-container"> 3 <div class="detail-container">
4 4
5 <div class="author-container"> 5 <div class="author-container">
@@ -127,6 +127,12 @@ export default { @@ -127,6 +127,12 @@ export default {
127 </script> 127 </script>
128 128
129 <style lang="scss" scoped> 129 <style lang="scss" scoped>
  130 +.article-detail-container {
  131 + /deep/ .layout-context {
  132 + -webkit-overflow-scrolling: touch;
  133 + }
  134 +}
  135 +
130 .detail-container { 136 .detail-container {
131 background: #fff; 137 background: #fff;
132 } 138 }
@@ -62,6 +62,11 @@ export default { @@ -62,6 +62,11 @@ export default {
62 scroll-behavior: smooth; 62 scroll-behavior: smooth;
63 } 63 }
64 64
  65 +.horizontal-slide::-webkit-scrollbar {
  66 + display: none;
  67 + width: 0 !important;
  68 +}
  69 +
65 .list-warp { 70 .list-warp {
66 overflow-x: scroll; 71 overflow-x: scroll;
67 width: max-content; 72 width: max-content;
@@ -267,7 +267,7 @@ export default { @@ -267,7 +267,7 @@ export default {
267 267
268 // create watcher for list data 268 // create watcher for list data
269 this.watchList = []; 269 this.watchList = [];
270 - ['resource.url', 'topList', 'recommend'].forEach(key => { 270 + ['videoResource.url', 'resource.url', 'topList', 'recommend'].forEach(key => {
271 this.watchList.push(this.$watch(key, val => { 271 this.watchList.push(this.$watch(key, val => {
272 if (val) { 272 if (val) {
273 this.listDataDirty = true; 273 this.listDataDirty = true;
@@ -432,18 +432,53 @@ export default { @@ -432,18 +432,53 @@ export default {
432 * 2.P_PARAM:当前页面资源位code; 432 * 2.P_PARAM:当前页面资源位code;
433 * 3.PRD_ID:商品ID; 433 * 3.PRD_ID:商品ID;
434 * 4.ACTION_URL:资源位跳转URL; 434 * 4.ACTION_URL:资源位跳转URL;
  435 + * 5.F_ID:楼层唯一id;
  436 + * 6.F_NAME:楼层名称;
  437 + * 7.F_INDEX:楼层顺序号,从1开始递增;
  438 + * 8.I_INDEX:楼层内部顺序号,从1开始递增;
435 */ 439 */
  440 + const { template_id, template_name } = this.resource;
  441 + let yasParams = {
  442 + P_NAME: 'XY_UFOProductDetail',
  443 + P_PARAM: this.resourceContentCode,
  444 + PRD_ID: this.productId,
  445 + ACTION_URL: this.resource.url,
  446 + };
  447 +
  448 + if (template_id) {
  449 + yasParams = {...yasParams, F_ID: template_id, F_NAME: template_name, F_INDEX: 1, I_INDEX: 1};
  450 + }
436 this.yasTargets.banner = { 451 this.yasTargets.banner = {
437 el: { 452 el: {
438 offsetTop: this.$refs.resourceImg.offsetTop, 453 offsetTop: this.$refs.resourceImg.offsetTop,
439 offsetHeight: this.$refs.resourceImg.offsetHeight, 454 offsetHeight: this.$refs.resourceImg.offsetHeight,
440 }, 455 },
441 - yasParams: { 456 + yasParams
  457 + };
  458 + }
  459 +
  460 + if (this.$refs.videoResourceImg && this.videoResource.url && (!this.yasTargets.banner || force)) {
  461 + const { template_id, template_name } = this.videoResource;
  462 + let yasParams = {
442 P_NAME: 'XY_UFOProductDetail', 463 P_NAME: 'XY_UFOProductDetail',
443 - P_PARAM: this.resourceContentCode,  
444 PRD_ID: this.productId, 464 PRD_ID: this.productId,
445 - ACTION_URL: this.resource.url, 465 + ACTION_URL: this.videoResource.url,
  466 + };
  467 +
  468 + if (template_id) {
  469 + yasParams = {...yasParams,
  470 + F_ID: template_id,
  471 + F_NAME: template_name,
  472 + F_INDEX: 2,
  473 + I_INDEX: 2,
  474 + P_PARAM: this.resourceContentCode};
446 } 475 }
  476 + this.yasTargets.bannerVideo = {
  477 + el: {
  478 + offsetTop: this.$refs.videoResourceImg.offsetTop,
  479 + offsetHeight: this.$refs.videoResourceImg.offsetHeight,
  480 + },
  481 + yasParams
447 }; 482 };
448 } 483 }
449 484
@@ -843,13 +878,17 @@ export default { @@ -843,13 +878,17 @@ export default {
843 return; 878 return;
844 } 879 }
845 880
846 - const url = this.resource.url; 881 + const {url, template_id, template_name} = this.resource;
847 882
848 /** 883 /**
849 * 商品详情页中的资源位点击 884 * 商品详情页中的资源位点击
850 * XY_UFO_GDS_DT_BANNER_C 885 * XY_UFO_GDS_DT_BANNER_C
851 * 1.PRD_ID:商品ID 886 * 1.PRD_ID:商品ID
852 * 2.ACTION_URL:跳转的URL 887 * 2.ACTION_URL:跳转的URL
  888 + * 3.F_ID:楼层唯一id;
  889 + * 4.F_NAME:楼层名称;
  890 + * 5.F_INDEX:楼层顺序号,从1开始递增;
  891 + * 6.I_INDEX:楼层内部顺序号,从1开始递增;
853 */ 892 */
854 this.$store.dispatch('reportYas', { 893 this.$store.dispatch('reportYas', {
855 params: { 894 params: {
@@ -857,6 +896,10 @@ export default { @@ -857,6 +896,10 @@ export default {
857 param: { 896 param: {
858 PRD_ID: this.productId, 897 PRD_ID: this.productId,
859 ACTION_URL: url, 898 ACTION_URL: url,
  899 + F_ID: template_id,
  900 + F_NAME: template_name,
  901 + F_INDEX: 1,
  902 + I_INDEX: 1
860 }, 903 },
861 } 904 }
862 }); 905 });
@@ -928,6 +971,27 @@ export default { @@ -928,6 +971,27 @@ export default {
928 }, 971 },
929 onVideoPlay() { 972 onVideoPlay() {
930 this.$refs.videoPlayer.parentHandleclick(); 973 this.$refs.videoPlayer.parentHandleclick();
  974 +
  975 + const {url, template_id, template_name} = this.videoResource;
  976 + let param = {
  977 + PRD_ID: this.productId,
  978 + ACTION_URL: url,
  979 + };
  980 +
  981 + if (template_id) {
  982 + param = {...param,
  983 + F_ID: template_id,
  984 + F_NAME: template_name,
  985 + F_INDEX: 2,
  986 + I_INDEX: 2
  987 + };
  988 + }
  989 + this.$store.dispatch('reportYas', {
  990 + params: {
  991 + appop: 'XY_UFO_GDS_DT_BANNER_C',
  992 + param,
  993 + }
  994 + });
931 } 995 }
932 }, 996 },
933 997
@@ -40,8 +40,19 @@ export default { @@ -40,8 +40,19 @@ export default {
40 // 视频资源位 40 // 视频资源位
41 const videoResourceInfo = resource.find(r=> /(\.mp4)/.test(r.data[0].url)); 41 const videoResourceInfo = resource.find(r=> /(\.mp4)/.test(r.data[0].url));
42 videoResource = get(videoResourceInfo, 'data[0]', {}); 42 videoResource = get(videoResourceInfo, 'data[0]', {});
  43 + if (videoResourceInfo) {
  44 + const {template_id, template_name} = videoResourceInfo;
  45 + videoResource = {...videoResource, template_id, template_name }
43 } 46 }
  47 + }
  48 +
  49 + const resourceImgInfo = get(resource, '[0]', null);
44 resource = get(resource, '[0].data[0]', {}); 50 resource = get(resource, '[0].data[0]', {});
  51 + if(resourceImgInfo) {
  52 + const {template_id, template_name} = resourceImgInfo;
  53 + resource = {...resource, template_id, template_name }
  54 + }
  55 +
45 56
46 const {product_info = {}} = detail || {}; 57 const {product_info = {}} = detail || {};
47 commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(product_info, { 58 commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(product_info, {