Authored by yyq

topic

1 <template> 1 <template>
2 <div v-if="topic" class="topic-wrap" @click="onClick"> 2 <div v-if="topic" class="topic-wrap" @click="onClick">
3 - <div class="topic-icon">#</div> 3 + <div class="topic-icon">
  4 + <span>#</span>
  5 + </div>
4 <span class="topic-text">{{topic}}</span> 6 <span class="topic-text">{{topic}}</span>
5 </div> 7 </div>
6 </template> 8 </template>
@@ -35,23 +37,19 @@ export default { @@ -35,23 +37,19 @@ export default {
35 } 37 }
36 38
37 .topic-icon { 39 .topic-icon {
38 - width: 38px;  
39 - height: 38px;  
40 - line-height: 38px;  
41 - font-size: 28px; 40 + width: 28px;
  41 + height: 28px;
  42 + line-height: 28px;
42 border-radius: 50%; 43 border-radius: 50%;
43 - margin: 5px; 44 + margin: 10px;
44 text-align: center; 45 text-align: center;
45 - color: #fff;  
46 background-color: #222; 46 background-color: #222;
47 - transform: scale(0.8, 0.8);  
48 47
49 -  
50 - .iconfont { 48 + > span {
51 font-size: 24px; 49 font-size: 24px;
52 color: #fff; 50 color: #fff;
53 - display: block;  
54 - transform: scale(0.76, 0.76); 51 + transform: scale(0.8, 0.8);
  52 + display: inline-block;
55 } 53 }
56 } 54 }
57 55
@@ -9,10 +9,10 @@ @@ -9,10 +9,10 @@
9 <div class="topics"> 9 <div class="topics">
10 <WidgetTopic 10 <WidgetTopic
11 :share="share" 11 :share="share"
12 - :topic="label.labelName"  
13 - @click.native="onTopic(label)"  
14 - v-for="label in data.labelList"  
15 - :key="label.labelId"> 12 + :topic="topic.topicName"
  13 + @click.native="onTopic(topic)"
  14 + v-for="topic in data.topicList"
  15 + :key="topic.topicId">
16 </WidgetTopic> 16 </WidgetTopic>
17 </div> 17 </div>
18 <div class="widgets"> 18 <div class="widgets">
@@ -152,7 +152,7 @@ export default { @@ -152,7 +152,7 @@ export default {
152 } 152 }
153 this.$refs.intro && this.$refs.intro.addEventListener('transitionend', this.onExpand.bind(this)); 153 this.$refs.intro && this.$refs.intro.addEventListener('transitionend', this.onExpand.bind(this));
154 }, 154 },
155 - onTopic({labelId, labelName}) { 155 + onTopic({topicId, topicName}) {
156 if (this.share) { 156 if (this.share) {
157 return this.$links.toDownloadApp(); 157 return this.$links.toDownloadApp();
158 } 158 }
@@ -163,12 +163,12 @@ export default { @@ -163,12 +163,12 @@ export default {
163 this.$router.push({ 163 this.$router.push({
164 name: 'topic', 164 name: 'topic',
165 params: { 165 params: {
166 - topicId: labelId,  
167 - topicName: labelName 166 + topicId: topicId,
  167 + topicName: topicName
168 } 168 }
169 }); 169 });
170 170
171 - this.reportLabel(labelId); 171 + this.reportLabel(topicId);
172 }, 172 },
173 onShare() { 173 onShare() {
174 this.$yoho.share({ 174 this.$yoho.share({
@@ -70,7 +70,7 @@ export default { @@ -70,7 +70,7 @@ export default {
70 introHeight: this.data.introHeight, 70 introHeight: this.data.introHeight,
71 introCollapseHeight: this.data.introCollapseHeight, 71 introCollapseHeight: this.data.introCollapseHeight,
72 articleType: this.data.articleType, 72 articleType: this.data.articleType,
73 - labelList: this.data.labelList, 73 + topicList: this.data.topicList,
74 hasFavor: this.articleState.hasFavor, 74 hasFavor: this.articleState.hasFavor,
75 hasPraise: this.articleState.hasPraise, 75 hasPraise: this.articleState.hasPraise,
76 commentCount: this.articleState.commentCount, 76 commentCount: this.articleState.commentCount,