Skip to content

Commit

Permalink
fix 皮肤只展示在评论
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchuana committed Jun 20, 2024
1 parent 5110e3c commit 173c681
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 168 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jx3box/jx3box-comment-ui",
"version": "1.9.5",
"version": "1.9.6",
"scripts": {
"dev": "env DEV_SERVER=true vue-cli-service serve",
"serve": "vue-cli-service serve",
Expand Down
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<Comment id="80449" category="post" order="desc" :homework="true"/>
<Comment id="80449" category="post" order="desc" :homework="true" />
<!-- <Comment id="81964" category="post" order="desc" :homework="true" /> -->
<!-- <Comment :id="30015" category="post" order="desc" /> -->
</template>

Expand Down
72 changes: 46 additions & 26 deletions src/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<div class="u-order">
<template v-if="homework">
<div class="u-homework">
<img class="u-homework-icon" src="./assets/img/homework.svg" alt="">
<img
class="u-homework-icon"
src="./assets/img/homework.svg"
alt=""
/>
<span>作业模式</span>
</div>
</template>
Expand Down Expand Up @@ -45,14 +49,14 @@
:key="item.id"
class="c-comment-list"
>
<CommentAvatar
<!-- <CommentAvatar
:user-avatar="item.avatar | showAvatar"
:user-href="item.userId | profileLink"
:username="item.displayName"
:avatarFrame="item.user_avatar_frame"
:withFrame="true"
:avatarSize="48"
/>
/> -->
<CommentAndReply
:base-api="baseAPI"
:item="item"
Expand Down Expand Up @@ -93,21 +97,36 @@
</template>
</el-main>

<homework v-model="showHomeWork" v-if="homework" :postType="postType" :postId="postData.postId" :client="postData.client" :userId="postData.userId" :article-id="id" :category="category"></homework>
<boxcoin-records v-model="showBoxCoin" v-if="homework" :postType="postType" :postId="postData.postId" :client="postData.client"></boxcoin-records>
<homework
v-model="showHomeWork"
v-if="homework"
:postType="postType"
:postId="postData.postId"
:client="postData.client"
:userId="postData.userId"
:article-id="id"
:category="category"
></homework>
<boxcoin-records
v-model="showBoxCoin"
v-if="homework"
:postType="postType"
:postId="postData.postId"
:client="postData.client"
></boxcoin-records>
</el-container>
</template>

<script>
import { showAvatar, authorLink } from "@jx3box/jx3box-common/js/utils";
import CommentAvatar from "./components/avatar.vue";
// import CommentAvatar from "./components/avatar.vue";
import CommentInputForm from "./components/comment-input-form.vue";
import CommentAndReply from "./components/comment-and-reply.vue";
import { GET, POST, DELETE, PUT } from "./service";
import { getOrderMode, setOrderMode } from "./options";
import Homework from "@jx3box/jx3box-common-ui/src/interact/Homework.vue";
import boxcoinRecords from "./components/boxcoin-records.vue";
import {bus} from "./utils";
import { bus } from "./utils";
export default {
name: "Comment",
props: {
Expand Down Expand Up @@ -137,11 +156,11 @@ export default {
},
},
components: {
CommentAvatar,
// CommentAvatar,
CommentAndReply,
CommentInputForm,
Homework,
boxcoinRecords
boxcoinRecords,
},
data: function () {
return {
Expand Down Expand Up @@ -191,9 +210,10 @@ export default {
`${this.baseAPI}/meta/white-list/${
this.openWhiteList ? "open" : "close"
}`
).then(()=>{
return this.reloadPower()
})
)
.then(() => {
return this.reloadPower();
})
.then(() => {
this.commentPower.is_white = this.openWhiteList;
this.reloadCommentList(this.pager.index);
Expand Down Expand Up @@ -308,14 +328,14 @@ export default {
})
.catch(() => {});
},
reloadPower(){
reloadPower() {
GET(`${this.baseAPI}/i-am-author`)
.then((power) => {
this.commentPower = power;
this.openWhiteList = power.is_white;
})
.catch(() => {});
}
.then((power) => {
this.commentPower = power;
this.openWhiteList = power.is_white;
})
.catch(() => {});
},
},
filters: {
profileLink: function (uid) {
Expand All @@ -334,22 +354,22 @@ export default {
this.isDesc = mode;
})
.then(() => {
this.reloadPower()
this.reloadPower();
})
.finally(() => {
this.reloadCommentList(1);
});
bus.on("homework-click", data => {
bus.on("homework-click", (data) => {
this.postData.postId = data.id;
this.postData.userId = data.userId;
this.showHomeWork = true;
})
});
bus.on("boxcoin-click", data => {
bus.on("boxcoin-click", (data) => {
this.postData.postId = data.id;
this.showBoxCoin = true;
})
});
},
};
</script>
Expand Down Expand Up @@ -481,7 +501,7 @@ export default {
align-items: center;
gap: 5px;
border: 1px solid #e6a23c;
background-color:#fefbc4;
background-color: #fefbc4;
color: #666;
padding: 2px 4px;
border-radius: 3px;
Expand All @@ -508,7 +528,7 @@ export default {
}
@media screen and (max-width: 720px) {
.c-comment-panel {
.u-op{
.u-op {
display: none;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default {

<style lang="less">
.c-comment-replylist {
padding: 10px 0;
padding: 10px 0 10px 68px;
border-top: 1px dashed #eee;
}
.c-comment-reply {
Expand Down
Loading

0 comments on commit 173c681

Please sign in to comment.