MeetingInviteMessageRender.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="meeting_wrap" @click="tryJoinMeeting">
  3. <view class="meeting_corner_mark"></view>
  4. <view class="title">
  5. <image class="meeting_icon" src="../../../../../static/images/meeting_icon.png" mode="aspectFit"></image>
  6. <text class="subject">{{ data.subject }}</text>
  7. </view>
  8. <view class="meeting_info_list">
  9. <view class="meeting_info_item">
  10. <text class="meeting_info_text">开始时间:{{ startTimeStr }}</text>
  11. </view>
  12. <view class="meeting_info_item">
  13. <text class="meeting_info_text">会议时长:{{ durationStr }}</text>
  14. </view>
  15. <view class="meeting_info_item">
  16. <text class="meeting_info_text">会议号:{{ data.id }}</text>
  17. </view>
  18. </view>
  19. <view class="join_tip">
  20. <text class="join_tip_text">进入会议</text>
  21. <image class="join_arrow" src="../../../../../static/images/meeting_join_arrow.png" mode="aspectFit"></image>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import dayjs from "dayjs";
  27. import { meetingModule, meetingErrorHandle } from "../../../../../util/imCommon";
  28. import { mapGetters } from "vuex";
  29. import config from "../../../../../common/config";
  30. import { joinMeeting } from '../../../../../api/meeting'
  31. const secondsToTime = {
  32. 1800: "30分钟",
  33. 3600: "1小时",
  34. 5400: "1.5小时",
  35. 7200: "2小时",
  36. };
  37. export default {
  38. name: "MeetingInviteMessageRender",
  39. components: {},
  40. props: {
  41. data: Object,
  42. isSender: {
  43. type: Boolean,
  44. default: false,
  45. }
  46. },
  47. data() {
  48. return {};
  49. },
  50. computed: {
  51. ...mapGetters(["storeSelfInfo"]),
  52. startTimeStr() {
  53. return dayjs(this.data.start * 1000).format("M月D日 HH:mm");
  54. },
  55. durationStr() {
  56. return secondsToTime[this.data.duration];
  57. },
  58. },
  59. methods: {
  60. tryJoinMeeting() {
  61. const params = {
  62. meetingID: this.data.id,
  63. userID: this.storeSelfInfo.userID,
  64. password: "",
  65. };
  66. joinMeeting(params)
  67. .then((data) => {
  68. const meetingData = {
  69. liveURL: data.liveKit?.url,
  70. token: data.liveKit?.token,
  71. roomID: this.data.roomID,
  72. imToken: uni.getStorageSync("IMToken"),
  73. baseURL: config.getApiUrl()
  74. };
  75. meetingModule.startMeeting(meetingData);
  76. })
  77. .catch(meetingErrorHandle);
  78. },
  79. },
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. .meeting_wrap {
  84. padding: 16rpx 26rpx;
  85. background-color: #fff;
  86. position: relative;
  87. border-radius: 12rpx;
  88. border-width: 1px;
  89. border-style: solid;
  90. border-color: #ececec;
  91. overflow: hidden;
  92. /* #ifndef APP-NVUE */
  93. display: flex;
  94. flex-direction: column;
  95. /* #endif */
  96. }
  97. .meeting_corner_mark {
  98. position: absolute;
  99. left: 4px;
  100. top: 4px;
  101. width: 0;
  102. height: 0;
  103. border-width: 5px;
  104. border-style: solid;
  105. border-top-color: #1e74de;
  106. border-left-color: #1e74de;
  107. border-right-color: transparent;
  108. border-bottom-color: transparent;
  109. }
  110. .title {
  111. display: flex;
  112. flex-direction: row;
  113. align-items: center;
  114. }
  115. .meeting_icon {
  116. width: 20px;
  117. height: 20px;
  118. margin-right: 4px;
  119. }
  120. .subject {
  121. font-size: 16px;
  122. color: #333;
  123. lines: 1;
  124. text-overflow: ellipsis;
  125. overflow: hidden;
  126. flex: 1;
  127. }
  128. .meeting_info_list {
  129. margin-top: 16rpx;
  130. padding-left: 36rpx;
  131. }
  132. .meeting_info_item {
  133. margin-bottom: 12rpx;
  134. }
  135. .meeting_info_text {
  136. color: #131f41;
  137. font-size: 14px;
  138. }
  139. .join_tip {
  140. display: flex;
  141. flex-direction: row;
  142. align-items: center;
  143. justify-content: center;
  144. margin-top: 6px;
  145. }
  146. .join_tip_text {
  147. color: #1e74de;
  148. font-size: 14px;
  149. }
  150. .join_arrow {
  151. width: 24px;
  152. height: 24px;
  153. margin-left: 4px;
  154. }
  155. </style>