|
|
@@ -17,7 +17,7 @@
|
|
|
src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/readyStart.png">
|
|
|
</image>
|
|
|
<view class="countdown-container" v-if="liveItem.status == 1 && liveCountdown">
|
|
|
- <!-- <view class="live-name">{{ liveItem.liveName }}</view> -->
|
|
|
+ <view class="live-name" v-if="liveItem.previewUrl">{{ liveItem.liveName }}</view>
|
|
|
<view class="countdown-display">
|
|
|
<text class="countdown-label">距离开播还有</text>
|
|
|
<view class="countdown-unit">
|
|
|
@@ -173,7 +173,7 @@
|
|
|
<view class="videolist" v-if="liveItem.status == 3">
|
|
|
<view class="video-container" style="height: 500rpx;"
|
|
|
:class="{'horizontal-layout': liveItem.showType == 1, 'fullscreen-mode': isFullscreen}">
|
|
|
- <view class="live-end-message">直播已结束</view>
|
|
|
+ <view class="live-end-message" :style="{marginTop:liveItem.showType === 2?'50%':''}">直播已结束</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -214,8 +214,8 @@
|
|
|
<!-- 底部聊天区域 -->
|
|
|
<view class="chat-area-container" :class="{
|
|
|
'chat-area-container2': liveItem.showType == 1,
|
|
|
- 'chat-area-container3': liveItem.status == 1 && !liveItem.previewUrl,
|
|
|
- 'chat-area-container4': liveItem.status == 1 && liveItem.previewUrl,
|
|
|
+ 'chat-area-container3': liveItem.status == 1 && !liveItem.previewUrl && liveItem.showType == 1,
|
|
|
+ 'chat-area-container4': liveItem.status == 1 && liveItem.previewUrl && liveItem.showType == 1,
|
|
|
'chat-area-focused': isFocus
|
|
|
}" :style="{ '--keyboard-height': keyboardHeight + 'rpx' ,'display':isFullscreen?'none':''}">
|
|
|
<view class="tabs_bg" v-if="liveItem.showType == 1">
|
|
|
@@ -239,7 +239,7 @@
|
|
|
:style="{ height: liveItem.showType === 1?`calc(100% - ${commonViewHeight}px)`:liveItem.status == 1?'100%':'',marginTop:liveItem.showType === 1?commonViewHeight+'px':'' }"
|
|
|
:enhanced="true" :bounces="false" :show-scrollbar="false" :fast-deceleration="false"
|
|
|
:enable-back-to-top="false" class="message-scroll-view"
|
|
|
- :class="liveItem.status == 1 ? 'message-scroll2' : ''" :scroll-top="scrollTop"
|
|
|
+ :class="liveItem.status == 1 ? '' : ''" :scroll-top="scrollTop"
|
|
|
:scroll-into-view="scrollIntoView" @scroll="onScroll" ref="scrollView">
|
|
|
<view class="message-list" v-for="(item, talkIndex) in (talklist || [])"
|
|
|
:key="item.uniqueId " :id="`list_${item.uniqueId }`" v-show="item.cmd != 'red' ">
|
|
|
@@ -716,7 +716,9 @@
|
|
|
internetTraffic, // 流量(缓冲百分比),
|
|
|
liveInternetTraffic, // 直播流量(缓冲百分比),
|
|
|
loginByMp,
|
|
|
- getUserInfo
|
|
|
+ getUserInfo,
|
|
|
+ getIsAddKf,
|
|
|
+ liveWatchUser
|
|
|
} from '@/api/living.js';
|
|
|
import {
|
|
|
editUser
|
|
|
@@ -748,6 +750,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ urlOption:{},
|
|
|
menuButtonInfo: {}, // 胶囊按钮布局信息
|
|
|
isHeight: false,
|
|
|
isFullscreen: false,
|
|
|
@@ -936,10 +939,20 @@
|
|
|
async onLoad(options) {
|
|
|
this.getMenuButtonInfo(); // 初始化获取胶囊信息
|
|
|
this.initTime()
|
|
|
-
|
|
|
+
|
|
|
// 解析参数
|
|
|
if (options.liveId) {
|
|
|
this.liveId = options.liveId;
|
|
|
+
|
|
|
+ }
|
|
|
+ if(options.qwUserId){
|
|
|
+ this.urlOption.companyId=options.companyId
|
|
|
+ this.urlOption.companyUserId=options.companyUserId
|
|
|
+ this.urlOption.corpId=options.corpId
|
|
|
+ this.urlOption.liveId=options.liveId
|
|
|
+ this.urlOption.qwUserId=options.qwUserId
|
|
|
+ this.urlOption.qwExternalId=options.externalId
|
|
|
+ this.urlOption.chatId=options.chatId
|
|
|
}
|
|
|
// 扫码传来的参数
|
|
|
if (options.scene) {
|
|
|
@@ -961,8 +974,10 @@
|
|
|
}
|
|
|
this.userinfo = uni.getStorageSync('userinfo');
|
|
|
console.log('全部参数', options);
|
|
|
-
|
|
|
+
|
|
|
// 优先判断登录状态,然后加载数据
|
|
|
+ // this.userData = uni.getStorageSync('userData');
|
|
|
+
|
|
|
try {
|
|
|
const isLogin = await this.utils.checkLiveToken();
|
|
|
this.hasCheckedLogin = true;
|
|
|
@@ -973,11 +988,12 @@
|
|
|
// 未登录:先登录,登录成功后再加载数据
|
|
|
this.goLogin();
|
|
|
}
|
|
|
+
|
|
|
} catch (error) {
|
|
|
console.error('初始化失败:', error);
|
|
|
this.hasCheckedLogin = true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 异步加载位置信息(不阻塞主流程)
|
|
|
if (!this.hasLoadedLocation) {
|
|
|
this.getLocationByIP();
|
|
|
@@ -1056,6 +1072,7 @@
|
|
|
setTimeout(() => {
|
|
|
uni.stopPullDownRefresh();
|
|
|
}, 1000);
|
|
|
+ this.getliving(this.liveId);
|
|
|
},
|
|
|
mounted() {
|
|
|
// 获取 video 上下文
|
|
|
@@ -1090,7 +1107,7 @@
|
|
|
this.hasCheckedLogin = true;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 位置信息只加载一次
|
|
|
if (!this.hasLoadedLocation) {
|
|
|
this.getLocationByIP();
|
|
|
@@ -1793,12 +1810,13 @@
|
|
|
if (this.isOnload) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.userInfo = uni.getStorageSync('userInfo');
|
|
|
if (this.userInfo) {
|
|
|
await this.getUserInfo();
|
|
|
}
|
|
|
|
|
|
+ // this.initTime();
|
|
|
if (this.liveId) {
|
|
|
// 优先加载直播间信息(包含视频资源URL)
|
|
|
await this.getliving(this.liveId);
|
|
|
@@ -1811,7 +1829,7 @@
|
|
|
]).catch(err => {
|
|
|
console.error('加载数据失败:', err);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
// 其他非关键数据异步加载
|
|
|
this.getCurrentActivities();
|
|
|
this.getliveOrder();
|
|
|
@@ -1863,7 +1881,9 @@
|
|
|
this.haveLogin()
|
|
|
this.userlogo = true
|
|
|
// console.log("TOKEN_KEYAuto",TOKEN_KEYAuto)
|
|
|
- // this.getIsAddKf()
|
|
|
+ if(this.urlOption.qwUserId){
|
|
|
+ this.getIsAddKf() //this.getIsAddKf()
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: res.msg,
|
|
|
@@ -1882,6 +1902,52 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // liveWatchUser(){
|
|
|
+ // var data={
|
|
|
+ // qwUserId:this.urlOption.qwUserId,
|
|
|
+ // liveId:this.urlOption.liveId,
|
|
|
+ // userId:this.userInfo.userId,
|
|
|
+ // corpId:this.urlOption.corpId,
|
|
|
+ // companyUserId:this.urlOption.companyUserId,
|
|
|
+ // qwExternalId:this.urlOption.qwExternalId,
|
|
|
+ // companyId:this.urlOption.companyId,
|
|
|
+ // chatId:this.urlOption.chatId,
|
|
|
+ // }
|
|
|
+ // liveWatchUser(data).then(
|
|
|
+ // res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: res.msg,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // rej => {}
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ // 客服
|
|
|
+ getIsAddKf() {
|
|
|
+ // {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
|
|
|
+ getIsAddKf(this.urlOption).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.isAddKf = 1
|
|
|
+ //this.getH5CourseVideoDetails()
|
|
|
+ } else if (res.code == 401) {
|
|
|
+ this.isAddKf = 0
|
|
|
+ this.goLogin();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {}
|
|
|
+ );
|
|
|
+ },
|
|
|
clickTabs(item) {},
|
|
|
getLocationByIP() {
|
|
|
// 防止重复请求
|
|
|
@@ -1889,7 +1955,7 @@
|
|
|
return;
|
|
|
}
|
|
|
this.hasLoadedLocation = true;
|
|
|
-
|
|
|
+
|
|
|
// 高德IP定位API,需要替换成你的key
|
|
|
const key = '4e13632be0cc278f56825919603c07cf';
|
|
|
uni.request({
|
|
|
@@ -3845,13 +3911,13 @@
|
|
|
// 修改获取直播信息方法
|
|
|
async getliving(liveId) {
|
|
|
if (!liveId) return;
|
|
|
-
|
|
|
+
|
|
|
// 防止重复请求
|
|
|
if (this.isLoadingLiveInfo) {
|
|
|
console.log('正在加载直播间信息,跳过重复请求');
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.isLoadingLiveInfo = true;
|
|
|
const param = {
|
|
|
id: liveId
|
|
|
@@ -3859,7 +3925,7 @@
|
|
|
try {
|
|
|
const res = await getlive(param);
|
|
|
this.isLoadingLiveInfo = false;
|
|
|
-
|
|
|
+
|
|
|
if (res.code !== 200) {
|
|
|
uni.showToast({
|
|
|
title: res.msg,
|
|
|
@@ -4009,7 +4075,7 @@
|
|
|
//直播间点赞、关注、在线人数数据
|
|
|
getliveViewData() {
|
|
|
if (!this.liveId) return;
|
|
|
-
|
|
|
+
|
|
|
// 使用 Promise 包装,支持 await
|
|
|
return getLiveViewData(this.liveId).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
@@ -5516,7 +5582,7 @@
|
|
|
}
|
|
|
|
|
|
&.chat-area-container4 {
|
|
|
- height: calc(85% - 640rpx);
|
|
|
+ height: calc(85% - 680rpx);
|
|
|
flex: 1;
|
|
|
transform: none; // 移除之前的变换
|
|
|
will-change: auto;
|
|
|
@@ -5567,7 +5633,7 @@
|
|
|
position: relative;
|
|
|
|
|
|
&.chat-content-focused {
|
|
|
- height: 100rpx;
|
|
|
+ height: 100rpx !important;
|
|
|
}
|
|
|
|
|
|
.notice-message {
|