GroupAnnounceRender.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/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. .bg_container {
  50. padding: 16rpx 24rpx;
  51. border-radius: 0rpx 12rpx 12rpx 12rpx;
  52. background-color: #f0f0f0;
  53. }
  54. .announcement_title {
  55. display: flex;
  56. align-items: center;
  57. color: #666;
  58. image {
  59. margin-right: 8rpx;
  60. width: 16px;
  61. height: 16px;
  62. }
  63. }
  64. .announcement_content {
  65. max-width: 70vw;
  66. word-break: break-all;
  67. overflow: hidden;
  68. margin-top: 12rpx;
  69. }
  70. </style>