Authored by 陈峰

commit

@@ -7,7 +7,11 @@ @@ -7,7 +7,11 @@
7 <p class="comment-user-name">{{parentComment.userName || '&nbsp;'}}</p> 7 <p class="comment-user-name">{{parentComment.userName || '&nbsp;'}}</p>
8 <p class="comment-time">{{parentComment.createTime | time}}</p> 8 <p class="comment-time">{{parentComment.createTime | time}}</p>
9 </div> 9 </div>
10 - <WidgetFav class="comment-fav" :num="parentComment.praiseTotal"></WidgetFav> 10 + <WidgetFav
  11 + class="comment-fav"
  12 + :comment-id="parentComment.id"
  13 + :num="parentComment.praiseTotal"
  14 + :option="favOption"></WidgetFav>
11 </div> 15 </div>
12 16
13 <div class="comment-cont" @click="replyComment(parentComment.id)" :data-parent-id="parentComment.parentId" :data-root-id="parentComment.rootId"> 17 <div class="comment-cont" @click="replyComment(parentComment.id)" :data-parent-id="parentComment.parentId" :data-root-id="parentComment.rootId">
@@ -51,10 +55,15 @@ export default { @@ -51,10 +55,15 @@ export default {
51 data() { 55 data() {
52 return { 56 return {
53 isShowAllReply: false, 57 isShowAllReply: false,
54 - limitNum: 2 58 + limitNum: 2,
55 }; 59 };
56 }, 60 },
57 computed: { 61 computed: {
  62 + favOption() {
  63 + return {
  64 + selected: this.parentComment.isPraise === 'Y'
  65 + };
  66 + },
58 replayShowList() { 67 replayShowList() {
59 if (this.childrenComments.length <= this.limitNum) { 68 if (this.childrenComments.length <= this.limitNum) {
60 return this.childrenComments; 69 return this.childrenComments;
@@ -71,8 +80,6 @@ export default { @@ -71,8 +80,6 @@ export default {
71 return this.isShowAllReply ? '收起' : `查看${this.moreReplyNum}条回复`; 80 return this.isShowAllReply ? '收起' : `查看${this.moreReplyNum}条回复`;
72 } 81 }
73 }, 82 },
74 - created() {  
75 - },  
76 methods: { 83 methods: {
77 ...mapActions(['postComment']), 84 ...mapActions(['postComment']),
78 onShowMore() { 85 onShowMore() {
@@ -142,6 +149,10 @@ export default { @@ -142,6 +149,10 @@ export default {
142 } 149 }
143 } 150 }
144 151
  152 + .comment-fav {
  153 + padding-right: 20px;
  154 + }
  155 +
145 .comment-cont { 156 .comment-cont {
146 font-size: 28px; 157 font-size: 28px;
147 color: #444; 158 color: #444;
@@ -41,6 +41,7 @@ export default { @@ -41,6 +41,7 @@ export default {
41 bottom: 0; 41 bottom: 0;
42 display: flex; 42 display: flex;
43 flex-direction: column; 43 flex-direction: column;
  44 + background-color: #fff;
44 45
45 &.header-fixed { 46 &.header-fixed {
46 display: block; 47 display: block;
@@ -191,6 +191,7 @@ @@ -191,6 +191,7 @@
191 191
192 this.syncService(syncFnName, { 192 this.syncService(syncFnName, {
193 articleId: this.articleId, 193 articleId: this.articleId,
  194 + commentId: this.commentId,
194 status: this.btnSelected 195 status: this.btnSelected
195 }).then(backFn).catch(backFn); 196 }).then(backFn).catch(backFn);
196 } 197 }
@@ -27,7 +27,7 @@ window._router = get(store, 'state.yoho.context.route'); @@ -27,7 +27,7 @@ window._router = get(store, 'state.yoho.context.route');
27 Vue.prop('yoho', yoho); 27 Vue.prop('yoho', yoho);
28 Vue.prop('sdk', sdk); 28 Vue.prop('sdk', sdk);
29 Vue.prop('auth', function() { 29 Vue.prop('auth', function() {
30 - if (!get(this.$store, '$context.islogin')) { 30 + if (!get(this.$store, '$context.isLogin')) {
31 this.$sdk && this.$sdk.goLogin && this.$sdk.goLogin(); 31 this.$sdk && this.$sdk.goLogin && this.$sdk.goLogin();
32 return false; 32 return false;
33 } 33 }