| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <template>
- <view>
- <text @click="toMemberRead" class="read_state" :style="{ color: unReadCount < 1 ? '#8E9AB0' : '#0089FF' }">
- {{ getReadStateStr}}</text>
- </view>
- </template>
- <script>
- import { SessionType } from "@/pages_im/constant/imConstants";
- export default {
- name: "",
- components: {},
- props: {
- message: Object,
- },
- data() {
- return {
-
- };
- },
- computed: {
- unReadCount() {
- if (this.message.sessionType === SessionType.Single) {
- return 0
- }
- return this.message.attachedInfoElem?.groupHasReadInfo.unreadCount ?? 0
- },
- getReadStateStr() {
- if (this.message.sessionType === SessionType.Single) {
- return this.message.isRead ? "已读" : "未读";
- }
- if (this.message.sessionType !== SessionType.Notification) {
- return this.unReadCount < 1 ? '全部已读' : `${this.unReadCount}人未读`
- }
- return "";
- },
- },
- methods: {
- toMemberRead() {
- if (this.message.sessionType === SessionType.Single) {
- return;
- }
- uni.$u.route("/pages/conversation/groupMessageReadState/index", {
- messageState: JSON.stringify({
- conversationID: this.$store.getters.storeCurrentConversation.conversationID,
- clientMsgID: this.message.clientMsgID,
- readedCount: this.message.attachedInfoElem?.groupHasReadInfo.hasReadCount ?? 0,
- unReadCount: this.unReadCount
- })
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .read_state {
- font-size: 24rpx;
- }
- </style>
|