diff --git a/apps/components/widgets/widget-follow.vue b/apps/components/widgets/widget-follow.vue index 99da5f7..9ff0e8c 100644 --- a/apps/components/widgets/widget-follow.vue +++ b/apps/components/widgets/widget-follow.vue @@ -31,7 +31,7 @@ export default { }, watch: { follow(val) { - this.followStatus = val; + this.followStatus = val === 'Y' || val === 'O'; } }, computed: { diff --git a/apps/pages/article/article-detail-share.vue b/apps/pages/article/article-detail-share.vue index a5ef28d..ae518ad 100644 --- a/apps/pages/article/article-detail-share.vue +++ b/apps/pages/article/article-detail-share.vue @@ -20,7 +20,7 @@ export default { return; } - let shareData = getDetailShareData(article); + let shareData = getDetailShareData(article, this.$yoho.appVersion); document && (document.title = shareData.title); diff --git a/apps/pages/article/article-detail.vue b/apps/pages/article/article-detail.vue index 80740bf..9100eb6 100644 --- a/apps/pages/article/article-detail.vue +++ b/apps/pages/article/article-detail.vue @@ -383,7 +383,7 @@ export default { return; } - Share.setShareInfo(getDetailShareData(article)); + Share.setShareInfo(getDetailShareData(article, this.$yoho.appVersion)); }, reportArticleShow(items) { if (!items || !items.length) { diff --git a/apps/pages/article/components/article/article-item-intro.vue b/apps/pages/article/components/article/article-item-intro.vue index 925eb17..c2f0e8c 100644 --- a/apps/pages/article/components/article/article-item-intro.vue +++ b/apps/pages/article/components/article/article-item-intro.vue @@ -173,7 +173,7 @@ export default { this.reportLabel(topicId); }, onShare() { - this.$yoho.share(getDetailShareData(this.data)); + this.$yoho.share(getDetailShareData(this.data, this.$yoho.appVersion)); }, onExpanding() { if (this.data.articleType === 2) { diff --git a/apps/pages/article/components/detail/article-header.vue b/apps/pages/article/components/detail/article-header.vue index 147ccc4..4e98da9 100644 --- a/apps/pages/article/components/detail/article-header.vue +++ b/apps/pages/article/components/detail/article-header.vue @@ -86,7 +86,7 @@ export default { } }, onShare() { - const share = getDetailShareData(this.data); + const share = getDetailShareData(this.data, this.$yoho.appVersion); keys(this.data.atUserInfo).forEach(k => { share.desc = share.desc.replace(new RegExp(`@${k}#`, 'gm'), `${this.data.atUserInfo[k]}`); diff --git a/apps/pages/article/components/detail/comment-list.vue b/apps/pages/article/components/detail/comment-list.vue index b69f4fc..8515a57 100644 --- a/apps/pages/article/components/detail/comment-list.vue +++ b/apps/pages/article/components/detail/comment-list.vue @@ -132,7 +132,9 @@ export default { this.onFetching = false; }, this.page > 1 ? 800 : 0); }, - onReply({ comment }) { + async onReply({ comment }) { + const uid = (await this.$sdk.getUser()).uid; + forEach(this.commentList, (val) => { if (val.parentComment && +val.parentComment.id === +comment.rootId) { val.childrenComments.unshift(Object.assign(comment, { @@ -140,7 +142,10 @@ export default { destId: this.articleId, headIco: this.yoho.context.userHeadIco, userName: this.yoho.context.userName, - parentUserName: get(find(val.childrenComments, { id: +comment.parentId }), 'userName', '') + uid, + parentUserName: +val.parentComment.id === +comment.parentId ? + val.parentComment.userName : + get(find(val.childrenComments, { id: +comment.parentId }), 'userName', '') })); } }); @@ -164,7 +169,7 @@ export default { break; } - const childrenIndex = findIndex(val.childrenComments, {id: +commentId}); + const childrenIndex = findIndex(val.childrenComments, { id: +commentId }); if ((+index !== -1) && (childrenIndex !== -1)) { this.commentList[index].childrenComments.splice(childrenIndex, 1); @@ -206,11 +211,12 @@ export default { align-items: center; justify-content: center; - .loading-wrap { - display: flex; - align-items: center; - justify-content: center; - color: #999; - } +.loading-wrap { + display: flex; + align-items: center; + justify-content: center; + color: #999; +} + } </style> diff --git a/apps/pages/userpage/components/user-list.vue b/apps/pages/userpage/components/user-list.vue index 0f627b4..c77889d 100644 --- a/apps/pages/userpage/components/user-list.vue +++ b/apps/pages/userpage/components/user-list.vue @@ -132,7 +132,11 @@ export default { if (this.type === 'fans') { // 粉丝是已关注的列表,你关注他,就变成互相关注 - this.list[index].isAttention = 'O'; + if (follow === 'Y') { + this.list[index].isAttention = 'O'; + } else { + this.list[index].isAttention = follow; + } } else { this.list[index].isAttention = follow; } diff --git a/apps/utils/share-handler.js b/apps/utils/share-handler.js index f7e9121..bf4dcfa 100644 --- a/apps/utils/share-handler.js +++ b/apps/utils/share-handler.js @@ -1,8 +1,4 @@ import {get, first} from 'lodash'; -const qs = require('yoho-qs'); -const cookie = require('yoho-cookie'); - -let app_version = cookie.get('app_version') || qs.app_version || ''; function _version2num(version) { if (!version) { @@ -40,7 +36,7 @@ function handleProtocol(url) { return url.join('//'); } -const getDetailShareData = (article) => { +const getDetailShareData = (article, app_version = '6.9.11') => { let shareImage = ''; let desc = ''; diff --git a/package.json b/package.json index f464aae..d2a6ad5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yoho-community-web", - "version": "6.9.11-beta3", + "version": "6.9.11-beta4", "private": true, "description": "A New Yohobuy Project With Express", "repository": {