diff --git a/pages/im/group/info.vue b/pages/im/group/info.vue index 4c185f1..5dee573 100644 --- a/pages/im/group/info.vue +++ b/pages/im/group/info.vue @@ -84,15 +84,10 @@ onLoad(e) { this.targetId = e.targetId this.qrContent += e.targetId - RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({ - status - }) => { + RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({status}) => { this.status = !Boolean(status) }) - RongIMLib.getConversation(this.conversationType, this.targetId, ({ - code, - conversation - }) => { + RongIMLib.getConversation(this.conversationType, this.targetId, ({code,conversation}) => { if (code == 0) { this.isTop = conversation.isTop } diff --git a/pages/im/group/invite.vue b/pages/im/group/invite.vue index 2abafc0..b523d3f 100644 --- a/pages/im/group/invite.vue +++ b/pages/im/group/invite.vue @@ -1,74 +1,63 @@ - diff --git a/utils/filters.js b/utils/filters.js index d541c07..cfab948 100644 --- a/utils/filters.js +++ b/utils/filters.js @@ -16,18 +16,18 @@ export const timeCustomCN = (val) => { let currentMonth = currentDate.getMonth() + 1; let date = val.substring(0, 19); date = date.replace(/-/g, '/'); - let valDate = new Date(date); + let valDate = new Date(date); let valD = valDate.getDate(); let valYear = valDate.getFullYear(); let valMonth = valDate.getMonth() + 1; // 判断是否属于今天,计算时分 - let difftime = (currentDate - valDate) / 1000; - if (currentYear === valYear && currentMonth === valMonth && currentD === valD) { - let minute = parseInt(difftime % 3600 / 60); - if (minute <= 60) { - return minute === 0 ? '刚刚' : minute + '分钟前'; + let difftime = (currentDate - valDate) / 1000; + if (currentYear === valYear && currentMonth === valMonth && currentD === valD) { + if (difftime < 3600) { + let minute = parseInt(difftime % 3600 / 60); + return minute === 0 ? '刚刚' : minute + '分钟前'; } else { - return (minute * 60).toFixed(0) + '小时前'; + return (difftime / 3600).toFixed(0) + '小时前'; } } else { // 计算天 @@ -37,7 +37,6 @@ export const timeCustomCN = (val) => { let days = Math.abs(currentDate.getTime() - valDate.getTime()) / (1000 * 60 * 60 * 24); return Math.ceil(days) + '天前'; } - } }