tuikit-atomicx-vue3 3.3.0-beta.3 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AttachmentPicker.module-BesmtGyl.js +11 -0
- package/dist/FilePicker.vue_vue_type_script_setup_true_lang-CdJ4DUzE.js +76 -0
- package/dist/ImagePicker.vue_vue_type_script_setup_true_lang-CbNUofpK.js +76 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-XRL7A5Gj.js → MessageInput.vue_vue_type_script_setup_true_lang-wUJPjWbx.js} +23 -18
- package/dist/VideoPicker.vue_vue_type_script_setup_true_lang-CmxjbNDJ.js +76 -0
- package/dist/chat/index.d.ts +3747 -2386
- package/dist/chat/index.js +12 -11
- package/dist/components/BarrageInput/BarrageInputH5.js +32 -8
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +9 -5
- package/dist/components/BarrageInput/TextEditor/index.js +14 -6
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +4 -4
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +12 -4
- package/dist/components/BarrageList/i18n/en-US/index.d.ts +1 -0
- package/dist/components/BarrageList/i18n/en-US/index.js +2 -1
- package/dist/components/BarrageList/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/BarrageList/i18n/zh-CN/index.js +2 -1
- package/dist/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.js +5 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupChatSetting.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupInfo/GroupInfo.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.js +3 -3
- package/dist/components/ChatSetting/GroupChatSetting/GroupMembers/GroupMembers.js +3 -3
- package/dist/components/ChatSetting/SettingItem/SettingItem.js +21 -21
- package/dist/components/ChatSetting/i18n/en-US.js +3 -3
- package/dist/components/ChatSetting/i18n/zh-CN.js +3 -3
- package/dist/components/ChatSetting/index.d.ts +1 -4
- package/dist/components/ChatSetting/index.js +3 -6
- package/dist/components/CoGuestPanel/CoGuestPanel.js +1 -1
- package/dist/components/ContactList/ContactInfo/ContactInfo.js +17 -17
- package/dist/components/ContactList/ContactInfo/ContactInfo.vue.d.ts +26 -2
- package/dist/components/ContactList/ContactInfo/GroupInfo/GroupInfo.js +2 -1
- package/dist/components/ContactList/ContactList.js +19 -10
- package/dist/components/ContactList/ContactList.vue.d.ts +109 -1
- package/dist/components/ContactList/index.d.ts +158 -26
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +8 -9
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +2 -1
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.js +8 -8
- package/dist/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.js +1 -2
- package/dist/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.js +8 -8
- package/dist/components/ConversationList/ConversationList.js +18 -44
- package/dist/components/ConversationList/ConversationList.vue.d.ts +197 -1535
- package/dist/components/ConversationList/ConversationListContent/ConversationListContent.js +8 -11
- package/dist/components/ConversationList/ConversationListContent/ConversationListContent.vue.d.ts +22 -340
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +80 -134
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +19 -30
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +0 -2
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +14 -15
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +12 -24
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +14 -14
- package/dist/components/ConversationList/ConversationPreview/index.d.ts +1 -1
- package/dist/components/ConversationList/ConversationPreview/index.js +17 -21
- package/dist/components/ConversationList/ConversationSearch/ConversationSearch.js +1 -0
- package/dist/components/ConversationList/index.d.ts +468 -2400
- package/dist/components/ConversationList/index.js +1 -1
- package/dist/components/LiveAudienceList/LiveAudienceListH5.js +1 -1
- package/dist/components/LiveCoreView/index.js +113 -58
- package/dist/components/LiveCoreView/index.vue.d.ts +9 -0
- package/dist/components/LiveList/LiveList.js +7 -5
- package/dist/components/LiveList/LiveListH5.js +77 -71
- package/dist/components/LiveList/i18n/en-US/index.d.ts +5 -0
- package/dist/components/LiveList/i18n/en-US/index.js +6 -1
- package/dist/components/LiveList/i18n/zh-CN/index.d.ts +5 -0
- package/dist/components/LiveList/i18n/zh-CN/index.js +6 -1
- package/dist/components/LiveList/pullToRefresh.js +204 -0
- package/dist/components/LiveList/pullToRefresh.vue.d.ts +86 -0
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +6 -5
- package/dist/components/LiveScenePanel/index.js +3 -3
- package/dist/components/MessageInput/AttachmentPicker/AttachmentPicker.vue.d.ts +0 -4
- package/dist/components/MessageInput/AttachmentPicker/FilePicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/ImagePicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/VideoPicker.js +1 -1
- package/dist/components/MessageInput/AttachmentPicker/index.js +14 -19
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +3 -3
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/MessageInput.vue.d.ts +6 -9
- package/dist/components/MessageInput/TextEditor/TextEditor.vue.d.ts +2 -2
- package/dist/components/MessageInput/TextEditor/index.js +18 -9
- package/dist/components/MessageInput/index.d.ts +5 -41
- package/dist/components/MessageInput/index.js +4 -4
- package/dist/components/MessageList/Message/CustomMessage/index.js +2 -2
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.js +7 -5
- package/dist/components/MessageList/Message/FaceMessage/FaceMessage.vue.d.ts +8 -8
- package/dist/components/MessageList/Message/LocationMessage/LocationMessage.js +2 -1
- package/dist/components/MessageList/Message/MergerMessage/MergerMessage.js +2 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +12 -4
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue.d.ts +3 -3
- package/dist/components/MessageList/MessageForward/MessageForward.js +2 -3
- package/dist/components/MessageList/MessageList.js +14 -7
- package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
- package/dist/components/MessageList/MessageTimeDivider/MessageTimeDivider.js +5 -5
- package/dist/components/MessageList/MessageTimeDivider/MessageTimeDivider.vue.d.ts +10 -10
- package/dist/components/MessageList/index.d.ts +143 -5
- package/dist/components/MessageList/index.js +5 -5
- package/dist/components/Search/Search.js +1 -3
- package/dist/components/Search/SearchResults/EmptyResult/EmptyResult.js +4 -6
- package/dist/components/Search/SearchResults/Loading/Loading.js +2 -4
- package/dist/components/Search/SearchResults/SearchResults.js +20 -22
- package/dist/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.js +6 -8
- package/dist/components/Search/SearchResults/SearchResultsItem/Group/Group.js +5 -7
- package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +19 -21
- package/dist/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.js +1 -3
- package/dist/components/Search/SearchResults/SearchResultsItem/User/User.js +5 -7
- package/dist/components/StreamMixer/LocalMixer/index.js +11 -5
- package/dist/components/StreamView/manager/mediaManager.js +1 -1
- package/dist/components/UserPicker/UserPicker.js +2 -2
- package/dist/components/UserPicker/UserPicker.vue.d.ts +7 -8
- package/dist/components/UserPicker/components/ListMode/ListMode.js +14 -17
- package/dist/components/UserPicker/components/ListMode/ListMode.vue.d.ts +2 -2
- package/dist/components/UserPicker/components/SelectedPanel/SelectedPanel.vue.d.ts +2 -2
- package/dist/components/UserPicker/components/TreeMode/TreeMode.vue.d.ts +3 -3
- package/dist/components/UserPicker/components/TreeMode/TreeNode.vue.d.ts +4 -4
- package/dist/components/UserPicker/hooks/useSearchFilter.d.ts +3 -3
- package/dist/components/UserPicker/hooks/useSelection.d.ts +8 -8
- package/dist/components/UserPicker/hooks/useTreeState.d.ts +3 -3
- package/dist/components/UserPicker/index.d.ts +134 -3
- package/dist/components/UserPicker/index.js +3 -2
- package/dist/components/UserPicker/type.d.ts +18 -18
- package/dist/index.js +6 -3
- package/dist/rtc/index.d.ts +9 -0
- package/dist/states/GroupSettingState/GroupSettingState.js +3 -3
- package/dist/states/LiveSeatState/usePlayStream/MixStreamPlayer.js +3 -0
- package/dist/states/LoginState.js +1 -0
- package/dist/states/MessageInputState/MessageInputState.js +25 -5
- package/dist/styles/index.css +1294 -3578
- package/dist/types/contact.d.ts +13 -12
- package/dist/types/conversation.d.ts +12 -14
- package/dist/types/engine.d.ts +12 -0
- package/dist/types/engine.js +15 -0
- package/dist/types/index.js +2 -1
- package/dist/utils/json.js +0 -1
- package/package.json +7 -3
- package/src/chat/index.ts +12 -4
- package/src/components/BarrageInput/BarrageInputH5.vue +50 -4
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.module.scss +1 -0
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
- package/src/components/BarrageInput/TextEditor/Editor.scss +1 -1
- package/src/components/BarrageInput/TextEditor/TextEditor.module.scss +2 -0
- package/src/components/BarrageInput/TextEditor/TextEditor.vue +6 -0
- package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +8 -8
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +10 -0
- package/src/components/BarrageList/i18n/en-US/index.ts +1 -0
- package/src/components/BarrageList/i18n/zh-CN/index.ts +1 -0
- package/src/components/ChatSetting/GroupChatSetting/GroupActions/GroupActions.vue +5 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupChatSetting.vue +5 -4
- package/src/components/ChatSetting/GroupChatSetting/GroupInfo/GroupInfo.vue +2 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupManagement/GroupManagement.vue +3 -2
- package/src/components/ChatSetting/GroupChatSetting/GroupMembers/GroupMembers.vue +3 -3
- package/src/components/ChatSetting/SettingItem/SettingItem.vue +10 -7
- package/src/components/ChatSetting/i18n/en-US.ts +3 -3
- package/src/components/ChatSetting/i18n/zh-CN.ts +3 -3
- package/src/components/ChatSetting/index.ts +3 -3
- package/src/components/CoGuestPanel/CoGuestPanel.vue +9 -0
- package/src/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/ContactInfo.vue +17 -9
- package/src/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/FriendInfo/FriendInfo.scss +4 -3
- package/src/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.scss +2 -0
- package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.vue +1 -0
- package/src/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.scss +2 -2
- package/src/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.scss +3 -2
- package/src/components/ContactList/ContactList.scss +2 -1
- package/src/components/ContactList/ContactList.vue +18 -3
- package/src/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.scss +3 -3
- package/src/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.scss +5 -6
- package/src/components/ContactList/ContactListItem/FriendItem/FriendItem.scss +3 -3
- package/src/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.scss +5 -6
- package/src/components/ContactList/ContactListItem/GroupItem/GroupItem.scss +3 -3
- package/src/components/ConversationList/ConversationActions/ConversationActions.scss +2 -12
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +2 -2
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +1 -0
- package/src/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.scss +2 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.vue +2 -2
- package/src/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.scss +2 -1
- package/src/components/ConversationList/ConversationList.scss +0 -5
- package/src/components/ConversationList/ConversationList.vue +15 -41
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.scss +1 -0
- package/src/components/ConversationList/ConversationListContent/ConversationListContent.vue +13 -18
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +11 -9
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.vue +14 -16
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +2 -14
- package/src/components/ConversationList/ConversationPreview/index.ts +1 -1
- package/src/components/ConversationList/ConversationSearch/ConversationSearch.vue +1 -0
- package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
- package/src/components/LiveCoreView/index.vue +145 -79
- package/src/components/LiveList/LiveList.vue +3 -0
- package/src/components/LiveList/LiveListH5.vue +60 -85
- package/src/components/LiveList/i18n/en-US/index.ts +5 -0
- package/src/components/LiveList/i18n/zh-CN/index.ts +5 -0
- package/src/components/LiveList/pullToRefresh.vue +364 -0
- package/src/components/LiveScenePanel/CameraSettingDialog.vue +6 -5
- package/src/components/LiveScenePanel/index.vue +2 -2
- package/src/components/MessageInput/AttachmentPicker/AttachmentPicker.module.scss +4 -0
- package/src/components/MessageInput/AttachmentPicker/AttachmentPicker.vue +12 -17
- package/src/components/MessageInput/AttachmentPicker/FilePicker.vue +3 -2
- package/src/components/MessageInput/AttachmentPicker/ImagePicker.vue +3 -2
- package/src/components/MessageInput/AttachmentPicker/VideoPicker.vue +3 -2
- package/src/components/MessageInput/EmojiPicker/EmojiPicker.module.scss +1 -0
- package/src/components/MessageInput/MessageInput.vue +21 -15
- package/src/components/MessageInput/TextEditor/Editor.scss +1 -0
- package/src/components/MessageInput/TextEditor/TextEditor.vue +16 -6
- package/src/components/MessageInput/types.d.ts +3 -4
- package/src/components/MessageList/Message/CustomMessage/CustomMessage.vue +1 -1
- package/src/components/MessageList/Message/FaceMessage/FaceMessage.vue +10 -7
- package/src/components/MessageList/Message/LocationMessage/LocationMessage.vue +3 -1
- package/src/components/MessageList/Message/MergerMessage/MergerMessage.vue +1 -1
- package/src/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.vue +2 -2
- package/src/components/MessageList/MessageForward/MessageForward.vue +3 -3
- package/src/components/MessageList/MessageList.vue +17 -5
- package/src/components/MessageList/MessageTimeDivider/MessageTimeDivider.vue +9 -9
- package/src/components/MessageList/index.ts +5 -4
- package/src/components/Search/Search.scss +0 -3
- package/src/components/Search/SearchResults/EmptyResult/EmptyResult.scss +0 -3
- package/src/components/Search/SearchResults/Loading/Loading.scss +0 -3
- package/src/components/Search/SearchResults/SearchResults.scss +7 -16
- package/src/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/Group/Group.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.scss +5 -11
- package/src/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.scss +0 -3
- package/src/components/Search/SearchResults/SearchResultsItem/User/User.scss +5 -6
- package/src/components/StreamMixer/LocalMixer/index.vue +9 -4
- package/src/components/StreamView/manager/mediaManager.ts +1 -1
- package/src/components/UserPicker/UserPicker.vue +6 -9
- package/src/components/UserPicker/components/ListMode/ListMode.vue +3 -7
- package/src/components/UserPicker/components/SelectedPanel/SelectedPanel.vue +2 -2
- package/src/components/UserPicker/components/TreeMode/TreeMode.vue +3 -3
- package/src/components/UserPicker/components/TreeMode/TreeNode.vue +3 -3
- package/src/components/UserPicker/hooks/useSearchFilter.ts +15 -14
- package/src/components/UserPicker/hooks/useSelection.ts +32 -32
- package/src/components/UserPicker/hooks/useTreeState.ts +4 -4
- package/src/components/UserPicker/index.ts +16 -14
- package/src/components/UserPicker/type.ts +18 -18
- package/src/types/contact.ts +13 -12
- package/src/types/conversation.ts +12 -14
- package/src/types/engine.ts +15 -0
- package/src/utils/json.ts +0 -4
- package/dist/AttachmentPicker.module-0_DWsAtr.js +0 -11
- package/dist/FilePicker.vue_vue_type_script_setup_true_lang-CaSj3Gh_.js +0 -72
- package/dist/ImagePicker.vue_vue_type_script_setup_true_lang-CrzGMmrh.js +0 -72
- package/dist/VideoPicker.vue_vue_type_script_setup_true_lang-DTv6TJKr.js +0 -72
- package/dist/states/UIOpenControlState/UIOpenControlState.d.ts +0 -15
- package/dist/states/UIOpenControlState/UIOpenControlState.js +0 -28
- package/dist/states/UIOpenControlState/index.d.ts +0 -1
- package/dist/states/UIOpenControlState/index.js +0 -4
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
<div
|
|
3
3
|
ref="liveCoreViewContainerRef"
|
|
4
4
|
class="live-core-view-container"
|
|
5
|
+
:class="{ 'align-center': isAlignCenter }"
|
|
5
6
|
>
|
|
7
|
+
<div
|
|
8
|
+
v-if="!$slots.localVideo && !isPlayedVideo"
|
|
9
|
+
class="live-core-placeholder"
|
|
10
|
+
>
|
|
11
|
+
<span class="placeholder-text">{{ t('No video') }}</span>
|
|
12
|
+
</div>
|
|
6
13
|
<div
|
|
7
14
|
class="live-core-view"
|
|
8
15
|
:style="streamViewStyle"
|
|
9
16
|
>
|
|
10
|
-
<div
|
|
11
|
-
v-if="!$slots.localVideo && seatList.length === 0"
|
|
12
|
-
class="live-core-placeholder"
|
|
13
|
-
>
|
|
14
|
-
<span class="placeholder-text">{{ t('No video') }}</span>
|
|
15
|
-
</div>
|
|
16
17
|
<div
|
|
17
18
|
id="atomicx-live-stream-content"
|
|
18
19
|
class="stream-content"
|
|
@@ -55,7 +56,7 @@ import { useLiveState } from '../../states/LiveState';
|
|
|
55
56
|
import { useLoginState } from '../../states/LoginState';
|
|
56
57
|
import { getContentSize } from '../../utils/domOperation';
|
|
57
58
|
import DefaultStreamViewUI from './DefaultStreamViewUI.vue';
|
|
58
|
-
import type { SeatUserInfo } from '../../types';
|
|
59
|
+
import type { SeatInfo, SeatUserInfo } from '../../types';
|
|
59
60
|
|
|
60
61
|
const { t } = useUIKit();
|
|
61
62
|
const { seatList, canvas, startPlayStream, stopPlayStream } = useLiveSeatState();
|
|
@@ -63,23 +64,37 @@ const { currentLive } = useLiveState();
|
|
|
63
64
|
|
|
64
65
|
const slots = useSlots();
|
|
65
66
|
|
|
66
|
-
const
|
|
67
|
+
const isInStreamMixerComp = computed(() => slots.localVideo);
|
|
67
68
|
|
|
68
69
|
const { loginUserInfo } = useLoginState();
|
|
70
|
+
const isPlayedVideo = ref(false);
|
|
69
71
|
const isMounted = ref(false);
|
|
72
|
+
const isAlignCenter = computed(() => {
|
|
73
|
+
if (!isInStreamMixerComp.value && isPortraitContainer.value && widthRatio.value < heightRatio.value) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
});
|
|
70
78
|
|
|
71
|
-
onMounted(() => {
|
|
79
|
+
onMounted(async () => {
|
|
72
80
|
isMounted.value = true;
|
|
73
|
-
startPlayStream({ view: 'atomicx-live-stream-content' });
|
|
81
|
+
await startPlayStream({ view: 'atomicx-live-stream-content' });
|
|
82
|
+
isPlayedVideo.value = true;
|
|
74
83
|
});
|
|
75
84
|
|
|
76
|
-
onBeforeUnmount(() => {
|
|
85
|
+
onBeforeUnmount(async () => {
|
|
77
86
|
isMounted.value = false;
|
|
78
|
-
stopPlayStream();
|
|
87
|
+
await stopPlayStream();
|
|
88
|
+
isPlayedVideo.value = false;
|
|
79
89
|
});
|
|
80
90
|
|
|
81
91
|
const isPortraitContainer = ref(true);
|
|
82
92
|
const liveCoreViewContainerRef = ref<HTMLDivElement>();
|
|
93
|
+
|
|
94
|
+
const liveCoreViewContainerSize = ref<{ width: number; height: number }>({
|
|
95
|
+
width: 0,
|
|
96
|
+
height: 0,
|
|
97
|
+
});
|
|
83
98
|
const originStreamViewStyle = ref({
|
|
84
99
|
width: 0,
|
|
85
100
|
height: 0,
|
|
@@ -105,20 +120,30 @@ const ratioLayoutList = computed(() => {
|
|
|
105
120
|
});
|
|
106
121
|
|
|
107
122
|
const streamViewSize = computed(() => {
|
|
108
|
-
if (isPortraitContainer.value) {
|
|
109
|
-
return {
|
|
110
|
-
width: originStreamViewStyle.value.width,
|
|
111
|
-
height: originStreamViewStyle.value.height,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
123
|
return {
|
|
115
124
|
width: originStreamViewStyle.value.width * originStreamViewStyle.value.scale,
|
|
116
125
|
height: originStreamViewStyle.value.height * originStreamViewStyle.value.scale,
|
|
117
126
|
};
|
|
118
127
|
});
|
|
119
128
|
|
|
120
|
-
const seatListWithRealSize = computed(() => seatList.value.map((item, index) => {
|
|
129
|
+
const seatListWithRealSize = computed(() => seatList.value.map((item: SeatInfo, index: number) => {
|
|
121
130
|
const ratioLayout = ratioLayoutList.value[index];
|
|
131
|
+
const isPortraitAndFill = isPortraitContainer.value && fillMode.value === StreamFillMode.Fill;
|
|
132
|
+
const isSampleWithCanvas = seatList.value.length === 1 || (item.region?.w === canvas.value.width && item.region?.h === canvas.value.height);
|
|
133
|
+
if (!isInStreamMixerComp.value && isPortraitAndFill && isSampleWithCanvas) {
|
|
134
|
+
return {
|
|
135
|
+
userInfo: item.userInfo as SeatUserInfo,
|
|
136
|
+
region: {
|
|
137
|
+
position: 'absolute' as const,
|
|
138
|
+
left: '50%',
|
|
139
|
+
top: '50%',
|
|
140
|
+
width: `${liveCoreViewContainerSize.value.width}px`,
|
|
141
|
+
height: `${liveCoreViewContainerSize.value.height}px`,
|
|
142
|
+
transform: `translate(-50%, -50%)`,
|
|
143
|
+
zIndex: Number(ratioLayout.zOrder) || 0,
|
|
144
|
+
},
|
|
145
|
+
}
|
|
146
|
+
}
|
|
122
147
|
return {
|
|
123
148
|
userInfo: item.userInfo as SeatUserInfo,
|
|
124
149
|
region: {
|
|
@@ -138,7 +163,7 @@ const seatListWithRealSize = computed(() => seatList.value.map((item, index) =>
|
|
|
138
163
|
const localStreamViewInfo = computed(() => seatListWithRealSize.value.find(item => item?.userInfo?.userId === loginUserInfo.value?.userId));
|
|
139
164
|
|
|
140
165
|
const needPlayStreamViewInfo = computed(() => {
|
|
141
|
-
if (
|
|
166
|
+
if (isInStreamMixerComp.value) {
|
|
142
167
|
return seatListWithRealSize.value.filter(item => item.userInfo?.userId !== loginUserInfo.value?.userId);
|
|
143
168
|
}
|
|
144
169
|
return seatListWithRealSize.value;
|
|
@@ -152,31 +177,31 @@ const needPlayStreamViewInfo = computed(() => {
|
|
|
152
177
|
// Based on container B's actual size, calculate the actual position and size of each child element
|
|
153
178
|
|
|
154
179
|
const visualStreamSize = computed(() => {
|
|
155
|
-
if (ratioLayoutList.value.length
|
|
180
|
+
if (!isPortraitContainer.value && widthRatio.value < heightRatio.value && ratioLayoutList.value.length > 0) {
|
|
181
|
+
const absoluteLayoutList = ratioLayoutList.value.map(item => ({
|
|
182
|
+
userId: item.userId,
|
|
183
|
+
left: originStreamViewStyle.value.width * item.x,
|
|
184
|
+
top: originStreamViewStyle.value.width * item.y,
|
|
185
|
+
width: originStreamViewStyle.value.width * item.width,
|
|
186
|
+
height: item.height === -1 ? originStreamViewStyle.value.height : originStreamViewStyle.value.width * item.height,
|
|
187
|
+
zIndex: item.zOrder,
|
|
188
|
+
}));
|
|
189
|
+
const minX = Math.min(...absoluteLayoutList.map(item => item.left));
|
|
190
|
+
const minY = Math.min(...absoluteLayoutList.map(item => item.top));
|
|
191
|
+
const maxX = Math.max(...absoluteLayoutList.map(item => item.left + item.width));
|
|
192
|
+
const maxY = Math.max(...absoluteLayoutList.map(item => item.top + item.height));
|
|
156
193
|
return {
|
|
157
|
-
width:
|
|
158
|
-
height:
|
|
159
|
-
centerX:
|
|
160
|
-
centerY:
|
|
194
|
+
width: maxX - minX,
|
|
195
|
+
height: maxY - minY,
|
|
196
|
+
centerX: (minX + maxX) / 2,
|
|
197
|
+
centerY: (minY + maxY) / 2,
|
|
161
198
|
};
|
|
162
199
|
}
|
|
163
|
-
const absoluteLayoutList = ratioLayoutList.value.map(item => ({
|
|
164
|
-
userId: item.userId,
|
|
165
|
-
left: originStreamViewStyle.value.width * item.x,
|
|
166
|
-
top: originStreamViewStyle.value.width * item.y,
|
|
167
|
-
width: originStreamViewStyle.value.width * item.width,
|
|
168
|
-
height: item.height === -1 ? originStreamViewStyle.value.height : originStreamViewStyle.value.width * item.height,
|
|
169
|
-
zIndex: item.zOrder,
|
|
170
|
-
}));
|
|
171
|
-
const minX = Math.min(...absoluteLayoutList.map(item => item.left));
|
|
172
|
-
const minY = Math.min(...absoluteLayoutList.map(item => item.top));
|
|
173
|
-
const maxX = Math.max(...absoluteLayoutList.map(item => item.left + item.width));
|
|
174
|
-
const maxY = Math.max(...absoluteLayoutList.map(item => item.top + item.height));
|
|
175
200
|
return {
|
|
176
|
-
width:
|
|
177
|
-
height:
|
|
178
|
-
centerX:
|
|
179
|
-
centerY:
|
|
201
|
+
width: 0,
|
|
202
|
+
height: 0,
|
|
203
|
+
centerX: 0,
|
|
204
|
+
centerY: 0,
|
|
180
205
|
};
|
|
181
206
|
});
|
|
182
207
|
|
|
@@ -188,11 +213,12 @@ function handleStreamListTransform() {
|
|
|
188
213
|
if (!liveCoreViewContainerRef.value) {
|
|
189
214
|
return;
|
|
190
215
|
}
|
|
191
|
-
const containerRect = liveCoreViewContainerRef.value.getBoundingClientRect();
|
|
192
|
-
const containerWidth = Math.floor(containerRect.width);
|
|
193
|
-
const containerHeight = Math.floor(containerRect.height);
|
|
194
216
|
|
|
195
217
|
if (visualStreamSize.value.width && visualStreamSize.value.height) {
|
|
218
|
+
const containerRect = liveCoreViewContainerRef.value.getBoundingClientRect();
|
|
219
|
+
const containerWidth = Math.floor(containerRect.width);
|
|
220
|
+
const containerHeight = Math.floor(containerRect.height);
|
|
221
|
+
|
|
196
222
|
const scaleWidth = containerWidth / visualStreamSize.value.width;
|
|
197
223
|
const scaleHeight = containerHeight / visualStreamSize.value.height;
|
|
198
224
|
originStreamViewStyle.value.scale = Math.min(scaleWidth, scaleHeight);
|
|
@@ -208,12 +234,6 @@ function handleStreamListTransform() {
|
|
|
208
234
|
}
|
|
209
235
|
|
|
210
236
|
const streamViewStyle = computed(() => {
|
|
211
|
-
if (isPortraitContainer.value) {
|
|
212
|
-
return {
|
|
213
|
-
width: `${Math.floor(originStreamViewStyle.value.width)}px`,
|
|
214
|
-
height: `${Math.floor(originStreamViewStyle.value.height)}px`,
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
237
|
return {
|
|
218
238
|
width: `${Math.floor(originStreamViewStyle.value.width) * originStreamViewStyle.value.scale}px`,
|
|
219
239
|
height: `${Math.floor(originStreamViewStyle.value.height) * originStreamViewStyle.value.scale}px`,
|
|
@@ -246,6 +266,35 @@ const heightRatio: ComputedRef<number> = computed(() => {
|
|
|
246
266
|
return Number(aspectRatio.value.split(':')[1]);
|
|
247
267
|
});
|
|
248
268
|
|
|
269
|
+
/**
|
|
270
|
+
* fillMode rules:
|
|
271
|
+
* Rule 1: If there is only one user in seatList, fillMode is Fill
|
|
272
|
+
* Rule 2: If a user's region in seatList matches the canvas size, fillMode is Fill
|
|
273
|
+
* Rule 3: If in landscape mode, fillMode must be Fit
|
|
274
|
+
*/
|
|
275
|
+
enum StreamFillMode {
|
|
276
|
+
Fit = 'fit',
|
|
277
|
+
Fill = 'fill',
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const fillMode = ref<StreamFillMode>(StreamFillMode.Fit);
|
|
281
|
+
|
|
282
|
+
watch(() => [canvas.value, seatList.value], () => {
|
|
283
|
+
if (canvas.value.width > canvas.value.height) {
|
|
284
|
+
fillMode.value = StreamFillMode.Fit;
|
|
285
|
+
handleStreamRegionSize();
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const onlyOneSeat = seatList.value.length === 1;
|
|
289
|
+
const hasOneFullScreenUser = seatList.value.find((item: any) => item.region?.w === canvas.value.width && item.region?.h === canvas.value.height);
|
|
290
|
+
if (!isInStreamMixerComp.value && (onlyOneSeat || hasOneFullScreenUser)) {
|
|
291
|
+
fillMode.value = StreamFillMode.Fill;
|
|
292
|
+
} else {
|
|
293
|
+
fillMode.value = StreamFillMode.Fit;
|
|
294
|
+
}
|
|
295
|
+
handleStreamRegionSize();
|
|
296
|
+
});
|
|
297
|
+
|
|
249
298
|
function handleStreamRegionSize() {
|
|
250
299
|
if (!liveCoreViewContainerRef.value) {
|
|
251
300
|
return;
|
|
@@ -257,13 +306,25 @@ function handleStreamRegionSize() {
|
|
|
257
306
|
if (widthRatio.value && heightRatio.value) {
|
|
258
307
|
const scaleWidth = containerWidth / widthRatio.value;
|
|
259
308
|
const scaleHeight = containerHeight / heightRatio.value;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
309
|
+
|
|
310
|
+
if (fillMode.value === StreamFillMode.Fit) {
|
|
311
|
+
if (scaleWidth > scaleHeight) {
|
|
312
|
+
width = (containerHeight / heightRatio.value) * widthRatio.value;
|
|
313
|
+
height = containerHeight;
|
|
314
|
+
}
|
|
315
|
+
if (scaleWidth <= scaleHeight) {
|
|
316
|
+
width = containerWidth;
|
|
317
|
+
height = (containerWidth / widthRatio.value) * heightRatio.value;
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
if (scaleWidth > scaleHeight) {
|
|
321
|
+
width = containerWidth;
|
|
322
|
+
height = (containerWidth / widthRatio.value) * heightRatio.value;
|
|
323
|
+
}
|
|
324
|
+
if (scaleWidth <= scaleHeight) {
|
|
325
|
+
width = (containerHeight / heightRatio.value) * widthRatio.value;
|
|
326
|
+
height = containerHeight;
|
|
327
|
+
}
|
|
267
328
|
}
|
|
268
329
|
}
|
|
269
330
|
originStreamViewStyle.value.width = width;
|
|
@@ -283,6 +344,10 @@ const getContainerOrientation = () => {
|
|
|
283
344
|
}
|
|
284
345
|
const containerRect = liveCoreViewContainerRef.value.getBoundingClientRect();
|
|
285
346
|
isPortraitContainer.value = containerRect.width < containerRect.height;
|
|
347
|
+
liveCoreViewContainerSize.value = {
|
|
348
|
+
width: containerRect.width,
|
|
349
|
+
height: containerRect.height,
|
|
350
|
+
};
|
|
286
351
|
};
|
|
287
352
|
|
|
288
353
|
const ro = new ResizeObserver(() => {
|
|
@@ -306,32 +371,33 @@ onBeforeUnmount(() => {
|
|
|
306
371
|
width: 100%;
|
|
307
372
|
height: 100%;
|
|
308
373
|
display: flex;
|
|
309
|
-
overflow: hidden;
|
|
310
|
-
align-items: center;
|
|
311
374
|
justify-content: center;
|
|
375
|
+
overflow: hidden;
|
|
376
|
+
&.align-center {
|
|
377
|
+
align-items: center;
|
|
378
|
+
}
|
|
379
|
+
.live-core-placeholder {
|
|
380
|
+
position: absolute;
|
|
381
|
+
top: 0;
|
|
382
|
+
left: 0;
|
|
383
|
+
width: 100%;
|
|
384
|
+
height: 100%;
|
|
385
|
+
display: flex;
|
|
386
|
+
align-items: center;
|
|
387
|
+
justify-content: center;
|
|
388
|
+
.placeholder-text {
|
|
389
|
+
color: var(--text-color-secondary, rgba(255, 255, 255, 0.55));
|
|
390
|
+
font-size: 14px;
|
|
391
|
+
font-style: normal;
|
|
392
|
+
font-weight: 400;
|
|
393
|
+
line-height: 22px;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
312
396
|
|
|
313
397
|
.live-core-view {
|
|
314
398
|
width: 100%;
|
|
315
399
|
height: 100%;
|
|
316
|
-
position:
|
|
317
|
-
|
|
318
|
-
.live-core-placeholder {
|
|
319
|
-
position: absolute;
|
|
320
|
-
top: 0;
|
|
321
|
-
left: 0;
|
|
322
|
-
width: 100%;
|
|
323
|
-
height: 100%;
|
|
324
|
-
display: flex;
|
|
325
|
-
align-items: center;
|
|
326
|
-
justify-content: center;
|
|
327
|
-
.placeholder-text {
|
|
328
|
-
color: var(--text-color-secondary, rgba(255, 255, 255, 0.55));
|
|
329
|
-
font-size: 14px;
|
|
330
|
-
font-style: normal;
|
|
331
|
-
font-weight: 400;
|
|
332
|
-
line-height: 22px;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
400
|
+
position: absolute;
|
|
335
401
|
|
|
336
402
|
.stream-content {
|
|
337
403
|
width: 100%;
|
|
@@ -345,7 +411,7 @@ onBeforeUnmount(() => {
|
|
|
345
411
|
width: 100%;
|
|
346
412
|
height: 100%;
|
|
347
413
|
position: absolute;
|
|
348
|
-
pointer-events:
|
|
414
|
+
pointer-events: auto;
|
|
349
415
|
top: 0;
|
|
350
416
|
left: 0;
|
|
351
417
|
}
|
|
@@ -111,6 +111,8 @@ watch(
|
|
|
111
111
|
async (user) => {
|
|
112
112
|
if (user && user.userId) {
|
|
113
113
|
isLoadingMore.value = true;
|
|
114
|
+
currentCursor.value = '';
|
|
115
|
+
liveList.value.length = 0;
|
|
114
116
|
await fetchLiveList({});
|
|
115
117
|
isLoadingMore.value = false;
|
|
116
118
|
}
|
|
@@ -296,6 +298,7 @@ $text-color3: var(--text-color-tertiary);
|
|
|
296
298
|
|
|
297
299
|
.right {
|
|
298
300
|
display: flex;
|
|
301
|
+
align-items: center;
|
|
299
302
|
float: right;
|
|
300
303
|
margin-right: 10px;
|
|
301
304
|
gap: 2px;
|
|
@@ -1,64 +1,52 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="loginUserInfo"
|
|
4
|
-
class="live-list-panel-h5"
|
|
5
|
-
>
|
|
2
|
+
<div v-if="loginUserInfo" class="live-list-panel-h5">
|
|
6
3
|
<div
|
|
7
|
-
v-if="
|
|
4
|
+
v-if="showLiveList.length > 0"
|
|
8
5
|
ref="scrollContainerRef"
|
|
9
6
|
class="live-list"
|
|
10
|
-
@scroll="handleScroll"
|
|
11
|
-
@wheel="handleWheel"
|
|
12
7
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
<PullToRefresh
|
|
9
|
+
:text="{
|
|
10
|
+
pull: t('Pull to refresh'),
|
|
11
|
+
release: t('Release to refresh'),
|
|
12
|
+
loading: t('Loading'),
|
|
13
|
+
success: t('Refresh success'),
|
|
14
|
+
error: t('Refresh failed'),
|
|
15
|
+
}"
|
|
16
|
+
@refresh="handleRefresh"
|
|
17
|
+
@load-more="fetchMoreLives"
|
|
18
|
+
>
|
|
19
|
+
<div class="live-list-items">
|
|
20
|
+
<div v-for="item in showLiveList" :key="item.liveId" class="live-item" @click="liveRoomClick(item)">
|
|
21
|
+
<div class="live-room-cover">
|
|
22
|
+
<div class="header">
|
|
23
|
+
<IconLiveCoverHeader :size="10" />
|
|
24
|
+
<span class="viewer-count"> {{ item.currentViewerCount || 0 }} </span>
|
|
25
|
+
<span> {{ t('people have watched the live') }} </span>
|
|
26
|
+
</div>
|
|
27
|
+
<img :src="item.coverUrl || DEFAULT_COVER" alt="" @error="handleCoverImageError" />
|
|
28
|
+
</div>
|
|
29
|
+
<span class="live-name">{{ item.liveName }} </span>
|
|
30
|
+
<div class="owner-info">
|
|
31
|
+
<Avatar
|
|
32
|
+
:src="item.liveOwner.avatarUrl"
|
|
33
|
+
:size="16"
|
|
34
|
+
:style="{ border: '1px solid var(--uikit-color-white-7)' }"
|
|
35
|
+
/>
|
|
36
|
+
<span class="owner-name">{{ item.liveOwner.userName || item.liveOwner.userId }} </span>
|
|
25
37
|
</div>
|
|
26
|
-
<img
|
|
27
|
-
:src="item.coverUrl || DEFAULT_COVER"
|
|
28
|
-
alt=""
|
|
29
|
-
@error="handleCoverImageError"
|
|
30
|
-
>
|
|
31
|
-
</div>
|
|
32
|
-
<span class="live-name">{{ item.liveName }} </span>
|
|
33
|
-
<div class="owner-info">
|
|
34
|
-
<Avatar
|
|
35
|
-
:src="item.liveOwner.avatarUrl"
|
|
36
|
-
:size="16"
|
|
37
|
-
:style="{ border: '1px solid var(--uikit-color-white-7)' }"
|
|
38
|
-
/>
|
|
39
|
-
<span class="owner-name">{{ item.liveOwner.userName || item.liveOwner.userId }} </span>
|
|
40
38
|
</div>
|
|
41
39
|
</div>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
>
|
|
47
|
-
<span>{{ t('No More') }}</span>
|
|
48
|
-
</div>
|
|
40
|
+
<div v-if="!hasMoreLive" class="bottom-text-no-more">
|
|
41
|
+
<span>{{ t('No More') }}</span>
|
|
42
|
+
</div>
|
|
43
|
+
</PullToRefresh>
|
|
49
44
|
</div>
|
|
50
|
-
<div
|
|
51
|
-
v-else-if="!isLoadingMore"
|
|
52
|
-
class="no-live"
|
|
53
|
-
>
|
|
45
|
+
<div v-else-if="!isLoadingMore" class="no-live">
|
|
54
46
|
<IconNoLiveRoom :size="60" />
|
|
55
47
|
<span>{{ t('No Live') }}</span>
|
|
56
48
|
</div>
|
|
57
|
-
<div
|
|
58
|
-
v-if="liveList.length > 0 && (isShowMoreVisible || isLoadingMore)"
|
|
59
|
-
class="bottom-text"
|
|
60
|
-
>
|
|
61
|
-
<span v-if="isShowMoreVisible">{{ t('Load More') }}</span>
|
|
49
|
+
<div v-if="liveList.length > 0 && isLoadingMore" class="bottom-text">
|
|
62
50
|
<span v-if="isLoadingMore">{{ t('Loading...') }}</span>
|
|
63
51
|
</div>
|
|
64
52
|
</div>
|
|
@@ -71,10 +59,12 @@ import { useLiveState } from '../../states/LiveState';
|
|
|
71
59
|
import { useLoginState } from '../../states/LoginState';
|
|
72
60
|
import { Avatar } from '../Avatar';
|
|
73
61
|
import type { LiveInfo } from '../../types';
|
|
62
|
+
import PullToRefresh from './pullToRefresh.vue';
|
|
74
63
|
|
|
75
64
|
const { liveList, currentCursor, fetchLiveList } = useLiveState();
|
|
76
65
|
const { loginUserInfo } = useLoginState();
|
|
77
66
|
const { t } = useUIKit();
|
|
67
|
+
const showLiveList = ref<LiveInfo[]>([]);
|
|
78
68
|
|
|
79
69
|
const DEFAULT_COVER = 'https://liteav-test-1252463788.cos.ap-guangzhou.myqcloud.com/voice_room/voice_room_cover1.png';
|
|
80
70
|
const scrollContainerRef = ref<HTMLElement | null>(null);
|
|
@@ -85,24 +75,23 @@ const hasMoreLive = computed(() => currentCursor.value !== '');
|
|
|
85
75
|
const liveItemWidth = ref('168px');
|
|
86
76
|
const liveItemHeight = ref('262px');
|
|
87
77
|
|
|
88
|
-
const shouldFetchMoreLiveList = computed(() => hasMoreLive.value && !isLoadingMore.value);
|
|
89
|
-
|
|
90
|
-
const isShowMoreVisible = computed(() => shouldFetchMoreLiveList.value && !scrollContainerRef.value);
|
|
91
|
-
|
|
92
78
|
const emit = defineEmits<{
|
|
93
79
|
(e: 'live-room-click', liveInfo: LiveInfo): void;
|
|
94
80
|
}>();
|
|
95
81
|
|
|
96
82
|
watch(
|
|
97
83
|
loginUserInfo,
|
|
98
|
-
async
|
|
84
|
+
async user => {
|
|
99
85
|
if (user && user.userId) {
|
|
100
86
|
isLoadingMore.value = true;
|
|
87
|
+
currentCursor.value = '';
|
|
88
|
+
liveList.value.length = 0;
|
|
101
89
|
await fetchLiveList({});
|
|
90
|
+
showLiveList.value = liveList.value.slice();
|
|
102
91
|
isLoadingMore.value = false;
|
|
103
92
|
}
|
|
104
93
|
},
|
|
105
|
-
{ immediate: true }
|
|
94
|
+
{ immediate: true }
|
|
106
95
|
);
|
|
107
96
|
|
|
108
97
|
watch(scrollContainerRef, () => {
|
|
@@ -117,39 +106,23 @@ watch(scrollContainerRef, () => {
|
|
|
117
106
|
}
|
|
118
107
|
});
|
|
119
108
|
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
>= scrollContainerRef.value.scrollHeight - threshold
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function handleWheel(event: WheelEvent) {
|
|
136
|
-
if (!scrollContainerRef.value) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (event.deltaY > 0 && isScrollAtBottom() && shouldFetchMoreLiveList.value) {
|
|
141
|
-
fetchMoreLives();
|
|
109
|
+
async function handleRefresh(completeRefresh: (success?: boolean) => void) {
|
|
110
|
+
try {
|
|
111
|
+
isLoadingMore.value = true;
|
|
112
|
+
currentCursor.value = '';
|
|
113
|
+
liveList.value.length = 0;
|
|
114
|
+
await fetchLiveList({});
|
|
115
|
+
showLiveList.value = liveList.value.slice();
|
|
116
|
+
isLoadingMore.value = false;
|
|
117
|
+
completeRefresh(true);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
completeRefresh(false);
|
|
142
120
|
}
|
|
143
121
|
}
|
|
144
122
|
|
|
145
|
-
function
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (isScrollAtBottom() && shouldFetchMoreLiveList.value) {
|
|
151
|
-
fetchMoreLives();
|
|
152
|
-
}
|
|
123
|
+
function liveRoomClick(liveInfo: LiveInfo) {
|
|
124
|
+
console.log('liveRoomClick,liveInfo:', liveInfo);
|
|
125
|
+
emit('live-room-click', liveInfo);
|
|
153
126
|
}
|
|
154
127
|
|
|
155
128
|
async function fetchMoreLives() {
|
|
@@ -159,6 +132,7 @@ async function fetchMoreLives() {
|
|
|
159
132
|
try {
|
|
160
133
|
isLoadingMore.value = true;
|
|
161
134
|
await fetchLiveList({ cursor: currentCursor.value });
|
|
135
|
+
showLiveList.value = liveList.value.slice();
|
|
162
136
|
} finally {
|
|
163
137
|
isLoadingMore.value = false;
|
|
164
138
|
}
|
|
@@ -329,6 +303,7 @@ $text-color3: var(--text-color-tertiary);
|
|
|
329
303
|
.bottom-text-no-more {
|
|
330
304
|
flex: 1;
|
|
331
305
|
min-height: 30px;
|
|
306
|
+
text-align: center;
|
|
332
307
|
position: relative;
|
|
333
308
|
|
|
334
309
|
span {
|
|
@@ -3,6 +3,11 @@ export const resource = {
|
|
|
3
3
|
'people have watched the live': 'people have watched the live',
|
|
4
4
|
'Load More': 'Load More',
|
|
5
5
|
'Loading...': 'Loading...',
|
|
6
|
+
'Loading': 'Loading',
|
|
6
7
|
'No More': 'No More',
|
|
7
8
|
'No Live': 'No Live',
|
|
9
|
+
'Pull down to refresh': 'Pull down to refresh',
|
|
10
|
+
'Release to refresh': 'Release to refresh',
|
|
11
|
+
'Refresh success': 'Refresh success',
|
|
12
|
+
'Refresh failed': 'Refresh failed',
|
|
8
13
|
};
|
|
@@ -3,6 +3,11 @@ export const resource = {
|
|
|
3
3
|
'people have watched the live': '人看过',
|
|
4
4
|
'Load More': '加载更多',
|
|
5
5
|
'Loading...': '加载中...',
|
|
6
|
+
'Loading': '正在加载...',
|
|
6
7
|
'No More': '没有更多',
|
|
7
8
|
'No Live': '暂无直播间',
|
|
9
|
+
'Pull to refresh': '下拉刷新',
|
|
10
|
+
'Release to refresh': '松开刷新',
|
|
11
|
+
'Refresh success': '刷新成功',
|
|
12
|
+
'Refresh failed': '刷新失败',
|
|
8
13
|
};
|