MeetingInviteMessageRender.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="meeting_wrap" @click="tryJoinMeeting">
  3. <view class="title">
  4. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/meeting_icon.png" />
  5. <view class="subject">{{ data.subject }}</view>
  6. </view>
  7. <ul>
  8. <li>开始时间:{{ startTimeStr }}</li>
  9. <li>会议时长:{{ durationStr }}</li>
  10. <li>会议号:{{ data.id }}</li>
  11. </ul>
  12. <view class="join_tip">
  13. <text>进入会议</text>
  14. <image style="width: 24px; height: 24px; margin-left: 4px" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/meeting_join_arrow.png" />
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import dayjs from "dayjs";
  20. import { meetingModule, meetingErrorHandle } from "../../../../../util/imCommon";
  21. import { mapGetters } from "vuex";
  22. import config from "../../../../../common/config";
  23. import { joinMeeting } from '../../../../../api/meeting'
  24. const secondsToTime = {
  25. 1800: "30分钟",
  26. 3600: "1小时",
  27. 5400: "1.5小时",
  28. 7200: "2小时",
  29. };
  30. export default {
  31. name: "MeetingInviteMessageRender",
  32. components: {},
  33. props: {
  34. data: Object,
  35. },
  36. data() {
  37. return {};
  38. },
  39. computed: {
  40. ...mapGetters(["storeSelfInfo"]),
  41. startTimeStr() {
  42. return dayjs(this.data.start * 1000).format("M月D日 HH:mm");
  43. },
  44. durationStr() {
  45. return secondsToTime[this.data.duration];
  46. },
  47. },
  48. methods: {
  49. tryJoinMeeting() {
  50. const params = {
  51. meetingID: this.data.id,
  52. userID: this.storeSelfInfo.userID,
  53. password: "",
  54. };
  55. joinMeeting(params)
  56. .then((data) => {
  57. const meetingData = {
  58. liveURL: data.liveKit?.url,
  59. token: data.liveKit?.token,
  60. roomID: this.data.roomID,
  61. imToken: uni.getStorageSync("IMToken"),
  62. baseURL: config.getApiUrl()
  63. };
  64. meetingModule.startMeeting(meetingData);
  65. })
  66. .catch(meetingErrorHandle);
  67. },
  68. },
  69. };
  70. </script>
  71. <style lang="scss" scoped>
  72. .meeting_wrap {
  73. padding: 16rpx 26rpx;
  74. border-radius: 12rpx;
  75. background-color: #fff;
  76. position: relative;
  77. border-radius: 12rpx;
  78. border: 1px solid #ececec;
  79. overflow: hidden;
  80. .title {
  81. display: flex;
  82. align-items: center;
  83. image {
  84. min-width: 20px;
  85. width: 20px;
  86. height: 20px;
  87. margin-right: 4px
  88. }
  89. .subject {
  90. @include nomalEllipsis();
  91. }
  92. }
  93. ul {
  94. margin-top: 16rpx;
  95. padding-left: 36rpx;
  96. color: #131f41;
  97. li {
  98. margin-bottom: 12rpx;
  99. }
  100. }
  101. .join_tip {
  102. display: flex;
  103. align-items: center;
  104. justify-content: center;
  105. color: #1e74de;
  106. margin-top: 6px;
  107. }
  108. &:before {
  109. content: "";
  110. position: absolute;
  111. left: 4px;
  112. top: 4px;
  113. border-width: 5px;
  114. border-style: solid;
  115. border-color: #1e74de transparent transparent #1e74de;
  116. }
  117. }
  118. </style>