GroupAnnounceRender.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="bg_container" style="background: none !important;border: 1px solid #E8EAEF !important; width: 380rpx;" @click="doubleClick">
  3. <view class="announcement_title">
  4. <image src="../../../../../static/images/chating_message_notice.png" mode=""></image>
  5. <text>群公告</text>
  6. </view>
  7. <view class="announcement_content">
  8. {{ getContent }}
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: "GroupAnnounceRender",
  15. components: {},
  16. props: {
  17. message: Object,
  18. },
  19. data() {
  20. return {
  21. lastTapDiffTime: 0
  22. };
  23. },
  24. computed: {
  25. getContent() {
  26. let detail = {};
  27. try {
  28. detail = JSON.parse(this.message.notificationElem.detail);
  29. } catch (e) {}
  30. return detail.group?.notification ?? "";
  31. },
  32. },
  33. methods: {
  34. doubleClick() {
  35. const curTime = new Date().getTime();
  36. const lastTime = this.lastTapDiffTime;
  37. this.lastTapDiffTime = curTime;
  38. const diff = curTime - lastTime;
  39. if (diff < 300) {
  40. uni.navigateTo({
  41. url: `/pages/conversation/groupAnnouncement/index`,
  42. });
  43. }
  44. }
  45. },
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .announcement_title {
  50. display: flex;
  51. align-items: center;
  52. color: #666;
  53. image {
  54. margin-right: 8rpx;
  55. width: 16px;
  56. height: 16px;
  57. }
  58. }
  59. .announcement_content {
  60. max-width: 70vw;
  61. word-break: break-all;
  62. overflow: hidden;
  63. margin-top: 12rpx;
  64. }
  65. </style>