Authored by yyq

share

<template>
<div class="topic-head">
<div class="topic-head" :style="headStyle">
<div class="center">
<p class="desc">{{data.topicDesc}}fhdjksghfjgdasjfghjadsgfhjdasgjkhdasgfoiuegquyfgbhjdksfgcadhjsgjkadsfoadjslfyeuioqwgfdhjsafadusyfghjdsagfjhkds</p>
<p class="desc">{{data.topicDesc}}</p>
<div v-if="showAttAmount" class="att-amount">
<label>{{data.attAmount}}人已关注</label>
</div>
... ... @@ -23,6 +23,11 @@
export default {
props: ['data'],
computed: {
headStyle() {
return {
'background-image': `url(//${this.data.topicImageUrl.split('//')[1]})`
};
},
showAttAmount() {
return this.data && +this.data.showAttAmount > 0;
},
... ... @@ -48,6 +53,7 @@ export default {
padding-top: 44PX;
box-sizing: border-box;
position: relative;
background-size: cover;
.center {
text-align: center;
... ...
... ... @@ -65,7 +65,12 @@ export default {
this.$emit('on-follow', follow);
},
onShare() {
this.$yoho.goShare({
title: this.data.topicName,
content: this.data.topicDesc,
url: window.location.href,
pic: this.data.topicImageUrl
});
}
}
};
... ...