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
<template>
<LayoutApp :show-back="true" title="社区详情">
<LayoutApp class="article-detail-container" :show-back="true" title="社区详情">
<div class="detail-container">
<div class="author-container">
... ... @@ -127,6 +127,12 @@ export default {
</script>
<style lang="scss" scoped>
.article-detail-container {
/deep/ .layout-context {
-webkit-overflow-scrolling: touch;
}
}
.detail-container {
background: #fff;
}
... ...
... ... @@ -62,6 +62,11 @@ export default {
scroll-behavior: smooth;
}
.horizontal-slide::-webkit-scrollbar {
display: none;
width: 0 !important;
}
.list-warp {
overflow-x: scroll;
width: max-content;
... ...
... ... @@ -267,7 +267,7 @@ export default {
// create watcher for list data
this.watchList = [];
['resource.url', 'topList', 'recommend'].forEach(key => {
['videoResource.url', 'resource.url', 'topList', 'recommend'].forEach(key => {
this.watchList.push(this.$watch(key, val => {
if (val) {
this.listDataDirty = true;
... ... @@ -432,18 +432,53 @@ export default {
* 2.P_PARAM:当前页面资源位code;
* 3.PRD_ID:商品ID;
* 4.ACTION_URL:资源位跳转URL;
* 5.F_ID:楼层唯一id;
* 6.F_NAME:楼层名称;
* 7.F_INDEX:楼层顺序号,从1开始递增;
* 8.I_INDEX:楼层内部顺序号,从1开始递增;
*/
const { template_id, template_name } = this.resource;
let yasParams = {
P_NAME: 'XY_UFOProductDetail',
P_PARAM: this.resourceContentCode,
PRD_ID: this.productId,
ACTION_URL: this.resource.url,
};
if (template_id) {
yasParams = {...yasParams, F_ID: template_id, F_NAME: template_name, F_INDEX: 1, I_INDEX: 1};
}
this.yasTargets.banner = {
el: {
offsetTop: this.$refs.resourceImg.offsetTop,
offsetHeight: this.$refs.resourceImg.offsetHeight,
},
yasParams: {
P_NAME: 'XY_UFOProductDetail',
P_PARAM: this.resourceContentCode,
PRD_ID: this.productId,
ACTION_URL: this.resource.url,
}
yasParams
};
}
if (this.$refs.videoResourceImg && this.videoResource.url && (!this.yasTargets.banner || force)) {
const { template_id, template_name } = this.videoResource;
let yasParams = {
P_NAME: 'XY_UFOProductDetail',
PRD_ID: this.productId,
ACTION_URL: this.videoResource.url,
};
if (template_id) {
yasParams = {...yasParams,
F_ID: template_id,
F_NAME: template_name,
F_INDEX: 2,
I_INDEX: 2,
P_PARAM: this.resourceContentCode};
}
this.yasTargets.bannerVideo = {
el: {
offsetTop: this.$refs.videoResourceImg.offsetTop,
offsetHeight: this.$refs.videoResourceImg.offsetHeight,
},
yasParams
};
}
... ... @@ -843,13 +878,17 @@ export default {
return;
}
const url = this.resource.url;
const {url, template_id, template_name} = this.resource;
/**
* 商品详情页中的资源位点击
* XY_UFO_GDS_DT_BANNER_C
* 1.PRD_ID:商品ID
* 2.ACTION_URL:跳转的URL
* 3.F_ID:楼层唯一id;
* 4.F_NAME:楼层名称;
* 5.F_INDEX:楼层顺序号,从1开始递增;
* 6.I_INDEX:楼层内部顺序号,从1开始递增;
*/
this.$store.dispatch('reportYas', {
params: {
... ... @@ -857,6 +896,10 @@ export default {
param: {
PRD_ID: this.productId,
ACTION_URL: url,
F_ID: template_id,
F_NAME: template_name,
F_INDEX: 1,
I_INDEX: 1
},
}
});
... ... @@ -928,6 +971,27 @@ export default {
},
onVideoPlay() {
this.$refs.videoPlayer.parentHandleclick();
const {url, template_id, template_name} = this.videoResource;
let param = {
PRD_ID: this.productId,
ACTION_URL: url,
};
if (template_id) {
param = {...param,
F_ID: template_id,
F_NAME: template_name,
F_INDEX: 2,
I_INDEX: 2
};
}
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_GDS_DT_BANNER_C',
param,
}
});
}
},
... ...
... ... @@ -40,8 +40,19 @@ export default {
// 视频资源位
const videoResourceInfo = resource.find(r=> /(\.mp4)/.test(r.data[0].url));
videoResource = get(videoResourceInfo, 'data[0]', {});
if (videoResourceInfo) {
const {template_id, template_name} = videoResourceInfo;
videoResource = {...videoResource, template_id, template_name }
}
}
const resourceImgInfo = get(resource, '[0]', null);
resource = get(resource, '[0].data[0]', {});
if(resourceImgInfo) {
const {template_id, template_name} = resourceImgInfo;
resource = {...resource, template_id, template_name }
}
const {product_info = {}} = detail || {};
commit(Types.UPDATE_PRODUCT_DETAIL, Object.assign(product_info, {
... ...