Authored by yyq

topic publish

@@ -24,6 +24,10 @@ export default { @@ -24,6 +24,10 @@ export default {
24 props: ['data'], 24 props: ['data'],
25 computed: { 25 computed: {
26 headStyle() { 26 headStyle() {
  27 + if (!this.data.topicImageUrl) {
  28 + return {};
  29 + }
  30 +
27 return { 31 return {
28 'background-image': `url(//${this.data.topicImageUrl.split('//')[1]})` 32 'background-image': `url(//${this.data.topicImageUrl.split('//')[1]})`
29 }; 33 };
@@ -66,7 +66,7 @@ export default { @@ -66,7 +66,7 @@ export default {
66 }, 66 },
67 onShare() { 67 onShare() {
68 this.$yoho.share({ 68 this.$yoho.share({
69 - title: this.data.topicName, 69 + title: '#' + this.data.topicName,
70 imgUrl: this.data.topicImageUrl, 70 imgUrl: this.data.topicImageUrl,
71 link: window.location.href.split('?')[0], 71 link: window.location.href.split('?')[0],
72 desc: this.data.topicDesc, 72 desc: this.data.topicDesc,
@@ -49,6 +49,13 @@ @@ -49,6 +49,13 @@
49 </template> 49 </template>
50 </LayoutRecycleList> 50 </LayoutRecycleList>
51 51
  52 + <a v-if="publishUrl" class="publish-btn" :href="publishUrl">
  53 + <span class="avatar-block">
  54 + <WidgetAvatar class="avatar" :width="70" :height="70"></WidgetAvatar>
  55 + </span>
  56 + 立即参与
  57 + </a>
  58 +
52 </Layout> 59 </Layout>
53 <ArticleActionSheet v-if="showArticleDetailAction" ref="actionSheet"></ArticleActionSheet> 60 <ArticleActionSheet v-if="showArticleDetailAction" ref="actionSheet"></ArticleActionSheet>
54 <YohoActionSheet transfer v-if="showCommentAction" ref="commentAction" :full="true"> 61 <YohoActionSheet transfer v-if="showCommentAction" ref="commentAction" :full="true">
@@ -124,11 +131,14 @@ export default { @@ -124,11 +131,14 @@ export default {
124 showMoreAction: true, 131 showMoreAction: true,
125 scrollTop: 0, 132 scrollTop: 0,
126 currentId: 0, 133 currentId: 0,
127 - colWidthForTwo: 0 134 + colWidthForTwo: 0,
128 }; 135 };
129 }, 136 },
130 computed: { 137 computed: {
131 ...mapState(['topicInfo']), 138 ...mapState(['topicInfo']),
  139 + publishUrl() {
  140 + return this.topicId ? `?openby:yohobuy={"action":"go.grasspublish","params":{"topicId":"${this.topicId}","topicName":"${this.topicName}"}}` : '';
  141 + },
132 topicTitle() { 142 topicTitle() {
133 return this.topicName || this.topicInfo.topicName || ''; 143 return this.topicName || this.topicInfo.topicName || '';
134 }, 144 },
@@ -352,4 +362,33 @@ export default { @@ -352,4 +362,33 @@ export default {
352 z-index: 1; 362 z-index: 1;
353 } 363 }
354 364
  365 + .publish-btn {
  366 + width: 260px;
  367 + height: 80px;
  368 + border-radius: 42px;
  369 + font-size: 30px;
  370 + color: #fff;
  371 + background: #D0021B;
  372 + position: absolute;
  373 + bottom: 100px;
  374 + left: calc(50% - 130px);
  375 + z-index: 1;
  376 + display: flex;
  377 + align-items: center;
  378 +
  379 + .avatar-block {
  380 + width: 52px;
  381 + height: 52px;
  382 + margin: 14px 30px 14px 14px;
  383 + border-radius: 50%;
  384 + overflow: hidden;
  385 + }
  386 +
  387 + .avatar {
  388 + display: block;
  389 + width: 100%;
  390 + height: 100%;
  391 + }
  392 + }
  393 +
355 </style> 394 </style>