Browse Source

礼物”

git commit -m 礼物”
liujiaxin 1 day ago
parent
commit
26e5fec236
42 changed files with 7996 additions and 8051 deletions
  1. 34 5
      api/living.js
  2. 2 2
      manifest.json
  3. 3 79
      pages.json
  4. 2 2
      pages/auth/login.vue
  5. 1 1
      pages/common/launch.vue
  6. 7 6
      pages/home/index.vue
  7. 47 5
      pages/user/index.vue
  8. 2 2
      pages_company/order/confirmCompanyOrder.vue
  9. 0 660
      pages_course/becomeVIP.vue
  10. 66 87
      pages_course/components/chatInput.vue
  11. 1170 0
      pages_course/components/liveVideo-new.vue
  12. 1174 847
      pages_course/components/liveVideo.vue
  13. 0 52
      pages_course/components/lotteryPopup.vue
  14. 4 4
      pages_course/components/shopPopup.vue
  15. 0 160
      pages_course/courseCover.vue
  16. 0 489
      pages_course/feedback.vue
  17. 4500 0
      pages_course/living-new.vue
  18. 923 578
      pages_course/living.vue
  19. 4 2
      pages_course/livingold.vue
  20. 0 161
      pages_course/reward.vue
  21. 0 2135
      pages_course/video.vue
  22. 0 2535
      pages_course/videovip.vue
  23. 0 209
      pages_course/webview.vue
  24. 43 16
      pages_shopping/live/complaint.vue
  25. 1 1
      pages_shopping/live/complaintList.vue
  26. 1 1
      pages_shopping/live/confirmCreateOrder.vue
  27. 1 1
      pages_shopping/live/storeOrderDetail.vue
  28. 5 5
      pages_shopping/shopping/paymentOrder.vue
  29. 3 3
      pages_shopping/shopping/productDetails.vue
  30. 1 1
      pages_user/user/pay.vue
  31. 2 2
      pages_user/user/userTuiAdd.vue
  32. BIN
      static/images/full_screen.png
  33. BIN
      static/images/half_screen.png
  34. BIN
      static/images/name.png
  35. BIN
      static/images/points_title.png
  36. BIN
      static/images/points_title2.png
  37. BIN
      static/images/problem.png
  38. BIN
      static/images/ranking1.png
  39. BIN
      static/images/ranking2.png
  40. BIN
      static/images/ranking3.png
  41. BIN
      static/images/trailer.png
  42. BIN
      static/images/viewer_title.png

+ 34 - 5
api/living.js

@@ -88,13 +88,13 @@ export function watchUserList(liveId, pageSize, pageNum, reasonable, data = {})
 		'application/json;charset=UTF-8')
 }
 // 获取最近聊天记录
-// export function liveMsg(liveId, pageSize, pageNum, data = {}) {
-// 	return request(api.liveMsg(liveId, pageSize, pageNum), data, 'GET', 'application/json;charset=UTF-8')
-// }
-// 加载直播间消息接口
 export function liveMsg(liveId, pageSize, pageNum, data = {}) {
-	return request('/app/live/liveMsg/myList', data, 'GET', 'application/json;charset=UTF-8');
+	return request(api.liveMsg(liveId, pageSize, pageNum), data, 'GET', 'application/json;charset=UTF-8')
 }
+// 加载直播间消息接口
+// export function liveMsg(liveId, pageSize, pageNum, data = {}) {
+// 	return request('/app/live/liveMsg/myList', data, 'GET', 'application/json;charset=UTF-8');
+// }
 
 
 // 小黄车
@@ -194,3 +194,32 @@ export function myLottery(data) {
 // export function sendPopMsg(liveId, pageSize, pageNum, data = {}) {
 // 	return request('/app/live/liveMsg/myList', data, 'GET', 'application/json;charset=UTF-8');
 // }
+
+
+// 查询正常状态的礼物列表,按价格升序排列
+export function activeList(data) {
+	return request('/app/live/liveGift/activeList', data, 'GET', 'application/json;charset=UTF-8');
+}
+// 用户送礼物
+export function sendliveGift(data) {
+	return request('/app/live/liveGift/send', data, 'POST', 'application/json;charset=UTF-8');
+}
+
+
+ // 查询当前用户当前直播间领取积分的剩余时长 (传入直播间id)
+ export function remainingTime(data) {
+  	return request('/app/live/completion/remaining-time',data,'GET','application/json;charset=UTF-8');
+ }
+ // 更新用户的看课时长 (传入直播间id和看课时长)
+ export function updateWatchDuration(liveId,watchDuration) {
+  	return request(`/app/live/completion/update-watch-duration?liveId=${liveId}&watchDuration=${watchDuration}`,null,'POST','application/json;charset=UTF-8');
+ }
+ // 用户领取看课积分(传入直播间id)
+ export function receivePoints(data) {
+  	return request(`/app/live/completion/receive-points?liveId=${data}`,data,'POST','application/json;charset=UTF-8');
+ }
+ // 查询用户自己的积分记录
+ export function integrallogs(data) {
+  	return request('/app/live/completion/integral-logs',data,'GET','application/json;charset=UTF-8');
+ }
+

+ 2 - 2
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "芳华选",
+    "name" : "芳华选",
     "appid" : "__UNI__D138114",
     "description" : "",
     "versionName" : "1.0.0",
@@ -101,7 +101,7 @@
     "sassImplementationName" : "node-sass",
     "vueVersion" : "2",
     "h5" : {
-        "title" : "芳华选",
+        "title" : "芳华选",
         "devServer" : {
             "https" : false
         },

+ 3 - 79
pages.json

@@ -24,7 +24,7 @@
 		{
 			"path": "pages/home/index",
 			"style": {
-				"navigationBarTitleText": "芳华选",
+				"navigationBarTitleText": "芳华选",
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom",
 				"app-plus": {
@@ -961,83 +961,7 @@
 		},
 		{
 			"root": "pages_course",
-			"pages": [{
-					"path": "video",
-					"style": {
-						"navigationBarTitleText": "课程",
-						"navigationStyle": "custom",
-						"scrollIndicator": "none",
-						"usingComponenets": {
-							"uni-popup": "/uni_modules/uni-popup/components/uni-popup/uni-popup"
-						},
-						"componentPlaceholder": {
-							"uni-popup": "view"
-						},
-						"app-plus": {
-							"bounce": "none",
-							"softinputMode": "adjustResize"
-						}
-					}
-
-				}, {
-					"path": "feedback",
-					"style": {
-						"navigationBarTitleText": "投诉反馈",
-						"navigationStyle": "custom",
-						"scrollIndicator": "none",
-						"app-plus": {
-							"bounce": "none",
-							"softinputMode": "adjustResize"
-						}
-					}
-
-				},
-				{
-					"path": "becomeVIP",
-					"style": {
-						"navigationBarTitleText": "注册会员",
-						"enablePullDownRefresh": false,
-						"navigationStyle": "custom"
-					}
-				},
-				{
-					"path": "webview",
-					"style": {
-						"navigationBarTitleText": "授权登录",
-						"scrollIndicator": "none",
-						"app-plus": {
-							"bounce": "none",
-							"softinputMode": "adjustResize"
-						}
-					}
-
-				},
-				{
-					"path": "videovip",
-					"style": {
-						"navigationBarTitleText": "手动看课",
-						"enablePullDownRefresh": false,
-						"navigationStyle": "custom",
-						"scrollIndicator": "none",
-						"app-plus": {
-							"bounce": "none",
-							"softinputMode": "adjustResize"
-						}
-					}
-				},
-				{
-					"path": "courseCover",
-					"style": {
-						"navigationBarTitleText": "看课封面",
-						"enablePullDownRefresh": false,
-						"navigationStyle": "custom",
-						"scrollIndicator": "none",
-						"app-plus": {
-							"bounce": "none",
-							"softinputMode": "adjustResize"
-						}
-					}
-				}, {
+			"pages": [ {
 					"path": "livingList",
 					"style": {
 						"navigationBarTitleText": "直播列表",
@@ -1070,7 +994,7 @@
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "芳华选",
+		"navigationBarTitleText": "芳华选",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#FFFFFF"
 	},

+ 2 - 2
pages/auth/login.vue

@@ -6,10 +6,10 @@
 				<view class="logo">
 					<view class="logo-img">
 						<image
-							src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250721/efce6c594de34caba6537992083a5e47.png">
+							src="/static/images/logo.png">
 						</image>
 					</view>
-					<view class="title">芳华选</view>
+					<view class="title">芳华选</view>
 				</view>
 				<view class="login-notice">为了提供更优质的服务,请先登录</view>
 				<!-- <button

+ 1 - 1
pages/common/launch.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="loadding" v-if="loadding==true">
 			<image src="/static/images/logo.png"></image>
-			<text class="text">芳华选</text>
+			<text class="text">芳华选</text>
 		</view>
 	</view>
 </template>

+ 7 - 6
pages/home/index.vue

@@ -8,8 +8,7 @@
 					<!-- 这里是状态栏 -->
 					<view class="status_bar" :style="{height: statusBarHeight}"></view>
 					<view class="top-title">
-						<image class="name" src="../../static/images/name.png"></image>
-						<!-- <view class="name">芳华惠选</view> -->
+						<view class="name">芳华悦选</view>
 						<!-- <view class="dot">•</view><view class="sub-name">七彩互联网医院</view> -->
 					</view>
 					<!-- 搜索框、购物车、客服 -->
@@ -82,7 +81,6 @@
 			</view>
 			<view class="item"  @click="navTo('/pages_course/livingList')">
 				<image class="bg-img" src="/static/images/banner2.png" mode=""></image>
-				
 			</view>
 		</view>
 		<view class="index-cont">
@@ -497,9 +495,9 @@
 		},
 		onShareAppMessage(res) {
 			return {
-				title: '芳华选',
+				title: '芳华选',
 				path: `/pages/common/launch`,
-				imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250721/efce6c594de34caba6537992083a5e47.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
+				imageUrl: '/static/images/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}
 		},
 		onReachBottom() {
@@ -509,7 +507,7 @@
 		//分享到朋友圈
 		onShareTimeline(res) {
 			return {
-				title: '芳华选互联网医院',
+				title: '芳华选互联网医院',
 				query:'',//页面参数
 				imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250721/efce6c594de34caba6537992083a5e47.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}
@@ -1008,6 +1006,9 @@
 				line-height: 88upx;
 				display: flex;
 				align-items: center;
+				font-weight: 600;
+				font-size: 36rpx;
+				color: #fff;
 				justify-content: flex-start;
 				.name{
 					margin-left: 15rpx;

+ 47 - 5
pages/user/index.vue

@@ -237,12 +237,54 @@
 				}
 				
 			},
+			// loginOUt(){
+			// 	this.utils.loginOut();
+			// 	this.getUserInfo();
+			// 	// uni.switchTab({
+			// 	// 	url:'/pages/home/index'
+			// 	// })
+			// },
 			loginOUt(){
-				this.utils.loginOut();
-				this.getUserInfo();
-				// uni.switchTab({
-				// 	url:'/pages/home/index'
-				// })
+			  const that = this;
+			  uni.showModal({
+			    title: '提示',
+			    content: '确定要退出登录吗?',
+			    success: function(res) {
+			      if (res.confirm) {
+			        // 先重置用户数据为默认值
+			        that.user = {
+			          isPromoter: 0,
+			          isWeixinAuth: 0,
+			          phone: "",
+			          nickname: "请登录",
+			          avatarUrl: "/static/images/detault_head.png",
+			          avatar: null // 确保头像也被重置
+			        };
+			        
+			        // 清空本地存储的用户数据
+			        uni.removeStorageSync('userData');
+			        
+			        // 执行退出登录逻辑
+			        that.utils.loginOut();
+			        
+			        // 重置订单数量
+			        that.count0 = 0;
+			        that.count1 = 0;
+			        that.count2 = 0;
+			        that.afterSalesCount = 0;
+			        that.msgNum = 0;
+			        
+			        // 可选:提示退出成功
+			        uni.showToast({
+			          title: '已退出登录',
+			          icon: 'success'
+			        });
+			        
+			        // 可选:如果需要刷新页面数据,可以重新调用 onShow 中的方法
+			        // 但由于我们已经手动重置了数据,这一步不是必需的
+			      }
+			    }
+			  });
 			},
 			openPersonInfo(){
 				this.utils.isLogin().then(res => {

+ 2 - 2
pages_company/order/confirmCompanyOrder.vue

@@ -83,7 +83,7 @@
 		//发送给朋友
 		onShareAppMessage(res) {
 			return {
-				title: "芳华选-您的专属健康解决方案",
+				title: "芳华选-您的专属健康解决方案",
 				path: '/pages_company/order/confirmOrder?orderKey='+this.orderKey,
 				imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250721/efce6c594de34caba6537992083a5e47.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}
@@ -92,7 +92,7 @@
 		//分享到朋友圈
 		onShareTimeline(res) {
 			return {
-				title:"芳华选-您的专属健康解决方案",
+				title:"芳华选-您的专属健康解决方案",
 				query:'orderKey='+this.orderKey,
 				imageUrl:  'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250721/efce6c594de34caba6537992083a5e47.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}

+ 0 - 660
pages_course/becomeVIP.vue

@@ -1,660 +0,0 @@
-<template>
-	<view class="content hb column justify-center align-center bgf">
-		<image :src="imgPath+'/app/image/becomevip.png'" mode="widthFix"></image>
-		<view class="justify-start align-center fs24 base-color-9" v-if="userInfo.userId">
-			<view>{{nameuser}}#</view>
-			<view>{{userInfo.userId}}</view>
-		</view>
-		<view class="bolds">成为会员,享受更多权益</view>
-		<!--#ifdef H5-->
-		<view class="sure" @click="registerCourse">{{isVip==1?'您已成为会员':viptext}}</view>
-		<!--#endif-->
-		<!--#ifdef MP-WEIXIN-->
-		
-		<view class="base-bg-orange colorf ptb20 plr40 radius60" 
-		v-if="(userinfos==null||userinfos=='')&&imgname=='乐氏本源'" @click="nato()">授权用户信息</view>
-		<view class="btns" v-else>
-			<button class="author-btn" @click="handleAgree()">{{viptext}}</button>
-		</view>
-		
-		<!--#endif-->
-		<!--#ifdef MP-WEIXIN-->
-		<u-popup :show="userlogo" mode="bottom" round='12'>
-			<view class="userlogo column">
-				<view class="mtb30 justify-start align-center ml20">
-					<u-avatar :src="imgPath+'/app/image/logo.png'" size="50"></u-avatar>
-					<view class="bold mlr20">{{imgname}}</view>
-					<view>申请</view>
-				</view>
-				<view class="bold fs36 ml20">授权你的昵称头像信息</view>
-				<view class="mtb20 justify-between align-center  plr20">
-					<view class="justify-start align-center">
-						<view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
-							<view v-if="userinfos.nickname">√</view>
-						</view>
-						<view class="ml20">
-							<view class="base-color-3 bold">第一步</view>
-							<view class="fs24 base-color-9">请点击授权微信昵称</view>
-						</view>
-					</view>
-					<view class="button-container">
-					   <input 
-					     type="nickname"
-					     class="hidden-input"
-						@blur="onNickNameInput"
-						 @input="onNickNameInput"
-					   />
-					   <button class="custom-button" :class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button>
-					 </view>
-				</view>
-				<view class="mtb20 justify-between align-center  plr20 mt40">
-					<view class="justify-start align-center">
-						<view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
-							<view v-if="userinfos.avatar">√</view>
-						</view>
-						<view class="ml20">
-							<view class="base-color-3 bold">第二步</view>
-							<view class="fs24 base-color-9">请点击授权微信头像</view>
-						</view>
-					</view>
-					<view class="button-container">
-					  <button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="hidden-input" 
-					  v-if="nameuser">
-					    允许授权
-					  </button>
-					  <button class="custom-button sub" @click="shouquan" v-if="nameuser==''">允许授权</button>
-					   <button class="custom-button "  :class="avataruser==''?'subname':'subavt'"
-					   v-else>{{avataruser?"已授权":'允许授权'}}</button>
-					 </view>
-				</view>
-				<view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
-			</view>
-		</u-popup>
-		<!--#endif-->
-		<!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
-	</view>
-</template>
-
-<script>
-	import { loginByMp,loginByMiniApp,checkUserInfo,editUser} from '@/api/user'
-	import {handleFsUserWx,registerCourses} from '@/api/courseLook.js'
-	import {
-		getConfigByKey
-	} from "@/api/course.js"
-	export default {
-		data() {
-			return {
-				isVip: 0,
-				isWechat: false,
-				isLogin: false,
-				companyid:'',
-				companyUserId:'',
-				userInfo:{},
-				tagIds:[],
-				isbecomevip:0,
-				viptext:'申请成为会员',
-				userlogo:false,
-				userinfos:{
-					nickname:'',
-					avatar:""
-				},
-				headImg:'',
-				authType:0,//0微信登录 1手机号登录
-				userdisabled:false,
-				projectId:'',
-				H5course:{},
-				projectCode:''
-			}
-		},
-		computed: {
-		    imgPath() {
-				if(uni.getStorageSync('requestImagesPath')){
-					return uni.getStorageSync('requestImagesPath')
-				}else{
-					return this.$store.state.imgpath
-				}
-		    },
-			imgname() {
-			  return this.$store.state.logoname
-			},
-			appid() {
-				return this.$store.state.appid
-			},
-			nameuser() {
-				return this.userinfos.nickname
-			},
-			avataruser() {
-				return this.userinfos.avatar
-			},
-		},
-		async onLoad(option) {
-			this.getWebviewUrl()
-			uni.$on('usercode',(data)=>{
-				console.log('huoqu ',data)
-				this.goLogin(data)
-			})
-			uni.$on('vipMsg',(data)=>{
-				console.log('vipMsg ',data)
-				this.viptext=data
-			})
-			if(uni.getStorageSync('userInfo')&&uni.getStorageSync('userInfo')!='{}') {
-				this.userInfo = uni.getStorageSync('userInfo')
-			} else {
-				this.userInfo = {}
-			}
-			// this.userInfo=JSON.parse(uni.getStorageSync('userInfo')) || {};
-			//#ifdef MP-WEIXIN
-			let obj=uni.getStorageSync('TOKEN_WEXIN');
-			//#endif
-			// #ifdef H5
-			let obj=uni.getStorageSync('TOKEN_KEY');
-			// #endif
-			// let obj=uni.getStorageSync('AppToken');
-			this.isLogin = !!obj;
-			console.log(option)
-			const keys = decodeURIComponent(Object.keys(option)[0]);
-			let becomeVip=JSON.parse(keys.split('becomeVip=')[1])
-			console.log(becomeVip)
-			this.companyid = becomeVip.companyId || ''
-			this.companyUserId=becomeVip.companyUserId || 0
-			this.projectId = becomeVip.projectId
-			this.H5course.companyId=becomeVip.companyId
-			this.H5course.companyUserId=becomeVip.companyUserId
-			this.H5course.projectId=becomeVip.projectId
-			this.projectCode=becomeVip.projectCode
-			uni.setStorageSync('H5course',this.H5course)
-			//#ifdef MP-WEIXIN
-			// if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
-			// 	this.userlogo=true
-			// }
-			if(!uni.getStorageSync('userinfos')&&this.$store.state.logoname=='乐氏本源'){
-				await this.utils.getConfigKey();
-				uni.navigateTo({
-					url:'/pages_course/webview'
-				})
-				return
-			}
-			// if(this.$store.state.logoname=='乐氏本源'){
-			// 	this.userInfos=uni.getStorageSync('userInfos')
-			// 	if(!uni.getStorageSync('userInfos')){
-			// 		uni.navigateTo({
-			// 			url:'/pages_course/webview'
-			// 		})
-			// 	}
-			// }
-			//#endif
-			if(option.tagids==null){
-				this.tagIds=[]
-			}else{
-				this.tagIds=option.tagids 
-				const arr =this.tagIds.split(",")
-				  .map(item => parseInt(item.trim(), 10))
-				  .filter(num => !isNaN(num)); // 过滤无效转换
-				  this.tagIds =arr
-				// console.log(this.tagIds); 
-			}
-			// this.isWechat = String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger"
-			// this.code = option.code
-			// 	// #ifdef H5
-			// 	if(this.code&&!this.isLogin) {
-			// 		this.loginByMp()
-			// 	}
-			// 	// #endif
-				
-		},
-		onShow() {
-			this.utils.getDomain({projectCode:this.projectCode}).then(res=>{
-				if(res.code == 200) {
-						this.sendType=uni.getStorageSync('sendType')
-						this.utils.getConfigKey()
-						if(uni.getStorageSync('userInfo')&&uni.getStorageSync('userInfo')!='{}') {
-							this.userInfo = uni.getStorageSync('userInfo')
-						} else {
-							this.userInfo = {}
-						}
-						this.userinfos=uni.getStorageSync('userinfos')
-						let obj=uni.getStorageSync('TOKEN_WEXIN');
-						console.log(uni.getStorageSync('userinfos'))
-						this.isLogin = !!obj;
-						if(this.isLogin&&this.isVip!=1) {
-							this.registerCourse()
-						}
-				}
-			})
-		},
-		methods: {
-			getWebviewUrl() {
-				var data = {
-					key: 'course.config'
-				}
-					getConfigByKey(data).then(res => {
-						if (res.code == 200) {
-							console.log("getConfigByKey====", JSON.parse(res.data))
-							let data = JSON.parse(res.data,)
-							uni.setStorageSync('weixinOauth',data.userCourseAuthDomain)
-						}else{
-							uni.showToast({
-								icon:'none',
-								title: res.msg,
-							});
-						}
-					})
-			},
-			async goLogin(data) {
-				console.log('huoqu111',data)
-				if(data){
-					console.log('huoqu1222',data)
-					uni.showLoading({
-						title: '加载中'
-					})
-					uni.login({
-						provider: "weixin",
-						success: async loginRes => {
-							console.log(loginRes)
-							let code = loginRes.code // 获取开发code
-							handleFsUserWx({
-							   code: code,
-							   appId:this.appid,
-							   userId:data.userId
-							})
-							.then( res => {
-								if(res.code==200){
-									console.log(res)
-									uni.hideLoading();
-									uni.showToast({
-										icon:'none',
-										title: "登录成功",
-									});
-									this.userinfos=uni.getStorageSync('userinfos')
-									uni.getStorageSync('TOKEN_WEXIN');
-									this.userInfo=uni.getStorageSync('userInfo');
-									this.isLogin = true
-									setTimeout(()=>{
-										this.registerCourse()
-									},200)
-								}else if(res.code==406){
-									uni.hideLoading();
-									uni.showToast({
-										icon:'none',
-										title: '该用户已成为其他销售会员',
-									});
-								}else{
-									uni.hideLoading();
-									uni.showToast({
-										icon:'none',
-										title: res.msg,
-									});
-								}
-							   
-							 })
-						},
-					})
-				}else{
-					uni.navigateTo({
-						url:'/pages_course/webview?H5course='+uni.getStorageSync('H5course')
-					})
-				}
-				
-			},
-			shouquan(){
-				if(this.userinfos.nickname==''){
-					uni.showToast({
-						icon:'none',
-						title: "请先授权微信昵称",
-					});
-				}
-			},
-			confimrname(){
-				if(this.userinfos.nickname==''){
-					uni.showToast({
-						icon:'none',
-						title: "请授权微信昵称",
-					});
-					return
-				}
-				if(this.userinfos.avatar==''){
-					uni.showToast({
-						icon:'none',
-						title: "请授权微信头像",
-					});
-					return
-				}
-				uni.setStorageSync('userinfos',this.userinfos)
-				this.editUserA()
-				this.userlogo=false
-			},
-			onChooseAvatar(e){
-				this.userinfos.avatar=e.detail.avatarUrl
-				console.log(e.detail.avatarUrl)
-				uni.uploadFile({
-					url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
-					filePath: e.detail.avatarUrl,
-					name: 'file',
-					formData: {
-						'user': 'test'  // 上传附带参数
-					},
-					success: (uploadFileRes) => {
-						console.log(uploadFileRes)
-						// 根据接口具体返回格式   赋值具体对应url
-						var data=JSON.parse(uploadFileRes.data)
-						this.headImg=uni.getStorageSync('requestPath')+data.fileName
-						this.userinfos.avatar=data.url
-					}
-				});
-			},
-			onNickNameInput(e){
-				console.log(e)
-				this.userinfos.nickname=e.detail.value
-			},
-			async nato(){
-				await this.utils.getConfigKey();
-				uni.navigateTo({
-					url:'/pages_course/webview'
-				})
-			},
-			handleAgree(){
-				console.log(144443)
-				if(this.isVip==1){
-					uni.showToast({
-						title: '您已成为会员!',
-						icon: 'none',
-						duration: 2000,
-					})
-				}else{
-					this.goLogin()
-					uni.showToast({
-						title: this.viptext,
-						icon: 'none',
-						duration: 2000,
-					})
-				}
-				
-			},
-			getWechatCode() {
-				if (this.isWechat) {
-					// let appid = "wx961fadab9bcb792b"; //微信APPid(福本源)
-					// let appid = "wx93ce67750e3cfba3"; //微信APPid(云联融智)
-					// let appid = "wxea1da2b708ab3c2f"; //微信APPid(蜂巢快药)
-					// let appid = "wx3de90a39feb8107a"; //微信APPid(中康看课)
-					// let appid = "wxec49f9d783abf233"; //微信APPid(惠名大药房)
-					// let appid = "wx5a0f7e1932e2689e"; //微信APPid(同顺堂)
-					// let appid = "wxe0b82a0018449a62"; //微信APPid(良苗)
-					// let appid = "wx568ea6b70350c585"; //微信APPid(倍力优)
-					let appid = "wx0d021524695f1943"; //微信APPid(百年康城)
-					// let appid = "wx090c5f399d65456e"; //微信APPid(青岛市德瑞康)
-					// let appid = "wx52298c1781d5cc99"; //微信APPid(金慷建)
-					let code = this.getUrlCode().code; //是否存在code
-					let local = window.location.href;
-					if (code == null || code === "") {
-
-						let urlPaths = local.split("/registerCourse");
-						uni.setStorageSync('beforLoginPage', urlPaths[1]);
-
-						//不存在就打开上面的地址进行授权
-						window.location.href =
-							"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
-							appid +
-							"&redirect_uri=" +
-							encodeURIComponent(local) +
-							"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
-					} else {
-						this.code = code;
-						this.loginByMp()
-					}
-				}else{
-					uni.showToast({
-						title: '请在微信浏览器中打开',
-						icon:'error'
-					})
-				}
-			},
-			getUrlCode() {
-				// 截取url中的code方法
-				var url = location.search;
-				var theRequest = new Object();
-				if (url.indexOf("?") != -1) {
-					var str = url.substr(1);
-					var strs = str.split("&");
-					for (var i = 0; i < strs.length; i++) {
-						theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
-					}
-				}
-				return theRequest;
-			},
-			loginByMp() {
-				if (this.code == null) {
-					return;
-				}
-				uni.showLoading({
-					title: "处理中..."
-				});
-				loginByMp({code:this.code}).then(res => {
-						uni.hideLoading();
-						if (res.code == 200) {
-							uni.setStorageSync('TOKEN_KEY', res.token);
-							uni.setStorageSync('userInfo', JSON.stringify(res.user));
-							this.userInfo= res.user
-							let beforLoginUrl = uni.getStorageSync('beforLoginPage');
-							this.isLogin = true
-							this.registerCourse()
-						} else {
-							uni.showToast({
-								title: res.msg,
-								icon: 'none'
-							});
-						}
-					},
-					err => {}
-				);
-			},
-			// 成为会员
-			registerCourse() {
-				console.log(123333)
-				this.isVip = 0
-				// 确保从本地存储重新获取最新数据
-				  // if(uni.getStorageSync('userInfo')){
-				  // 	this.userInfo=JSON.parse(uni.getStorageSync('userInfo'));
-				  // }
-				  // if (!this.userInfo.userId) {
-				  // 	// 空值检查
-				  //   uni.showToast({ title: '用户未登录或信息不完整', icon: 'none' });
-				  //   return;
-				  // }
-				  if(this.tagIds==null){
-					  this.tagIds=""
-				  }
-				  // console.log(this.tagIds)
-				const data={
-					userId:this.userInfo.userId,
-					companyUserId:this.companyUserId,
-					companyId:this.companyid,
-					tagIds:this.tagIds,
-					projectId:this.projectId
-					}
-				if(this.isLogin) {
-					registerCourses(data).then(res=>{
-						if(res.code == 200) {
-							this.isVip = 1
-							this.isbecomevip=1
-							this.viptext='您已成为会员'
-							uni.showToast({
-								title: '注册成功',
-								icon:'none'
-							})
-						} else {
-							this.isbecomevip=1
-							// console.log(this.isbecomevip)
-							this.viptext=res.msg
-							uni.showToast({
-								icon:'none',
-								title: res.msg
-							})
-						}
-					})
-				} else {
-					// #ifdef H5
-					this.getWechatCode()
-					// #endif
-					
-				}
-			}
-		}
-	}
-</script>
-<style lang="scss" scoped>
-	page{
-		background-color: #fff;
-	}
-	.subname{
-		background-color: #00aa00;
-		color: #fff;
-	}
-	.subavt{
-		background-color: #fff;
-		border: 2rpx #0a0 solid;
-		color: #00aa00;
-	}
-	.boxweixin{
-		width: 44rpx;
-		height: 44rpx;
-		border-radius: 50%;
-		text-align: center;
-		line-height: 34rpx;
-		color: #0a0;
-	}
-	.boxnosel{
-		border: #757575 4rpx solid;
-	}
-	.boxsel{
-		border: #0a0 4rpx solid;
-	}
-	.button-container {
-	  position: relative;
-	  width: 240rpx;
-	}
-	.hidden-input {
-	  position: absolute;
-	  top: 0;
-	  left: 0;
-	  width: 100%;
-	  height: 100%;
-	  opacity: 0;
-	  z-index: 2;
-	}
-	.custom-button {
-	  position: relative;
-	  z-index: 1;
-	  /* 其他样式 */
-	  width:100%;
-	  margin: 0 auto;
-	  height: 80rpx;
-	  line-height: 60rpx;
-	  font-size: 28rpx;
-	  padding: 10rpx 20rpx;
-	}
-	.submitname{
-		width: 90%;
-		margin: 0 auto;
-		text-align: center;
-		padding: 30rpx;
-		margin-top: 40rpx;
-	}
-	.sub{
-		background-color: #f0f0f0;
-		color: #0a0;
-	}
-	.subact{
-		background-color: #0a0;
-		color: #fff;
-	}
-	.userlogo{
-		height: 760rpx;
-	}
-	.getlogo{
-		width:240rpx;
-		background-color: #fff;
-		// padding: 10rpx 20rpx;
-	}
-	::v-deep .u-popup {
-	 flex: 0 !important;
-	}
-	// .submitname{
-	// 	width: 60%;
-	// 	background-color: #05a8ee;
-	// 	color: #fff;
-	// 	margin: 0 auto;
-	// 	border-radius: 80rpx;
-	// 	text-align: center;
-	// 	padding: 20rpx;
-	// 	margin-top: 40rpx;
-	// }
-	.userlogo{
-		height: 760rpx;
-	}
-	.getlogo{
-		width:calc(60% - 40rpx);
-		margin: 0 auto;
-		background-color: #fff;
-		padding: 10rpx 20rpx;
-		image{
-			width: 80rpx !important;
-			height: 80rpx !important;
-		}
-	}
-	.footer-tips {
-			// margin-top: 14rpx;
-			position: fixed;
-			width: 100%;
-			bottom: 44rpx;
-			text-align: center;
-			font-family: PingFang SC,PingFang SC;
-			font-weight: 500;
-			font-size: 12px;
-			color: #bbb;
-			transform: scale(0.8); 
-		}
-	.content {
-		image {
-			width: 300rpx;
-			height: 300rpx;
-		}
-	}
-	.bolds {
-		color: #999;
-		font-size: 16px;
-		height: auto;
-		line-height: inherit;
-		margin-bottom: 0;
-		width: 304px;
-		word-break: break-all;
-		text-align: center;
-		margin: 50rpx 0 100rpx 0;
-	}
-	.sure {
-		width: 500rpx;
-		background-color: #1777ff;
-		line-height: 88rpx;
-		text-align: center;
-		border-radius: 8rpx;
-		color: #fff;
-	}
-	.btns{
-		position: relative;
-		width: 630rpx;
-		height: 80rpx;
-		.author-btn{				
-			z-index:100;
-			position: absolute;
-			width: 630rpx;
-			height: 80rpx;
-			line-height: 80rpx;
-			text-align: center;
-			background: #1777ff;
-			border-radius: 40rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: rgba(255, 255, 255, 1);
-		}
-	}
-</style>

+ 66 - 87
pages_course/components/chatInput.vue

@@ -1,23 +1,26 @@
 <template>
 	<view class="chat-input-container" :class="{ 'parent-container-focused': isFocus }">
-		<view class="x-f input-container-optimized" :class="{
+		<view class="x-f input-container" :class="{
         'input-container-focused': isFocus,
-        'justify-between': !isFocus
-      }" :style="containerStyle">
+        'input-container-normal': !isFocus
+      }">
 			<input id="txgMsg" :placeholder="placeholderText" v-model="inputValue" placeholder-style="color:#e7e7e7;"
-				placeholder-class="placeholder-style" class="ml20 input-native input-optimized"
+				placeholder-class="placeholder-style" class="ml20 input-native input-field"
 				:class="{ 'input-focused': isFocus }" @focus="handleFocus" @blur="handleBlur" cursor-spacing="100"
 				:adjust-position="false" />
-			<view v-if="isFocus" class="send" @click="handleSend">发送</view>
+			<view class="send-btn" @click="handleSend">发送</view>
 		</view>
 
-		<view class="justify-between mr15 align-center shopping-icon-container" :style="iconContainerStyle">
+		<view class="icon-container" :class="{ 'icon-hidden': isFocus }">
+			<view class="icon-bg ml20" @click="handleMoreClick">
+				<image src="/static/images/more-icon.png" class="w58 h58" />
+			</view>
 			<view class="icon-bg ml20" @tap="handleOpenCart">
 				<image src="/static/images/shopping.png" class="w58 h58" />
 			</view>
-			<view class="icon-bg ml20" @click="handleShowGift">
+			<!-- <view class="icon-bg ml20" @tap="handleShowGift">
 				<image src="/static/images/gift.png" class="w58 h58" />
-			</view>
+			</view> -->
 		</view>
 	</view>
 </template>
@@ -26,17 +29,14 @@
 	export default {
 		name: 'ChatInput',
 		props: {
-			// 输入框占位符文本
 			placeholderText: {
 				type: String,
 				default: '说点什么...'
 			},
-			// 初始输入值
 			value: {
 				type: String,
 				default: ''
 			},
-			// 是否聚焦状态(从父组件传递)
 			focused: {
 				type: Boolean,
 				default: false
@@ -48,40 +48,16 @@
 				inputValue: ''
 			};
 		},
-		computed: {
-			// 输入框容器样式
-			containerStyle() {
-				return {
-					padding: this.isFocus ? '10rpx 10rpx 10rpx 20rpx' : '10rpx 14rpx 10rpx 32rpx',
-					
-					width: this.isFocus ? 'calc(100% - 20rpx)' : '100%',
-					maxWidth: this.isFocus ? 'calc(100% - 20rpx)' : 'auto',
-					marginRight: this.isFocus ? '20rpx' : '0',
-					flex: this.isFocus ? '1' : 'auto'
-				};
-			},
-			// 图标容器样式
-			iconContainerStyle() {
-				return {
-					opacity: this.isFocus ? 0 : 1,
-					visibility: this.isFocus ? 'hidden' : 'visible',
-					transform: 'translateZ(0)'
-				};
-			}
-		},
 		watch: {
-			// 监听父组件传递的聚焦状态
 			focused: {
 				immediate: true,
 				handler(newVal) {
 					this.isFocus = newVal;
 				}
 			},
-			// 监听输入值变化,同步到父组件
 			inputValue(newVal) {
 				this.$emit('input', newVal);
 			},
-			// 监听父组件传递的值变化
 			value: {
 				immediate: true,
 				handler(newVal) {
@@ -90,23 +66,23 @@
 			}
 		},
 		methods: {
-			// 输入框聚焦事件
+			handleMoreClick() {
+				this.$emit('show-more');
+			},
 			handleFocus() {
 				this.isFocus = true;
 				this.$emit('focus', this.inputValue);
 			},
 
-			// 输入框失焦事件
 			handleBlur() {
 				this.isFocus = false;
 				this.$emit('blur', this.inputValue);
 			},
 
-			// 发送消息
 			handleSend() {
 				if (this.inputValue.trim()) {
 					this.$emit('send', this.inputValue);
-					this.inputValue = ''; // 清空输入框
+					this.inputValue = '';
 				} else {
 					uni.showToast({
 						title: '不能发送空消息',
@@ -115,27 +91,22 @@
 				}
 			},
 
-			// 打开购物车
 			handleOpenCart() {
 				this.$emit('open-cart');
 			},
 
-			// 显示礼物弹窗
 			handleShowGift() {
 				this.$emit('show-gift');
 			},
 
-			// 清空输入框(供父组件调用)
 			clearInput() {
 				this.inputValue = '';
 			},
 
-			// 设置输入框值(供父组件调用)
 			setInputValue(value) {
 				this.inputValue = value;
 			},
 
-			// 获取输入框值(供父组件调用)
 			getInputValue() {
 				return this.inputValue;
 			}
@@ -151,88 +122,91 @@
 		padding: 24rpx;
 		width: 100%;
 		box-sizing: border-box;
+		transition: all 0.3s ease;
 
 		&.parent-container-focused {
-			justify-content: flex-start !important;
-			align-items: stretch !important;
+			justify-content: flex-start;
 		}
 	}
 
-	.input-container-optimized {
-		background: #393939; 
+	.input-container {
+		background: rgba(0, 0, 0, 0.3);
 		height: 90rpx;
 		box-sizing: border-box;
 		border-radius: 36rpx;
-		transform: translateZ(0);
-		will-change: transform;
-		backface-visibility: hidden;
-		perspective: 1000px;
 		display: flex;
 		align-items: center;
+		transition: all 0.3s ease;
+		overflow: hidden;
 
-		&.input-container-focused {
-			box-sizing: border-box;
-			width: calc(100% - 20rpx) !important;
-			max-width: calc(100% - 20rpx) !important;
-			min-width: calc(100% - 20rpx) !important;
-			margin-right: 20rpx !important;
-			padding: 10rpx 10rpx 10rpx 20rpx !important;
-			justify-content: flex-start !important;
-			gap: 20rpx !important;
-			flex: 1 !important;
-			flex-grow: 1 !important;
-			flex-shrink: 0 !important;
-			flex-basis: calc(100% - 20rpx) !important;
+		&.input-container-normal {
+			padding: 10rpx 14rpx 10rpx 32rpx;
+			flex: 1;
+			justify-content: space-between;
 		}
 
-		&.justify-between {
-			justify-content: space-between;
+		&.input-container-focused {
+			padding: 10rpx 10rpx 10rpx 20rpx;
+			width: 100%;
+			flex: 1 0 auto;
+			justify-content: flex-start;
+			gap: 20rpx;
 		}
 	}
 
-	.input-optimized {
-		border: none !important;
-		font-size: 32rpx !important;
-		color: #ffffff !important;
-		background: transparent !important;
-		width: 70% !important;
-		transform: translateZ(0);
-		will-change: contents, width;
-		backface-visibility: hidden;
+	.input-field {
+		border: none;
+		font-size: 32rpx;
+		color: #ffffff;
+		background: transparent;
 		flex: 1;
+		min-width: 0;
+		transition: all 0.3s ease;
 
 		&.input-focused {
-			width: auto !important;
-			flex: 1 !important;
-			min-width: 0 !important;
-			margin-left: 10rpx !important;
-			max-width: none !important;
+			flex: 1;
+			min-width: 0;
 		}
 	}
 
-	.send {
+	.send-btn {
 		background-color: #fafafa;
 		border-radius: 28rpx;
-		padding: 14rpx 16rpx;
+		padding: 12rpx 16rpx;
 		color: #181818;
 		font-weight: 500;
 		min-width: 80rpx;
 		text-align: center;
 		flex-shrink: 0;
 		white-space: nowrap;
+		cursor: pointer;
+		transition: all 0.2s ease;
+
+		&:active {
+			opacity: 0.8;
+			transform: scale(0.98);
+		}
 	}
 
-	.shopping-icon-container {
-		will-change: opacity, visibility;
-		backface-visibility: hidden;
+	.icon-container {
 		display: flex;
 		align-items: center;
 		justify-content: space-between;
 		flex-shrink: 0;
+		transition: all 0.3s ease;
+		margin-left: 20rpx;
+
+		&.icon-hidden {
+			opacity: 0;
+			visibility: hidden;
+			width: 0;
+			margin-left: 0;
+			flex: 0;
+		}
 	}
 
 	.icon-bg {
-		background-color: rgba(57, 57, 57, 0.8);
+		background: rgba(0, 0, 0, 0.3);
 		border-radius: 50%;
 		width: 88rpx;
 		height: 88rpx;
@@ -240,9 +214,14 @@
 		justify-content: center;
 		align-items: center;
 		transition: transform 0.2s ease;
+		cursor: pointer;
 
 		&:active {
 			transform: scale(0.95);
 		}
+
+		&+& {
+			margin-left: 20rpx;
+		}
 	}
 </style>

+ 1170 - 0
pages_course/components/liveVideo-new.vue

@@ -0,0 +1,1170 @@
+<template>
+	<view class="video-player-container">
+		<!-- 直播状态显示 -->
+		<view class="videolist" v-if="liveItem.status == 2">
+			<view class="video" :class="{'video_row': liveItem.showType == 1,'fullscreen-mode': isFullscreen}">
+				<!-- 直播 -->
+				<live-player v-if="liveItem.livingUrl && liveItem.liveType == 1" :id="'myLivePlayer_' + liveId"
+					:src="liveItem.livingUrl" autoplay mode="live" object-fit="cover" :muted="false"
+					orientation="vertical" :enable-play-gesture="false" min-cache="1" max-cache="3"
+					@statechange="onLiveStateChange" @error="onLiveError" class="item"></live-player>
+
+				<!-- 录播 -->
+				<video v-if="liveItem.videoUrl && liveItem.liveType == 2" :id="`myVideo_${liveId}`" :autoplay="true"
+					class="item" :src="liveItem.videoUrl" :controls="false" object-fit="cover" :custom-cache="false"
+					:enable-progress-gesture="false" vslide-gesture-in-fullscreen="false" :show-center-play-btn="false"
+					:http-cache="false" loop @error="videoError" @timeupdate="onVideoTimeUpdate"
+					@loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause" @play="onVideoPlay"
+					@waiting="onVideoWaiting" :enable-play-gesture="false" :play-strategy="1"
+					@dblclick="preventDoubleClick" preload="auto" :enable-stash-buffer="false" :stash-initial-size="0"
+					:stash-max-size="0" :stash-time="0" type="application/x-mpegURL"></video>
+
+				<view v-if="liveItem.videoUrl && liveItem.liveType == 2" class="time">{{ diffTotalTime }}</view>
+				<!-- v-if="showCustomControls && liveItem.showType==1 && !isFullscreen" -->
+				<view class="custom-controls" @click.stop="toggleFullscreen">
+					<image src="/static/images/full_screen.png" class="control-icon" />
+				</view>
+				<!-- 全屏返回按钮 - 只在全屏状态下显示 -->
+				<view v-if="isFullscreen" class="fullscreen-exit-btn" @click="exitFullscreen">
+					<image src="/static/images/half_screen.png" class="exit-fullscreen-icon" />
+					<text class="exit-text">退出全屏</text>
+				</view>
+			</view>
+
+		</view>
+
+		<!-- 直播结束状态 -->
+		<view class="videolist" v-if="liveItem.status == 3">
+			<view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
+				<view class="end">直播已结束</view>
+			</view>
+		</view>
+
+		<!-- 直播回放状态 -->
+		<view class="videolist" v-if="liveItem.status == 4">
+			<view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
+				<!-- 直播回放 -->
+				<video v-if="liveItem.videoUrl && liveItem.liveType == 3" :id="`myVideo_${liveId}`" class="item"
+					:src="liveItem.videoUrl" :autoplay="true" :controls="true" object-fit="cover" :custom-cache="false"
+					:enable-progress-gesture="liveItem.isSpeedAllowed" vslide-gesture-in-fullscreen="true"
+					:show-center-play-btn="true" :http-cache="false" loop @error="videoError"
+					@timeupdate="onVideoTimeUpdate" @loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause"
+					@play="onVideoPlay" :enable-play-gesture="true" preload="auto" @waiting="onVideoWaiting"
+					type="application/x-mpegURL"></video>
+				<view v-if="liveItem.videoUrl && liveItem.liveType == 3" class="lable">直播回放</view>
+			</view>
+
+		</view>
+		<view class="trailer-box" v-if="liveItem.status == 1">
+			<video v-if="liveItem.previewUrl" :id="`myVideo_${liveId}`" class="trailer-video" :src="liveItem.previewUrl"
+				:autoplay="true" :loop="false" object-fit="cover" :custom-cache="false" :enable-progress-gesture="false"
+				vslide-gesture-in-fullscreen="false" :show-center-play-btn="false" :http-cache="false"
+				@error="videoError" @loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause" @play="onVideoPlay"
+				:disable-progress="true" :enable-play-gesture="true" @waiting="onVideoWaiting" preload="auto"
+				type="application/x-mpegURL" :controls="false"></video>
+			<image v-if="liveItem.status == 1 && !liveItem.previewUrl" class="trailer-placeholder"
+				src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/no_live.png">
+			</image>
+			<view class="countdown-container" v-if="liveItem.status == 1 && liveCountdown">
+				<view class="live-name">{{ liveItem.liveName }}</view>
+				<view class="countdown-display">
+					<text class="countdown-label">距离开播还有</text>
+					<view class="countdown-unit">
+						{{ liveCountdown.hours || '00' }}
+					</view>
+					<view class="countdown-separator">:</view>
+					<view class="countdown-unit">
+						{{ liveCountdown.minutes || '00' }}
+					</view>
+					<view class="countdown-separator">:</view>
+					<view class="countdown-unit">
+						{{ liveCountdown.seconds || '00' }}
+					</view>
+				</view>
+			</view>
+			<view class="trailer-actions">
+				<button open-type="share" class="button-reset share-button">
+					<view class="action-button mr18" @click="handleAgreement">
+						<text>分享给好友</text>
+					</view>
+				</button>
+
+				<view class="action-button reserve-button" @click="handleAgreement">
+					<image class="button-icon mr8" src="/static/images/trailer.png"></image>
+					<text>预约直播</text>
+				</view>
+			</view>
+		</view>
+
+		<!-- 无直播状态 -->
+		<view class="trailer-box" v-if="!liveItem">
+			<image class="img" src="/static/images/no_live.png"></image>
+			<view class="title">暂无直播</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		generateRandomString
+	} from '@/utils/common.js';
+	import dayjs from 'dayjs';
+	import {
+		internetTraffic,
+		liveInternetTraffic
+	} from '@/api/living.js';
+	import {
+		getUserInfo
+	} from '@/api/user';
+
+	export default {
+		name: 'LiveVideoPlayer',
+		props: {
+			liveItem: {
+				type: Object,
+				default: () => ({})
+			},
+			liveId: {
+				type: [String, Number],
+				default: ''
+			},
+			userData: {
+				type: Object,
+				default: () => ({})
+			},
+			isAgreement: {
+				type: Boolean,
+				default: false
+			}
+		},
+		data() {
+			return {
+				isFullscreen: false,
+				isVideoRotated: false,
+				showNonVideoElementsFlag: true,
+				showCustomControls: true,
+				videoContext: null,
+
+				// 流量计算相关
+				uuId: '',
+				totalTraffic: 0,
+				bitrate: 800,
+				bitrateLive: 1600,
+
+				// 定时器
+				trafficTimer: null,
+				liveStartTimer: null,
+				trafficInterval: null,
+				lookTimer: null,
+
+				// 状态数据
+				liveCountdown: {},
+				diffTotalTime: '',
+				videoCurrentTime: 0,
+				videoProgressKey: '',
+				startTime: 0,
+				stayTime: 0,
+				// 内部状态跟踪
+				hasInitialized: false,
+				lastLiveItemStatus: null
+			};
+		},
+		watch: {
+			// 深度监听 liveItem 的所有变化
+			liveItem: {
+				handler(newVal, oldVal) {
+					if (newVal && newVal.status === 1 && newVal.startTime) {
+						// 如果是预告状态且有开始时间,立即启动倒计时
+						this.startLiveCountdown();
+					}
+				},
+				deep: true,
+				immediate: true // 立即执行一次
+			},
+
+			// 单独监听 status 变化作为备用
+			'liveItem.status': {
+				handler(newStatus, oldStatus) {
+					console.log('状态变化:', oldStatus, '->', newStatus);
+
+					if (newStatus === 1 && this.liveItem.startTime) {
+						this.startLiveCountdown();
+					} else if (newStatus === 2) {
+						this.startTimeTimer(this.liveItem);
+					}
+				},
+				immediate: true
+			}
+		},
+		async created() {
+			// 最早的可执行时机
+			if (this.liveItem && Object.keys(this.liveItem).length > 0) {
+				await this.initializeComponent();
+			}
+		},
+		// async mounted() {
+		// 	await this.initializeComponent();
+		// },
+		computed: {
+			shouldShowNonVideoElements() {
+				return !this.isFullscreen && this.showNonVideoElementsFlag;
+			},
+
+			// 控制是否显示全屏按钮
+			shouldShowFullscreenButton() {
+				return this.liveItem.showType == 1 && !this.isFullscreen;
+			},
+		},
+		beforeUnmount() {
+			this.cleanup();
+			// 强制退出全屏
+			this.isFullscreen = false;
+			this.showCustomControls = true;
+		},
+
+		methods: {
+			// 退出全屏
+			exitFullscreen() {
+				this.isFullscreen = false;
+				// 恢复竖屏样式
+				this.restoreVideoList();
+				// 显示非videolist元素
+				this.showNonVideoElements();
+				// 强制页面重排
+				this.$forceUpdate();
+			},
+
+			// 恢复videolist盒子
+			restoreVideoList() {
+				this.isVideoRotated = false;
+				this.isFullscreen = false;
+			},
+
+			// 切换全屏
+			toggleFullscreen() {
+				// console.log('自定义全屏按钮被点击');
+
+				if (this.isFullscreen) {
+					// 退出全屏
+					this.exitFullscreen();
+				} else {
+					// 进入全屏
+					this.enterFullscreen();
+				}
+			}, // 进入全屏
+			enterFullscreen() {
+				// console.log('执行进入全屏');
+				this.isFullscreen = true;
+
+				// 设置横屏样式
+				this.rotateVideoList();
+
+				// 隐藏非videolist元素
+				this.hideNonVideoElements();
+
+				// 强制页面重排
+				this.$forceUpdate();
+			},
+			// 隐藏非videolist元素
+			hideNonVideoElements() {
+				this.showNonVideoElementsFlag = false;
+				console.log('隐藏非视频元素');
+			},
+			// 显示非videolist元素
+			showNonVideoElements() {
+				this.showNonVideoElementsFlag = true;
+			},
+			// 防止默认全屏事件
+			onFullscreenChange(e) {
+				// 阻止默认全屏行为
+				e.preventDefault();
+
+				// 如果有video进入全屏,立即退出
+				if (e.detail && e.detail.fullScreen) {
+					const videoContext = uni.createVideoContext(`myVideo_${this.liveId}`, this);
+					if (videoContext) {
+						setTimeout(() => {
+							videoContext.exitFullScreen();
+						}, 100);
+					}
+				}
+			},
+
+			// 旋转videolist盒子
+			rotateVideoList() {
+				this.isVideoRotated = true;
+				this.isFullscreen = true;
+				console.log('视频容器旋转到横屏状态');
+			},
+			// 全屏状态变化监听
+
+			onFullscreenChange(e) {
+				console.log('全屏状态变化事件详情:', e);
+
+				// 方法1:通过事件参数获取(小程序主要方式)
+				let fullScreen = false;
+
+				// 视频组件的全屏事件参数
+				if (e.detail && typeof e.detail.fullScreen !== 'undefined') {
+					fullScreen = e.detail.fullScreen;
+					console.log('通过e.detail.fullScreen获取全屏状态:', fullScreen);
+				}
+				// 其他可能的参数名
+				else if (e.detail && typeof e.detail.fullscreen !== 'undefined') {
+					fullScreen = e.detail.fullscreen;
+					console.log('通过e.detail.fullscreen获取全屏状态:', fullScreen);
+				}
+				// 方法2:检测横屏(备用)
+				else {
+					// 在小程序环境中,可以通过屏幕方向判断
+					try {
+						const systemInfo = uni.getSystemInfoSync();
+						fullScreen = systemInfo.windowWidth > systemInfo.windowHeight;
+						console.log('通过屏幕方向判断全屏状态:', fullScreen);
+					} catch (err) {
+						console.error('获取系统信息失败:', err);
+						// 默认使用事件参数
+						fullScreen = e.detail || false;
+					}
+				}
+
+				this.isFullscreen = fullScreen;
+				console.log('最终设置isFullscreen为:', this.isFullscreen);
+
+				// 根据全屏状态显示/隐藏自定义控件
+				this.showCustomControls = !this.isFullscreen;
+
+				// 强制UI更新
+				this.$forceUpdate();
+
+				// 全屏时锁定横屏
+				if (this.isFullscreen) {
+					this.lockOrientation();
+				} else {
+					this.unlockOrientation();
+				}
+			},
+			// 锁定屏幕方向为横屏
+			lockOrientation() {
+				// 设置屏幕方向为横屏
+				try {
+					// 尝试锁定横屏
+					plus.screen.lockOrientation('landscape-primary');
+				} catch (e) {
+					console.log('锁定屏幕方向失败:', e);
+					// 备用方案
+					try {
+						// 使用 Web API(如果支持)
+						if (screen.orientation && screen.orientation.lock) {
+							screen.orientation.lock('landscape');
+						}
+					} catch (err) {
+						console.log('备用方案也失败了:', err);
+					}
+				}
+			}, // 解锁屏幕方向
+			unlockOrientation() {
+				try {
+					plus.screen.unlockOrientation();
+				} catch (e) {
+					console.log('解锁屏幕方向失败:', e);
+					// 备用方案
+					try {
+						if (screen.orientation && screen.orientation.unlock) {
+							screen.orientation.unlock();
+						}
+					} catch (err) {
+						console.log('备用解锁方案也失败了:', err);
+					}
+				}
+			},
+
+
+
+			handleAgreement() {
+				console.log('预约直播点击');
+				this.$emit('agreementClick');
+			}, // 播放视频
+			playVideo() {
+				if (!this.liveItem) {
+					console.log('liveItem 为空,无法播放视频');
+					return;
+				}
+				try {
+					// 直播流使用live-player
+					// 逻辑学
+					// this.liveItem.liveType === 1 
+					// this.liveItem.livingUrl='https://live.test.ifeiyu100.com/live/133.flv?txSecret=d95f28727acac2800e9aee9cef98858d&txTime=6943A264'
+					// this.liveItem.status == 2
+
+					if (this.liveItem.liveType === 1 && this.liveItem.livingUrl && this.liveItem.status == 2) {
+						const livePlayerId = `myLivePlayer_${this.liveId}`;
+						const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
+						// console.log("直播")
+						if (livePlayerContext) {
+							livePlayerContext.play();
+						}
+					} else if (this.liveItem.status == 1 && this.liveItem.previewUrl) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+
+						if (videoContext) {
+							videoContext.play();
+						}
+					} else if (this.liveItem.liveType === 2 && this.liveItem.videoUrl && this.liveItem.status == 2) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+						// console.log("录播")
+						if (videoContext) {
+							videoContext.play();
+						}
+					} // 回放视频使用video
+					else if (this.liveItem.liveType === 3 && this.liveItem.videoUrl && this.liveItem.status == 4) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+						// console.log("回放")
+						if (videoContext) {
+							videoContext.play();
+						}
+					}
+				} catch (error) {
+					console.error('播放视频失败:', error);
+				}
+			},
+
+			pauseVideo() {
+				if (!this.liveItem) return;
+
+				try {
+					// 直播流使用live-player
+					if (this.liveItem.status == 1) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+						if (videoContext) {
+							videoContext.pause();
+						}
+					} else if (this.liveItem.status == 2) {
+						if (this.liveItem.liveType === 1) {
+							const livePlayerId = `myLivePlayer_${this.liveId}`;
+							const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
+							if (livePlayerContext) {
+								livePlayerContext.pause();
+							}
+						} else if (this.liveItem.liveType === 2) {
+							const videoId = `myVideo_${this.liveId}`;
+							const videoContext = uni.createVideoContext(videoId, this);
+							if (videoContext) {
+								videoContext.pause();
+							}
+						}
+					}
+				} catch (error) {
+					console.error('暂停视频失败:', error);
+				}
+			},
+			// 视频错误处理
+			videoError(e, liveItem) {
+				if (!liveItem || !this.liveId) return;
+				// 初始化重试计数
+				if (this.videoRetryCounts[liveItem.liveId] === undefined) {
+					this.videoRetryCounts[liveItem.liveId] = 0;
+				}
+				// 限制重试次数
+				if (this.videoRetryCounts[liveItem.liveId] >= 3) {
+					console.error(`直播间 ${this.liveId} 视频加载失败,停止重试`);
+					// 显示错误提示
+					uni.showToast({
+						title: '视频加载失败,请检查网络',
+						icon: 'none',
+						duration: 2000
+					});
+					return;
+				}
+
+				this.videoRetryCounts[this.liveId]++;
+
+				// 延迟重试
+				setTimeout(() => {
+					if (this.liveId === this.liveId) {
+						console.log(`第${this.videoRetryCounts[this.liveId]}次重试播放视频`);
+						this.playVideo();
+					}
+				}, 2000);
+			}, // 视频暂停
+			onVideoPause(e) {
+				if (this.liveItem.liveType === 2) {
+					const videoId = `myVideo_${this.liveId}`;
+					const videoContext = uni.createVideoContext(videoId, this);
+					setTimeout(() => {
+						videoContext.play();
+					}, 100);
+				}
+				// 暂停时保存进度
+				this.saveVideoProgress();
+			}, //直播、录播缓冲
+			getLiveInternetTraffic() {
+				if (!this.liveId) return;
+				const currentTime = (this.stayTime / this.liveItem.duration) * 100;
+				const param = {
+					userId: this.userData.userId || '',
+					liveId: this.liveId || '',
+					uuId: dayjs().format('YYYYMMDD') + this.uuId,
+					internetTraffic: this.totalTraffic
+				};
+				liveInternetTraffic(param);
+			},
+			startTimer() {
+				this.startTime = Date.now();
+				this.lookTimer = setInterval(() => {
+					this.stayTime = Math.floor((Date.now() - this.startTime) / 1000);
+				}, 1000);
+			},
+			// 计算流量
+			// calculateTraffic(bitrate) {
+			// 	const currentTime = Date.now();
+			// 	const duration = (currentTime - this.startTime) / 1000; // 持续时间(秒)
+			// 	// 流量 = 码率 × 时间
+			// 	// 码率单位: bps, 时间单位: 秒, 流量单位: 比特
+			// 	const trafficBits = bitrate * duration;
+			// 	// 转换为字节
+			// 	this.totalTraffic = trafficBits / 8;
+			// 	this.getLiveInternetTraffic();
+			// },
+			// 逻辑学计算流量
+			calculateTraffic(bitrate) {
+				const currentTime = Date.now();
+				const duration = (currentTime - this.startTime) / 1000; // 持续时间(秒)
+
+				// 流量 = 码率 × 时间
+				// 码率单位: bps, 时间单位: 秒, 流量单位: 比特
+				const trafficBits = bitrate * duration;
+
+				// 转换为字节
+				this.totalTraffic = trafficBits / 8;
+
+				// 调用流量上报接口
+				this.getLiveInternetTraffic();
+			},
+
+
+			//直播计算流量
+			// startTrafficCalculation(bitrate) {
+			// 	if (this.trafficTimer) {
+			// 		clearInterval(this.trafficTimer);
+			// 		this.trafficTimer = null;
+			// 	}
+			// 	this.startTime = Date.now();
+			// 	var that = this;
+			// 	this.trafficTimer = setInterval(() => {
+			// 		that.calculateTraffic(bitrate);
+			// 	}, 10000); // 每10秒计算一次
+			// },
+			startTrafficCalculation() {
+				if (this.trafficTimer) {
+					clearInterval(this.trafficTimer);
+					this.trafficTimer = null;
+				}
+
+				this.startTime = Date.now();
+				var that = this;
+
+				// 计算码率
+				let bitrate = this.calculateBitrate();
+
+				this.trafficTimer = setInterval(() => {
+					that.calculateTraffic(bitrate);
+				}, 10000); // 每10秒计算一次
+			}, // 计算码率
+			// calculateBitrate() {
+			// 	// 如果接口返回了视频文件大小和时长,使用这些数据计算码率
+			// 	if (this.liveItem.videoFileSize && this.liveItem.videoDuration) {
+			// 		// 码率 = 文件大小(字节) / 时长(秒) × 8 (转换为bps) × 5
+			// 		const calculatedBitrate = (this.liveItem.videoFileSize / this.liveItem.videoDuration) * 8 * 5;
+			// 		console.log(
+			// 			`使用接口数据计算码率: ${calculatedBitrate} bps (文件大小: ${this.liveItem.videoFileSize} 字节, 时长: ${this.liveItem.videoDuration} 秒)`
+			// 		);
+			// 		return calculatedBitrate;
+			// 	} else {
+			// 		// 如果任一字段为空,使用默认码率 1500 bps
+			// 		console.log('接口数据不完整,使用默认码率: 1500 bps');
+			// 		return 800;
+			// 	}
+			// },
+			calculateBitrate() {
+				// 如果接口返回了视频文件大小和时长,使用这些数据计算码率
+				if (this.liveItem.videoFileSize && this.liveItem.videoDuration) {
+					// 码率 = 文件大小(字节) / 时长(秒) × 8 (转换为bps)
+					return (this.liveItem.videoFileSize / this.liveItem.videoDuration) * 8;
+				} else {
+					// 默认值
+					return this.liveItem.liveType === 1 ? 1600 : 800;
+				}
+			},
+			calculateAndSubmitTraffic() {
+				if (!this.liveItem || !this.liveItem.videoFileSize) return;
+
+				const watchDuration = Math.floor((Date.now() - this.trafficStartTime) / 1000);
+				const totalDuration = this.liveItem.videoDuration || this.liveItem.duration || 0;
+				const videoFileSize = this.liveItem.videoFileSize || 0;
+
+				if (totalDuration <= 0 || videoFileSize <= 0) return;
+
+				// 精确计算流量
+				const traffic = (watchDuration / totalDuration) * videoFileSize;
+				this.totalTraffic = traffic;
+
+				// 提交流量数据
+				this.submitTraffic(watchDuration);
+			},
+			submitTraffic(watchDuration) {
+				const totalDuration = this.liveItem.videoDuration || this.liveItem.duration || 0;
+				const videoFileSize = this.liveItem.videoFileSize || 0;
+
+				if (totalDuration <= 0 || videoFileSize <= 0) return;
+
+				const traffic = (watchDuration / totalDuration) * videoFileSize;
+
+				const param = {
+					userId: this.userData.userId || '',
+					liveId: this.liveId || '',
+					uuId: dayjs().format('YYYYMMDD') + this.uuId,
+					internetTraffic: Math.round(traffic),
+					watchDuration: watchDuration,
+					totalDuration: totalDuration,
+					videoFileSize: videoFileSize
+				};
+
+				liveInternetTraffic(param).catch(err => {
+					console.error('流量数据提交失败:', err);
+				});
+			},
+
+			// 回放、预告缓冲
+			getInternetTraffic() {
+				if (!this.liveId || !this.liveId || !this.userData.userId || !this.uuId) return;
+				const currentTime = (this.stayTime / this.liveItem.duration) * 100;
+				const param = {
+					videoType: this.liveItem.videoType,
+					videoId: this.liveItem.videoId,
+					userId: this.userData.userId,
+					liveId: this.liveId,
+					uuId: dayjs().format('YYYYMMDD') + this.uuId,
+					duration: this.liveItem.duration,
+					bufferRate: currentTime
+				};
+				if (this.liveItem.status == 1) {
+					param.videoType = this.liveItem.previewVideoType || '';
+					param.videoId = this.liveItem.previewVideoId || '';
+				}
+				if (this.liveItem.liveType == 1) {
+					param.bufferRate = this.totalTraffic;
+				}
+				internetTraffic(param);
+			},
+			saveVideoProgress() {
+				if (this.videoProgressKey) {
+					uni.setStorage({
+						key: this.videoProgressKey,
+						data: this.videoCurrentTime,
+						success: () => {},
+						fail: (err) => {
+							console.error('保存视频进度失败:', err);
+						}
+					});
+				}
+			},
+			getTimeDifferenceInSeconds(createTimeStr) {
+				const createTime = new Date(createTimeStr.replace(/-/g, '/'));
+				const now = new Date();
+				const timeDiffMs = now - createTime;
+				const timeDiffSeconds = Math.floor(timeDiffMs / 1000);
+				return Math.max(0, timeDiffSeconds);
+			},
+			// onVideoWaiting(e) {
+			// 	// console.log('视频等待加载', e);
+			// 	if (this.liveItem.liveType == 2) {
+			// 		this.startTrafficCalculation(this.bitrate);
+			// 	} else {
+			// 		let that = this;
+			// 		if (this.trafficInterval) {
+			// 			clearInterval(this.trafficInterval);
+			// 			this.trafficInterval = null;
+			// 		}
+			// 		this.trafficInterval = setInterval(function() {
+			// 			that.getInternetTraffic();
+			// 		}, 10000);
+			// 	}
+			// },
+			onVideoWaiting(e) {
+				// console.log('视频等待加载', e);
+				if (this.liveItem.liveType == 2) {
+					// 修改这里:不再传入固定码率,而是在方法内部计算
+					this.startTrafficCalculation();
+				} else {
+					let that = this;
+					if (this.trafficInterval) {
+						clearInterval(this.trafficInterval);
+						this.trafficInterval = null;
+					}
+					this.trafficInterval = setInterval(function() {
+						that.getInternetTraffic();
+					}, 10000);
+				}
+			},
+			setVideoProgress() {
+				// 只有录播和回放需要设置进度
+				if (this.liveItem.liveType !== 2 && this.liveItem.liveType !== 3) {
+					return;
+				}
+				let currentTime = 0;
+				if (this.liveItem.liveType === 2) {
+					// 录播:计算当前时间与开始时间的差值,对视频总时长取模
+					const diff = this.getTimeDifferenceInSeconds(this.liveItem.startTime);
+					if (diff > this.liveItem.duration) {
+						console.log("开始断点续播了")
+						const storedProgress = uni.getStorageSync(this.videoProgressKey) || 0;
+						console.log("开始断点续播了storedProgress", storedProgress)
+						currentTime = storedProgress >= this.liveItem.duration ? 0 : storedProgress || 0;
+						console.log("开始断点续播了currentTime", currentTime)
+					} else {
+						currentTime = diff % this.liveItem.duration;
+					}
+
+					// currentTime = diff % this.liveItem.duration;
+				} else if (this.liveItem.liveType === 3) {
+					// 回放:从存储中获取进度
+					const storedProgress = uni.getStorageSync(this.videoProgressKey);
+					currentTime = storedProgress || 0;
+				}
+				const videoId = `myVideo_${this.liveId}`;
+				const videoContext = uni.createVideoContext(videoId, this);
+				if (videoContext) {
+					videoContext.seek(currentTime);
+				}
+			}, // 视频播放
+			onVideoPlay(e) {},
+			// 录播时间点
+			onVideoMetaLoaded(e) {
+				console.log("录播时间点", e)
+				this.videoProgressKey = `videoProgress_${this.liveId}`;
+				this.setVideoProgress();
+			},
+			// 视频时间更新
+			onVideoTimeUpdate(e) {
+				// 获取当前播放时间
+				this.videoCurrentTime = e.detail.currentTime;
+				// 每隔10秒保存一次进度(避免频繁存储)
+				if (Math.floor(this.videoCurrentTime) % 10 === 0) {
+					this.saveVideoProgress();
+				}
+			},
+			// 初始化组件 - 增强版本
+			async initializeComponent() {
+				console.log('初始化视频组件:', {
+					liveId: this.liveId,
+					liveItem: this.liveItem,
+					状态: this.liveItem?.status,
+					开始时间: this.liveItem?.startTime
+				});
+
+				this.uuId = generateRandomString(16);
+				this.isAgreement = uni.getStorageSync('isAgreement');
+
+				// 立即检查当前状态并启动相应功能
+				if (this.liveItem?.status === 1 && this.liveItem.startTime) {
+					console.log('检测到预告状态,立即启动倒计时');
+					this.startLiveCountdown();
+				} else if (this.liveItem?.status === 2) {
+					this.startTimeTimer(this.liveItem);
+					this.playVideo();
+				}
+
+				this.startTimer();
+				this.hasInitialized = true;
+			},
+
+			// 启动直播倒计时 - 增强版本
+			startLiveCountdown() {
+				console.log('启动直播倒计时:', this.liveItem.startTime);
+
+				// 清理旧定时器
+				if (this.liveStartTimer) {
+					clearInterval(this.liveStartTimer);
+					this.liveStartTimer = null;
+				}
+
+				// 立即计算一次倒计时
+				this.liveCountdown = this.handleTime(this.liveItem.startTime, 0);
+				console.log('初始倒计时:', this.liveCountdown);
+
+				// 如果倒计时已结束,触发直播开始事件
+				if (!this.liveCountdown) {
+					console.log('倒计时已结束,触发直播开始');
+					this.$emit('liveStart');
+					return;
+				}
+
+				// 启动定时器
+				this.liveStartTimer = setInterval(() => {
+					const previousCountdown = JSON.stringify(this.liveCountdown);
+					this.liveCountdown = this.handleTime(this.liveItem.startTime, 0);
+
+					// 记录倒计时变化(用于调试)
+					if (previousCountdown !== JSON.stringify(this.liveCountdown)) {
+						console.log('倒计时更新:', this.liveCountdown);
+					}
+
+					if (!this.liveCountdown) {
+						console.log('倒计时结束,触发直播开始');
+						this.$emit('liveStart');
+						clearInterval(this.liveStartTimer);
+						this.liveStartTimer = null;
+					}
+				}, 1000);
+			},
+
+			// 时间处理函数 - 增强错误处理
+			handleTime(time, duration) {
+				if (!time) {
+					console.error('时间参数为空');
+					return false;
+				}
+
+				let timeStamp;
+
+				try {
+					if (typeof time === 'number' && time > 0 && time < 9999999999999) {
+						timeStamp = time;
+					} else if (typeof time === 'string' && time.trim() !== '') {
+						const isoTime = time.replace(' ', 'T');
+						const date = new Date(isoTime);
+						if (!isNaN(date.getTime())) {
+							timeStamp = date.getTime();
+						} else {
+							console.error('无效的日期格式:', time);
+							return false;
+						}
+					} else {
+						console.error('time参数必须是有效的时间戳或日期字符串');
+						return false;
+					}
+
+					const targetTimestamp = timeStamp + duration * 60 * 1000;
+					const currentTimestamp = Date.now();
+					const timeDiffMs = targetTimestamp - currentTimestamp;
+
+					if (timeDiffMs <= 0) {
+						return false;
+					}
+					const hours = Math.floor(timeDiffMs / (1000 * 60 * 60));
+					const minutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));
+					const seconds = Math.floor((timeDiffMs % (1000 * 60)) / 1000);
+
+					const formatNum = (num) => num.toString().padStart(2, '0');
+					return {
+						hours: formatNum(hours),
+						minutes: formatNum(minutes),
+						seconds: formatNum(seconds),
+						rawMs: timeDiffMs // 添加原始毫秒数用于调试
+					};
+				} catch (error) {
+					console.error('时间处理错误:', error);
+					return false;
+				}
+			},
+
+			// 其他方法保持不变...
+			startTimeTimer(item) {
+				if (!item) return;
+
+				this.calculateTimeDiff(item);
+
+				if (item.timeTimer) {
+					clearInterval(item.timeTimer);
+				}
+
+				item.timeTimer = setInterval(() => {
+					this.calculateTimeDiff(item);
+				}, 1000);
+			},
+
+			calculateTimeDiff(item) {
+				if (!item.startTime) return;
+
+				const time = new Date(item.startTime.replace(/-/g, '/'));
+				if (isNaN(time.getTime())) return;
+
+				const now = new Date();
+				let diffMs = Math.max(0, now.getTime() - time.getTime());
+
+				const totalSeconds = Math.floor(diffMs / 1000);
+				const hours = this.padZero(Math.floor(totalSeconds / 3600));
+				const minutes = this.padZero(Math.floor((totalSeconds % 3600) / 60));
+				const seconds = this.padZero(totalSeconds % 60);
+
+				this.diffTotalTime = `${hours}:${minutes}:${seconds}`;
+			},
+
+			padZero(num) {
+				return num < 10 ? `0${num}` : num;
+			},
+
+			// 清理方法
+			cleanup() {
+				if (this.liveStartTimer) {
+					clearInterval(this.liveStartTimer);
+					this.liveStartTimer = null;
+				}
+				if (this.trafficTimer) {
+					clearInterval(this.trafficTimer);
+					this.trafficTimer = null;
+				}
+
+				if (this.trafficInterval) {
+					clearInterval(this.trafficInterval);
+					this.trafficInterval = null;
+				}
+				if (this.lookTimer) {
+					clearInterval(this.lookTimer);
+					this.lookTimer = null;
+				}
+				if (this.liveItem && this.liveItem.timeTimer) {
+					clearInterval(this.liveItem.timeTimer);
+					this.liveItem.timeTimer = null;
+				}
+			}
+		}
+	};
+</script>
+
+<style scoped lang="scss">
+	.video-player-container {
+		width: 100%;
+		height: 100%;
+		position: relative;
+	}
+
+	.videolist {
+		position: relative;
+		height: 100vh;
+		width: 100%;
+
+		.video {
+			height: 100vh;
+			width: 100%;
+
+			.item {
+				width: 100%;
+				height: 100%;
+			}
+
+			.time {
+				color: #ffffff;
+				font-size: 20rpx;
+				margin-left: 10rpx;
+			}
+
+			.end {
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				transform: translate(-50%, -50%);
+				font-size: 36rpx;
+				color: #fff;
+			}
+
+			.lable {
+				position: absolute;
+				top: 50rpx;
+				right: 16rpx;
+				background-color: rgba(57, 57, 57, 0.6);
+				padding: 4rpx 10rpx;
+				color: #fff;
+				border-radius: 15rpx;
+			}
+		}
+
+		.video_row {
+			position: absolute;
+			top: 380rpx;
+			max-height: 450rpx;
+			z-index: 99;
+
+			.fullscreen-mode {
+				width: auto !important;
+				height: auto !important;
+				z-index: 99999 !important;
+				background-color: #000 !important;
+				transform: rotate(90deg) !important;
+				transform-origin: center center !important;
+
+				.fullscreen-exit-btn {
+					z-index: 999999 !important;
+				}
+
+				.video-player {
+					width: 100vh !important;
+					height: 100vw !important;
+					// object-fit: contain !important;
+				}
+			}
+
+
+			/* 全屏时隐藏其他元素 */
+			.video-container.fullscreen-mode~* {
+				display: none !important;
+			}
+
+
+			/* 全屏按钮样式优化 */
+			.custom-controls {
+				position: absolute;
+				// top: 50%;
+				bottom: 10%;
+				right: 40rpx;
+				z-index: 99999999;
+				background: rgba(0, 0, 0, 0.6);
+				border-radius: 50%;
+				width: 80rpx;
+				height: 80rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				transition: all 0.3s ease;
+
+				.control-icon {
+					width: 46rpx;
+					height: 46rpx;
+				}
+
+				&:active {
+					transform: scale(0.95);
+					background: rgba(0, 0, 0, 0.8);
+				}
+			}
+
+		}
+	}
+
+	// 重置按钮样式
+	.button-reset {
+		background-color: transparent !important;
+		padding: 0 !important;
+		line-height: 1 !important;
+		margin: 0 !important;
+		width: auto !important;
+		font-weight: 500 !important;
+		border-radius: none !important;
+
+		&::after {
+			border: none !important;
+			padding: 0 !important;
+			margin: 0 !important;
+		}
+	}
+
+	.trailer-box {
+		width: calc(100% - 80rpx);
+		background: #333333;
+		border-radius: 24rpx;
+		position: absolute;
+		top: 320rpx;
+		left: 50%;
+		transform: translateX(-50%);
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		color: #fff;
+		padding: 20rpx;
+		z-index: 99999;
+		box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.12);
+		transition: box-shadow 0.3s ease;
+
+		.trailer-video {
+			width: 100%;
+			height: 400rpx;
+		}
+
+		.trailer-placeholder {
+			margin-bottom: 40rpx;
+			width: 240rpx;
+			height: 240rpx;
+		}
+
+		.countdown-container {
+			margin: 20rpx 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+
+			.live-name {
+				font-weight: 600;
+				font-size: 36rpx;
+			}
+
+			.countdown-display {
+				display: flex;
+				align-items: center;
+				margin: 30rpx 0;
+
+				.countdown-label {
+					font-size: 24rpx;
+					color: #999999;
+				}
+
+				.countdown-separator {
+					font-size: 24rpx;
+					color: #999999;
+				}
+
+				.countdown-unit {
+					width: 40rpx;
+					height: 40rpx;
+					background: #4D4D4D;
+					border-radius: 8rpx;
+					text-align: center;
+					overflow: hidden;
+					margin: 0 8rpx;
+					font-weight: 500;
+					font-size: 28rpx;
+					color: #FFFFFF;
+					line-height: 40rpx;
+				}
+			}
+		}
+
+		.trailer-actions {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			.action-button {
+				width: 280rpx;
+				height: 72rpx;
+				border-radius: 36rpx;
+				line-height: 72rpx;
+				text-align: center;
+				color: #fff;
+
+				&.reserve-button {
+					background: linear-gradient(136deg, #38D97D 0%, #02B176 100%);
+				}
+
+				&:not(.reserve-button) {
+					background: #F4A007;
+				}
+
+				.button-icon {
+					width: 32rpx;
+					height: 32rpx;
+				}
+			}
+		}
+
+		.no-live-title {
+			margin-top: 30rpx;
+			font-size: 42rpx;
+			font-weight: 500;
+		}
+	}
+</style>

+ 1174 - 847
pages_course/components/liveVideo.vue

@@ -1,855 +1,1182 @@
 <template>
-  <view class="video-player-container">
-    <!-- 直播状态显示 -->
-    <view class="videolist" v-if="liveItem.status == 2">
-      <view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
-        <!-- 直播 -->
-        <live-player 
-          v-if="liveItem.livingUrl && liveItem.liveType == 1" 
-          :id="'myLivePlayer_' + liveId"
-          :src="liveItem.livingUrl" 
-          autoplay 
-          mode="live" 
-          object-fit="contain" 
-          :muted="false"
-          orientation="vertical" 
-          :enable-play-gesture="false" 
-          min-cache="1" 
-          max-cache="3"
-          @statechange="onLiveStateChange" 
-          @error="onLiveError"
-          class="item"></live-player>
-        
-        <!-- 录播 -->
-        <video 
-          v-if="liveItem.videoUrl && liveItem.liveType == 2" 
-          :id="`myVideo_${liveId}`"
-          :autoplay="true" 
-          class="item" 
-          :src="liveItem.videoUrl" 
-          :controls="false"
-          object-fit="contain" 
-          :custom-cache="false" 
-          :enable-progress-gesture="false"
-          vslide-gesture-in-fullscreen="false" 
-          :show-center-play-btn="false" 
-          :http-cache="false" 
-          loop
-          @error="videoError" 
-          @timeupdate="onVideoTimeUpdate" 
-          @loadedmetadata="onVideoMetaLoaded"
-          @pause="onVideoPause" 
-          @play="onVideoPlay" 
-          @waiting="onVideoWaiting"
-          :enable-play-gesture="false" 
-          :play-strategy="1" 
-          @dblclick="preventDoubleClick"
-          preload="auto" 
-          :enable-stash-buffer="false" 
-          :stash-initial-size="0" 
-          :stash-max-size="0"
-          :stash-time="0" 
-          type="application/x-mpegURL"></video>
-        
-        <view v-if="liveItem.videoUrl && liveItem.liveType == 2" class="time">{{ diffTotalTime }}</view>
-      </view>
-    </view>
-
-    <!-- 直播结束状态 -->
-    <view class="videolist" v-if="liveItem.status == 3">
-      <view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
-        <view class="end">直播已结束</view>
-      </view>
-    </view>
-
-    <!-- 直播回放状态 -->
-    <view class="videolist" v-if="liveItem.status == 4">
-      <view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
-        <!-- 直播回放 -->
-        <video 
-          v-if="liveItem.videoUrl && liveItem.liveType == 3" 
-          :id="`myVideo_${liveId}`" 
-          class="item"
-          :src="liveItem.videoUrl" 
-          :autoplay="true" 
-          :controls="true" 
-          object-fit="contain"
-          :custom-cache="false" 
-          :enable-progress-gesture="liveItem.isSpeedAllowed"
-          vslide-gesture-in-fullscreen="true" 
-          :show-center-play-btn="true" 
-          :http-cache="false" 
-          loop
-          @error="videoError" 
-          @timeupdate="onVideoTimeUpdate" 
-          @loadedmetadata="onVideoMetaLoaded"
-          @pause="onVideoPause" 
-          @play="onVideoPlay" 
-          :enable-play-gesture="true" 
-          preload="auto"
-          @waiting="onVideoWaiting" 
-          type="application/x-mpegURL"></video>
-        
-        <view v-if="liveItem.videoUrl && liveItem.liveType == 3" class="lable">直播回放</view>
-      </view>
-    </view>
-
-    <!-- 直播预告状态 -->
-    <view class="trailer-box" v-if="liveItem.status == 1">
-      <video 
-        v-if="liveItem.previewUrl" 
-        :id="`myVideo_${liveId}`" 
-        class="item" 
-        :src="liveItem.previewUrl"
-        :autoplay="true" 
-        :loop="false" 
-        :controls="false" 
-        object-fit="contain" 
-        :custom-cache="false"
-        :enable-progress-gesture="false" 
-        vslide-gesture-in-fullscreen="false"
-        :show-center-play-btn="false" 
-        :http-cache="false" 
-        @error="videoError"
-        @loadedmetadata="onVideoMetaLoaded" 
-        @pause="onVideoPause" 
-        @play="onVideoPlay"
-        :disable-progress="true" 
-        :enable-play-gesture="true" 
-        @waiting="onVideoWaiting" 
-        preload="auto"
-        type="application/x-mpegURL"></video>
-      
-      <image 
-        v-if="liveItem.status == 1 && !liveItem.previewUrl" 
-        class="img"
-        src="/static/images/no_live.png"></image>
-      
-      <view class="countdown-item mt30 mb30" v-if="liveItem.status == 1 && liveCountdown">
-        开播倒计时
-        <view class="x-f">
-          <view class="white">{{ liveCountdown.hours || '00' }}</view>
-          <view class="white">{{ liveCountdown.minutes || '00' }}</view>
-          <view class="white">{{ liveCountdown.seconds || '00' }}</view>
-        </view>
-      </view>
-      
-      <view class="name">{{ liveItem.liveName }}</view>
-      <view class="title" v-if="liveCountdown">暂未开播</view>
-      
-      <view class="button" v-if="!isAgreement" @click="handleAgreement">预约直播</view>
-      <view class="button ash" v-if="isAgreement">已预约</view>
-      <view class="title" v-if="!liveCountdown">主播还在来的路上</view>
-    </view>
-
-    <!-- 无直播状态 -->
-    <view class="trailer-box" v-if="!liveItem">
-      <image class="img" src="/static/images/no_live.png"></image>
-      <view class="title">暂无直播</view>
-    </view>
-  </view>
+	<view class="video-player-container">
+		<!-- 直播状态显示 -->
+		<view class="videolist" v-if="liveItem.status == 2" :class="isFullscreen ? 'screen' : ''">
+			<view class="video" :class="{'video_row': liveItem.showType == 1,'fullscreen-mode': isFullscreen}">
+				<!-- 直播 -->
+				<live-player v-if="liveItem.livingUrl && liveItem.liveType == 1" :id="'myLivePlayer_' + liveId"
+					:src="liveItem.livingUrl" autoplay mode="live" object-fit="cover" :muted="false"
+					orientation="vertical" :enable-play-gesture="false" min-cache="1" max-cache="3"
+					@statechange="onLiveStateChange" @error="onLiveError" class="item"></live-player>
+
+				<!-- 录播 -->
+				<video v-if="liveItem.videoUrl && liveItem.liveType == 2" :id="`myVideo_${liveId}`" :autoplay="true"
+					class="item" :src="liveItem.videoUrl" :controls="false"
+					:object-fit="liveItem.showType==2||isFullscreen?'contain':'fill'" :custom-cache="false"
+					:enable-progress-gesture="false" vslide-gesture-in-fullscreen="false" :show-center-play-btn="false"
+					:http-cache="false" loop @error="videoError" @timeupdate="onVideoTimeUpdate"
+					@loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause" @play="onVideoPlay"
+					@waiting="onVideoWaiting" :enable-play-gesture="false" :play-strategy="1"
+					@dblclick="preventDoubleClick" preload="auto" :enable-stash-buffer="false" :stash-initial-size="0"
+					:stash-max-size="0" :stash-time="0" type="application/x-mpegURL"></video>
+				<view v-if="liveItem.videoUrl && liveItem.liveType == 2" class="time"
+					:class="isFullscreen ? 'look-time' : 'time'">{{ diffTotalTime }}</view>
+				<view class="custom-controls" @click.stop="toggleFullscreen">
+					<image src="/static/images/full_screen.png" class="control-icon" />
+				</view>
+				<!-- 全屏返回按钮 - 只在全屏状态下显示 -->
+				<view v-if="isFullscreen" class="fullscreen-exit-btn" @click="exitFullscreen">
+					<image src="/static/images/half_screen.png" class="exit-fullscreen-icon" />
+					<text class="exit-text">退出全屏</text>
+				</view>
+			</view>
+
+		</view>
+
+		<!-- 直播结束状态 -->
+		<view class="videolist" v-if="liveItem.status == 3">
+			<view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
+				<view class="end">直播已结束</view>
+			</view>
+		</view>
+
+		<!-- 直播回放状态 -->
+		<view class="videolist" v-if="liveItem.status == 4">
+			<view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
+				<!-- 直播回放 -->
+				<video v-if="liveItem.videoUrl && liveItem.liveType == 3" :id="`myVideo_${liveId}`" class="item"
+					:src="liveItem.videoUrl" :autoplay="true" :controls="true" object-fit="cover" :custom-cache="false"
+					:enable-progress-gesture="liveItem.isSpeedAllowed" vslide-gesture-in-fullscreen="true"
+					:show-center-play-btn="true" :http-cache="false" loop @error="videoError"
+					@timeupdate="onVideoTimeUpdate" @loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause"
+					@play="onVideoPlay" :enable-play-gesture="true" preload="auto" @waiting="onVideoWaiting"
+					type="application/x-mpegURL"></video>
+				<view v-if="liveItem.videoUrl && liveItem.liveType == 3" class="lable">直播回放</view>
+			</view>
+
+		</view>
+		<view class="trailer-box" v-if="liveItem.status == 1">
+			<video v-if="liveItem.previewUrl" :id="`myVideo_${liveId}`" class="trailer-video" :src="liveItem.previewUrl"
+				:autoplay="true" loop object-fit="cover" :custom-cache="false" :enable-progress-gesture="false"
+				vslide-gesture-in-fullscreen="false" :show-center-play-btn="false" :http-cache="false"
+				@error="videoError" @loadedmetadata="onVideoMetaLoaded" @pause="onVideoPause" @play="onVideoPlay"
+				:disable-progress="true" :enable-play-gesture="true" @waiting="onVideoWaiting" preload="auto"
+				type="application/x-mpegURL" :controls="false"></video>
+			<image v-if="liveItem.status == 1 && !liveItem.previewUrl" class="trailer-placeholder"
+				src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/no_live.png">
+			</image>
+			<view class="countdown-container" v-if="liveItem.status == 1 && liveCountdown">
+				<view class="live-name">{{ liveItem.liveName }}</view>
+				<view class="countdown-display">
+					<text class="countdown-label">距离开播还有</text>
+					<view class="countdown-unit">
+						{{ liveCountdown.hours || '00' }}
+					</view>
+					<view class="countdown-separator">:</view>
+					<view class="countdown-unit">
+						{{ liveCountdown.minutes || '00' }}
+					</view>
+					<view class="countdown-separator">:</view>
+					<view class="countdown-unit">
+						{{ liveCountdown.seconds || '00' }}
+					</view>
+				</view>
+			</view>
+			<view class="trailer-actions">
+				<button open-type="share" class="button-reset share-button">
+					<view class="action-button mr18" @click="handleAgreement">
+						<text>分享给好友</text>
+					</view>
+				</button>
+
+				<view class="action-button reserve-button" @click="handleAgreement">
+					<image class="button-icon mr8" src="/static/images/trailer.png"></image>
+					<text>{{ hasSubscribed ? '已预约' : '预约直播'}}</text>
+					<!-- <text>预约直播</text> -->
+				</view>
+			</view>
+		</view>
+
+		<!-- 无直播状态 -->
+		<view class="trailer-box" v-if="!liveItem">
+			<image class="img" src="/static/images/no_live.png"></image>
+			<view class="title">暂无直播</view>
+		</view>
+	</view>
 </template>
 
 <script>
-import { generateRandomString } from '@/utils/common.js';
-import dayjs from 'dayjs';
-import { internetTraffic, liveInternetTraffic } from '@/api/living.js';
-import { getUserInfo } from '@/api/user';
-
-export default {
-  name: 'LiveVideoPlayer',
-  props: {
-    liveItem: {
-      type: Object,
-      default: () => ({})
-    },
-    liveId: {
-      type: [String, Number],
-      default: ''
-    },
-    userData: {
-      type: Object,
-      default: () => ({})
-    }
-  },
-  data() {
-    return {
-      // 流量计算相关
-      uuId: '',
-      totalTraffic: 0,
-      bitrate: 800, // 录播默认码率 0.16Mbps
-      bitrateLive: 1600, // 直播默认码率 0.16Mbps
-      
-      // 定时器
-      trafficTimer: null,
-      liveStartTimer: null,
-      trafficInterval: null,
-      lookTimer: null,
-      
-      // 状态数据
-      liveCountdown: {},
-      diffTotalTime: '',
-      videoCurrentTime: 0,
-      videoProgressKey: '',
-      startTime: 0,
-      stayTime: 0,
-      isAgreement: false,
-      
-      // 性能优化
-      videoRetryCounts: Object.create(null)
-    };
-  },
-  computed: {
-    // 计算当前时间与开始时间的差值
-    currentTimeDiff() {
-      if (!this.liveItem.startTime) return 0;
-      const timeStr = this.liveItem.startTime;
-      const time = new Date(timeStr.replace(/-/g, '/'));
-      if (isNaN(time.getTime())) return 0;
-      
-      const now = new Date();
-      return Math.max(0, now.getTime() - time.getTime());
-    }
-  },
-  watch: {
-    'liveItem.status': {
-      handler(newStatus, oldStatus) {
-        if (newStatus === undefined || oldStatus === undefined) return;
-        if (newStatus === oldStatus) return;
-        
-        console.log(`直播状态变化: ${oldStatus} -> ${newStatus}`);
-        this.handleStatusChange(newStatus);
-      },
-      immediate: true
-    }
-	// ,
- //    'liveItem.status': {
- //      handler(newVal) {
- //        if (newVal && newVal.status === 2) {
- //          this.startTimeTimer(newVal);
- //        }
- //      },
- //      deep: true,
- //      immediate: true
- //    }
-  },
-  async mounted() {
-    await this.initializeComponent();
-  },
-  beforeUnmount() {
-    this.cleanup();
-  },
-  methods: {
-    // 初始化组件
-    async initializeComponent() {
-      this.uuId = generateRandomString(16);
-      this.isAgreement = uni.getStorageSync('isAgreement');
-      
-      if (this.liveItem.status === 2) {
-        this.startTimeTimer(this.liveItem);
-      }
-      
-      if (this.liveItem.status === 1 && this.liveItem.startTime) {
-        this.startLiveCountdown();
-      }
-      
-      this.startTimer();
-    },
-    
-    // 处理状态变化
-    handleStatusChange(newStatus) {
-      // 清理旧定时器
-      this.cleanupTimers();
-      
-      switch (newStatus) {
-        case 1: // 预告
-          this.startLiveCountdown();
-          break;
-        case 2: // 直播中
-          this.startTimeTimer(this.liveItem);
-          this.playVideo();
-          break;
-        case 3: // 已结束
-        case 4: // 回放
-          this.pauseVideo();
-          break;
-      }
-    },
-    
-    // 启动直播倒计时
-    startLiveCountdown() {
-      if (this.liveStartTimer) {
-        clearInterval(this.liveStartTimer);
-      }
-      
-      this.liveStartTimer = setInterval(() => {
-        this.liveCountdown = this.handleTime(this.liveItem.startTime, 0);
-        if (!this.liveCountdown) {
-          this.$emit('liveStart');
-          clearInterval(this.liveStartTimer);
-        }
-      }, 1000);
-    },
-    
-    // 启动时间计时器
-    startTimeTimer(item) {
-      if (!item) return;
-      
-      // 立即计算一次
-      this.calculateTimeDiff(item);
-      
-      // 每秒更新
-      if (item.timeTimer) {
-        clearInterval(item.timeTimer);
-      }
-      
-      item.timeTimer = setInterval(() => {
-        this.calculateTimeDiff(item);
-      }, 1000);
-    },
-    
-    // 计算时间差
-    calculateTimeDiff(item) {
-      if (!item.startTime) return;
-      
-      const time = new Date(item.startTime.replace(/-/g, '/'));
-      if (isNaN(time.getTime())) return;
-      
-      const now = new Date();
-      let diffMs = Math.max(0, now.getTime() - time.getTime());
-      
-      const totalSeconds = Math.floor(diffMs / 1000);
-      const hours = this.padZero(Math.floor(totalSeconds / 3600));
-      const minutes = this.padZero(Math.floor((totalSeconds % 3600) / 60));
-      const seconds = this.padZero(totalSeconds % 60);
-      
-      this.diffTotalTime = `${hours}:${minutes}:${seconds}`;
-    },
-    
-    // 补零函数
-    padZero(num) {
-      return num < 10 ? `0${num}` : num;
-    },
-    
-    // 时间处理
-    handleTime(time, duration) {
-      let timeStamp;
-      
-      if (typeof time === 'number' && time > 0 && time < 9999999999999) {
-        timeStamp = time;
-      } else if (typeof time === 'string' && time.trim() !== '') {
-        const isoTime = time.replace(' ', 'T');
-        const date = new Date(isoTime);
-        if (!isNaN(date.getTime())) {
-          timeStamp = date.getTime();
-        } else {
-          console.error('无效的日期格式:', time);
-          return false;
-        }
-      } else {
-        console.error('time参数必须是有效的时间戳或日期字符串');
-        return false;
-      }
-      
-      const targetTimestamp = timeStamp + duration * 60 * 1000;
-      const currentTimestamp = Date.now();
-      const timeDiffMs = targetTimestamp - currentTimestamp;
-      
-      if (timeDiffMs <= 0) {
-        return false;
-      }
-      
-      const hours = Math.floor(timeDiffMs / (1000 * 60 * 60));
-      const minutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));
-      const seconds = Math.floor((timeDiffMs % (1000 * 60)) / 1000);
-      
-      const formatNum = (num) => num.toString().padStart(2, '0');
-      return {
-        hours: formatNum(hours),
-        minutes: formatNum(minutes),
-        seconds: formatNum(seconds)
-      };
-    },
-    
-    // 播放视频
-    playVideo() {
-      if (!this.liveItem) {
-        console.log('liveItem 为空,无法播放视频');
-        return;
-      }
-      
-      try {
-        // 直播流
-        if (this.liveItem.liveType === 1 && this.liveItem.livingUrl && this.liveItem.status == 2) {
-          const livePlayerId = `myLivePlayer_${this.liveId}`;
-          const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
-          if (livePlayerContext) {
-            livePlayerContext.play();
-          }
-        } 
-        // 预告视频
-        else if (this.liveItem.status == 1 && this.liveItem.previewUrl) {
-          const videoId = `myVideo_${this.liveId}`;
-          const videoContext = uni.createVideoContext(videoId, this);
-          if (videoContext) {
-            videoContext.play();
-          }
-        } 
-        // 录播
-        else if (this.liveItem.liveType === 2 && this.liveItem.videoUrl && this.liveItem.status == 2) {
-          const videoId = `myVideo_${this.liveId}`;
-          const videoContext = uni.createVideoContext(videoId, this);
-          if (videoContext) {
-            videoContext.play();
-          }
-        } 
-        // 回放
-        else if (this.liveItem.liveType === 3 && this.liveItem.videoUrl && this.liveItem.status == 4) {
-          const videoId = `myVideo_${this.liveId}`;
-          const videoContext = uni.createVideoContext(videoId, this);
-          if (videoContext) {
-            videoContext.play();
-          }
-        }
-      } catch (error) {
-        console.error('播放视频失败:', error);
-        this.$emit('playError', error);
-      }
-    },
-    
-    // 暂停视频
-    pauseVideo() {
-      if (!this.liveItem) return;
-      
-      try {
-        if (this.liveItem.status == 1) {
-          const videoId = `myVideo_${this.liveId}`;
-          const videoContext = uni.createVideoContext(videoId, this);
-          if (videoContext) {
-            videoContext.pause();
-          }
-        } else if (this.liveItem.status == 2) {
-          if (this.liveItem.liveType === 1) {
-            const livePlayerId = `myLivePlayer_${this.liveId}`;
-            const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
-            if (livePlayerContext) {
-              livePlayerContext.pause();
-            }
-          } else if (this.liveItem.liveType === 2) {
-            const videoId = `myVideo_${this.liveId}`;
-            const videoContext = uni.createVideoContext(videoId, this);
-            if (videoContext) {
-              videoContext.pause();
-            }
-          }
-        }
-      } catch (error) {
-        console.error('暂停视频失败:', error);
-        this.$emit('pauseError', error);
-      }
-    },
-    
-    // 视频错误处理
-    videoError(e) {
-      if (!this.liveItem || !this.liveId) return;
-      
-      // 初始化重试计数
-      if (this.videoRetryCounts[this.liveId] === undefined) {
-        this.videoRetryCounts[this.liveId] = 0;
-      }
-      
-      // 限制重试次数
-      if (this.videoRetryCounts[this.liveId] >= 3) {
-        console.error(`直播间 ${this.liveId} 视频加载失败,停止重试`);
-        this.$emit('videoError', {
-          type: 'loadFailed',
-          liveId: this.liveId,
-          message: '视频加载失败,请检查网络'
-        });
-        return;
-      }
-      
-      this.videoRetryCounts[this.liveId]++;
-      
-      // 延迟重试
-      setTimeout(() => {
-        console.log(`第${this.videoRetryCounts[this.liveId]}次重试播放视频`);
-        this.playVideo();
-      }, 2000);
-      
-      this.$emit('videoError', {
-        type: 'retry',
-        liveId: this.liveId,
-        retryCount: this.videoRetryCounts[this.liveId]
-      });
-    },
-    
-    // 直播状态变化
-    onLiveStateChange(e) {
-      const stateCode = e.detail.code;
-      
-      if (e.detail.code == -2301 || e.detail.code == -2302) {
-        this.playVideo();
-      } else if (e.detail.code == 2004) {
-        this.calculateTimeDiff(this.liveItem);
-        this.startTrafficCalculation(this.bitrateLive);
-      }
-      
-      this.$emit('liveStateChange', e.detail);
-    },
-    
-    // 直播错误
-    onLiveError(e) {
-      this.videoError(e);
-      this.$emit('liveError', e.detail);
-    },
-    
-    // 视频元数据加载
-    onVideoMetaLoaded(e) {
-      this.videoProgressKey = `videoProgress_${this.liveId}`;
-      this.setVideoProgress();
-      this.$emit('videoMetaLoaded', e.detail);
-    },
-    
-    // 设置视频进度
-    setVideoProgress() {
-      if (this.liveItem.liveType !== 2 && this.liveItem.liveType !== 3) {
-        return;
-      }
-      
-      let currentTime = 0;
-      if (this.liveItem.liveType === 2) {
-        const diff = this.getTimeDifferenceInSeconds(this.liveItem.startTime);
-        if (diff > this.liveItem.duration) {
-          const storedProgress = uni.getStorageSync(this.videoProgressKey) || 0;
-          currentTime = storedProgress >= this.liveItem.duration ? 0 : storedProgress || 0;
-        } else {
-          currentTime = diff % this.liveItem.duration;
-        }
-      } else if (this.liveItem.liveType === 3) {
-        const storedProgress = uni.getStorageSync(this.videoProgressKey);
-        currentTime = storedProgress || 0;
-      }
-      
-      const videoId = `myVideo_${this.liveId}`;
-      const videoContext = uni.createVideoContext(videoId, this);
-      if (videoContext) {
-        videoContext.seek(currentTime);
-      }
-    },
-    
-    // 获取时间差(秒)
-    getTimeDifferenceInSeconds(createTimeStr) {
-      const createTime = new Date(createTimeStr.replace(/-/g, '/'));
-      const now = new Date();
-      const timeDiffMs = now - createTime;
-      return Math.max(0, Math.floor(timeDiffMs / 1000));
-    },
-    
-    // 视频时间更新
-    onVideoTimeUpdate(e) {
-      this.videoCurrentTime = e.detail.currentTime;
-      
-      if (Math.floor(this.videoCurrentTime) % 10 === 0) {
-        this.saveVideoProgress();
-      }
-      
-      this.$emit('videoTimeUpdate', e.detail);
-    },
-    
-    // 视频暂停
-    onVideoPause(e) {
-      if (this.liveItem.liveType === 2) {
-        const videoId = `myVideo_${this.liveId}`;
-        const videoContext = uni.createVideoContext(videoId, this);
-        setTimeout(() => {
-          videoContext.play();
-        }, 100);
-      }
-      
-      this.saveVideoProgress();
-      this.$emit('videoPause', e.detail);
-    },
-    
-    // 视频播放
-    onVideoPlay(e) {
-      this.$emit('videoPlay', e.detail);
-    },
-    
-    // 视频等待
-    onVideoWaiting(e) {
-      if (this.liveItem.liveType == 2) {
-        this.startTrafficCalculation(this.bitrate);
-      } else {
-        if (this.trafficInterval) {
-          clearInterval(this.trafficInterval);
-          this.trafficInterval = null;
-        }
-        
-        this.trafficInterval = setInterval(() => {
-          this.getInternetTraffic();
-        }, 10000);
-      }
-      
-      this.$emit('videoWaiting', e.detail);
-    },
-    
-    // 阻止双击事件
-    preventDoubleClick(e) {
-      e.preventDefault();
-      e.stopPropagation();
-      return false;
-    },
-    
-    // 保存视频进度
-    saveVideoProgress() {
-      if (this.videoProgressKey) {
-        uni.setStorage({
-          key: this.videoProgressKey,
-          data: this.videoCurrentTime,
-          success: () => {},
-          fail: (err) => {
-            console.error('保存视频进度失败:', err);
-          }
-        });
-      }
-    },
-    
-    // 开始流量计算
-    startTrafficCalculation(bitrate) {
-      if (this.trafficTimer) {
-        clearInterval(this.trafficTimer);
-        this.trafficTimer = null;
-      }
-      
-      this.startTime = Date.now();
-      this.trafficTimer = setInterval(() => {
-        this.calculateTraffic(bitrate);
-      }, 10000);
-    },
-    
-    // 计算流量
-    calculateTraffic(bitrate) {
-      const currentTime = Date.now();
-      const duration = (currentTime - this.startTime) / 1000;
-      const trafficBits = bitrate * duration;
-      this.totalTraffic = trafficBits / 8;
-      this.getLiveInternetTraffic();
-    },
-    
-    // 直播流量统计
-    getLiveInternetTraffic() {
-      if (!this.liveId || !this.userData.userId) return;
-      
-      const param = {
-        userId: this.userData.userId,
-        liveId: this.liveId,
-        uuId: dayjs().format('YYYYMMDD') + this.uuId,
-        internetTraffic: this.totalTraffic
-      };
-      
-      liveInternetTraffic(param).catch(err => {
-        console.error('直播流量统计失败:', err);
-      });
-    },
-    
-    // 回放、预告流量统计
-    getInternetTraffic() {
-      if (!this.liveId || !this.userData.userId || !this.uuId) return;
-      
-      const currentTime = (this.stayTime / this.liveItem.duration) * 100;
-      const param = {
-        videoType: this.liveItem.videoType,
-        videoId: this.liveItem.videoId,
-        userId: this.userData.userId,
-        liveId: this.liveId,
-        uuId: dayjs().format('YYYYMMDD') + this.uuId,
-        duration: this.liveItem.duration,
-        bufferRate: currentTime
-      };
-      
-      if (this.liveItem.status == 1) {
-        param.videoType = this.liveItem.previewVideoType || '';
-        param.videoId = this.liveItem.previewVideoId || '';
-      }
-      
-      if (this.liveItem.liveType == 1) {
-        param.bufferRate = this.totalTraffic;
-      }
-      
-      internetTraffic(param).catch(err => {
-        console.error('流量统计失败:', err);
-      });
-    },
-    
-    // 开始计时器
-    startTimer() {
-      this.startTime = Date.now();
-      this.lookTimer = setInterval(() => {
-        this.stayTime = Math.floor((Date.now() - this.startTime) / 1000);
-      }, 1000);
-    },
-    
-    // 预约直播
-    handleAgreement() {
-      this.$emit('agreementClick');
-    },
-    
-    // 清理定时器
-    cleanupTimers() {
-      if (this.liveStartTimer) {
-        clearInterval(this.liveStartTimer);
-        this.liveStartTimer = null;
-      }
-      
-      if (this.trafficTimer) {
-        clearInterval(this.trafficTimer);
-        this.trafficTimer = null;
-      }
-      
-      if (this.trafficInterval) {
-        clearInterval(this.trafficInterval);
-        this.trafficInterval = null;
-      }
-      
-      if (this.lookTimer) {
-        clearInterval(this.lookTimer);
-        this.lookTimer = null;
-      }
-      
-      if (this.liveItem && this.liveItem.timeTimer) {
-        clearInterval(this.liveItem.timeTimer);
-        this.liveItem.timeTimer = null;
-      }
-    },
-    
-    // 组件清理
-    cleanup() {
-      this.cleanupTimers();
-      this.pauseVideo();
-      this.saveVideoProgress();
-    }
-  }
-};
+	import {
+		generateRandomString
+	} from '@/utils/common.js';
+	import dayjs from 'dayjs';
+	import {
+		internetTraffic,
+		liveInternetTraffic
+	} from '@/api/living.js';
+	import {
+		getUserInfo
+	} from '@/api/user';
+
+	export default {
+		name: 'LiveVideoPlayer',
+		props: {
+			liveItem: {
+				type: Object,
+				default: () => ({})
+			},
+			liveId: {
+				type: [String, Number],
+				default: ''
+			},
+			userData: {
+				type: Object,
+				default: () => ({})
+			},
+			isAgreement: {
+				type: Boolean,
+				default: false
+			},
+			hasSubscribed: {
+				type: Boolean,
+				default: false
+			}
+		},
+		data() {
+			return {
+				// hasSubscribed: false, // 已成功订阅(永久禁用)
+				isFullscreen: false,
+				isVideoRotated: false,
+				showNonVideoElementsFlag: true,
+				showCustomControls: true,
+				videoContext: null,
+
+				// 流量计算相关
+				uuId: '',
+				totalTraffic: 0,
+				bitrate: 800,
+				bitrateLive: 1600,
+
+				// 定时器
+				trafficTimer: null,
+				liveStartTimer: null,
+				trafficInterval: null,
+				lookTimer: null,
+
+				// 状态数据
+				liveCountdown: {},
+				diffTotalTime: '',
+				videoCurrentTime: 0,
+				videoProgressKey: '',
+				startTime: 0,
+				stayTime: 0,
+				// 内部状态跟踪
+				hasInitialized: false,
+				lastLiveItemStatus: null
+			};
+		},
+		watch: {
+			// 深度监听 liveItem 的所有变化
+			liveItem: {
+				handler(newVal, oldVal) {
+					if (newVal && newVal.status === 1 && newVal.startTime) {
+						// 如果是预告状态且有开始时间,立即启动倒计时
+						this.startLiveCountdown();
+					}
+				},
+				deep: true,
+				immediate: true // 立即执行一次
+			},
+
+			// 单独监听 status 变化作为备用
+			'liveItem.status': {
+				handler(newStatus, oldStatus) {
+					console.log('状态变化:', oldStatus, '->', newStatus);
+
+					if (newStatus === 1 && this.liveItem.startTime) {
+						this.startLiveCountdown();
+					} else if (newStatus === 2) {
+						this.startTimeTimer(this.liveItem);
+					}
+				},
+				immediate: true
+			}
+		},
+		async created() {
+			// 最早的可执行时机
+			if (this.liveItem && Object.keys(this.liveItem).length > 0) {
+				await this.initializeComponent();
+			}
+		},
+		// async mounted() {
+		// 	await this.initializeComponent();
+		// },
+		computed: {
+			shouldShowNonVideoElements() {
+				return !this.isFullscreen && this.showNonVideoElementsFlag;
+			},
+
+			// 控制是否显示全屏按钮
+			shouldShowFullscreenButton() {
+				return this.liveItem.showType == 1 && !this.isFullscreen;
+			},
+		},
+		beforeUnmount() {
+			this.cleanup();
+			// 强制退出全屏
+			this.isFullscreen = false;
+			this.showCustomControls = true;
+		},
+
+		methods: {
+			// 退出全屏
+			exitFullscreen() {
+				console.log('执行退出全屏');
+
+				this.isFullscreen = false;
+
+				// 显示非videolist元素
+				this.showNonVideoElements();
+
+				// 强制页面重排
+				this.$nextTick(() => {
+					this.$forceUpdate();
+					this.$emit('fullscreen-change', this.isFullscreen);
+				});
+			},
+
+			// 恢复videolist盒子
+			restoreVideoList() {
+				this.isVideoRotated = false;
+				this.isFullscreen = false;
+			},
+
+			// 切换全屏
+			toggleFullscreen() {
+				// console.log('自定义全屏按钮被点击');
+
+				if (this.isFullscreen) {
+					// 退出全屏
+					this.exitFullscreen();
+				} else {
+					// 进入全屏
+					this.enterFullscreen();
+				}
+
+			}, // 进入全屏
+			enterFullscreen() {
+				console.log('执行进入全屏');
+				this.isFullscreen = true;
+				// 设置横屏样式
+				this.rotateVideoList();
+
+				// 隐藏非videolist元素
+				this.hideNonVideoElements();
+				this.$emit('fullscreen-change', this.isFullscreen);
+				// 强制页面重排
+				this.$forceUpdate();
+			},
+			// 隐藏非videolist元素
+			hideNonVideoElements() {
+				this.showNonVideoElementsFlag = false;
+				console.log('隐藏非视频元素');
+			},
+			// 显示非videolist元素
+			showNonVideoElements() {
+				this.showNonVideoElementsFlag = true;
+			},
+			// 防止默认全屏事件
+			onFullscreenChange(e) {
+				// 阻止默认全屏行为
+				e.preventDefault();
+
+				// 如果有video进入全屏,立即退出
+				if (e.detail && e.detail.fullScreen) {
+					const videoContext = uni.createVideoContext(`myVideo_${this.liveId}`, this);
+					if (videoContext) {
+						setTimeout(() => {
+							videoContext.exitFullScreen();
+						}, 100);
+					}
+				}
+			},
+
+			// 旋转videolist盒子
+			rotateVideoList() {
+				this.isVideoRotated = true;
+				this.isFullscreen = true;
+				console.log('视频容器旋转到横屏状态');
+			},
+			// 全屏状态变化监听
+
+			onFullscreenChange(e) {
+				console.log('全屏状态变化事件详情:', e);
+
+				// 方法1:通过事件参数获取(小程序主要方式)
+				let fullScreen = false;
+
+				// 视频组件的全屏事件参数
+				if (e.detail && typeof e.detail.fullScreen !== 'undefined') {
+					fullScreen = e.detail.fullScreen;
+					console.log('通过e.detail.fullScreen获取全屏状态:', fullScreen);
+				}
+				// 其他可能的参数名
+				else if (e.detail && typeof e.detail.fullscreen !== 'undefined') {
+					fullScreen = e.detail.fullscreen;
+					console.log('通过e.detail.fullscreen获取全屏状态:', fullScreen);
+				}
+				// 方法2:检测横屏(备用)
+				else {
+					// 在小程序环境中,可以通过屏幕方向判断
+					try {
+						const systemInfo = uni.getSystemInfoSync();
+						fullScreen = systemInfo.windowWidth > systemInfo.windowHeight;
+						console.log('通过屏幕方向判断全屏状态:', fullScreen);
+					} catch (err) {
+						console.error('获取系统信息失败:', err);
+						// 默认使用事件参数
+						fullScreen = e.detail || false;
+					}
+				}
+
+				this.isFullscreen = fullScreen;
+				console.log('最终设置isFullscreen为:', this.isFullscreen);
+
+				// 根据全屏状态显示/隐藏自定义控件
+				this.showCustomControls = !this.isFullscreen;
+
+				// 强制UI更新
+				this.$forceUpdate();
+
+				// 全屏时锁定横屏
+				if (this.isFullscreen) {
+					this.lockOrientation();
+				} else {
+					this.unlockOrientation();
+				}
+			},
+			// 锁定屏幕方向为横屏
+			lockOrientation() {
+				// 设置屏幕方向为横屏
+				try {
+					// 尝试锁定横屏
+					plus.screen.lockOrientation('landscape-primary');
+				} catch (e) {
+					console.log('锁定屏幕方向失败:', e);
+					// 备用方案
+					try {
+						// 使用 Web API(如果支持)
+						if (screen.orientation && screen.orientation.lock) {
+							screen.orientation.lock('landscape');
+						}
+					} catch (err) {
+						console.log('备用方案也失败了:', err);
+					}
+				}
+			}, // 解锁屏幕方向
+			unlockOrientation() {
+				try {
+					plus.screen.unlockOrientation();
+				} catch (e) {
+					console.log('解锁屏幕方向失败:', e);
+					// 备用方案
+					try {
+						if (screen.orientation && screen.orientation.unlock) {
+							screen.orientation.unlock();
+						}
+					} catch (err) {
+						console.log('备用解锁方案也失败了:', err);
+					}
+				}
+			},
+
+
+
+			handleAgreement() {
+				console.log('预约直播点击');
+				this.$emit('agreementClick');
+			}, // 播放视频
+			playVideo() {
+				if (!this.liveItem) {
+					console.log('liveItem 为空,无法播放视频');
+					return;
+				}
+				try {
+					// 直播流使用live-player
+					if (this.liveItem.liveType === 1 && this.liveItem.livingUrl && this.liveItem.status == 2) {
+						const livePlayerId = `myLivePlayer_${this.liveId}`;
+						const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
+						// console.log("直播")
+						if (livePlayerContext) {
+							livePlayerContext.play();
+						}
+					} else if (this.liveItem.status == 1 && this.liveItem.previewUrl) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+
+						if (videoContext) {
+							videoContext.play();
+						}
+					} else if (this.liveItem.liveType === 2 && this.liveItem.videoUrl && this.liveItem.status == 2) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+						// console.log("录播")
+						if (videoContext) {
+							videoContext.play();
+						}
+					} // 回放视频使用video
+					else if (this.liveItem.liveType === 3 && this.liveItem.videoUrl && this.liveItem.status == 4) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+						// console.log("回放")
+						if (videoContext) {
+							videoContext.play();
+						}
+					}
+				} catch (error) {
+					console.error('播放视频失败:', error);
+				}
+			},
+
+			pauseVideo() {
+				if (!this.liveItem) return;
+
+				try {
+					// 直播流使用live-player
+					if (this.liveItem.status == 1) {
+						const videoId = `myVideo_${this.liveId}`;
+						const videoContext = uni.createVideoContext(videoId, this);
+						if (videoContext) {
+							videoContext.pause();
+						}
+					} else if (this.liveItem.status == 2) {
+						if (this.liveItem.liveType === 1) {
+							const livePlayerId = `myLivePlayer_${this.liveId}`;
+							const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
+							if (livePlayerContext) {
+								livePlayerContext.pause();
+							}
+						} else if (this.liveItem.liveType === 2) {
+							const videoId = `myVideo_${this.liveId}`;
+							const videoContext = uni.createVideoContext(videoId, this);
+							if (videoContext) {
+								videoContext.pause();
+							}
+						}
+					}
+				} catch (error) {
+					console.error('暂停视频失败:', error);
+				}
+			},
+			// 视频错误处理
+			videoError(e, liveItem) {
+				if (!liveItem || !this.liveId) return;
+				// 初始化重试计数
+				if (this.videoRetryCounts[liveItem.liveId] === undefined) {
+					this.videoRetryCounts[liveItem.liveId] = 0;
+				}
+				// 限制重试次数
+				if (this.videoRetryCounts[liveItem.liveId] >= 3) {
+					console.error(`直播间 ${this.liveId} 视频加载失败,停止重试`);
+					// 显示错误提示
+					uni.showToast({
+						title: '视频加载失败,请检查网络',
+						icon: 'none',
+						duration: 2000
+					});
+					return;
+				}
+
+				this.videoRetryCounts[this.liveId]++;
+
+				// 延迟重试
+				setTimeout(() => {
+					if (this.liveId === this.liveId) {
+						console.log(`第${this.videoRetryCounts[this.liveId]}次重试播放视频`);
+						this.playVideo();
+					}
+				}, 2000);
+			}, // 视频暂停
+			onVideoPause(e) {
+				if (this.liveItem.liveType === 2) {
+					const videoId = `myVideo_${this.liveId}`;
+					const videoContext = uni.createVideoContext(videoId, this);
+					setTimeout(() => {
+						videoContext.play();
+					}, 100);
+				}
+				// 暂停时保存进度
+				this.saveVideoProgress();
+			}, //直播、录播缓冲
+			getLiveInternetTraffic() {
+				if (!this.liveId) return;
+				const currentTime = (this.stayTime / this.liveItem.duration) * 100;
+				const param = {
+					userId: this.userData.userId || '',
+					liveId: this.liveId || '',
+					uuId: dayjs().format('YYYYMMDD') + this.uuId,
+					internetTraffic: this.totalTraffic
+				};
+				liveInternetTraffic(param);
+			},
+			startTimer() {
+				this.startTime = Date.now();
+				this.lookTimer = setInterval(() => {
+					this.stayTime = Math.floor((Date.now() - this.startTime) / 1000);
+				}, 1000);
+			},
+			// 计算流量
+			// calculateTraffic(bitrate) {
+			// 	const currentTime = Date.now();
+			// 	const duration = (currentTime - this.startTime) / 1000; // 持续时间(秒)
+			// 	// 流量 = 码率 × 时间
+			// 	// 码率单位: bps, 时间单位: 秒, 流量单位: 比特
+			// 	const trafficBits = bitrate * duration;
+			// 	// 转换为字节
+			// 	this.totalTraffic = trafficBits / 8;
+			// 	this.getLiveInternetTraffic();
+			// },
+			// 计算流量
+			calculateTraffic(bitrate) {
+				const currentTime = Date.now();
+				const duration = (currentTime - this.startTime) / 1000; // 持续时间(秒)
+
+				// 流量 = 码率 × 时间
+				// 码率单位: bps, 时间单位: 秒, 流量单位: 比特
+				const trafficBits = bitrate * duration;
+
+				// 转换为字节
+				this.totalTraffic = trafficBits / 8;
+
+				// 调用流量上报接口
+				this.getLiveInternetTraffic();
+			},
+			//直播计算流量
+			// startTrafficCalculation(bitrate) {
+			// 	if (this.trafficTimer) {
+			// 		clearInterval(this.trafficTimer);
+			// 		this.trafficTimer = null;
+			// 	}
+			// 	this.startTime = Date.now();
+			// 	var that = this;
+			// 	this.trafficTimer = setInterval(() => {
+			// 		that.calculateTraffic(bitrate);
+			// 	}, 10000); // 每10秒计算一次
+			// },
+			startTrafficCalculation() {
+				if (this.trafficTimer) {
+					clearInterval(this.trafficTimer);
+					this.trafficTimer = null;
+				}
+
+				this.startTime = Date.now();
+				var that = this;
+
+				// 计算码率
+				let bitrate = this.calculateBitrate();
+
+				this.trafficTimer = setInterval(() => {
+					that.calculateTraffic(bitrate);
+				}, 10000); // 每10秒计算一次
+			}, // 计算码率
+			calculateBitrate() {
+				// 如果接口返回了视频文件大小和时长,使用这些数据计算码率
+				if (this.liveItem.videoFileSize && this.liveItem.videoDuration) {
+					// 码率 = 文件大小(字节) / 时长(秒) × 8 (转换为bps) × 5
+					const calculatedBitrate = (this.liveItem.videoFileSize / this.liveItem.videoDuration) * 8 * 5;
+					console.log(
+						`使用接口数据计算码率: ${calculatedBitrate} bps (文件大小: ${this.liveItem.videoFileSize} 字节, 时长: ${this.liveItem.videoDuration} 秒)`
+					);
+					return calculatedBitrate;
+				} else {
+					// 如果任一字段为空,使用默认码率 1500 bps
+					console.log('接口数据不完整,使用默认码率: 1500 bps');
+					return 800;
+				}
+			},
+
+			// 回放、预告缓冲
+			getInternetTraffic() {
+				if (!this.liveId || !this.liveId || !this.userData.userId || !this.uuId) return;
+				const currentTime = (this.stayTime / this.liveItem.duration) * 100;
+				const param = {
+					videoType: this.liveItem.videoType,
+					videoId: this.liveItem.videoId,
+					userId: this.userData.userId,
+					liveId: this.liveId,
+					uuId: dayjs().format('YYYYMMDD') + this.uuId,
+					duration: this.liveItem.duration,
+					bufferRate: currentTime
+				};
+				if (this.liveItem.status == 1) {
+					param.videoType = this.liveItem.previewVideoType || '';
+					param.videoId = this.liveItem.previewVideoId || '';
+				}
+				if (this.liveItem.liveType == 1) {
+					param.bufferRate = this.totalTraffic;
+				}
+				internetTraffic(param);
+			},
+			saveVideoProgress() {
+				if (this.videoProgressKey) {
+					uni.setStorage({
+						key: this.videoProgressKey,
+						data: this.videoCurrentTime,
+						success: () => {},
+						fail: (err) => {
+							console.error('保存视频进度失败:', err);
+						}
+					});
+				}
+			},
+			getTimeDifferenceInSeconds(createTimeStr) {
+				const createTime = new Date(createTimeStr.replace(/-/g, '/'));
+				const now = new Date();
+				const timeDiffMs = now - createTime;
+				const timeDiffSeconds = Math.floor(timeDiffMs / 1000);
+				return Math.max(0, timeDiffSeconds);
+			},
+			// onVideoWaiting(e) {
+			// 	// console.log('视频等待加载', e);
+			// 	if (this.liveItem.liveType == 2) {
+			// 		this.startTrafficCalculation(this.bitrate);
+			// 	} else {
+			// 		let that = this;
+			// 		if (this.trafficInterval) {
+			// 			clearInterval(this.trafficInterval);
+			// 			this.trafficInterval = null;
+			// 		}
+			// 		this.trafficInterval = setInterval(function() {
+			// 			that.getInternetTraffic();
+			// 		}, 10000);
+			// 	}
+			// },
+			onVideoWaiting(e) {
+				// console.log('视频等待加载', e);
+				if (this.liveItem.liveType == 2) {
+					// 修改这里:不再传入固定码率,而是在方法内部计算
+					this.startTrafficCalculation();
+				} else {
+					let that = this;
+					if (this.trafficInterval) {
+						clearInterval(this.trafficInterval);
+						this.trafficInterval = null;
+					}
+					this.trafficInterval = setInterval(function() {
+						that.getInternetTraffic();
+					}, 10000);
+				}
+			},
+			setVideoProgress() {
+				// 只有录播和回放需要设置进度
+				if (this.liveItem.liveType !== 2 && this.liveItem.liveType !== 3) {
+					return;
+				}
+				let currentTime = 0;
+				if (this.liveItem.liveType === 2) {
+					// 录播:计算当前时间与开始时间的差值,对视频总时长取模
+					const diff = this.getTimeDifferenceInSeconds(this.liveItem.startTime);
+					if (diff > this.liveItem.duration) {
+						console.log("开始断点续播了")
+						const storedProgress = uni.getStorageSync(this.videoProgressKey) || 0;
+						console.log("开始断点续播了storedProgress", storedProgress)
+						currentTime = storedProgress >= this.liveItem.duration ? 0 : storedProgress || 0;
+						console.log("开始断点续播了currentTime", currentTime)
+					} else {
+						currentTime = diff % this.liveItem.duration;
+					}
+
+					// currentTime = diff % this.liveItem.duration;
+				} else if (this.liveItem.liveType === 3) {
+					// 回放:从存储中获取进度
+					const storedProgress = uni.getStorageSync(this.videoProgressKey);
+					currentTime = storedProgress || 0;
+				}
+				const videoId = `myVideo_${this.liveId}`;
+				const videoContext = uni.createVideoContext(videoId, this);
+				if (videoContext) {
+					videoContext.seek(currentTime);
+				}
+			}, // 视频播放
+			onVideoPlay(e) {},
+			// 录播时间点
+			onVideoMetaLoaded(e) {
+				console.log("录播时间点", e)
+				this.videoProgressKey = `videoProgress_${this.liveId}`;
+				this.setVideoProgress();
+			},
+			// 视频时间更新
+			onVideoTimeUpdate(e) {
+				// 获取当前播放时间
+				this.videoCurrentTime = e.detail.currentTime;
+				// 每隔10秒保存一次进度(避免频繁存储)
+				if (Math.floor(this.videoCurrentTime) % 10 === 0) {
+					this.saveVideoProgress();
+				}
+			},
+			// 初始化组件 - 增强版本
+			async initializeComponent() {
+				console.log('初始化视频组件:', {
+					liveId: this.liveId,
+					liveItem: this.liveItem,
+					状态: this.liveItem?.status,
+					开始时间: this.liveItem?.startTime
+				});
+
+				this.uuId = generateRandomString(16);
+				this.isAgreement = uni.getStorageSync('isAgreement');
+
+				// 立即检查当前状态并启动相应功能
+				if (this.liveItem?.status === 1 && this.liveItem.startTime) {
+					console.log('检测到预告状态,立即启动倒计时');
+					this.startLiveCountdown();
+				} else if (this.liveItem?.status === 2) {
+					this.startTimeTimer(this.liveItem);
+					this.playVideo();
+				}
+
+				this.startTimer();
+				this.hasInitialized = true;
+			},
+
+			// 启动直播倒计时 - 增强版本
+			startLiveCountdown() {
+				console.log('启动直播倒计时:', this.liveItem.startTime);
+
+				// 清理旧定时器
+				if (this.liveStartTimer) {
+					clearInterval(this.liveStartTimer);
+					this.liveStartTimer = null;
+				}
+
+				// 立即计算一次倒计时
+				this.liveCountdown = this.handleTime(this.liveItem.startTime, 0);
+				console.log('初始倒计时:', this.liveCountdown);
+
+				// 如果倒计时已结束,触发直播开始事件
+				if (!this.liveCountdown) {
+					console.log('倒计时已结束,触发直播开始');
+					this.$emit('liveStart');
+					return;
+				}
+
+				// 启动定时器
+				this.liveStartTimer = setInterval(() => {
+					const previousCountdown = JSON.stringify(this.liveCountdown);
+					this.liveCountdown = this.handleTime(this.liveItem.startTime, 0);
+
+					// 记录倒计时变化(用于调试)
+					if (previousCountdown !== JSON.stringify(this.liveCountdown)) {
+						console.log('倒计时更新:', this.liveCountdown);
+					}
+
+					if (!this.liveCountdown) {
+						console.log('倒计时结束,触发直播开始');
+						this.$emit('liveStart');
+						clearInterval(this.liveStartTimer);
+						this.liveStartTimer = null;
+					}
+				}, 1000);
+			},
+
+			// 时间处理函数 - 增强错误处理
+			handleTime(time, duration) {
+				if (!time) {
+					console.error('时间参数为空');
+					return false;
+				}
+
+				let timeStamp;
+
+				try {
+					if (typeof time === 'number' && time > 0 && time < 9999999999999) {
+						timeStamp = time;
+					} else if (typeof time === 'string' && time.trim() !== '') {
+						const isoTime = time.replace(' ', 'T');
+						const date = new Date(isoTime);
+						if (!isNaN(date.getTime())) {
+							timeStamp = date.getTime();
+						} else {
+							console.error('无效的日期格式:', time);
+							return false;
+						}
+					} else {
+						console.error('time参数必须是有效的时间戳或日期字符串');
+						return false;
+					}
+
+					const targetTimestamp = timeStamp + duration * 60 * 1000;
+					const currentTimestamp = Date.now();
+					const timeDiffMs = targetTimestamp - currentTimestamp;
+
+					if (timeDiffMs <= 0) {
+						return false;
+					}
+					const hours = Math.floor(timeDiffMs / (1000 * 60 * 60));
+					const minutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));
+					const seconds = Math.floor((timeDiffMs % (1000 * 60)) / 1000);
+
+					const formatNum = (num) => num.toString().padStart(2, '0');
+					return {
+						hours: formatNum(hours),
+						minutes: formatNum(minutes),
+						seconds: formatNum(seconds),
+						rawMs: timeDiffMs // 添加原始毫秒数用于调试
+					};
+				} catch (error) {
+					console.error('时间处理错误:', error);
+					return false;
+				}
+			},
+
+			// 其他方法保持不变...
+			startTimeTimer(item) {
+				if (!item) return;
+
+				this.calculateTimeDiff(item);
+
+				if (item.timeTimer) {
+					clearInterval(item.timeTimer);
+				}
+
+				item.timeTimer = setInterval(() => {
+					this.calculateTimeDiff(item);
+				}, 1000);
+			},
+
+			calculateTimeDiff(item) {
+				if (!item.startTime) return;
+
+				const time = new Date(item.startTime.replace(/-/g, '/'));
+				if (isNaN(time.getTime())) return;
+
+				const now = new Date();
+				let diffMs = Math.max(0, now.getTime() - time.getTime());
+
+				const totalSeconds = Math.floor(diffMs / 1000);
+				const hours = this.padZero(Math.floor(totalSeconds / 3600));
+				const minutes = this.padZero(Math.floor((totalSeconds % 3600) / 60));
+				const seconds = this.padZero(totalSeconds % 60);
+
+				this.diffTotalTime = `${hours}:${minutes}:${seconds}`;
+			},
+
+			padZero(num) {
+				return num < 10 ? `0${num}` : num;
+			},
+
+			// 清理方法
+			cleanup() {
+				if (this.liveStartTimer) {
+					clearInterval(this.liveStartTimer);
+					this.liveStartTimer = null;
+				}
+				if (this.trafficTimer) {
+					clearInterval(this.trafficTimer);
+					this.trafficTimer = null;
+				}
+
+				if (this.trafficInterval) {
+					clearInterval(this.trafficInterval);
+					this.trafficInterval = null;
+				}
+				if (this.lookTimer) {
+					clearInterval(this.lookTimer);
+					this.lookTimer = null;
+				}
+				if (this.liveItem && this.liveItem.timeTimer) {
+					clearInterval(this.liveItem.timeTimer);
+					this.liveItem.timeTimer = null;
+				}
+			}
+		}
+	};
 </script>
 
 <style scoped lang="scss">
-.video-player-container {
-  width: 100%;
-  height: 100%;
-  position: relative;
-}
-
-.videolist {
-  position: relative;
-  height: 100vh;
-  width: 100%;
-
-  .video {
-    height: 100vh;
-    width: 100%;
-    
-    .item {
-      width: 100%;
-      height: 100%;
-    }
-    
-    .time {
-      color: #ffffff;
-      font-size: 20rpx;
-      margin-left: 10rpx;
-    }
-    
-    .end {
-      position: absolute;
-      top: 50%;
-      left: 50%;
-      transform: translate(-50%, -50%);
-      font-size: 36rpx;
-      color: #fff;
-    }
-    
-    .lable {
-      position: absolute;
-      top: 50rpx;
-      right: 16rpx;
-      background-color: rgba(57, 57, 57, 0.6);
-      padding: 4rpx 10rpx;
-      color: #fff;
-      border-radius: 15rpx;
-    }
-  }
-  
-  .video_row {
-    position: absolute;
-    top: 20%;
-    max-height: 450rpx;
-    z-index: 99;
-  }
-}
-
-.trailer-box {
-  position: relative;
-  top: 15%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  color: #ffffff;
-  padding: 20rpx;
-
-  .button {
-    margin-top: 20rpx;
-    background: #6d7bd4;
-    color: #fff;
-    border-radius: 20rpx;
-    padding: 20rpx 30rpx;
-    position: relative;
-    z-index: 99999;
-  }
-
-  .ash {
-    background: #636363;
-  }
-
-  .countdown-item {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-
-    .white {
-      width: 60rpx;
-      height: 60rpx;
-      text-align: center;
-      overflow: hidden;
-      background: #ffffff;
-      border-radius: 8rpx;
-      margin: 30rpx 10rpx 0;
-      font-weight: 600;
-      font-size: 24rpx;
-      color: #000000;
-      line-height: 60rpx;
-    }
-  }
-
-  .item {
-    width: 100%;
-    height: 400rpx;
-  }
-
-  .name {
-    font-size: 34rpx;
-  }
-
-  .img {
-    margin-bottom: 40rpx;
-    width: 240rpx;
-    height: 240rpx;
-  }
-
-  .title {
-    margin-top: 30rpx;
-    font-size: 42rpx;
-    font-weight: 500;
-  }
-}
+	.video-player-container {
+		width: 100%;
+		height: 100%;
+		position: relative;
+	}
+
+	.videolist {
+		position: relative;
+		height: 100vh;
+		width: 100%;
+
+		&.screen {
+			width: 100%;
+			height: 100%;
+		}
+
+		.video {
+			height: 100vh;
+			width: 100%;
+
+			.item {
+				width: 100%;
+				height: 100%;
+			}
+
+			.time {
+				color: #ffffff;
+				font-size: 20rpx;
+				margin-left: 10rpx;
+			}
+
+			.look-time {
+				position: absolute;
+				left: 10vh;
+				bottom: 24rpx;
+				font-size: 20rpx;
+				background-color: rgba(57, 57, 57, 0.6);
+				border-radius: 15rpx;
+				z-index: 999999 !important;
+				padding: 10rpx 16rpx;
+				color: #fff;
+			}
+
+			.end {
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				transform: translate(-50%, -50%);
+				font-size: 36rpx;
+				color: #fff;
+			}
+
+			.lable {
+				position: absolute;
+				top: 50rpx;
+				right: 16rpx;
+				background-color: rgba(57, 57, 57, 0.6);
+				padding: 4rpx 10rpx;
+				color: #fff;
+				border-radius: 15rpx;
+			}
+		}
+
+		.video_row {
+			position: absolute;
+			top: 380rpx;
+			max-height: 450rpx;
+			z-index: 99;
+
+			/* ==== 全屏模式样式 ==== */
+			&.fullscreen-mode {
+				// position: fixed !important;
+				// top: 0 !important;
+				// left: 0 !important;
+				top: 0;
+				width: 0;
+				height: auto;
+				z-index: 99999 !important;
+				background-color: #000 !important;
+				transform: rotate(90deg) !important;
+				transform-origin: center center !important;
+				// transform: rotate(0) ;
+				// transform: rotate(90deg) translateY(-100%) !important;
+				// transform-origin: left top !important;
+
+				.item {
+					position: absolute;
+					bottom: 0;
+					width: 100vh !important;
+					height: 100vw !important;
+					// transform: rotate(-90deg) !important;
+					transform-origin: center center !important;
+					object-fit: contain !important;
+				}
+
+				.custom-controls {
+					transform: rotate(-90deg) !important;
+					transform-origin: center center !important;
+					bottom: auto !important;
+					top: 40rpx !important;
+					right: 40rpx !important;
+				}
+
+				.fullscreen-exit-btn {
+					position: fixed;
+					bottom: 40rpx;
+					left: 82vh;
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					justify-content: center;
+					z-index: 100001;
+					background: rgba(57, 57, 57, 0.6);
+					border-radius: 40rpx;
+					padding: 20rpx 24rpx;
+					transition: all 0.3s ease;
+
+					&:active {
+						transform: scale(0.95);
+						background: rgba(50, 50, 50, 0.6);
+					}
+
+					.exit-fullscreen-icon {
+						width: 40rpx;
+						height: 40rpx;
+						margin-bottom: 10rpx;
+					}
+
+					.exit-text {
+						color: #ffffff;
+						font-size: 22rpx;
+						white-space: nowrap;
+					}
+				}
+			}
+
+			/* 全屏按钮样式优化 */
+			.custom-controls {
+				position: absolute;
+				bottom: 10%;
+				right: 40rpx;
+				z-index: 99999999;
+				background: rgba(0, 0, 0, 0.6);
+				border-radius: 50%;
+				width: 80rpx;
+				height: 80rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				transition: all 0.3s ease;
+
+				.control-icon {
+					width: 46rpx;
+					height: 46rpx;
+				}
+
+				&:active {
+					transform: scale(0.95);
+					background: rgba(0, 0, 0, 0.8);
+				}
+			}
+		}
+	}
+
+	// 重置按钮样式
+	.button-reset {
+		background-color: transparent !important;
+		padding: 0 !important;
+		line-height: 1 !important;
+		margin: 0 !important;
+		width: auto !important;
+		font-weight: 500 !important;
+		border-radius: none !important;
+
+		&::after {
+			border: none !important;
+			padding: 0 !important;
+			margin: 0 !important;
+		}
+	}
+
+	.trailer-box {
+		width: calc(100% - 80rpx);
+		background: #333333;
+		border-radius: 24rpx;
+		position: absolute;
+		top: 320rpx;
+		left: 50%;
+		transform: translateX(-50%);
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		color: #fff;
+		padding: 20rpx;
+		z-index: 99;
+		box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.12);
+		transition: box-shadow 0.3s ease;
+
+		.trailer-video {
+			width: 100%;
+			height: 400rpx;
+		}
+
+		.trailer-placeholder {
+			margin-bottom: 40rpx;
+			width: 240rpx;
+			height: 240rpx;
+		}
+
+		.countdown-container {
+			margin: 20rpx 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+
+			.live-name {
+				font-weight: 600;
+				font-size: 36rpx;
+			}
+
+			.countdown-display {
+				display: flex;
+				align-items: center;
+				margin: 30rpx 0;
+
+				.countdown-label {
+					font-size: 24rpx;
+					color: #999999;
+				}
+
+				.countdown-separator {
+					font-size: 24rpx;
+					color: #999999;
+				}
+
+				.countdown-unit {
+					width: 40rpx;
+					height: 40rpx;
+					background: #4D4D4D;
+					border-radius: 8rpx;
+					text-align: center;
+					overflow: hidden;
+					margin: 0 8rpx;
+					font-weight: 500;
+					font-size: 28rpx;
+					color: #FFFFFF;
+					line-height: 40rpx;
+				}
+			}
+		}
+
+		.trailer-actions {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			.action-button {
+				width: 280rpx;
+				height: 72rpx;
+				display: flex;align-items: center;
+				justify-content: center;
+				border-radius: 36rpx;
+				color: #fff;
+
+				&.reserve-button {
+					background: linear-gradient(136deg, #38D97D 0%, #02B176 100%);
+				}
+
+				&:not(.reserve-button) {
+					background: #F4A007;
+				}
+
+				.button-icon {
+					width: 32rpx;
+					height: 32rpx;
+				}
+			}
+		}
+
+		.no-live-title {
+			margin-top: 30rpx;
+			font-size: 42rpx;
+			font-weight: 500;
+		}
+	}
 </style>

+ 0 - 52
pages_course/components/lotteryPopup.vue

@@ -148,56 +148,4 @@ export default {
   color: #f4410b;
   text-align: center;
 }
-
-/* 工具类样式 */
-/* .column {
-  display: flex;
-  flex-direction: column;
-}
-
-.align-center {
-  align-items: center;
-}
-
-.x-f {
-  display: flex;
-  align-items: center;
-}
-
-.colorf {
-  color: #ffffff;
-}
-
-.fs24 {
-  font-size: 24rpx;
-}
-
-.fs28 {
-  font-size: 28rpx;
-}
-
-.mt30 {
-  margin-top: 30rpx;
-}
-
-.mb30 {
-  margin-bottom: 30rpx;
-}
-
-.w446 {
-  width: 446rpx;
-}
-
-.h80 {
-  height: 80rpx;
-}
-
-.mr20 {
-  margin-right: 20rpx;
-}
-
-.x-end {
-  display: flex;
-  justify-content: flex-end;
-} */
 </style>

+ 4 - 4
pages_course/components/shopPopup.vue

@@ -51,7 +51,7 @@
           <view 
             v-for="(item, index) in products" 
             :key="index" 
-            class="list-item"
+            class="list-item"  @click="handleGoShop(item)"
           >
             <view class="goods-img">
               <image class="img" :src="item.imgUrl" mode="widthFix" />
@@ -72,14 +72,14 @@
                   <view class="collect-btn">
                     <image 
                       v-if="item.isFavorite" 
-                      @click="handleCollect(item)" 
+                      @click.stop="handleCollect(item)" 
                       class="w36 h36" 
                       style="vertical-align: middle" 
                       src="/static/images/collect_select.png" 
                     />
                     <image 
                       v-else 
-                      @click="handleCollect(item)" 
+                      @click.stop="handleCollect(item)" 
                       class="w36 h36"
                       style="vertical-align: middle" 
                       src="/static/images/collect.png" 
@@ -88,7 +88,7 @@
                   <view 
                     v-if="item.status == 1" 
                     class="shop-btn"
-                    @click="handleGoShop(item)"
+                   
                   >
                     去购买
                   </view>

+ 0 - 160
pages_course/courseCover.vue

@@ -1,160 +0,0 @@
-<template>
-	<view class="w100" style="width: 100%;">
-		<view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
-			<u-icon name="arrow-left" size="28" @click="tosales" v-if="appToken"></u-icon>
-			<view class="header-title" :style="{width:menuButtonLeft + 'px',height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">{{courseInfo.title}}</view>
-		</view>
-		<view>
-			<image  class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
-			<view class="title-content" id="title-content">
-				<!-- 答题时展示小节课程名,其他展示课程名 -->
-				<!-- 小节课程名 -->
-				<view class="subtitlebox " >
-					{{courseInfo.title}}
-				</view>
-				<!-- 课程名字 -->
-				<view class="base-color-6 fs24">
-					{{courseInfo.courseName}}
-				</view>
-			</view>
-		</view>
-		<view class="btns">
-			<view class="author-btn" @click="comecourse">进入课程</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		getH5CourseByVideoId,
-	} from "@/api/courseLook.js"
-	export default{
-		data(){
-			return{
-				videoId:3450,
-				courseInfo:'',
-				projectCode:'',
-				sendType:'',
-				courselist:{},
-				statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
-			}
-		},
-		onLoad(option) {
-			console.log(option)
-			const keys = decodeURIComponent(Object.keys(option)[0]);
-			this.courselist=JSON.parse(keys.split('course=')[1])
-			this.videoId=this.courselist.videoId
-			this.projectCode=this.courselist.projectCode
-			console.log(keys)
-			console.log(this.courselist)
-			// if(this.videoId){
-			// 	this.getH5CourseByVideo()
-			// }
-		},
-		onShow() {
-			this.getHeight()
-			this.utils.getDomain({projectCode:this.projectCode}).then(res=>{
-				if(res.code == 200) {
-					if (this.videoId) {
-						this.sendType=uni.getStorageSync('sendType')
-						this.getH5CourseByVideo()
-						// this.utils.getConfigKey()
-					}
-				}
-			})
-		},
-		methods:{
-			getHeight() {
-				this.$nextTick(() => {
-					const query = uni.createSelectorQuery().in(this);
-					query
-						.select("#title-content")
-						.boundingClientRect((data) => {
-							this.height =
-								`calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 120rpx )`
-						})
-						.exec();
-				})
-			},
-			comecourse(){
-				if(this.sendType==1){
-					uni.navigateTo({
-						url:'/pages_course/videovip?course='+JSON.stringify(this.courselist)
-					})
-				}else{
-					
-				}
-				
-			},
-			getH5CourseByVideo() {
-				const data={
-					videoId:this.videoId
-				}
-				getH5CourseByVideoId(data).then(res=>{
-					if (res.code == 200) {
-						this.courseInfo = res.data
-						uni.setNavigationBarTitle({
-							title: this.courseInfo && this.courseInfo.title ? this.courseInfo.title : ''
-						});
-					}else{
-						
-					}
-				})
-			},
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.header-nav {
-		height: 88rpx;
-		// @include u-flex(row, center, flex-start);
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		overflow: hidden;
-		background-color: #fff;
-		box-sizing: border-box;
-		.header-title {
-			text-align: center;
-			overflow: hidden;
-			white-space: nowrap;
-			text-overflow: ellipsis;
-			padding: 0 10rpx 0rpx;
-			font-family: PingFang SC,PingFang SC;
-			font-weight: 500;
-			font-size: 15px;
-			color: #000;
-			box-sizing: border-box;
-		}
-	}
-	.video-poster{
-		width: 100%;
-	}
-	.title-content{
-		padding: 20rpx;
-		.subtitlebox{
-			font-size: 32rpx;
-			font-weight: bold;
-		}
-	}
-	.btns{
-		position: fixed;
-		padding: 40rpx 20rpx;
-		bottom: 0;
-		width: calc(100% - 40rpx);
-	}
-	.author-btn{
-			z-index:100;
-			width: 100%;
-			height: 80rpx;
-			background: #ff5c03;
-			border-radius: 40rpx;
-			font-size: 36rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			text-align: center;
-			line-height: 80rpx;
-			color: rgba(255, 255, 255, 1);
-		}
-</style>

+ 0 - 489
pages_course/feedback.vue

@@ -1,489 +0,0 @@
-<template>
-	<view>
-		<view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
-			<view class="arrow-left" :style="{top: statusBarHeight + 'px'}" @click="goBack">返回</view>
-			<view class="header-title" :style="{height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">投诉反馈</view>
-		</view>
-		<view class="container" :style="{paddingTop: `calc(88rpx + ${statusBarHeight}px)`}">
-			<view class="formbox" v-if="isLastChild==1">
-				<view class="formbox-title">{{ text }}</view>
-				<view class="form">
-					<u-form labelPosition="top" labelWidth='auto' :model="formdata" :rules="rules" ref="uForm" errorType="toast">
-						<u-form-item label=" " prop="complaintContent">
-							<u--textarea v-model="formdata.complaintContent" border="none" :clearable="true" placeholder="请填写反馈内容" count maxlength='200'></u--textarea>
-						</u-form-item>
-						<view class="box">
-							<u-form-item label="图片(最多9张)">
-								<view class="imgitem">
-									<u-upload
-										:fileList="fileList1"
-										@afterRead="afterRead"
-										@delete="deletePic"
-										name="1"
-										:maxCount="9"
-									></u-upload>
-								</view>
-							</u-form-item>
-						</view>
-					</u-form>
-				</view>
-				<view class="footer-btn">
-					<button class="submit-btn" @click="submit">提交</button>
-					<!-- <button class="submit-btn back-btn" @click="goBack">返回</button> -->
-				</view>
-			</view>
-			<view class="container" v-else>
-				<view class="list-item title">请选择反馈类型</view>
-				<view class="list-item" v-for="(item, index) in feedbackItems" :key="index"
-					@click="handleClick(item,index)">
-					<view>{{ item.complaintTypeName }}</view>
-					<uni-icons type="right" size="20" color="rgba(0,0,0,.3)" v-if="isLastChild==0"></uni-icons>
-				</view>
-				<view class="list-item" v-if="pageIndex!=0&&isLastChild==0" @click="goBack">
-					返回上一层
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import { mapGetters } from 'vuex';
-	import{ getTypeTree, complaintRecord,loginByMp } from "@/api/course.js"
-	export default {
-		data() {
-			return {
-				statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
-				menuButtonH: 45,
-				pageIndex: 0,
-				list: [],
-				feedbackItems: [],
-				userId: '',
-				courseId: '',
-				videoId: '',
-				formdata: {
-					complaintContent: ""
-				},
-				rules: {
-					complaintContent:[{
-						required: true,
-						message: '投诉反馈内容不能为空',
-						trigger: ["change", "blur"]
-					}]
-				},
-				text: '',
-				templateId: 0,
-				user: {},
-				isLastChild: 0,
-				isLogin: false,
-				fileList1: [],
-				projectCode:'',
-				code:''
-			};
-		},
-		computed: {
-			...mapGetters(['coureLogin']),
-		},
-		watch: {
-		    coureLogin: {
-		      immediate: true,          // 页面一进入就检查一次
-		      handler(val) {
-		        if (val == 2) {
-					console.log("AppToken失效,请重新登录")
-					this.isLogin = false
-					this.goLogin()
-		        }
-		      }
-		    }
-		},
-		onLoad(option) {
-			this.userId = option.userId || ''
-			this.courseId = option.courseId || ''
-			this.videoId = option.videoId || ''
-			this.projectCode = option.projectCode || ''
-			uni.$on('usercode',(data)=>{
-				if(data) {
-					this.code=data.code
-					this.goLogin(data)
-				}
-			})
-			this.utils.getDomain({projectCode:this.projectCode}).then(res=>{
-				if(res.code == 200) {
-					uni.setStorageSync('addressUrl',res.addressUrl)
-					this.utils.isLoginCourseAuto().then(
-						res => {
-							if(res){
-								this.isLogin = true
-								this.getMenuButton()
-								this.getList()
-							} else{
-								this.isLogin = false
-								this.goLogin()
-							}
-						},
-						rej => {}
-					);
-				}
-			})
-		},
-		onUnload() {
-			uni.$off('usercode')
-		},
-		methods: {
-			getMenuButton(){
-				const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
-				this.menuButtonH = menuButtonInfo.height
-			},
-			goBack() {
-				// 返回上一层逻辑
-				if (this.pageIndex == 0) {
-					uni.navigateBack();
-				} else {
-					this.pageIndex--;
-					this.formdata = {
-						complaintContent: ""
-					}
-					if (this.isLastChild == 1) {
-						this.isLastChild = 0
-					} else {
-						if (this.pageIndex == 0) {
-							this.feedbackItems = this.list
-							this.templateId = 0
-						} else {
-							const list = this.findGrandparentOrAllData(this.list, this.templateId)
-							this.feedbackItems = list.childrenType
-							this.templateId = list.complaintTypeId
-						}
-					}
-				
-				}
-			},
-			findGrandparentOrAllData(data, targetId) {
-				// 递归函数,用于查找目标节点的父级节点
-				function findParent(node, targetId) {
-					if (!node || !node.childrenType) return null;
-			
-					for (let child of node.childrenType) {
-						if (child.complaintTypeId === targetId) {
-							return node; // 找到目标节点的父级节点
-						}
-			
-						const result = findParent(child, targetId); // 递归查找子节点
-						if (result) return result;
-					}
-			
-					return null;
-				}
-			
-				// 遍历顶层节点,查找目标节点的父级和祖父级节点
-				for (let root of data) {
-					if (root.complaintTypeId === targetId) {
-						return data; // 如果目标节点是顶层节点,返回所有数据
-					}
-			
-					const parent = findParent(root, targetId); // 查找目标节点的父级节点
-					if (parent) {
-						const grandparent = findParent(root, parent.complaintTypeId); // 查找父级节点的父级节点
-						return grandparent || data; // 如果找到祖父节点返回祖父节点,否则返回所有数据
-					}
-				}
-			
-				return data; // 如果没有找到目标节点,返回所有数据
-			},
-			handleClick(item,index) {
-				if (this.isLastChild == 1) return
-				if (this.pageIndex >= 0) {
-					this.pageIndex++
-					let children = this.feedbackItems[index].childrenType || [];
-					this.templateId = this.feedbackItems[index].complaintTypeId
-					this.formdata = {
-						complaintContent: ""
-					}
-					this.text = this.feedbackItems[index].complaintTypeName
-					if (children.length > 0) {
-						this.isLastChild = 0
-						this.feedbackItems = children
-						this.templateId = this.feedbackItems[0].complaintTypeId
-					} else {
-						this.isLastChild = 1
-						this.formdata = {
-							complaintContent: ""
-						}
-						setTimeout(() => {
-							this.$refs.uForm.setRules(this.rules)
-						}, 200)
-					}
-				}
-			},
-			getList(){
-				getTypeTree().then(res=>{
-					if(res.code == 200) {
-						this.list = res.data
-						this.pageIndex = 0
-						this.feedbackItems = this.list
-					}
-				})
-			},
-			submit() {
-				if(this.fileList1.some(item=>item.status == 'uploading')) {
-					uni.showToast({
-						title: '等待图片上传中',
-						icon: 'none'
-					})
-					return
-				}
-				var images=[];
-				this.fileList1.forEach(function(element) {
-					images.push(element.url)
-				});
-				this.$refs.uForm.validate().then(res => {
-					if (res) {
-						const param = {
-							userId: this.userId,
-							complaintTypeId: this.templateId,
-							complaintContent: this.formdata.complaintContent,
-							courseId: this.courseId,
-							videoId: this.videoId,
-							complaintUrl: images.toString()
-						}
-						complaintRecord(param).then(res=>{
-							uni.showModal({
-								title: '',
-								content: '我们已收到您的反馈,谢谢',
-								showCancel: false,
-								success: function (res) {
-									if (res.confirm) {
-										uni.navigateBack()
-									} else if (res.cancel) {
-										uni.navigateBack()
-									}
-								}
-							});
-						})
-					}
-				})
-			},
-			deletePic(event) {
-				this[`fileList${event.name}`].splice(event.index, 1)
-			},
-			async afterRead(event) {
-				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
-				let lists = [].concat(event.file)
-				let fileListLen = this[`fileList${event.name}`].length
-				lists.map((item) => {
-					this[`fileList${event.name}`].push({
-						...item,
-						status: 'uploading',
-						message: '上传中'
-					})
-				})
-				for (let i = 0; i < lists.length; i++) {
-					const result = await this.uploadFilePromise(lists[i].url)
-					let item = this[`fileList${event.name}`][fileListLen]
-					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
-						status: 'success',
-						message: '',
-						url: result
-					}))
-					fileListLen++
-				}
-			},
-			uploadFilePromise(url) {
-				const projectCode = uni.getStorageSync('projectCode')
-				return new Promise((resolve, reject) => {
-					let a = uni.uploadFile({
-						url: uni.getStorageSync('addressUrl_'+projectCode)+ '/app/common/uploadOSS', // 仅为示例,非真实的接口地址
-						filePath: url,
-						name: 'file',
-						success: (res) => {
-							setTimeout(() => {
-								console.log(JSON.parse(res.data).url)
-								resolve(JSON.parse(res.data).url)
-							}, 1000)
-						}
-					});
-				})
-			},
-			goLogin(data) {
-				if(!this.projectCode){
-					uni.showToast({
-						title: '链接有误',
-						icon: 'none'
-					});
-					return
-				} 
-				this.loginFsUserWx(data)
-				return
-				this.utils.getProvider().then(provider=>{
-					console.log('当前的环境商',provider)
-					if (!provider) {
-					  reject()
-					}
-					uni.login({
-						provider: provider,
-						success: async loginRes => {
-							console.log(loginRes)
-							uni.getUserInfo({
-							   provider: provider,
-							   success: (infoRes)=> {
-								    uni.showToast({
-										title: '处理中...',
-										icon: 'loading'
-								    });
-									loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId:getApp().globalData.appId}).then(res=>{
-										 uni.hideLoading();
-										 if (res.code == 200) {
-											 this.$store.commit('setCoureLogin', 1);
-											uni.setStorageSync(this.utils.TOKEN_KEYAuto, res.token);
-											uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
-											this.userId = res.user.userId || ''
-											this.isLogin = true
-											this.getMenuButton()
-											this.getList()
-										 } else {
-											uni.showToast({
-												title: res.msg,
-												icon: 'none'
-											});
-										 }
-									 }).catch(err=>{
-										uni.hideLoading();
-										uni.showToast({
-											icon:'none',
-											title: "登录失败,请重新登录",
-										});
-									});
-							   }
-							});
-						}
-					})
-				}).catch(err => {})
-			},
-			// H5授权绑定关系
-			async loginFsUserWx(data){
-				if(data){
-					let token = uni.getStorageSync('TOKEN_WEXIN');
-					let user = uni.getStorageSync('userInfo')
-					
-					uni.setStorageSync(this.utils.TOKEN_KEYAuto, token);
-					uni.setStorageSync('auto_userInfo', JSON.stringify(user));
-					this.userId = user.userId || ''
-					this.isLogin = true
-					this.getMenuButton()
-					this.getList()
-				}else{
-					uni.setStorageSync('H5course',{
-						companyId: this.urlOption.companyId,
-						companyUserId:this.urlOption.companyUserId,
-						type: 1, //1自动,其他手动
-					})
-					uni.showLoading({ title: '加载中' });
-										
-					try {
-					  await this.utils.getDomain({ projectCode: this.projectCode}); // code 换成你的业务标识
-					  await this.utils.getConfigKey();
-					  uni.navigateTo({
-					  	url:'/pages_course/webview?H5course='+uni.getStorageSync('H5course')
-					  })
-					} catch (err) {
-					  console.error('初始化失败', err);
-					  uni.showToast({ title: '请求失败', icon: 'none' });
-					} finally {
-					  uni.hideLoading();
-					}
-				}
-			}
-		}
-	};
-</script>
-
-<style scoped lang="scss">
-	.container {
-		background-color: #fff;
-	}
-	.formbox-title {
-		padding-bottom: 30rpx;
-		border-bottom: 1px solid #f4f4f4;
-	}
-	.formbox {
-		border-top: 1px solid #f4f4f4;
-		padding: 30rpx;
-	}
-	.box {
-		padding-bottom: 24rpx;
-		border-top: 1px solid #f4f4f4;
-		.imgitem {
-			padding-top: 20rpx;
-		}
-	}
-	.footer-btn {
-		margin-top: 50rpx;
-	}
-	.submit-btn {
-		width: 50%;
-		height: 88rpx;
-		line-height: 88rpx;
-		text-align: center;
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		color: #FFFFFF;
-		background: rgb(0,178,106);
-		border-radius: 16rpx;
-		border: 1rpx solid ;
-		margin-bottom: 30rpx;
-		&::after {
-			border: none;
-		}
-	}
-	.back-btn {
-		color: #bbb;
-		background: transparent;
-		border-radius: 16rpx;
-		border: 1rpx solid #999;
-	}
-	.header-nav {
-		height: 88rpx;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		overflow: hidden;
-		background-color: #fff;
-		box-sizing: border-box;
-		width: 100%;
-		position: fixed;
-		top: 0;
-		left: 0;
-		.header-title {
-			flex: 1;
-			text-align: center;
-			overflow: hidden;
-			white-space: nowrap;
-			text-overflow: ellipsis;
-			font-family: PingFang SC,PingFang SC;
-			font-weight: 500;
-			font-size: 15px;
-			color: #000;
-			box-sizing: border-box;
-		}
-	}
-	.arrow-left {
-		position: absolute;
-		left: 24rpx;
-		height: 88rpx;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		overflow: hidden;
-	}
-	.list-item {
-		background-color: #fff;
-		padding: 24rpx;
-		border-bottom: 1rpx solid #f4f4f4;
-		font-size: 15px;
-		color: #333;
-	}
-
-	.title {
-		background-color: #f4f4f4;
-	}
-</style>

+ 4500 - 0
pages_course/living-new.vue

@@ -0,0 +1,4500 @@
+<template>
+	<view class="swiper-wrapper">
+		<image src="https://fs-1323137866.cos.ap-chongqing.myqcloud.com/live_bg.jpg" class="live-bg"></image>
+		<view class="container">
+			<view class="content">
+				<view style="position: fixed; top: 0; z-index: 5" class="content-top">
+					<view class="x-f">
+						<image v-if="!scene" @click="goBack" class="w60 h64  mr6" src="/static/images/return3.png" />
+						<view class="align-center"
+							style="padding: 6rpx 8rpx; height: 64rpx; background: rgba(0,0,0,0.5); border-radius: 32rpx">
+							<u-avatar :src="liveItem.liveImgUrl || '/static/images/avatar.png'" :size="32"></u-avatar>
+							<view class="colorf ml10 mr6">
+								<view>{{ liveItem.liveName ? truncateString(liveItem.liveName, 8) : '未命名' }}</view>
+							</view>
+						</view>
+					</view>
+					<view class="end">
+						<view v-if="Array.isArray(filteredViewers)" class="align-center" @click="toggleViewerList"
+							style="margin-top: 120rpx">
+							<view v-for="(item, viewerIndex) in filteredViewers" :key="viewerIndex">
+								<image v-if="item.avatar" class="w52 h52 mr4" style="border-radius: 26rpx"
+									:src="item.avatar" />
+								<view v-else class="w52 h52 mr4"
+									:style="{ backgroundColor: getUserRandomColor(item.userId), borderRadius: '50%' }">
+									<text class="text-white text-xs">{{ getNicknameInitial(item.nickName) }}</text>
+								</view>
+							</view>
+							<view class="sum">{{formattedWatchCount || 0 }}</view>
+						</view>
+						<view class="complaint-box" @click="navgetTo('/pages_shopping/live/complaintList') ">
+							<image class="image w32 h32 mr10" src="/static/images/complaint.png" mode="widthFix" />
+							<view class="fs26">投诉</view>
+						</view>
+					</view>
+				</view>
+				<!-- 右边的side -->
+				<view v-show="!isFocus" class="side-group" :class="{ 
+								'top2': (!isShowRed && !(isShowLottery && countdown)),
+								'top3': (isShowRed || (isShowLottery && countdown))
+							}">
+					<view class="side-item" @click="onRed()" v-if="isShowRed">
+						<button class="button button-reset" style="height: 70rpx;">
+							<image class="image" style="width: 72rpx;" src="/static/images/redbag.png"
+								mode="widthFix" />
+						</button>
+						<view class="fs30">领红包</view>
+					</view>
+					<view class="side-item" @click="onLottery()" v-if="isShowLottery && countdown">
+						<button class="button button-reset">
+							<image class="image" src="/static/images/lottery.png" mode="widthFix" />
+						</button>
+						<view class=" fs30">抽奖</view>
+					</view>
+					<view class="side-item" @click="onLike">
+						<LikeButton :initialCount="100" :heartsPerClick="5" @like="onLike" />
+						<view class="txt" style="font-size: 30rpx;">{{ formattedLikeCount || 0 }}</view>
+					</view>
+					<view class="side-item">
+						<button open-type="share" class="button button-reset">
+							<image class="image" src="/static/images/weixin1.png" mode="widthFix" />
+						</button>
+						<view class="txt" style="font-size: 30rpx;">分享</view>
+					</view>
+				</view>
+				<!-- 直播 -->
+				<LiveVideo ref="liveVideo" :isAgreement="isAgreement" :liveItem="liveItem" :liveId="liveId"
+					:userData="userData" @liveStart="handleLiveStart" @videoError="handleVideoError"
+					@liveStateChange="handleLiveStateChange" @agreementClick="handleAgreement" />
+				<!-- 底部聊天区域 -->
+				<view class="chat-area-container" :class="{ 'chat-area-focused': isFocus }"
+					:style="{ '--keyboard-height': keyboardHeight + 'rpx' }">
+					<view class="mt20 chat-content" :class="{ 'chat-content-focused': isFocus }">
+						<view v-if="showPurchasePrompt && orderUser && orderUser.count && liveItem.status == 2"
+							class="shop-prompt f30  mb20">
+							<image class="w32 h32 mr8" src="/static/images/shopping.png" />
+							<text>{{ orderUser.count || 0 }}人正在去购买</text>
+						</view>
+						<!-- v-if="showWelcomeMessage" -->
+						<view v-if="showWelcomeMessage" class="welcome-message" style="max-width: 100%">
+							<view class="list justify-start" v-show="inAndOut.cmd == 'entry' || inAndOut.cmd == 'out'">
+								<view class="talk-list justify-start">
+									<view class="fs30">
+										<text style="color: #ff89d6">{{ inAndOut.nickName || '未命名' }}</text>
+										<text class="colorf">{{ inAndOut.msg }}直播间</text>
+									</view>
+								</view>
+							</view>
+						</view>
+						<view class="notice-message" v-if="!isFocus&&isShowNotice">
+							公告消息: {{notice.msg}}
+						</view>
+						<scroll-view id="msgScroll" v-if="Array.isArray(talklist)" enable-flex scroll-y="true"
+							:enhanced="true" :bounces="false" :show-scrollbar="false" :fast-deceleration="false"
+							:enable-back-to-top="false" class="scrolly flex-1 column"
+							style="width: calc(100% - 20rpx);  -webkit-overflow-scrolling: touch;"
+							:scroll-top="scrollTop" :scroll-into-view="scrollIntoView" @scroll="onScroll"
+							ref="scrollView" scroll-with-animation="true" :scroll-animation-duration="300">
+
+							<view class="list justify-start" v-for="(item, talkIndex) in talklist || []"
+								:key="item.uniqueId || talkIndex" :id="`list_${item.uniqueId || talkIndex}`"
+								v-show="item.cmd != 'red' && item.cmd != 'out' && item.cmd != 'entry'">
+								<view class="talk-list justify-start">
+									<view class="fs30 talk-item" style="max-width: 100%;">
+										<text class="nickname"
+											style="color: #ffda73;">{{ item.nickName || '未命名' }}:</text><text
+											class="message colorf">{{ item.msg }}</text>
+									</view>
+								</view>
+							</view>
+						</scroll-view>
+						<!-- 一键弹幕 -->
+						<u-scroll-list :indicator="false" v-if="!isFocus">
+							<view class="barrage" v-for="(item, index) in barrageList " :key="index"
+								@click="onBarrage(item)">
+								{{item}}
+							</view>
+						</u-scroll-list>
+					</view>
+
+					<!-- 聊天输入组件 -->
+					<ChatInput ref="chatInput" :value="value" :focused="isFocus" :placeholderText="placeholderText"
+						@focus="onInputFocus" @blur="onInputBlur" @send="onSendMessage" @open-cart="openCart"
+						@show-gift="showGift" @input="onInputChange" />
+				</view>
+			</view>
+
+			<!-- 商品卡片 -->
+			<LiveGoods :isShow="isShowGoods" :goodsData="goodsCard" @goShop="handleGoShop" @close="handleCloseGoods" />
+			<!-- 抽奖弹窗 -->
+			<LotteryPopup :show="isShowLotteryPop && countdown" :countdown="countdown" :products="lotteryProducts"
+				@close="handleLotteryClose" @claim="handleLotteryClaim" />
+
+			<u-popup :show="!!integral.status" round="20rpx" mode="center" bgColor="#ffffff" zIndex="10076">
+				<view class="integral-box">
+					<view class="top">
+						<view class="title">观看视频领芳华币</view>
+						<image class="photo" src="/static/images/integral_bg.png" mode="widthFix" />
+					</view>
+					<view class="item">
+						<view class="title">{{ integral.msg }}</view>
+						<view class="button" @click="integral.status = false">确认</view>
+					</view>
+				</view>
+			</u-popup>
+
+			<u-popup :show="isShowRedCard" round="20rpx" mode="center" bgColor="transparent" zIndex="10076">
+				<view class="red-card">
+					<image class="img" src="/static/images/red_card.png" />
+					<view class="red-content">
+						<view class="title">{{ redCard.msg }}</view>
+						<view class="txt">直播惊喜芳华币</view>
+						<view class="button" @click="isShowRedCard = false">确认</view>
+					</view>
+				</view>
+			</u-popup>
+
+			<!-- 中奖和未中奖 -->
+			<u-popup :show="isShowPrize && havePrize" round="20rpx" mode="center" bgColor="#fff" zIndex="10076">
+				<view class="prize-card" v-if="isCurrentUserWon">
+					<image class="nav-img" src="/static/images/red_head.png" mode="widthFix" />
+					<view class="title">恭喜您 中奖啦!</view>
+					<view class="prize-content" v-for="(item, index) in prizeInfo || []" :key="index">
+						<view class="item">{{ item.userName }}</view>
+						<view class="item">{{ item.userId }}</view>
+						<view class="txt item">{{ item.prizeLevel }}等奖</view>
+					</view>
+					<view class="tip">请填写收货地址,主播将会将奖品发给您</view>
+					<view class="button"
+						@click="navgetTo('/pages_shopping/live/confirmCreateOrder?type=win&productId='+getCurrentUserPrizeProductId+'&liveId='+liveId+'&recordId='+getCurrentUserPrizeRecordId),confirm()">
+						填写地址</view>
+				</view>
+				<view class="no-prize-card" v-else>
+					<image class="img" src="/static/images/no-prize.png" mode="widthFix" />
+					<view class="tip">很遗憾 您未中奖</view>
+					<view class="button" @click="confirm">确认</view>
+				</view>
+			</u-popup>
+
+			<!-- 中奖记录 -->
+			<WinningPopup :show="winning" :prizeList="prizeAll" :liveId="liveId" @close="closeWin"
+				@fill-address="handleFillAddress" />
+
+			<!-- 观众列表弹窗 -->
+			<Viewer :show="showViewerList" :viewers="liveViewers" :loading="viewLoading" :scrollHeight="scrollHeight"
+				@close="closeViewerList" @open="openViewerList" @scrolltolower="handleScrollToLower" />
+
+			<!-- 更多弹窗 -->
+			<u-popup :show="isMore" @close="closeMore" round="20rpx" bgColor="#f3f5f9" zIndex="10076">
+				<view class="more-block">
+					<view class="item" @click="navgetTo('/pages_shopping/live/integral'), (isMore = false)">
+						<image class="w48 h48" src="/static/images/order.png" />
+						<view style="text-align: center">芳华币</view>
+					</view>
+					<view class="item"
+						@click="navgetTo('/pages_shopping/live/storeOrderRefundList?liveId=' + liveId), (isMore = false)">
+						<image class="w48 h48" src="/static/images/after_sales.png" />
+						<view style="text-align: center">售后订单</view>
+					</view>
+					<view class="item" @click="goMiniProgram(), (isMore = false)">
+						<image class="w48 h48" src="/static/images/points.png" />
+						<view style="text-align: center">兑换好礼</view>
+					</view>
+					<view class="item" @click="getMyLottery(), (isMore = false), (winning = true)">
+						<image class="w48 h48" src="/static/images/health_sel.png" />
+						<view style="text-align: center">中奖记录</view>
+					</view>
+				</view>
+			</u-popup>
+
+			
+
+			<!-- 商品弹窗组件 -->
+			<ShopPopup :show="shopping" :searchKeyword="inputInfo" :products="products" :loading="loadingProducts"
+				:boxHeight="boxHeight" @close="closeShop" @search="handleSearchInput"
+				@navigate-to-order="handleNavigateToOrder" @show-more="handleShowMore" @collect="onGoodsCollect"
+				@go-shop="handleGoShopFromCart" />
+
+			<!-- 优惠券弹窗 -->
+			<view class="coupon-pop" v-if="isShowCoupon">
+				<view class="coupon-block">
+					<image class="bg" src="/static/images/coupon_bg.png" />
+					<image class="nav" src="/static/images/coupon_top.png" />
+					<image @click="isShowCoupon = false" class="w40 h40 close" style="z-index: 99"
+						src="/static/images/close1.png" />
+					<view class="item">
+						<view class="title">{{ couponInfo.couponName }}</view>
+						<view class="price">
+							¥
+							<text class="bold">{{ couponInfo.couponPrice }}</text>
+						</view>
+						<view class="txt">满{{ couponInfo.useMinPrice }}元可用</view>
+						<view class="txt" style="margin-top: 26rpx">指定商品可用</view>
+						<view class="txt">自领取起{{ couponInfo.couponTime }}天内有效</view>
+						<view class="button" @click="onCoupon()">立即领券</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	import ChatInput from '@/pages_course/components/chatInput.vue';
+	import Viewer from '@/pages_course/components/viewer.vue';
+	import LiveVideo from '@/pages_course/components/liveVideo.vue';
+	import ShopPopup from '@/pages_course/components/shopPopup.vue';
+	import LotteryPopup from '@/pages_course/components/lotteryPopup.vue';
+	import WinningPopup from '@/pages_course/components/winningPopup.vue';
+	import LiveGoods from '@/pages_course/components/liveGoods.vue';
+	import LikeButton from '@/pages_course/components/like.vue';
+	import CryptoJS from 'crypto-js';
+	import {
+		myLottery, // 我的中奖明细
+		coupon, //领取优惠券
+		liveLottery, // 抽奖查询
+		claim, //抽奖
+		liveRed, // 点击领红包
+		liveDataLike, // 点赞
+		collectStore, // 店铺收藏/取消收藏
+		collectGoods, // 商品收藏/取消收藏
+		watchUserList, //获取直播间用户(展示在线用户)
+		liveMsg, //获取最近聊天记录
+		// 小黄车
+		liveStore, //店铺展示,
+		liveOrderUser, //正在购买
+		getLiveInfo, //获取直播间信息接口
+		getLiveViewData, //直播间点赞、关注、在线人数数据
+		currentActivities, //红包 卡片 抽奖
+		getlive,
+		subNotifyLive,
+		internetTraffic, // 流量(缓冲百分比),
+		liveInternetTraffic // 直播流量(缓冲百分比),
+	} from '@/api/living.js';
+	import {
+		getUserInfo
+	} from '@/api/user';
+	import {
+		generateRandomString
+	} from '@/utils/common.js';
+	import dayjs from 'dayjs';
+	import {
+		nextTick
+	} from 'vue';
+
+	var isSocketOpen = false;
+	var socket = null;
+
+	export default {
+		components: {
+			LikeButton,
+			LiveGoods,
+			LotteryPopup,
+			WinningPopup,
+			ShopPopup,
+			LiveVideo,
+			Viewer,
+			ChatInput
+		},
+		data() {
+			return {
+				notice: [],
+				isShowNotice: false,
+				// 观众列表相关状态
+				showViewerList: false,
+				// giftList: [{
+				// 	img: '/static/images/gift1.png',
+				// 	name: '人气票',
+				// 	number: 1
+				// }, {
+				// 	img: '/static/images/gift2.png',
+				// 	name: '小心心',
+				// 	number: 1
+				// }, {
+				// 	img: '/static/images/gift3.png',
+				// 	name: '棒棒糖',
+				// 	number: 9
+				// }, {
+				// 	img: '/static/images/gift4.png',
+				// 	name: '玫瑰',
+				// 	number: 50
+				// }, {
+				// 	img: '/static/images/gift5.png',
+				// 	name: '鲜花',
+				// 	number: 88
+				// }, {
+				// 	img: '/static/images/gift6.png',
+				// 	name: '水晶球',
+				// 	number: 99
+				// }, {
+				// 	img: '/static/images/gift7.png',
+				// 	name: '啤酒',
+				// 	number: 128
+				// }, {
+				// 	img: '/static/images/gift8.png',
+				// 	name: '浪漫热气球',
+				// 	number: 1000
+				// }],
+				activeIndex: -1, // -1表示没有选中
+				barrageList: ['支持你!', '谢谢你!', '平台真好!', '666', '欢迎回家!'], //一键弹幕列表
+				uuId: '',
+				totalTraffic: 0, // 总流量(字节)
+				bitrate: 800, // 录播默认码率 0.16Mbps
+				bitrateLive: 1600, // 直播默认码率 0.16Mbps
+
+				//定时器
+				trafficTimer: null,
+				pingTimeoutTimer: null, // 心跳超时定时器
+				heartBeatTimer: null, // 心跳定时器
+				liveViewDataTimer: null,
+				reconnectTimer: null, // 重连定时器
+				scrollTimer: null, // 滚动防抖定时器
+				lastScrollTime: 0, // 上次滚动时间
+				scrollDebounceDelay: 200, // 滚动防抖延迟(毫秒)
+				searchTimer: null, //搜索
+				purchasePromptTimer: null, //购买提示
+				welcomeTimer: null, //进入离开直播间定时器
+				redTimer: null,
+				liveStartTimer: null,
+				lotteryTimer: null,
+				memoryMonitorTimer: null, // 内存监控定时器
+				networkStatusTimer: null, // 网络状态检测定时器
+				networkRetryTimer: null, // 网络重试定时器
+				lastHeartBeatTime: 0, // 上次心跳时间
+
+				// 性能监控
+				connectionStartTime: 0, // 连接开始时间
+				connectionLatency: 0, // 连接延迟
+				messageCount: 0, // 消息计数
+				errorCount: 0, // 错误计数
+				lastPerformanceCheck: 0, // 上次性能检查时间
+
+				stayTime: 0,
+				startTime: 0,
+
+				scrollTop: 0,
+				currentScrollTop: 0, // 当前实际滚动位置
+				scrollIntoView: '', // scroll-into-view属性
+				messageIdCounter: 0, // 消息ID计数器,确保每个消息有唯一ID
+				scrollPending: false, // 滚动操作是否正在等待执行
+				isOnload: false,
+				isConnecting: false, // 是否正在连接中
+				hasInitialized: false,
+
+				liveViewersData: [],
+				liveUserCalled: false, //调用过watchUserList没
+				userRandomColors: Object.create(null), // 缓存用户ID -> 随机色的映射
+
+				heartBeatRetryCount: 0, // 心跳发送重试次数(避免一次失败就重连)
+				maxHeartBeatRetries: 3, // 心跳最大重试次数(增加到3次)
+				pingTimeout: 25000, // 心跳超时时间(25秒,适应移动网络)
+				shownEntryUsers: new Set(), // 存储已显示过「进入提示」的用户ID
+
+				socket: null, // WebSocket 实例
+				isSocketOpen: false, // 连接是否已打开
+				heartBeatInterval: 15000, // 心跳发送间隔(15秒)
+				adaptiveHeartBeatInterval: 15000, // 自适应心跳间隔
+				reconnectCount: 0, // 当前重连次数f
+				maxReconnectAttempts: 5, // 最大重连次数(增加到5次)
+				isManualClose: false, // 是否手动关闭(用于区分主动关闭和异常断开)
+				networkType: 'unknown', // 当前网络类型
+				isNetworkAvailable: true, // 网络是否可用
+
+				// templateId: 'fxYJu817lxHNKXl0hJypb-y-lLm8CNmGbcwpQmasCVg',//芳华惠选
+				templateId: 'bpc9DOFwugg7_cNDN260TRclIgmIjDOuvLxIbM-c0mg', //芳华悦选
+				isAgreement: false,
+
+				wsNewUrl: 'wss://api.fhhx.runtzh.com/ws/app/webSocket',
+				// wsNewUrl: 'ws://192.168.10.166:7114/ws/app/webSocket',
+				qrFrom: null,
+				scene: '',
+
+				liveCountdown: {}, //直播倒计时
+				countdown: {}, //抽奖倒计时
+				liveViewData: {},
+
+				keyboardHeight: 0,
+				videoCurrentTime: 0, // 当前视频播放时间
+				videoProgressKey: '', // 存储进度的key
+				inAndOut: {},
+				winning: false,
+				isShowPrize: false,
+				isShowCoupon: false,
+				prizeInfo: [],
+				havePrize: uni.getStorageSync('havePrize') || false, //是否参与抽奖
+				countDownKey: 0,
+				lotteryProducts: [],
+				lotteryList: [],
+				talklist: [],
+				isShowLotteryPop: false,
+				liveItem: {},
+				isSending: false,
+				isMore: false,
+
+				value: '',
+				placeholderText: '说点什么...',
+
+				prizeAll: [],
+				isShowLottery: false,
+				isShowRedCard: false,
+				redCard: null, //点击红包出现弹窗
+				integral: {},
+				lotteryInfo: {},
+				goodsCard: {},
+				couponInfo: {},
+				redInfo: {},
+				storeId: null,
+				isFocus: false,
+				shopping: false,
+				systemInfo: null, // 缓存系统信息,避免重复调用同步API
+
+				inputInfo: '',
+				showWelcomeMessage: false,
+				isShowGoods: false,
+				isShowRed: false,
+				lastClickTime: 0,
+				videoRetryCounts: Object.create(null), // 记录每个直播间的视频重试次数,格式: { liveId: 次数 }
+
+				clickDelay: 300, // 300ms内只响应一次点击
+				liveUserTotal: 0,
+				viewPageSize: 10, // 每页数量
+				viewPageNum: 1, // 当前页码
+				viewLoading: false, // 是否正在加载
+				scrollHeight: 0,
+
+				showPurchasePrompt: false,
+				prevOrderCount: 0, // 用于记录上一次的购买人数
+				videoUrl: null,
+				//横屏1 竖屏2
+				boxHeight: 300, //小黄车高度
+				liveViewers: [], //观众
+				products: [],
+				loadingProducts: false, // 商品加载状态
+				orderUser: {}, //正在购买
+				userType: 0,
+				timestamp: '',
+				liveId: null,
+				userinfo: '', //用户信息
+				userData: {},
+				diffTotalTime: '',
+			};
+		},
+		async onLoad(options) {
+
+			if (options.liveId) {
+				this.liveId = options.liveId;
+			}
+			// 扫码传来的参数
+			if (options.scene) {
+				this.scene = options.scene;
+				const decodedScene = decodeURIComponent(this.scene);
+				const params = {};
+				decodedScene.split('&').forEach((item) => {
+					const [key, value] = item.split('=');
+					params[key] = value;
+					this.liveId = params.a;
+				});
+				if (params.b && params.c) {
+					this.qrFrom = `&companyId=${params.b}&companyUserId=${params.c}`;
+				}
+			}
+			if (options.companyId && options.companyUserId) {
+				this.qrFrom = `&companyId=${options.companyId}&companyUserId=${options.companyUserId}`;
+			}
+			this.userinfo = uni.getStorageSync('userInfo');
+			this.userData = uni.getStorageSync('userData');
+						console.log('全部参数', options);
+			try {
+				const isLogin = await this.utils.isLogin();
+				if (isLogin) {
+					await this.getUserInfo();
+					this.initTime();
+					if (this.liveId) {
+						// 先获取直播间信息
+						const res = await this.getliving(this.liveId); // 这里需要获取返回值
+						if (res && res.data) { // 检查 res 是否存在
+							if (res.data.videoFileSize) {
+								this.liveItem.videoFileSize = res.data.videoFileSize;
+							}
+							if (res.data.videoDuration) {
+								this.liveItem.videoDuration = res.data.videoDuration;
+							}
+						}
+						this.isOnload = true;
+						// 然后获取聊天记录
+						await this.getLiveMsg(this.liveId);
+						await this.getliveViewData();
+					}
+				}
+			} catch (error) {
+				console.error('初始化失败:', error);
+			}
+			//获取键盘高度 - 针对iPhone优化(使用缓存的系统信息)
+			uni.onKeyboardHeightChange((res) => {
+				console.log('键盘高度变化:', res.height, '平台:', this.systemInfo.platform);
+				if (this.systemInfo.platform === 'ios') {
+					// iPhone特殊处理
+					if (res.height > 0) {
+						// 键盘弹出
+						this.isKeyboardShow = true;
+						// iPhone键盘高度计算优化
+						let calculatedHeight = res.height * 2;
+						// 根据iPhone型号进行微调
+						if (this.systemInfo.model) {
+							if (this.systemInfo.model.includes('iPhone X') ||
+								this.systemInfo.model.includes('iPhone 11') ||
+								this.systemInfo.model.includes('iPhone 12') ||
+								this.systemInfo.model.includes('iPhone 13') ||
+								this.systemInfo.model.includes('iPhone 14') ||
+								this.systemInfo.model.includes('iPhone 15') ||
+								this.systemInfo.model.includes('iPhone 16') ||
+								this.systemInfo.model.includes('iPhone 17')) {
+								// 刘海屏设备需要额外调整
+								calculatedHeight = calculatedHeight + 20; // 增加20rpx补偿
+							}
+						}
+
+						// 减去底部安全区域,避免过高
+						const safeAreaBottom = this.systemInfo.safeAreaInsets ? this.systemInfo.safeAreaInsets
+							.bottom : 0;
+						if (safeAreaBottom > 0) {
+							calculatedHeight = calculatedHeight - (safeAreaBottom * 3.0); // 微调10rpx
+						}
+						this.keyboardHeight = Math.max(400, calculatedHeight);
+					} else {
+						// 键盘隐藏
+						this.isKeyboardShow = false;
+						this.keyboardHeight = 0;
+					}
+				} else {
+					console.log("手机型号是>>>>", this.systemInfo.model)
+					// Android处理保持原有逻辑
+					if (res.height > 0) {
+						this.isKeyboardShow = true;
+						const safeAreaBottom = this.systemInfo.safeAreaInsets ? this.systemInfo.safeAreaInsets
+							.bottom : 0;
+						// this.keyboardHeight = (res.height * 2)-50;
+						// this.keyboardHeight = res.height * 2;
+						if (this.systemInfo.brand == 'vivo') {
+							this.keyboardHeight = res.height * 2;
+						} else {
+							this.keyboardHeight = (res.height * 1.78) + 20;
+						}
+						console.log("高度是", this.keyboardHeight)
+					} else {
+						this.isKeyboardShow = false;
+						this.keyboardHeight = 0;
+					}
+				}
+			});
+
+			// 初始化网络状态监听
+			this.initNetworkStatusListener();
+		},
+		onPullDownRefresh() {
+			this.getLiveMsg(this.liveItem);
+			this.getliveUser();
+			setTimeout(() => {
+				uni.stopPullDownRefresh();
+			}, 1000);
+		},
+		async onShow() {
+			try {
+				const isLogin = await this.utils.isLogin();
+				if (isLogin) {
+					await this.getUserInfo();
+					this.initTime();
+					if (this.liveId) {
+						// 先获取直播间信息
+						await this.getliving(this.liveId);
+						this.isOnload = true;
+						// 然后获取聊天记录
+						await this.getLiveMsg(this.liveItem);
+						await this.getliveViewData();
+					}
+				}
+			} catch (error) {
+				console.error('初始化失败:', error);
+			}
+			if (this.liveId) {
+				await this.getLiveMsg(this.liveItem);
+			}
+			if (!this.liveViewData) {
+				this.getliveViewData();
+			}
+
+			
+			// if (!this.userData) {
+				await this.getUserInfo();
+			// }
+
+			this.uuId = generateRandomString(16);
+			const isLiveLogin = uni.getStorageSync('isLiveLogin');
+			this.share = uni.getStorageSync('share');
+			this.scene = uni.getStorageSync('scene');
+			if (this.share && this.share.length > 0) {
+				this.liveId = this.share.liveId;
+				this.qrFrom = `&companyId=${this.share.companyId}&companyUserId=${this.share.companyUserId}`;
+				uni.removeStorageSync('share');
+			}
+			if (this.scene) {
+				const decodedScene = decodeURIComponent(this.scene);
+				const params = {};
+				decodedScene.split('&').forEach((item) => {
+					const [key, value] = item.split('=');
+					params[key] = value;
+					this.liveId = params.a;
+				});
+				if (params.b && params.c) {
+					this.qrFrom = `&companyId=${params.b}&companyUserId=${params.c}`;
+				}
+				uni.removeStorageSync('scene');
+			}
+			if (isLiveLogin) {
+				if (this.liveId) {
+					await this.getliving(this.liveId);
+					this.getCurrentActivities();
+					this.getliveOrder();
+					this.initSocket();
+				}
+				this.hasInitialized = true;
+				uni.removeStorageSync('isLiveLogin');
+			}
+			// 恢复播放和连接
+			await this.resumePageActivity();
+			// this.userinfo = JSON.parse(uni.getStorageSync('userInfo'));
+			this.userinfo = uni.getStorageSync('userInfo');
+			this.isAgreement = uni.getStorageSync('isAgreement');
+
+			this.$nextTick(() => {
+				if (this.$refs.liveVideo && this.$refs.liveVideo.setVideoProgress) {
+					this.$refs.liveVideo.setVideoProgress();
+				}
+			});
+			if (this.lookTimer) {
+				clearInterval(this.lookTimer);
+				this.lookTimer = null;
+				this.stayTime = 0;
+				this.startTime = 0;
+			}
+
+			// 启动内存监控,定期清理
+			this.startMemoryMonitor();
+			if (this.trafficTimer) {
+				clearInterval(this.trafficTimer);
+				this.trafficTimer = null;
+				this.startTime = 0;
+				this.totalTraffic = 0;
+			}
+			if (this.$refs.liveVideo && this.$refs.liveVideo.startTimer) {
+				this.$refs.liveVideo.startTimer();
+			}
+			this.$nextTick(() => {
+				if (!this.userData.unionId) {
+					uni.navigateTo({
+						url: '/pages/auth/login'
+					});
+				}
+			});
+
+		},
+
+		//分享给好友
+		onShareAppMessage() {
+			return {
+				title: '邀请你来观看直播:' + this.liveItem.liveName,
+				path: '/pages_course/living?companyId=-2&companyUserId=' + this.userData.userId + '&liveId=' + this.liveId,
+				imageUrl: '/static/images/logo.png',
+				success(res) {
+					console.log('分享成功', res);
+				},
+				fail(err) {
+					console.error('分享失败', err);
+				}
+			};
+		}, // 分享到朋友圈
+		onShareTimeline() {
+			return {
+				title: '邀请你来观看直播:' + this.liveItem.liveName,
+				query: 'companyId=-2&companyUserId=' + this.userData.userId + '&liveId=' + this.liveId
+			};
+		},
+		// 	onShareTimeline() {
+		// 	try {
+		// 		// 构建分享参数
+		// 		const shareParams = {
+		// 			companyId: '-2',
+		// 			companyUserId: this.userData?.userId || '',
+		// 			liveId: this.liveId || ''
+		// 		};
+
+		// 		// 过滤空值并构建 query string
+		// 		const queryString = Object.entries(shareParams)
+		// 			.filter(([_, value]) => value && value !== '')
+		// 			.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
+		// 			.join('&');
+
+		// 		// 构建标题
+		// 		let title = '邀请你观看精彩直播';
+		// 		if (this.liveItem?.liveName) {
+		// 			title = `直播:${this.liveItem.liveName}`;
+		// 			// 标题长度限制
+		// 			if (title.length > 20) {
+		// 				title = title.substring(0, 17) + '...';
+		// 			}
+		// 		}
+
+		// 		return {
+		// 			title: title,
+		// 			query: queryString
+		// 		};
+
+		// 	} catch (error) {
+		// 		console.error('分享到朋友圈配置失败:', error);
+		// 		// 兜底配置
+		// 		return {
+		// 			title: '邀请你观看精彩直播',
+		// 			query: 'companyId=-2'
+		// 		};
+		// 	}
+		// },
+		computed: {
+			// 观看人数
+			formattedWatchCount() {
+				return this.formatNumber(this.liveUserTotal || 0);
+			},
+			//点赞人数
+			formattedLikeCount() {
+				return this.formatNumber(this.liveViewData.like || 0);
+			},
+			filteredViewers() {
+				const safeLiveViewers = Array.isArray(this.liveViewersData) ? this.liveViewersData : [];
+				// 截取前3项
+				return safeLiveViewers.slice(0, 3);
+			},
+			isCurrentUserWon() {
+				if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
+					return false;
+				}
+				return this.prizeInfo.some((item) => {
+					return String(item.userId) === String(this.userData.userId);
+				});
+			},
+			getCurrentUserPrizeProductId() {
+				if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
+					return null;
+				}
+				// 在 prizeInfo 中查找当前用户的中奖记录
+				const userPrize = this.prizeInfo.find(item => {
+					return String(item.userId) == String(this.userData.userId);
+				});
+
+				// 返回商品ID,如果没有找到则返回null
+				return userPrize ? userPrize.productId : null;
+			},
+			getCurrentUserPrizeRecordId() {
+				if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
+					return null;
+				}
+				// 在 prizeInfo 中查找当前用户的中奖记录
+				const userPrize = this.prizeInfo.find(item => {
+					return String(item.userId) == String(this.userData.userId);
+				});
+
+				// 返回商品ID,如果没有找到则返回null
+				return userPrize ? userPrize.recordId : null;
+			}
+
+		},
+		onHide() {
+			//  清除所有定时器(使用增强清理)
+			// this.clearAllTimersEnhanced();
+			// this.stopHeartBeat();
+			if (this.trafficTimer) {
+				clearInterval(this.trafficTimer);
+			}
+
+			// 页面隐藏时清理部分数据,减少内存占用
+			if (this.talklist && this.talklist.length > 20) {
+				// 只保留最新的20条消息
+				this.talklist = this.talklist.slice(-20);
+			}
+
+			// 触发垃圾回收
+			// this.triggerGarbageCollection();
+		},
+
+		onUnload() {
+			// 保存视频进度
+			if (this.$refs.liveVideo && this.$refs.liveVideo.saveVideoProgress) {
+				this.$refs.liveVideo.saveVideoProgress();
+			}
+
+			// 清理直播相关定时器
+			if (this.liveItem) {
+				if (this.$refs.liveVideo && this.$refs.liveVideo.pauseVideo) {
+					this.$refs.liveVideo.pauseVideo();
+				}
+				// 清除直播间的时间定时器
+				if (this.liveItem.timeTimer) {
+					clearInterval(this.liveItem.timeTimer);
+					this.liveItem.timeTimer = null;
+				}
+			}
+
+			// 关闭WebSocket连接(会自动清理相关资源)
+			this.closeWebSocket(true);
+
+			// 清除所有定时器(使用增强清理)
+			this.clearAllTimersEnhanced();
+
+			// 暂停视频
+			const videoId = `myVideo_${this.liveId}`;
+			const videoContext = uni.createVideoContext(videoId, this);
+			if (videoContext) {
+				videoContext.pause();
+			}
+
+			// 移除网络状态监听
+			try {
+				uni.offNetworkStatusChange();
+			} catch (err) {
+				console.warn('移除网络状态监听失败:', err);
+			}
+
+			// 清理大数据和状态
+			this.clearBigData();
+			this.resetAllStates();
+		},
+
+		mounted() {
+			// 初始化系统信息缓存,避免在键盘监听器中重复调用同步API
+			this.systemInfo = uni.getSystemInfoSync();
+			console.log('系统信息:', this.systemInfo.platform, this.systemInfo.model);
+
+			this.getCurrentActivities();
+			this.getliveOrder();
+		},
+		watch: {
+			// 监听liveItem.status的变化
+			// 'liveItem.status': {
+			// 	handler(newStatus, oldStatus) {
+			// 		if (newStatus === undefined || oldStatus === undefined) return;
+			// 		if (newStatus === oldStatus) return;
+			// 		if (!this.liveId) {
+			// 			console.warn('liveId不存在,无法触发getliving请求');
+			// 			return;
+			// 		}
+			// 		// 状态变化时,调用getliving更新直播间数据
+			// 		// console.log(`liveItem.status从${oldStatus}变为${newStatus},触发getliving请求`);
+			// 		this.getliving(this.liveId);
+			// 	},
+			// 	deep: true
+			// },
+			// 监听orderUser.count的变化
+			'orderUser.count': {
+				handler(newVal, oldVal) {
+					if (newVal !== this.prevOrderCount) {
+						this.prevOrderCount = newVal;
+						this.showPurchaseMessage();
+					}
+				},
+				immediate: true
+			}
+		},
+		methods: {
+			onInputFocus(value) {
+				this.isFocus = true;
+				console.log('输入框聚焦:', value);
+			},
+
+			onInputBlur(value) {
+				this.isFocus = false;
+				console.log('输入框失焦:', value);
+			},
+
+			onSendMessage(message) {
+				console.log('发送消息:', message);
+				// 调用原有的发送消息逻辑
+				this.sendMsg();
+			},
+
+			onInputChange(value) {
+				this.value = value;
+			},
+			// 处理直播开始
+			handleLiveStart() {
+				console.log('直播开始');
+				// 刷新直播间信息
+				this.getliving(this.liveId);
+			},
+
+			handleSearchInput(keyword) {
+				this.inputInfo = keyword;
+				// 使用防抖优化性能,避免频繁请求
+				clearTimeout(this.searchTimer);
+				this.searchTimer = setTimeout(() => {
+					this.queryCollect();
+				}, 500); // 500毫秒延迟
+			},
+			// 处理视频错误
+			handleVideoError(error) {
+				console.error('视频播放错误:', error);
+				// 可以显示错误提示等
+			}, // 处理直播状态变化
+			handleLiveStateChange(state) {
+				console.log('直播状态变化:', state);
+			},
+			//跳转到订单页面
+			handleNavigateToOrder() {
+				this.navgetTo('/pages_shopping/live/order');
+			},
+
+			// 显示更多弹窗
+			handleShowMore() {
+				this.isMore = true;
+				this.shopping = false;
+			},
+			handleFillAddress(data) {
+				const {
+					productId,
+					recordId,
+					liveId
+				} = data;
+				this.winning = false;
+				this.navgetTo(
+					`/pages_shopping/live/confirmCreateOrder?type=win&productId=${productId}&liveId=${liveId}&recordId=${recordId}`
+				);
+			},
+			// 处理关闭抽奖弹窗
+			handleLotteryClose() {
+				this.isShowLotteryPop = false;
+			},
+
+			// 处理参与抽奖
+			handleLotteryClaim() {
+				this.onClaim(); // 调用原有的抽奖方法
+			},
+			handleGoShop(goodsData) {
+				// 处理跳转商店,使用goodsData中的productId和goodsId
+				this.goShop(goodsData.productId, goodsData.goodsId);
+			},
+			handleCloseGoods() {
+				// 关闭商品卡片
+				this.isShowGoods = false;
+			},
+			formatNumber(num) {
+				if (typeof num !== 'number') {
+					num = Number(num) || 0;
+				}
+				if (num < 10000) {
+					return num.toString();
+				}
+				// 处理万以上的数字
+				const wan = num / 10000;
+				if (wan < 10) {
+					// 1万-10万之间,保留2位小数
+					const rounded = Math.round(wan * 100) / 100;
+					return rounded.toFixed(2).replace(/\.?0+$/, '') + 'w';
+				} else if (wan < 10000) {
+					// 10万-1亿之间,保留1位小数
+					const rounded = Math.round(wan * 10) / 10;
+					return rounded.toFixed(1).replace(/\.0$/, '') + 'w';
+				} else {
+					// 1亿以上,转换为亿单位
+					const yi = wan / 10000;
+					const rounded = Math.round(yi * 100) / 100;
+					return rounded.toFixed(2).replace(/\.?0+$/, '') + '亿';
+				}
+			},
+			// 重置所有状态
+			resetAllStates() {
+				this.liveUserCalled = false;
+				this.talklist = [];
+				this.liveViewersData = [];
+				this.liveViewers = [];
+				this.products = [];
+				this.liveItem = [];
+
+				// 重置WebSocket相关状态
+				this.isSocketOpen = false;
+				this.isConnecting = false;
+				this.isManualClose = true;
+				this.reconnectCount = 0;
+				this.heartBeatRetryCount = 0;
+				this.lastHeartBeatTime = 0;
+				this.adaptiveHeartBeatInterval = this.heartBeatInterval;
+				this.isNetworkAvailable = true;
+				this.networkType = 'unknown';
+
+				// 重置性能监控数据
+				this.connectionStartTime = 0;
+				this.connectionLatency = 0;
+				this.messageCount = 0;
+				this.errorCount = 0;
+				this.lastPerformanceCheck = 0;
+			},
+
+			// 获取WebSocket性能统计
+			getWebSocketPerformanceStats() {
+				const now = Date.now();
+				const uptime = this.connectionStartTime > 0 ? now - this.connectionStartTime : 0;
+
+				return {
+					connectionLatency: this.connectionLatency,
+					uptime: uptime,
+					messageCount: this.messageCount,
+					errorCount: this.errorCount,
+					errorRate: this.messageCount > 0 ? (this.errorCount / this.messageCount * 100).toFixed(2) : 0,
+					messagesPerSecond: uptime > 0 ? (this.messageCount / (uptime / 1000)).toFixed(2) : 0,
+					networkType: this.networkType,
+					isConnected: this.isSocketAvailable(),
+					reconnectCount: this.reconnectCount
+				};
+			},
+
+			// 定期检查性能并输出统计信息
+			performanceCheck() {
+				const now = Date.now();
+				// 每5分钟输出一次性能统计
+				if (now - this.lastPerformanceCheck > 300000) { // 5分钟
+					const stats = this.getWebSocketPerformanceStats();
+					console.log('WebSocket性能统计:', stats);
+					this.lastPerformanceCheck = now;
+
+					// 如果错误率过高,记录警告
+					if (stats.errorRate > 10) {
+						console.warn(`WebSocket错误率过高: ${stats.errorRate}%`);
+					}
+
+					// 如果连接延迟过高,记录警告
+					if (stats.connectionLatency > 5000) {
+						console.warn(`WebSocket连接延迟过高: ${stats.connectionLatency}ms`);
+					}
+				}
+			},
+
+			// 定期清理视频缓存
+			startVideoCacheCleanup() {
+				if (this.videoCleanupTimer) {
+					clearInterval(this.videoCleanupTimer);
+				}
+
+				// 每30秒清理一次视频缓存
+				this.videoCleanupTimer = setInterval(() => {
+					this.cleanupVideoCache();
+				}, 30000);
+			},
+			// 清理视频缓存
+			cleanupVideoCache() {
+				if (!this.liveItem || !this.liveId) return;
+
+				// 只对录播视频进行清理
+				if (this.liveItem.liveType === 2 && this.liveItem.videoUrl) {
+					this.reloadVideoPlayer();
+				}
+			},
+			// 重新加载视频播放器
+			reloadVideoPlayer() {
+				const videoId = `myVideo_${this.liveId}`;
+				const videoContext = uni.createVideoContext(videoId, this);
+
+				if (videoContext) {
+					const currentTime = this.videoCurrentTime;
+					// 暂停视频
+					videoContext.pause();
+					// 延迟重新加载
+					setTimeout(() => {
+						// 重新设置视频源,强制清理缓存
+						this.$set(this.liveItem, 'videoUrl', this.liveItem.videoUrl + '&t=' + Date.now());
+
+						// 恢复播放位置
+						setTimeout(() => {
+							if (videoContext.seek) {
+								videoContext.seek(currentTime);
+							}
+							videoContext.play();
+						}, 500);
+					}, 100);
+				}
+			},
+			// 启动内存监控
+			startMemoryMonitoring() {
+				if (this.memoryMonitorTimer) {
+					clearInterval(this.memoryMonitorTimer);
+				}
+				this.memoryMonitorTimer = setInterval(() => {
+					this.checkMemoryUsage();
+				}, 15000); // 每15秒检查一次
+			},
+
+
+			// 检查内存使用情况
+			checkMemoryUsage() {
+				try {
+					// 检查定时器数量
+					const timerCount = this.getActiveTimerCount();
+					if (timerCount > 10) {
+						console.warn(`检测到过多定时器: ${timerCount}个,可能存在内存泄漏`);
+						this.cleanupUnusedTimers();
+					}
+
+					// 检查消息队列长度
+					if (this.messageQueue && this.messageQueue.length > 100) {
+						console.warn(`消息队列过长: ${this.messageQueue.length}条,清理旧消息`);
+						this.messageQueue = this.messageQueue.slice(-50); // 只保留最新50条
+					}
+
+					// 检查用户颜色缓存
+					if (this.userRandomColors && Object.keys(this.userRandomColors).length > 500) {
+						console.warn('用户颜色缓存过大,清理部分缓存');
+						const keys = Object.keys(this.userRandomColors);
+						const keysToRemove = keys.slice(0, keys.length - 200); // 只保留最新200个
+						keysToRemove.forEach(key => delete this.userRandomColors[key]);
+					}
+
+					// 定期触发垃圾回收
+					if (Date.now() - this.lastPerformanceCheck > 60000) { // 每分钟一次
+						this.triggerGarbageCollection();
+						this.lastPerformanceCheck = Date.now();
+					}
+				} catch (error) {
+					console.error('内存检查失败:', error);
+				}
+			},
+
+
+
+			// 强制内存清理
+			forceMemoryCleanup() {
+				console.log('执行强制内存清理');
+
+				// 1. 清理视频播放器
+				this.cleanupVideoPlayer();
+
+				// 2. 清理大数据
+				this.clearBigData();
+
+				// 3. 强制垃圾回收(在支持的环境下)
+				this.triggerGarbageCollection();
+			},
+			// 清理视频播放器
+			cleanupVideoPlayer() {
+				const videoId = `myVideo_${this.liveId}`;
+				const videoContext = uni.createVideoContext(videoId, this);
+
+				if (videoContext) {
+					// 停止播放
+					videoContext.stop();
+
+					// 重置视频源
+					setTimeout(() => {
+						this.$set(this.liveItem, 'videoUrl', '');
+						setTimeout(() => {
+							this.$set(this.liveItem, 'videoUrl', this.getFreshVideoUrl());
+							if (this.$refs.liveVideo && this.$refs.liveVideo.playVideo) {
+								this.$refs.liveVideo.playVideo();
+							}
+
+						}, 500);
+					}, 100);
+				}
+			},
+			// 获取带时间戳的新视频URL
+			getFreshVideoUrl() {
+				if (!this.liveItem.originalVideoUrl) {
+					this.liveItem.originalVideoUrl = this.liveItem.videoUrl;
+				}
+
+				// 添加时间戳参数,避免缓存
+				const separator = this.liveItem.originalVideoUrl.includes('?') ? '&' : '?';
+				return this.liveItem.originalVideoUrl + separator + 't=' + Date.now();
+			},
+			// 清理大数据
+			clearBigData() {
+				// 清理聊天记录,只保留最近50条
+				if (this.talklist.length > 50) {
+					this.talklist = this.talklist.slice(-50);
+				}
+				// 清理观众数据
+				if (this.liveViewersData.length > 100) {
+					this.liveViewersData = this.liveViewersData.slice(-100);
+				}
+
+				// 清理虚拟数据
+				if (this.liveViewers.length > 100) {
+					this.liveViewers = this.liveViewers.slice(-100);
+				}
+
+				// 清理商品数据
+				if (this.products.length > 50) {
+					this.products = this.products.slice(0, 50);
+				}
+
+				// 强制垃圾回收(如果支持)
+				if (typeof gc === 'function') {
+					gc();
+				}
+			},
+
+
+			// 触发垃圾回收(在支持的环境下)
+			triggerGarbageCollection() {
+				if (wx && wx.triggerGC) {
+					wx.triggerGC();
+				}
+			},
+
+			// 强制滚动到底部(备用方案)
+			forceScrollToBottom() {
+				console.log('执行强制滚动到底部');
+
+				// 方案1:直接设置一个很大的scrollTop值
+				this.scrollTop = 999999;
+
+				// 方案2:使用scroll-into-view滚动到最后一个元素
+				this.$nextTick(() => {
+					if (this.talklist && this.talklist.length > 0) {
+						const lastMessage = this.talklist[this.talklist.length - 1];
+						const targetId = `list_${lastMessage.uniqueId || (this.talklist.length - 1)}`;
+						console.log(
+							`尝试滚动到元素: ${targetId}, 当前消息数量: ${this.talklist.length}, 最后消息ID: ${lastMessage.uniqueId}`
+						);
+
+						this.scrollIntoView = targetId;
+
+						// 清除scroll-into-view,避免影响后续滚动
+						setTimeout(() => {
+							this.scrollIntoView = '';
+						}, 200);
+					}
+
+					// 方案3:使用更大的延迟再次设置scrollTop
+					setTimeout(() => {
+						this.scrollTop = 999999;
+						console.log('延迟设置scrollTop为999999');
+					}, 100);
+
+					// 方案4:300ms后使用原生API作为最终备用方案
+					setTimeout(() => {
+						this.nativeScrollToBottom();
+					}, 300);
+				});
+			},
+
+			// 可靠的滚动方法(包含多种备用方案)
+			simpleScrollToBottom() {
+				const now = Date.now();
+
+				// 防抖检查:如果距离上次滚动时间太短,则忽略
+				if (now - this.lastScrollTime < this.scrollDebounceDelay) {
+					console.log('滚动防抖:忽略频繁调用');
+					return;
+				}
+
+				this.lastScrollTime = now;
+				console.log('执行可靠滚动到底部');
+
+				// 清理之前的定时器
+				if (this.scrollTimer) {
+					clearTimeout(this.scrollTimer);
+					this.scrollTimer = null;
+				}
+
+				// 方案1:直接设置scrollTop
+				this.scrollTop = 999999999;
+				console.log('方案1: 设置scrollTop为999999999');
+
+				// 方案2:使用scroll-into-view(备用方案)
+				if (this.talklist.length > 0) {
+					const lastMessage = this.talklist[this.talklist.length - 1];
+					if (lastMessage && lastMessage.uniqueId) {
+						this.scrollIntoView = `msg-${lastMessage.uniqueId}`;
+						console.log(`方案2: 设置scrollIntoView为msg-${lastMessage.uniqueId}`);
+					}
+				}
+
+				// 方案3:延迟再次设置scrollTop(最终备用方案)
+				this.scrollTimer = setTimeout(() => {
+					this.scrollTop = 999999999;
+					console.log('方案3: 延迟设置scrollTop为999999999');
+					this.scrollTimer = null;
+				}, 50);
+			},
+
+			// 强制滚动到底部(用于发送消息,绕过防抖限制)
+			forceScrollToBottomOnSend() {
+				console.log('执行强制滚动到底部(发送消息专用)');
+
+				// 清理之前的定时器
+				if (this.scrollTimer) {
+					clearTimeout(this.scrollTimer);
+					this.scrollTimer = null;
+				}
+
+				// 强制更新滚动时间,确保不被防抖阻止
+				this.lastScrollTime = Date.now();
+
+				// 清除scroll-into-view,避免冲突
+				this.scrollIntoView = '';
+
+				// 方案1:立即使用scroll-into-view滚动到最后一条消息
+				if (this.talklist.length > 0) {
+					const lastMessage = this.talklist[this.talklist.length - 1];
+					if (lastMessage && lastMessage.uniqueId) {
+						this.scrollIntoView = `list_${lastMessage.uniqueId}`;
+						//console.log(`强制滚动方案1: 设置scrollIntoView为list_${lastMessage.uniqueId}`);
+					}
+				}
+
+				// 方案2:同时设置scrollTop为一个非常大的值
+				const targetScrollTop = Date.now(); // 使用时间戳确保每次都不同
+				this.scrollTop = targetScrollTop;
+				//console.log('强制滚动方案2: 设置scrollTop为', targetScrollTop);
+
+				// 方案3:立即尝试原生滚动
+				this.nativeScrollToBottom();
+
+				// 方案4:使用nextTick确保DOM更新后再次滚动
+				this.$nextTick(() => {
+					// 清除scroll-into-view后重新设置scrollTop
+					this.scrollIntoView = '';
+					this.scrollTop = targetScrollTop + 1;
+					//console.log('强制滚动方案3: nextTick后重新设置scrollTop');
+					// 再次尝试原生滚动
+					setTimeout(() => {
+						this.nativeScrollToBottom();
+					}, 50);
+				});
+
+				// 方案5:延迟检查和强制滚动(最终保障)
+				this.scrollTimer = setTimeout(() => {
+					this.checkAndForceScroll(targetScrollTop);
+					this.scrollTimer = null;
+				}, 200);
+			},
+
+			// 检查并强制滚动
+			checkAndForceScroll(targetScrollTop) {
+				//console.log(`检查滚动状态: 当前位置=${this.currentScrollTop}, 目标位置=${targetScrollTop}`);
+				// 无论当前位置如何,都尝试强制滚动到底部
+				// 使用scroll-into-view滚动到最后一条消息
+				if (this.talklist.length > 0) {
+					const lastMessage = this.talklist[this.talklist.length - 1];
+					if (lastMessage && lastMessage.uniqueId) {
+						this.scrollIntoView = `list_${lastMessage.uniqueId}`;
+						//console.log(`最终检查: 设置scrollIntoView为list_${lastMessage.uniqueId}`);
+					}
+				}
+
+				// 设置一个新的scrollTop值
+				this.scrollTop = Date.now() + Math.random() * 1000;
+				//console.log('最终检查: 设置新的scrollTop值');
+
+				// 多次尝试原生滚动
+				this.nativeScrollToBottom();
+
+				setTimeout(() => {
+					this.nativeScrollToBottom();
+				}, 100);
+
+			},
+
+			// 使用原生API强制滚动(最终备用方案)
+			nativeScrollToBottom() {
+				try {
+					// 方案1:使用uni.createSelectorQuery直接操作DOM
+					const query = uni.createSelectorQuery().in(this);
+					query.select('#msgScroll').node((res) => {
+						if (res && res.node) {
+							console.log('找到msgScroll节点,执行原生滚动');
+							const scrollHeight = res.node.scrollHeight;
+							res.node.scrollTop = scrollHeight;
+
+							// 确保滚动生效,延迟再次设置
+							setTimeout(() => {
+								res.node.scrollTop = scrollHeight + 100;
+							}, 50);
+						}
+					}).exec();
+
+					// 方案2:同时使用scrollIntoView API
+					// query.select('#msgScroll').scrollIntoView({
+					// 	duration: 0,
+					// 	complete: () => {
+					// 		console.log('scrollIntoView完成');
+					// 	}
+					// }).exec();
+
+					// 方案3:尝试获取最后一个消息元素并滚动到它
+					// if (this.talklist.length > 0) {
+					// 	const lastMessage = this.talklist[this.talklist.length - 1];
+					// 	if (lastMessage && lastMessage.uniqueId) {
+					// 		query.select(`#list_${lastMessage.uniqueId}`).scrollIntoView({
+					// 			duration: 0,
+					// 			complete: () => {
+					// 				console.log('最后消息元素滚动完成');
+					// 			}
+					// 		}).exec();
+					// 	}
+					// }
+
+				} catch (error) {
+					console.error('原生滚动失败:', error);
+				}
+			},
+
+			// 监听滚动事件
+			onScroll(e) {
+				this.currentScrollTop = e.detail.scrollTop;
+				// console.log('当前滚动位置:', this.currentScrollTop);
+			},
+			// 停止内存监控
+			stopMemoryMonitor() {
+				if (this.memoryMonitorTimer) {
+					clearInterval(this.memoryMonitorTimer);
+					this.memoryMonitorTimer = null;
+				}
+			},
+			// 获取活跃定时器数量
+			getActiveTimerCount() {
+				const timers = [
+					'trafficTimer', 'pingTimeoutTimer', 'heartBeatTimer', 'liveViewDataTimer',
+					'reconnectTimer', 'scrollTimer', 'searchTimer', 'purchasePromptTimer',
+					'welcomeTimer', 'redTimer', 'liveStartTimer', 'lotteryTimer', 'noticeTimer',
+					'memoryMonitorTimer', 'networkStatusTimer', 'networkRetryTimer'
+				];
+
+				return timers.filter(timer => this[timer] !== null).length;
+			},
+
+			// 清理未使用的定时器
+			cleanupUnusedTimers() {
+				// 检查并清理可能泄漏的定时器
+				const timers = [
+					'trafficTimer', 'pingTimeoutTimer', 'heartBeatTimer', 'liveViewDataTimer',
+					'reconnectTimer', 'scrollTimer', 'searchTimer', 'purchasePromptTimer',
+					'welcomeTimer', 'redTimer', 'liveStartTimer', 'lotteryTimer',
+					'networkStatusTimer', 'networkRetryTimer'
+				];
+
+				timers.forEach(timerName => {
+					if (this[timerName] && typeof this[timerName] === 'number') {
+						// 检查定时器是否还在运行
+						if (timerName.includes('Interval')) {
+							clearInterval(this[timerName]);
+						} else {
+							clearTimeout(this[timerName]);
+						}
+						this[timerName] = null;
+						console.log(`清理了可能泄漏的定时器: ${timerName}`);
+					}
+				});
+			},
+
+			// 增强的定时器清理方法
+			clearAllTimersEnhanced() {
+				// 先调用原有的清理方法
+				this.clearAllTimers();
+
+				// 额外清理新增的定时器
+				if (this.networkRetryTimer) {
+					clearTimeout(this.networkRetryTimer);
+					this.networkRetryTimer = null;
+				}
+
+				// 停止内存监控
+				this.stopMemoryMonitor();
+
+				// 清理缓存数据
+				this.userRandomColors = Object.create(null);
+				this.shownEntryUsers.clear();
+
+				// 重置性能监控数据
+				this.messageCount = 0;
+				this.errorCount = 0;
+				this.connectionLatency = 0;
+				this.lastPerformanceCheck = 0;
+
+				console.log('增强清理完成:所有定时器和缓存已清理');
+			},
+
+			goMiniProgram() {
+				// uni.navigateToMiniProgram({
+				// 	appId: 'wx45cf09091aead547',
+				// 	path: '/pages/home/index',
+				// 	success: function(res) {
+				// 		console.log('跳转成功', res);
+				// 	},
+				// 	fail: function(err) {
+				// 		console.error('跳转失败', err);
+				// 	}
+				// });
+				uni.showToast({
+					title: '系统升级中,兑换请联系伴学助手!',
+					icon: 'none'
+				});
+			},
+			// 阻止双击事件
+			preventDoubleClick(e) {
+				e.preventDefault();
+				e.stopPropagation();
+				return false;
+			},
+
+			// 清理所有定时器和内存
+			clearAllTimers() {
+				// 清理所有定时器
+				const timers = [
+					'noticeTimer',
+					'scrollTimer',
+					'liveViewDataTimer',
+					'redTimer',
+					'liveStartTimer',
+					'lotteryTimer',
+					'welcomeTimer',
+					'trafficInterval',
+					'lookTimer',
+					'trafficTimer',
+					'intervalId',
+					'reconnectTimer',
+					'searchTimer',
+					'purchasePromptTimer',
+					'heartBeatTimer',
+					'pingTimeoutTimer'
+				];
+
+				timers.forEach((timer) => {
+					if (this[timer]) {
+						if (timer.includes('Interval') || timer.includes('Timer')) {
+							clearInterval(this[timer]);
+						} else {
+							clearTimeout(this[timer]);
+						}
+						this[timer] = null;
+					}
+				});
+
+				// 重置相关状态
+				this.stayTime = 0;
+				this.startTime = 0;
+				this.totalTraffic = 0;
+				this.scrollPending = false;
+				this.reconnectCount = 0;
+				this.heartBeatRetryCount = 0;
+			},
+
+
+
+
+
+			scrollToBottom() {
+				const now = Date.now();
+				// 防抖检查:如果距离上次滚动时间太短,则忽略
+				if (now - this.lastScrollTime < this.scrollDebounceDelay) {
+					console.log('滚动防抖:忽略频繁调用');
+					return;
+				}
+				this.lastScrollTime = now;
+				// 清理之前的定时器
+				if (this.scrollTimer) {
+					clearTimeout(this.scrollTimer);
+					this.scrollTimer = null;
+				}
+				// 直接设置滚动位置
+				this.scrollTop = 999999999;
+
+			},
+
+			// 启动内存监控
+			startMemoryMonitor() {
+				// 清理之前的监控
+				if (this.memoryMonitorTimer) {
+					clearInterval(this.memoryMonitorTimer);
+				}
+				// 每5分钟检查一次内存使用情况
+				this.memoryMonitorTimer = setInterval(() => {
+					this.checkAndCleanMemory();
+				}, 5 * 60 * 1000); // 5分钟
+			},
+
+			// 检查并清理内存
+			checkAndCleanMemory() {
+				try {
+					// 清理过多的聊天消息
+					if (this.talklist && this.talklist.length > 25) {
+						const keepCount = 20;
+						this.talklist.splice(0, this.talklist.length - keepCount);
+					}
+
+					// 清理用户颜色缓存(保留最近的50个)
+					if (this.userRandomColors && Object.keys(this.userRandomColors).length > 50) {
+						const entries = Object.entries(this.userRandomColors);
+						const keepEntries = entries.slice(-50);
+						this.userRandomColors = Object.fromEntries(keepEntries);
+					}
+
+					// 清理已显示用户集合(保留最近的100个)
+					if (this.shownEntryUsers && this.shownEntryUsers.size > 100) {
+						const array = Array.from(this.shownEntryUsers);
+						this.shownEntryUsers.clear();
+						array.slice(-100).forEach((id) => this.shownEntryUsers.add(id));
+					}
+
+					console.log('内存清理完成');
+				} catch (error) {
+					console.error('内存清理失败:', error);
+				}
+			},
+
+			// 恢复页面活动
+			async resumePageActivity() {
+				if (this.liveItem) {
+					await this.getliving(this.liveId);
+					this.startTimeTimer(this.liveItem);
+				}
+				if (!this.isSocketAvailable()) {
+					this.initSocket();
+				}
+			},
+
+			// 获取用户专属随机色(缓存机制:同一用户始终用同一颜色)
+			getUserRandomColor(userId) {
+				if (!userId) {
+					return '#8978e2'; // 默认颜色
+				}
+				//如果缓存中已有该用户的颜色,直接返回
+				if (this.userRandomColors[userId]) {
+					return this.userRandomColors[userId];
+				}
+				//为新用户生成固定颜色(基于用户ID生成,不是完全随机)
+				const color = this.generateStableColor(userId);
+				this.userRandomColors[userId] = color;
+				// 存储到本地缓存,确保页面刷新后颜色不变
+				this.saveUserColorsToStorage();
+				return color;
+			}, // 基于用户ID生成稳定颜色(不是完全随机)
+			generateStableColor(userId) {
+				// 将用户ID转换为数字种子
+				let seed = 0;
+				for (let i = 0; i < userId.length; i++) {
+					seed = (seed * 31 + userId.charCodeAt(i)) % 1000000;
+				}
+				const colorPool = [
+					'#FF6B6B',
+					'#4ECDC4',
+					'#45B7D1',
+					'#96CEB4',
+					'#FFEAA7',
+					'#DDA0DD',
+					'#98D8C8',
+					'#F7DC6F',
+					'#BB8FCE',
+					'#85C1E9',
+					'#F8C471',
+					'#82E0AA',
+					'#F1948A',
+					'#85C1E9',
+					'#D7BDE2'
+				];
+				return colorPool[seed % colorPool.length];
+			},
+			// 保存颜色映射到本地存储
+			saveUserColorsToStorage() {
+				try {
+					uni.setStorageSync('userRandomColors', this.userRandomColors);
+				} catch (e) {
+					console.warn('保存用户颜色缓存失败:', e);
+				}
+			},
+			// 从本地存储加载颜色映射
+			loadUserColorsFromStorage() {
+				try {
+					const cached = uni.getStorageSync('userRandomColors');
+					if (cached) {
+						this.userRandomColors = cached;
+					}
+				} catch (e) {
+					console.warn('加载用户颜色缓存失败:', e);
+				}
+			},
+			//头像名字
+			getNicknameInitial(nickName) {
+				if (!nickName || typeof nickName !== 'string') return '未';
+				if (/^[\u4e00-\u9fa5]/.test(nickName[0])) {
+					return nickName[0];
+				}
+				return nickName[0].toUpperCase();
+			},
+
+			async getUserInfo() {
+				await getUserInfo().then(
+					(res) => {
+						if (res.code == 200) {
+							this.userData = res.user;
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: '请求失败'
+							});
+						}
+					},
+					(rej) => {}
+				);
+			},
+			//订阅消息
+			handleAgreement() {
+				const templateId = this.templateId;
+				uni.requestSubscribeMessage({
+					tmplIds: [templateId],
+					success: (res) => {
+						// console.log("模板订阅状态", res[templateId]);
+						if (res[templateId] === 'accept') {
+							uni.showToast({
+								title: '订阅成功,开播将提醒您',
+								icon: 'success'
+							});
+							this.callSendMessageApi();
+						} else if (res[templateId] === 'reject') {
+							uni.showToast({
+								title: '您已拒绝订阅,将无法收到提醒',
+								icon: 'none'
+							});
+						} else if (res[templateId] === 'ban') {
+							uni.showToast({
+								title: '您已关闭所有订阅权限,请在设置中开启',
+								icon: 'none'
+							});
+						}
+					},
+					fail: (err) => {
+						console.error('订阅消息失败', err);
+						uni.showToast({
+							title: '订阅失败,请重试',
+							icon: 'none'
+						});
+					}
+				});
+			},
+			async callSendMessageApi() {
+				if (!this.userData.userId) return;
+				const templateData = {
+					liveId: this.liveId,
+					userId: this.userData.userId,
+					templateId: this.templateId || '', // 模板ID
+					maOpenId: this.userData.maOpenId || '',
+					appid: this.appid || '',
+					data: {
+						thing6: this.liveItem.liveName,
+						date7: this.liveItem.startTime
+					}
+				};
+				subNotifyLive(templateData).then(
+					(res) => {
+						if (res.code == 200) {
+							this.isAgreement = true;
+							uni.setStorageSync('isAgreement', true);
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}
+					},
+					(rej) => {}
+				);
+			},
+
+			//发送心跳
+			sendHeartBeat() {
+				if (!this.isSocketAvailable() || !this.isNetworkAvailable) {
+					console.warn('网络不可用或Socket连接异常,跳过心跳发送');
+					return;
+				}
+
+				this.lastHeartBeatTime = Date.now();
+
+				try {
+					const heartBeatMsg = JSON.stringify({
+						cmd: 'heartbeat',
+						msg: 'ping',
+						userId: this.userData.userId || '',
+						liveId: this.liveId,
+						timestamp: this.lastHeartBeatTime,
+						networkType: this.networkType
+					});
+
+					this.socket.send({
+						data: heartBeatMsg,
+						success: () => {
+							this.heartBeatRetryCount = 0; // 成功后重置重试次数
+							this.adjustHeartBeatInterval(true); // 网络良好,可适当延长间隔
+							this.startPingTimeout(); // 启动超时检测
+						},
+						fail: (err) => {
+							console.error('心跳包发送失败:', err);
+							this.heartBeatRetryCount++;
+							this.adjustHeartBeatInterval(false); // 网络不稳定,缩短间隔
+
+							// 根据网络类型调整重试策略
+							const retryDelay = this.getRetryDelay();
+
+							if (this.heartBeatRetryCount < this.maxHeartBeatRetries) {
+								setTimeout(() => this.sendHeartBeat(), retryDelay);
+							} else {
+								this.heartBeatRetryCount = 0;
+								this.handleReconnect(); // 重试用完才重连
+							}
+						}
+					});
+				} catch (err) {
+					console.error('心跳发送异常:', err);
+					this.heartBeatRetryCount++;
+
+					const retryDelay = this.getRetryDelay();
+					if (this.heartBeatRetryCount < this.maxHeartBeatRetries) {
+						setTimeout(() => this.sendHeartBeat(), retryDelay);
+					} else {
+						this.heartBeatRetryCount = 0;
+						this.handleReconnect();
+					}
+				}
+			},
+
+			// 根据网络状态获取重试延迟
+			getRetryDelay() {
+				const baseDelay = 2000;
+				const retryMultiplier = Math.pow(1.5, this.heartBeatRetryCount); // 指数退避
+
+				// 根据网络类型调整延迟
+				let networkMultiplier = 1;
+				switch (this.networkType) {
+					case '2g':
+						networkMultiplier = 3;
+						break;
+					case '3g':
+						networkMultiplier = 2;
+						break;
+					case '4g':
+					case '5g':
+						networkMultiplier = 1;
+						break;
+					case 'wifi':
+						networkMultiplier = 0.8;
+						break;
+					default:
+						networkMultiplier = 1.5;
+				}
+
+				return Math.min(baseDelay * retryMultiplier * networkMultiplier, 10000); // 最大10秒
+			},
+
+			// 自适应调整心跳间隔
+			adjustHeartBeatInterval(isSuccess) {
+				if (isSuccess) {
+					// 连接稳定,可适当延长间隔(最大30秒)
+					this.adaptiveHeartBeatInterval = Math.min(this.adaptiveHeartBeatInterval * 1.1, 30000);
+				} else {
+					// 连接不稳定,缩短间隔(最小10秒)
+					this.adaptiveHeartBeatInterval = Math.max(this.adaptiveHeartBeatInterval * 0.9, 10000);
+				}
+			},
+			// 启动心跳超时检测
+			startPingTimeout() {
+				// 清除现有的ping超时定时器
+				if (this.pingTimeoutTimer) {
+					clearTimeout(this.pingTimeoutTimer);
+					this.pingTimeoutTimer = null;
+				}
+				// 启动新的ping超时定时器
+				this.pingTimeoutTimer = setTimeout(() => {
+					console.warn('心跳超时,触发重连');
+					// 清理当前定时器引用
+					this.pingTimeoutTimer = null;
+					// 增加心跳重试次数
+					this.heartBeatRetryCount++;
+					// 如果重试次数未达到上限,先尝试重发心跳
+					if (this.heartBeatRetryCount < this.maxHeartBeatRetries) {
+						console.log(`心跳超时,尝试重发 (${this.heartBeatRetryCount}/${this.maxHeartBeatRetries})`);
+						setTimeout(() => this.sendHeartBeat(), 1000);
+					} else {
+						console.log('心跳重试次数用尽,触发重连');
+						this.heartBeatRetryCount = 0;
+						this.handleReconnect();
+					}
+				}, this.pingTimeout);
+			},
+			stopHeartBeat() {
+				if (this.heartBeatTimer) {
+					clearInterval(this.heartBeatTimer);
+					this.heartBeatTimer = null;
+				}
+				if (this.pingTimeoutTimer) {
+					clearTimeout(this.pingTimeoutTimer);
+					this.pingTimeoutTimer = null;
+				}
+			}, // 封装通用的连接状态校验方法
+			isSocketAvailable() {
+				// WebSocket readyState:0=CONNECTING, 1=OPEN, 2=CLOSING, 3=CLOSED
+				return this.socket && this.isSocketOpen && this.socket.readyState === 1;
+			},
+			// 处理重连逻辑
+			handleReconnect() {
+				if (this.isManualClose) {
+					console.log('手动关闭连接,不进行重连');
+					return;
+				}
+
+				// 防止重复重连
+				if (this.reconnectTimer) {
+					console.log('重连已在进行中,跳过重复重连');
+					return;
+				}
+
+				this.stopHeartBeat();
+
+				// 检查网络状态
+				if (!this.isNetworkAvailable) {
+					console.warn('网络不可用,延迟重连');
+					this.reconnectTimer = setTimeout(() => {
+						this.reconnectTimer = null;
+						this.handleReconnect();
+					}, 5000);
+					return;
+				}
+
+				if (this.reconnectCount < this.maxReconnectAttempts) {
+					this.reconnectCount++;
+
+					// 指数退避算法:基础延迟 * 2^(重连次数-1) + 随机抖动
+					const baseDelay = 1000;
+					const exponentialDelay = baseDelay * Math.pow(2, this.reconnectCount - 1);
+					const jitter = Math.random() * 1000; // 随机抖动,避免同时重连
+					const totalDelay = Math.min(exponentialDelay + jitter, 30000); // 最大30秒
+
+					console.log(`第${this.reconnectCount}次重连,延迟${Math.round(totalDelay)}ms,网络类型:${this.networkType}`);
+
+					this.reconnectTimer = setTimeout(() => {
+						this.reconnectTimer = null; // 清理定时器引用
+						// 重连前再次检查网络状态和连接状态
+						if (this.isNetworkAvailable && !this.isManualClose && !this.isSocketAvailable()) {
+							console.log('开始执行重连...');
+							this.initSocket();
+						} else if (this.isSocketAvailable()) {
+							console.log('连接已恢复,取消重连');
+							this.reconnectCount = 0; // 重置重连计数
+						} else {
+							console.warn('重连时网络不可用或已手动关闭');
+							this.handleReconnect(); // 递归重试
+						}
+					}, totalDelay);
+				} else {
+					console.log(`已达最大重连次数(${this.maxReconnectAttempts}),停止重连`);
+					this.showReconnectFailedMessage();
+				}
+			},
+
+			// 显示重连失败提示
+			showReconnectFailedMessage() {
+				uni.showToast({
+					title: '网络连接异常,请检查网络后重新进入',
+					icon: 'none',
+					duration: 3000
+				});
+			},
+
+			// 统一处理连接错误
+			handleConnectionError(errorType, error) {
+				console.error(`WebSocket ${errorType}:`, error);
+
+				// 根据错误类型进行不同处理
+				if (errorType === '连接请求失败') {
+					// 连接请求失败,可能是网络问题或服务器问题
+					if (!this.isNetworkAvailable) {
+						console.warn('网络不可用,等待网络恢复后重连');
+						return;
+					}
+				}
+
+				// 触发重连
+				this.handleReconnect();
+			},
+			// 重置重连状态
+			resetReconnectState() {
+				this.reconnectCount = 0;
+				this.heartBeatRetryCount = 0;
+
+				// 清理重连定时器
+				if (this.reconnectTimer) {
+					clearTimeout(this.reconnectTimer);
+					this.reconnectTimer = null;
+				}
+
+				// 重置自适应心跳间隔
+				this.adaptiveHeartBeatInterval = this.heartBeatInterval;
+			},
+
+			// 初始化网络状态监听
+			initNetworkStatusListener() {
+				// 获取当前网络状态
+				uni.getNetworkType({
+					success: (res) => {
+						this.networkType = res.networkType;
+						this.isNetworkAvailable = res.networkType !== 'none';
+						console.log('当前网络类型:', res.networkType);
+					}
+				});
+
+				// 监听网络状态变化
+				uni.onNetworkStatusChange((res) => {
+					const oldNetworkType = this.networkType;
+					const oldNetworkAvailable = this.isNetworkAvailable;
+
+					this.networkType = res.networkType;
+					this.isNetworkAvailable = res.isConnected;
+
+					console.log(`网络状态变化: ${oldNetworkType} -> ${res.networkType}, 连接状态: ${res.isConnected}`);
+
+					// 网络从不可用变为可用时,尝试重连
+					if (!oldNetworkAvailable && res.isConnected) {
+						console.log('网络恢复,尝试重连WebSocket');
+						this.resetReconnectState();
+						setTimeout(() => {
+							if (!this.isSocketAvailable()) {
+								this.initSocket();
+							}
+						}, 1000);
+					}
+
+					// 网络类型变化时,调整心跳策略
+					if (oldNetworkType !== res.networkType && res.isConnected) {
+						this.adjustHeartBeatForNetworkType(res.networkType);
+					}
+
+					// 网络断开时停止心跳
+					if (!res.isConnected) {
+						console.warn('网络断开,停止心跳');
+						this.stopHeartBeat();
+					}
+				});
+			},
+
+			// 根据网络类型调整心跳策略
+			adjustHeartBeatForNetworkType(networkType) {
+				let newInterval = this.heartBeatInterval;
+				switch (networkType) {
+					case '2g':
+						newInterval = 30000; // 2G网络,30秒间隔
+						break;
+					case '3g':
+						newInterval = 20000; // 3G网络,20秒间隔
+						break;
+					case '4g':
+					case '5g':
+						newInterval = 15000; // 4G/5G网络,15秒间隔
+						break;
+					case 'wifi':
+						newInterval = 10000; // WiFi网络,10秒间隔
+						break;
+					default:
+						newInterval = 15000; // 默认15秒
+				}
+
+				if (newInterval !== this.adaptiveHeartBeatInterval) {
+					this.adaptiveHeartBeatInterval = newInterval;
+					console.log(`根据网络类型(${networkType})调整心跳间隔为${newInterval}ms`);
+
+					// 如果当前有心跳在运行,重启心跳以应用新间隔
+					if (this.heartBeatTimer && this.isSocketAvailable()) {
+						this.startHeartBeat();
+					}
+				}
+			},
+
+			//输入框
+			inputFocus() {
+				// 立即更新状态,确保UI零延迟响应
+				this.isFocus = true;
+				this.isKeyboardShow = true;
+
+				// 获取容器信息用于调试
+				// this.$nextTick(() => {
+				// 	try {
+				// 		// 获取输入框容器元素信息
+				// 		const query = uni.createSelectorQuery().in(this);
+				// 		query.select('.input-container-optimized').boundingClientRect((data) => {
+				// 			if (data) {
+				// 				console.log('输入框容器当前宽度:', data.width);
+				// 				console.log('输入框容器当前高度:', data.height);
+				// 				console.log('容器位置信息:', data);
+				// 			} else {
+				// 				console.log('未找到输入框容器元素');
+				// 			}
+				// 		}).exec();
+				// 	} catch (error) {
+				// 		console.log('获取容器信息失败:', error);
+				// 	}
+				// });
+			},
+			inputBlur() {
+				this.isFocus = false;
+			},
+
+
+
+
+
+
+
+
+
+
+			// 设置视频当前时间
+			// setVideoCurrentTime(time) {
+			// 	if (!time) return;
+			// 	const videoId = `myVideo_${this.liveId}`;
+			// 	const videoContext = uni.createVideoContext(videoId, this);
+
+			// 	if (videoContext) {
+			// 		videoContext.seek(time);
+			// 		console.log(`设置视频播放位置: ${time}秒`);
+			// 	}
+			// },
+
+			// 保存视频进度
+
+
+			// 点击红包
+			onRed() {
+				if (!this.liveId) return;
+				if (!this.redInfo?.redId) return;
+				if (this.redTimer) {
+					clearInterval(this.redTimer);
+					this.redTimer = null;
+				}
+				let data = {
+					liveId: this.liveId,
+					userId: this.userData.userId,
+					redId: this.redInfo.redId
+				};
+				liveRed(data).then((res) => {
+						this.isShowRed = false;
+						this.redCard = res;
+						this.isShowRedCard = true;
+					},
+					(rej) => {}
+				);
+			},
+			//领取优惠券
+			onCoupon() {
+				if (!this.couponInfo.couponIssueId) return;
+				let data = {
+					goodsId: this.couponInfo.goodsId,
+					couponIssueId: this.couponInfo.couponIssueId,
+					liveId: this.liveId
+				};
+				coupon(data).then((res) => {
+						this.isShowCoupon = false;
+						if (res.code == 200) {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}
+					})
+					.catch((rej) => {});
+			},
+
+			// 我的中奖名单
+			getMyLottery() {
+				this.winning = true;
+				myLottery()
+					.then((res) => {
+						if (res.code == 200) {
+							// console.log("我的中奖名单", res)
+							this.prizeAll = res.data.list || {};
+						} else {}
+					})
+					.catch((rej) => {});
+			},
+			// 抽奖
+			onLottery() {
+				if (!this.lotteryInfo) return;
+
+				let data = {
+					lotteryId: this.lotteryInfo.lotteryId
+				};
+
+				liveLottery(data)
+					.then((res) => {
+						if (res.code == 200) {
+							const resData = res.data || {};
+							this.lotteryList = Array.isArray(resData) ? resData : [];
+							this.lotteryProducts = Array.isArray(resData.products) ? resData.products : [];
+
+							if (resData.duration) {
+								this.isShowLotteryPop = true;
+							}
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+							this.lotteryList = [];
+							this.lotteryProducts = [];
+						}
+					})
+					.catch((rej) => {
+						uni.showToast({
+							title: '获取抽奖信息失败',
+							icon: 'none'
+						});
+						// 失败时强制重置为数组
+						this.lotteryList = [];
+						this.lotteryProducts = [];
+					});
+			},
+			// 参与抽奖
+			onClaim() {
+				let data = {
+					liveId: this.liveId,
+					lotteryId: this.lotteryInfo.lotteryId
+				};
+				claim(data).then(
+					(res) => {
+						if (res.code == 200) {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+							this.isShowLotteryPop = false;
+							this.havePrize = true;
+							uni.setStorageSync('havePrize', this.havePrize);
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}
+					},
+					(rej) => {}
+				);
+			},
+			confirm() {
+				this.isShowPrize = false;
+				this.havePrize = false;
+				uni.setStorageSync('havePrize', this.havePrize);
+			},
+			// 商品收藏
+			onGoodsCollect(item) {
+				if (!item || item.length === 0 || !item.goodsId) {
+					return;
+				}
+				collectGoods(item.goodsId).then(
+					(res) => {
+						if (res.code == 200) {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+							item.isFavorite = !item.isFavorite;
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}
+					},
+					(rej) => {}
+				);
+			},
+			handleGoShopFromCart(item) {
+				this.goShop(item.productId, item.goodsId);
+			},
+			//正在购买
+			getliveOrder(item) {
+				if (!this.liveId) {
+					return;
+				}
+				liveOrderUser(this.liveId).then(
+					(res) => {
+						if (res.code == 200) {
+							this.orderUser = res;
+						} else {
+							console.log('获取正在购买用户失败');
+						}
+					},
+					(rej) => {}
+				);
+			},
+			onLiveStateChange(e, liveItem) {
+				// 可以根据状态码处理不同的直播状态
+				const stateCode = e.detail.code;
+				if (e.detail.code == -2301 || e.detail.code == -2302) {
+					if (this.$refs.liveVideo && this.$refs.liveVideo.playVideo) {
+						this.$refs.liveVideo.playVideo();
+					}
+				} else if (e.detail.code == 2004) {
+					this.calculateTimeDiff(this.liveItem);
+					this.startTrafficCalculation(this.bitrateLive);
+				}
+				// 2001: 已经连接服务器
+				// 2002: 已经连接服务器,开始拉流
+				// 2003: 网络接收到首个视频数据包(IDR)
+				// 2004: 视频播放开始
+				// 2005: 视频播放进度
+				// 2006: 视频播放结束
+				// 2007: 视频播放Loading
+				// 2008: 解码器启动
+				// -2301: 网络断连,且经多次重连抢救无效,更多重试请自行重启播放
+				// -2302: 获取加速拉流地址失败
+			}, // 直播错误事件
+			onLiveError(e, liveItem) {
+				this.videoError(e, liveItem);
+				console.log('错误');
+			},
+			//  红包 卡片 抽奖
+			getCurrentActivities() {
+				if (!this.liveId) return;
+				currentActivities(this.liveId).then(
+					(res) => {
+						if (res.code === 200) {
+							// 提取数据(默认空数组/对象避免报错)
+							this.redInfo = (Array.isArray(res.red) ? res.red : [])[0] || {};
+							this.lotteryInfo = (Array.isArray(res.lottery) ? res.lottery : [])[0] || {};
+							this.goodsCard = res.goods || {};
+							this.notice = res.topMsg || {};
+							this.isShowGoods = this.goodsCard && this.goodsCard.status == 1;
+							this.isShowRed = this.redInfo && this.redInfo.redStatus == 1;
+							this.isShowLottery = this.lotteryInfo && this.lotteryInfo.lotteryStatus == 1;
+							if (this.isShowRed) {
+								this.redTimer = setInterval(() => {
+									const redCountdown = this.handleTime(this.redInfo.updateTime, this.redInfo
+										.duration);
+									if (!redCountdown) {
+										this.isShowRed = false;
+										clearInterval(this.redTimer);
+									}
+								}, 1000);
+							}
+							if (this.notice.msg) {
+								console.log("有》》》》")
+								this.noticeTimer = setInterval(() => {
+									const noticeCountdown = this.handleTime(this.notice.endTime, 0);
+									console.log("出现1>>>", noticeCountdown)
+									if (!noticeCountdown) {
+										this.isShowNotice = false;
+										clearInterval(this.noticeTimer);
+									} else {
+										this.isShowNotice = true
+									}
+								}, 1000);
+							}
+							// 处理抽奖定时器
+							if (this.isShowLottery) {
+								this.lotteryTimer = setInterval(() => {
+									this.countdown = this.handleTime(this.lotteryInfo.updateTime, this
+										.lotteryInfo.duration);
+								}, 1000);
+							}
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							});
+						}
+					},
+					(rej) => {}
+				);
+			},
+
+			// 计算当前时间与 liveItem.startTime 的差值,并更新 totalTime
+			calculateTimeDiff(item) {
+				if (!item.startTime) return;
+				// 提取对应场景的时间字符串(直播用startTime,抽奖用updateTime)
+				let timeStr = item.startTime;
+
+				// 转换时间格式(适配iOS,将 "-" 替换为 "/")
+				const time = new Date(timeStr.replace(/-/g, '/'));
+
+				if (isNaN(time.getTime())) {
+					return;
+				}
+				const now = new Date();
+				let diffMs = Math.max(0, now.getTime() - time.getTime());
+				// 转换为 时:分:秒(补零处理)
+				const totalSeconds = Math.floor(diffMs / 1000);
+				const hours = this.padZero(Math.floor(totalSeconds / 3600));
+				const minutes = this.padZero(Math.floor((totalSeconds % 3600) / 60));
+				const seconds = this.padZero(totalSeconds % 60);
+				this.diffTotalTime = `${hours}:${minutes}:${seconds}`;
+				// this.$set(this.liveItem, "diffMs", diffMs);
+				// this.$set(this.liveItem, "totalSeconds", totalSeconds);
+			},
+
+			padZero(num) {
+				return num < 10 ? `0${num}` : num;
+			},
+			// 启动当前直播间的时间差值定时器
+			startTimeTimer(item) {
+				if (!item) return;
+				// 立即计算一次(避免等待1秒才显示)
+				const totalTime = this.calculateTimeDiff(item);
+				item.timeTimer = setInterval(() => {
+					const totalTime = this.calculateTimeDiff(item);
+				}, 1000);
+			},
+
+			toggleViewerList() {
+				const now = Date.now();
+				if (now - this.lastClickTime > this.clickDelay) {
+					this.showViewerList = !this.showViewerList;
+					if (this.showViewerList) {
+						this.getliveUser(false); // 加载第一页观众
+					}
+					this.lastClickTime = now;
+				}
+			},
+			closeViewerList() {
+				this.showViewerList = false;
+			},
+			openViewerList() {
+				this.$nextTick(() => {
+					this.calculateScrollHeight();
+				});
+			},
+			calculateScrollHeight() {
+				const query = uni.createSelectorQuery().in(this);
+				query.select('.viewer-list-popup').boundingClientRect((data) => {
+					if (data) {
+						this.scrollHeight = data.height - 120; // 减去标题和padding高度
+					}
+				}).exec();
+			},
+
+
+
+			openViews() {
+				// 计算scroll-view高度
+				this.$nextTick(() => {
+					const query = uni.createSelectorQuery().in(this);
+					query
+						.select('.view-box')
+						.boundingClientRect((data) => {
+							if (data) {
+								this.scrollHeight = data.height - 80; // 80是标题高度,120是底部高度
+							}
+						})
+						.exec();
+				});
+			},
+			// 滚动到底部触发
+			handleScrollToLower() {
+				// 清除上一次未执行的定时器,避免重复请求
+				if (this.scrollTimer) {
+					clearTimeout(this.scrollTimer);
+				}
+				// 延迟1秒执行接口请求
+				this.scrollTimer = setTimeout(() => {
+					this.getliveUser(true);
+				}, 1000);
+			},
+			async getLiveMsg(liveItem) {
+				if (!liveItem || !this.liveId) {
+					console.error('getLiveMsg 错误:无效的 liveItem');
+					return;
+				}
+				try {
+					const res = await liveMsg(this.liveId, 30, 1);
+					if (res.code == 200) {
+						const rows = Array.isArray(res.rows) ? res.rows : [];
+						const reversedTalkList = [...rows].reverse();
+						this.talklist = Array.isArray(reversedTalkList) ? reversedTalkList : [];
+						// 获取历史消息后也滚动到底部
+						this.$nextTick(() => {
+							this.scrollToBottom();
+						});
+					} else {
+						this.talklist = [];
+					}
+				} catch (error) {
+					this.talklist = [];
+					console.error('获取聊天记录失败:', error);
+				}
+			},
+			generateRandomChineseName() {
+				const prefixes = [
+					'幸福',
+					'快乐',
+					'安康',
+					'吉祥',
+					'如意',
+					'平安',
+					'健康',
+					'长寿',
+					'福气',
+					'美满',
+					'和谐',
+					'团圆',
+					'富贵',
+					'荣华',
+					'宁静',
+					'淡泊',
+					'知足',
+					'常乐',
+					'悠然',
+					'自在',
+					'夕阳',
+					'晚霞',
+					'金秋',
+					'银发',
+					'老顽童',
+					'开心',
+					'笑口常开',
+					'岁月静好',
+					'云淡风轻',
+					'海阔天空'
+				];
+
+				const suffixes = [
+					'老人',
+					'大爷',
+					'大妈',
+					'爷爷',
+					'奶奶',
+					'伯伯',
+					'阿姨',
+					'前辈',
+					'先生',
+					'女士',
+					'长者',
+					'翁',
+					'婆',
+					'哥',
+					'姐',
+					'友',
+					'客',
+					'迷',
+					'粉丝',
+					'达人',
+					'爱好者',
+					'之家',
+					'之人',
+					'之心',
+					'之情',
+					'之乐',
+					'之旅',
+					'之梦',
+					'之歌',
+					'之韵'
+				];
+
+				const specialNames = [
+					'老有所乐',
+					'知足常乐',
+					'笑看人生',
+					'云淡风轻',
+					'岁月如歌',
+					'夕阳红',
+					'金色年华',
+					'老当益壮',
+					'鹤发童颜',
+					'老骥伏枥',
+					'闲云野鹤',
+					'淡泊明志',
+					'宁静致远',
+					'随遇而安',
+					'顺其自然',
+					'老来俏',
+					'开心果',
+					'老宝贝',
+					'不老松',
+					'常青树'
+				];
+
+				// 30%概率使用特殊网名,70%使用前缀+后缀组合
+				if (Math.random() < 0.3) {
+					return specialNames[Math.floor(Math.random() * specialNames.length)];
+				} else {
+					const prefix = prefixes[Math.floor(Math.random() * prefixes.length)];
+					const suffix = suffixes[Math.floor(Math.random() * suffixes.length)];
+					return prefix + suffix;
+				}
+			},
+			// 获取直播间用户
+			async getliveUser(isLoadMore = false) {
+				this.viewLoading = true;
+				try {
+					const res = await watchUserList(this.liveId, this.viewPageSize, this.viewPageNum, false);
+					if (res.code === 200) {
+						const userRows = Array.isArray(res.rows) ? res.rows : [];
+
+						let array = userRows.map((item) => ({
+							avatar: item.avatar || '',
+							userId: item.userId || '',
+							nickName: item.nickName || '未命名'
+						}));
+
+						// 虚拟数据
+						let virtualData = [];
+						let virtualTotal = res.total * 2 + 50;
+						this.liveUserTotal = virtualTotal;
+						for (let i = 0; i < virtualTotal; i++) {
+							let data = {
+								avatar: '',
+								userId: '8565' + i,
+								nickName: this.generateRandomChineseName()
+							};
+							virtualData.push(data);
+						}
+						this.liveViewersData = [...array, ...virtualData];
+
+						const newRows = Array.isArray(res.rows) ? res.rows : [];
+						const currentViewers = Array.isArray(this.liveViewers) ? this.liveViewers : [];
+
+						let viewlist = isLoadMore ? [...currentViewers, ...newRows] : newRows;
+						this.liveViewers = [...viewlist, ...virtualData];
+						this.viewPageNum++;
+					}
+				} catch (error) {
+					console.error('获取观众列表失败:', error);
+				} finally {
+					this.viewLoading = false;
+				}
+			},
+
+
+			// 显示购买提示信息
+			showPurchaseMessage() {
+				// 清除之前的定时器
+				if (this.purchasePromptTimer) {
+					clearTimeout(this.purchasePromptTimer);
+				}
+
+				// 显示提示
+				this.showPurchasePrompt = true;
+
+				// 2秒后自动隐藏
+				this.purchasePromptTimer = setTimeout(() => {
+					this.showPurchasePrompt = false;
+				}, 2000);
+			},
+
+			//名字超过省略
+			truncateString(str, maxLength) {
+				if (typeof str !== 'string' || str.length <= maxLength) {
+					return str;
+				}
+				return str.slice(0, maxLength) + '...'; // 截断后加省略号
+			},
+			// 跳转页面
+			navgetTo(url) {
+				uni.navigateTo({
+					url: url
+				});
+			},
+			// 修改获取直播信息方法
+			async getliving(liveId) {
+				if (!liveId) return;
+				const param = {
+					id: liveId
+				};
+				try {
+					const res = await getlive(param);
+					if (res.code !== 200) {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						});
+						return;
+					}
+					this.liveItem = Object.assign({}, this.liveItem, res.data);
+					// this.talklist = Array.isArray((res.data || {}).talklist) ? res.data.talklist : [];
+					this.startTimeTimer(this.liveItem);
+					// 清除旧定时器(如预告倒计时)
+					if (this.liveStartTimer) {
+						clearInterval(this.liveStartTimer);
+						this.liveStartTimer = null;
+					}
+					// 逻辑学
+					// res.data.liveType = 1 
+					// res.data.flvHlsUrl='https://live.test.ifeiyu100.com/live/133.flv?txSecret=d95f28727acac2800e9aee9cef98858d&txTime=6943A264'
+					// res.data.status = 2
+					
+					
+					if (res.data.status == 1) {
+						// 直播预告
+						this.liveStartTimer = setInterval(async () => {
+							this.liveCountdown = this.handleTime(res.data.startTime, 0);
+							if (!this.liveCountdown) {
+								uni.removeStorageSync('isAgreement');
+								await this.getliving(this.liveId);
+								clearInterval(this.liveStartTimer);
+							}
+						}, 1000);
+						this.$set(this.liveItem, 'previewUrl', res.data.previewUrl);
+						this.$set(this.liveItem, 'livingUrl', ''); // 清空直播流
+						this.$set(this.liveItem, 'videoUrl', ''); // 清空回放视频
+					} else if (res.data.status == 2) {
+						if (res.data.liveType == 1) {
+							// 直播流
+							let cTime = Math.floor(Math.random() * 10000) + 1;
+							let livingUrl = res.data.flvHlsUrl + '&t=' + cTime;
+							console.log('地址在', this.liveItem.livingUrl);
+							this.$set(this.liveItem, 'livingUrl', livingUrl);
+							this.$set(this.liveItem, 'videoUrl', ''); // 清空回放视频
+							console.log("我在直播>>>")
+						} else if (res.data.liveType === 2) {
+							console.log("我在录播>>>")
+							// 回放视频   2录播 3直播回放
+							// let urlStr = 'https://fs-1319721001.cos.ap-chongqing.myqcloud.com/10%E6%9C%8820%E6%97%A5%20%281%29.m3u8'
+							// this.$set(this.liveItem, 'videoUrl', urlStr);
+							this.$set(this.liveItem, 'videoUrl', res.data.videoUrl);
+							this.$set(this.liveItem, 'livingUrl', '');
+						}
+					} else if (res.data.status == 4 && res.data.liveType == 3) {
+						this.$set(this.liveItem, 'videoUrl', res.data.videoUrl);
+						this.$set(this.liveItem, 'livingUrl', '');
+					} else {
+						// 未开播
+						this.$set(this.liveItem, 'livingUrl', '');
+						this.$set(this.liveItem, 'videoUrl', '');
+					}
+					this.$set(this.liveItem, 'autoplay', res.data.liveType !== 0);
+					this.$set(this.liveItem, 'showType', res.data.showType);
+					this.storeId = res.storeId;
+					this.startLiveViewDataTimer();
+					if (this.$refs.liveVideo && this.$refs.liveVideo.playVideo) {
+						this.$refs.liveVideo.playVideo();
+					}
+				} catch (err) {
+					console.error('获取直播信息失败:', err);
+					uni.showToast({
+						title: '获取直播信息失败',
+						icon: 'none'
+					});
+				}
+			},
+
+			getPureDecimal(num, precision = 6) {
+				const decimalPart = Math.abs(num).toFixed(precision).split('.')[1];
+				return decimalPart?.replace(/0+$/, '') || ''; // 移除末尾多余的0
+			},
+
+			goBack() {
+				// 暂停当前视频
+				if (this.liveItem) {
+					if (this.$refs.liveVideo && this.$refs.liveVideo.pauseVideo) {
+						this.$refs.liveVideo.pauseVideo();
+					}
+				}
+				// 关闭WebSocket连接
+				this.closeWebSocket(true);
+				// 导航返回
+				const pages = getCurrentPages();
+				if (pages.length > 1) {
+					uni.navigateBack();
+				} else {
+					uni.reLaunch({
+						url: '/pages_course/livingList'
+					});
+				}
+			},
+			// 点赞
+			async onLike() {
+				if (!this.liveId) return;
+				try {
+					const res = await liveDataLike(this.liveId);
+					if (res?.like) {
+						this.liveViewData.like++; //只更新当前直播间的点赞数
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						});
+					}
+				} catch (error) {
+					console.error('点赞失败:', error);
+				}
+			},
+
+			//直播间点赞、关注、在线人数数据
+			getliveViewData() {
+				if (!this.liveId) return;
+				getLiveViewData(this.liveId).then((res) => {
+					if (res.code == 200) {
+						// 强制响应式更新,确保数据实时显示
+						this.liveViewData = res;
+					}
+				}).catch((error) => {
+					console.error('获取直播间数据失败:', error);
+					// 失败时兜底,避免显示异常
+					this.liveViewData = {
+						like: 0,
+						watchCount: 0
+					};
+				});
+			},
+			// 30秒刷新一下直播间点赞数
+			startLiveViewDataTimer() {
+				// 先清除旧定时器(防止重复创建)
+				if (this.liveViewDataTimer) {
+					clearInterval(this.liveViewDataTimer);
+					this.liveViewDataTimer = null;
+				}
+				this.getliveViewData();
+				this.liveViewDataTimer = setInterval(() => {
+					// 安全校验:确保liveItem和liveId存在(避免无效请求)
+					if (this.liveId) {
+						this.getliveViewData();
+					}
+				}, 20000);
+			},
+			// 去购买,跳商品详情
+			goShop(productId, goodsId) {
+				if (!this.liveId) return;
+				uni.navigateTo({
+					url: '/pages_shopping/live/goods?productId=' + productId + '&liveId=' + this.liveId +
+						'&goodsId=' + goodsId + '&storeId=' + this.storeId
+				});
+			},
+			// 查询店铺
+			async queryCollect() {
+				this.loadingProducts = true;
+				if (!this.liveId) return;
+				if (this.inputInfo == null) this.inputInfo = '';
+				uni.showLoading({
+					title: '加载中'
+				});
+				try {
+					const res = await liveStore(this.liveId, this.inputInfo);
+					uni.hideLoading();
+					this.shopping = true;
+					if (res.code === 200) {
+						// 数据绑定到当前 liveItem,避免全局污染
+						this.products = Array.isArray(res.data) ? res.data : [];
+					}
+				} catch (error) {
+					console.error('获取小黄车商品失败:', error);
+				} finally {
+					this.loadingProducts = false;
+				}
+			},
+			// 时间戳
+			initTime() {
+				const now = new Date();
+				this.timestamp = now.getTime();
+			},
+			
+			// 如果需要通过ref调用组件方法
+			clearChatInput() {
+				this.$refs.chatInput.clearInput();
+			},
+			openCart() {
+				this.queryCollect();
+			},
+
+			
+			// 关闭小黄车
+			closeShop() {
+				this.shopping = false;
+			},
+			closeMore() {
+				this.isMore = false;
+			},
+			closeWin() {
+				this.winning = false;
+			},
+			// 关闭WebSocket连接(isManual:是否手动关闭)
+			closeWebSocket(isManual = true) {
+				if (!this.socket || !this.isSocketOpen) {
+					console.warn('WebSocket 任务不存在或未打开,无需关闭');
+					return;
+				}
+
+				console.log(`WebSocket连接关闭 - ${isManual ? '手动' : '自动'}`);
+				this.isManualClose = isManual;
+
+				// 清理所有定时器和状态
+				this.cleanupAllResources();
+
+				try {
+					// 先保存引用,避免在关闭过程中被置为null
+					const socketToClose = this.socket;
+					this.socket = null;
+					this.isSocketOpen = false;
+					this.isConnecting = false;
+
+					socketToClose.close({
+						code: 1000,
+						reason: isManual ? '主动关闭' : '异常关闭'
+					});
+					console.log('WebSocket连接已发起关闭');
+				} catch (err) {
+					console.error('关闭WebSocket失败:', err);
+					// 即使关闭失败,也要重置状态
+					this.socket = null;
+					this.isSocketOpen = false;
+					this.isConnecting = false;
+				}
+			},
+
+			// 清理所有资源
+			cleanupAllResources() {
+				// 停止心跳相关
+				this.stopHeartBeat();
+
+				// 清理ping超时定时器
+				if (this.pingTimeoutTimer) {
+					clearTimeout(this.pingTimeoutTimer);
+					this.pingTimeoutTimer = null;
+				}
+
+				// 清理网络状态定时器
+				if (this.networkStatusTimer) {
+					clearTimeout(this.networkStatusTimer);
+					this.networkStatusTimer = null;
+				}
+
+				// 重置重连状态
+				this.resetReconnectState();
+
+				// 重置心跳相关状态
+				this.heartBeatRetryCount = 0;
+				this.lastHeartBeatTime = 0;
+				this.adaptiveHeartBeatInterval = this.heartBeatInterval;
+			},
+			startHeartBeat() {
+				this.stopHeartBeat(); // 先停止现有心跳,防止重复
+				// 使用自适应间隔循环发送心跳
+				this.heartBeatTimer = setInterval(() => {
+					this.sendHeartBeat();
+				}, this.adaptiveHeartBeatInterval);
+			},
+			initSocket() {
+				// 检查是否正在连接中
+				if (this.isConnecting) {
+					console.log('WebSocket正在连接中,跳过重复连接');
+					return;
+				}
+
+				// 检查网络状态
+				if (!this.isNetworkAvailable) {
+					console.warn('网络不可用,延迟WebSocket连接');
+					// 使用定时器而不是递归调用,避免内存泄漏
+					if (!this.networkRetryTimer) {
+						this.networkRetryTimer = setTimeout(() => {
+							this.networkRetryTimer = null;
+							this.initSocket();
+						}, 3000);
+					}
+					return;
+				}
+
+				// 如果已经存在连接且状态为open,则退出
+				if (this.socket && this.socket.readyState === 1) {
+					console.log('WebSocket连接已存在且正常,无需重新连接');
+					// 重置重连计数
+					this.reconnectCount = 0;
+					return;
+				}
+
+				// 关闭现有连接
+				if (this.socket && (this.socket.readyState === 0 || this.socket.readyState === 1)) {
+					console.log('关闭现有WebSocket连接,创建新连接');
+					this.closeWebSocket(false); // 非手动关闭
+					// 等待一小段时间确保连接完全关闭
+					setTimeout(() => {
+						this.createWebSocketConnection();
+					}, 100);
+					return;
+				}
+
+				this.createWebSocketConnection();
+			},
+			createWebSocketConnection() {
+				// 校验必要参数
+				if (!this.liveId) {
+					console.error('缺失直播间ID,无法初始化WebSocket');
+					return;
+				}
+				if (!this.userData || !this.userData.userId) {
+					console.error('用户信息缺失,无法初始化WebSocket');
+					return;
+				}
+
+				// 设置连接状态
+				this.isConnecting = true;
+				this.isSocketOpen = false;
+
+				// 记录连接开始时间(性能监控)
+				this.connectionStartTime = Date.now();
+
+				// 清除之前的重连定时器
+				this.resetReconnectState();
+
+				setTimeout(() => {
+					this.getliveUser(false);
+				}, 200);
+
+				const now = new Date();
+				this.timestamp = now.getTime(); // 生成签名
+				const signature = CryptoJS.HmacSHA256(
+					`${this.liveId}${this.userData.userId}${this.userType}${this.timestamp}`, this.timestamp.toString()
+				).toString(CryptoJS.enc.Hex);
+
+				try {
+					const baseWsUrl = 'wss://im.fhhx.runtzh.com/ws/app/webSocket';
+					//const baseWsUrl = 'wss://api.fhhx.runtzh.com/ws/app/webSocket';
+					// const baseWsUrl = 'ws://192.168.10.166:7114/ws/app/webSocket';
+					let wsUrl =
+						`${baseWsUrl}?userId=${this.userData.userId}&liveId=${this.liveId}&userType=${this.userType}&timestamp=${this.timestamp}&signature=${signature}`;
+					if (this.qrFrom) {
+						wsUrl += this.qrFrom;
+					}
+
+					console.log("qxj wsUrl", wsUrl);
+					// console.log(`尝试连接WebSocket: ${wsUrl.replace(/signature=[^&]+/, 'signature=***')}`);
+					const socketTask = uni.connectSocket({
+						url: wsUrl,
+						success: () => {
+							console.log("WebSocket连接请求发送成功");
+						},
+						fail: (err) => {
+							console.error('WebSocket连接请求失败:', err);
+							this.isConnecting = false;
+							this.handleConnectionError('连接请求失败', err);
+						}
+					});
+
+					// 连接打开事件
+					socketTask.onOpen((res) => {
+						console.log("WebSocket连接已打开");
+						this.socket = socketTask;
+						this.isConnecting = false;
+						this.isSocketOpen = true;
+
+						// 计算连接延迟(性能监控)
+						if (this.connectionStartTime > 0) {
+							this.connectionLatency = Date.now() - this.connectionStartTime;
+							console.log(`WebSocket连接延迟: ${this.connectionLatency}ms`);
+						}
+
+						this.reconnectCount = 0;
+						this.resetReconnectState();
+						this.heartBeatRetryCount = 0; // 重置心跳重试次数
+						this.shownEntryUsers.clear(); // 重连后重置进入提示记录
+
+						// 连接成功后显示提示(仅首次连接)
+						if (this.reconnectCount === 0) {
+							console.log('WebSocket连接建立成功');
+						} else {
+							console.log(`WebSocket重连成功(第${this.reconnectCount}次尝试)`);
+						}
+						this.startHeartBeat();
+
+					});
+
+					// 消息接收事件
+					socketTask.onMessage((res) => {
+						// 消息计数(性能监控)
+						this.messageCount++;
+						try {
+							const data = JSON.parse(res.data);
+							// 处理服务端心跳响应 - 修复:后端返回的是heartBeat而不是heartBeatAck
+							if (!!data.data && data.data.cmd === 'heartbeat') {
+								// console.log('收到心跳响应:', data.data);
+								// 清除ping超时定时器
+								if (this.pingTimeoutTimer) {
+									clearTimeout(this.pingTimeoutTimer);
+									this.pingTimeoutTimer = null;
+								}
+								// 重置心跳重试次数
+								this.heartBeatRetryCount = 0;
+								// 更新网络状态为良好
+								this.adjustHeartBeatInterval(true);
+								return;
+							}
+							this.handleSocketMessage(res);
+
+						} catch (err) {
+							console.error('消息解析异常:', err);
+							this.errorCount++; // 错误计数
+						}
+					});
+					// 连接错误事件
+					socketTask.onError((err) => {
+						console.error('WebSocket连接错误:', err);
+						this.errorCount++; // 错误计数
+						this.isSocketOpen = false;
+						this.isConnecting = false;
+						this.stopHeartBeat();
+						this.handleConnectionError('连接错误', err);
+					});
+
+					// 连接关闭事件
+					socketTask.onClose((res) => {
+						console.log('WebSocket连接关闭:', res);
+						this.isSocketOpen = false;
+						this.isConnecting = false;
+						this.stopHeartBeat(); // 清除心跳定时器
+
+						// 根据关闭原因决定是否重连
+						if (!this.isManualClose) {
+							if (res.code === 1000) {
+								console.log('WebSocket正常关闭,不进行重连');
+							} else {
+								console.warn(`WebSocket异常关闭 (code: ${res.code}, reason: ${res.reason})`);
+								this.handleReconnect();
+							}
+						} else {
+							console.log('WebSocket手动关闭,不进行重连');
+						}
+					});
+				} catch (e) {
+					console.error('创建WebSocket异常:', e);
+					this.handleReconnect();
+				}
+			},
+			handleTime(time, duration) {
+				let timeStamp;
+
+				if (typeof time === 'number' && time > 0 && time < 9999999999999) {
+					timeStamp = time;
+				} else if (typeof time === 'string' && time.trim() !== '') {
+					// 手动解析 CST 时间字符串
+					const match = time.match(/^(\w{3}) (\w{3}) (\d{1,2}) (\d{1,2}):(\d{2}):(\d{2}) CST (\d{4})$/);
+
+					if (match) {
+						const [, day, month, date, hours, minutes, seconds, year] = match;
+
+						// 月份映射
+						const monthMap = {
+							'Jan': 0,
+							'Feb': 1,
+							'Mar': 2,
+							'Apr': 3,
+							'May': 4,
+							'Jun': 5,
+							'Jul': 6,
+							'Aug': 7,
+							'Sep': 8,
+							'Oct': 9,
+							'Nov': 10,
+							'Dec': 11
+						};
+
+						// 创建日期对象(CST 是 UTC+8,与中国时区一致)
+						const jsDate = new Date(
+							parseInt(year),
+							monthMap[month],
+							parseInt(date),
+							parseInt(hours),
+							parseInt(minutes),
+							parseInt(seconds)
+						);
+						timeStamp = jsDate.getTime();
+					} else {
+						// 如果不是预期格式,回退到普通解析
+						const date = new Date(time);
+						if (!isNaN(date.getTime())) {
+							timeStamp = date.getTime();
+						} else {
+							console.error('无效的日期格式:', time);
+							return false;
+						}
+					}
+				} else {
+					console.error('time参数必须是有效的时间戳(数字)或日期字符串');
+					return false;
+				}
+
+				const targetTimestamp = timeStamp + duration * 60 * 1000;
+				const currentTimestamp = Date.now();
+				const timeDiffMs = targetTimestamp - currentTimestamp;
+
+				if (timeDiffMs <= 0) {
+					return false;
+				}
+
+				const hours = Math.floor(timeDiffMs / (1000 * 60 * 60));
+				const minutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));
+				const seconds = Math.floor((timeDiffMs % (1000 * 60)) / 1000);
+
+				const formatNum = (num) => num.toString().padStart(2, '0');
+				return {
+					hours: formatNum(hours),
+					minutes: formatNum(minutes),
+					seconds: formatNum(seconds)
+				};
+			},
+			// 限制聊天消息数量,防止内存泄漏
+			addToTalkList(message) {
+				// 减少最大消息数量,提升iPhone性能
+				const MAX_TALK_ITEMS = 30;
+
+				// 直接操作数组,避免创建新数组
+				if (!Array.isArray(this.talklist)) {
+					this.talklist = [];
+				}
+
+				const wasAtLimit = this.talklist.length >= MAX_TALK_ITEMS;
+				//console.log(`添加消息前: 当前消息数量=${this.talklist.length}, 是否达到限制=${wasAtLimit}`);
+
+				// 检查是否是自己发送的消息
+				const isMyMessage = message.userId === this.userData.userId;
+				//console.log(`消息来源: ${isMyMessage ? '自己' : '他人'}, userId=${message.userId}`);
+
+				// 给消息添加唯一ID
+				try {
+					message.uniqueId = ++this.messageIdCounter;
+
+					// 安全解析 JSON
+					let msgdata = {};
+					try {
+						msgdata = JSON.parse(message.data);
+					} catch (e) {
+						console.warn('JSON解析失败:', e);
+						msgdata = {};
+					}
+
+					message.msgId = msgdata.msgId || Date.now();
+					this.talklist.push(message);
+
+				} catch (error) {
+					console.error('处理消息时出错:', error);
+				}
+
+				// 当消息超过限制时,批量删除旧消息
+				if (this.talklist.length > MAX_TALK_ITEMS) {
+					const removeCount = this.talklist.length - MAX_TALK_ITEMS;
+					//console.log(`消息超过限制,删除前${removeCount}条旧消息`);
+					this.talklist.splice(0, removeCount);
+				}
+				//console.log(`添加消息后: 当前消息数量=${this.talklist.length}`);
+
+				// 强制触发视图更新
+				this.$forceUpdate();
+
+				// 使用单次nextTick确保DOM更新后再滚动
+				this.$nextTick(() => {
+					this.forceScrollToBottomOnSend();
+					// if (isMyMessage) {
+					// 	// 如果是自己发送的消息,强制滚动到底部
+					// 	console.log('自己的消息,执行强制滚动');
+					// 	this.forceScrollToBottomOnSend();
+					// } else {
+					// 	// 如果是他人的消息,使用普通滚动(有防抖)
+					// 	console.log('他人的消息,执行普通滚动');
+					// 	this.simpleScrollToBottom();
+					// }
+				});
+			},
+			// 处理Socket消息
+			async handleSocketMessage(message) {
+				try {
+					let data = JSON.parse(message.data);
+					const socketMessage = data.data; // 服务端返回的消息体
+					//console.log("qxj handleSocketMessage socketMessage",socketMessage);
+					if (data.code == 200) {
+						const messageData = {
+							...socketMessage,
+							cmd: socketMessage.cmd || '', // 确保cmd字段存在
+							ts: Date.now() // 时间戳
+						};
+						// 处理服务端返回的sendMsg消息,加入本地列表
+						if (socketMessage.cmd == 'sendMsg') {
+							if (!this.isSocketAvailable()) {
+								uni.showToast({
+									title: '连接已断开,正在重试...',
+									icon: 'none'
+								});
+								this.handleReconnect();
+								return;
+							}
+							this.addToTalkList(messageData);
+						} else if (socketMessage.cmd == 'red') {
+							const redData = socketMessage.data ? JSON.parse(socketMessage.data) : {};
+							this.redInfo = redData || {};
+							this.isShowRed = socketMessage.status === 1;
+							if (this.isShowRed) {
+								this.redTimer = setInterval(() => {
+									const redCountdown = this.handleTime(this.redInfo.updateTime, this.redInfo
+										.duration);
+									if (!redCountdown) {
+										this.isShowRed = false;
+										clearInterval(this.redTimer);
+									}
+								}, 1000);
+							}
+						} else if (socketMessage.cmd == 'goods') {
+							const goodsData = socketMessage.data ? JSON.parse(socketMessage.data) : {};
+							this.goodsCard = goodsData || {};
+							this.isShowGoods = socketMessage.status == 1;
+						} else if (socketMessage.cmd == 'coupon') {
+							const couponData = socketMessage.data ? JSON.parse(socketMessage.data) : {};
+							this.couponInfo = couponData || {};
+							this.isShowCoupon = socketMessage.status === 1;
+							if (this.isShowCoupon) {}
+						} else if (socketMessage.cmd == 'likeDetail') {
+							this.liveViewData.like = socketMessage.data;
+						} else if (socketMessage.cmd == 'lottery') {
+							const lotteryData = socketMessage.data ? JSON.parse(socketMessage.data) : {};
+							this.lotteryInfo = lotteryData || {};
+							this.isShowLottery = socketMessage.status === 1;
+							if (socketMessage.status != 1) {
+								this.isShowLotteryPop = false;
+							}
+							// 清除已有定时器(无论状态是否为1,先清掉旧的)
+							clearTimeout(this.lotteryTimer);
+							if (this.isShowLottery) {
+								this.lotteryTimer = setInterval(() => {
+									this.countdown = this.handleTime(this.lotteryInfo.updateTime, this
+										.lotteryInfo.duration);
+									if (!this.countdown) {
+										console.log('倒计时', this.countdown);
+										this.isShowLottery = false;
+										this.isShowLotteryPop = false;
+										clearInterval(this.lotteryTimer);
+									}
+								}, 1000);
+							} else {
+								this.isShowLottery = false;
+							}
+						} else if (socketMessage.cmd == 'deleteMsg') {
+							const index = this.talklist.findIndex(item => item.msgId == socketMessage.msg);
+							if (index !== -1) {
+								this.talklist.splice(index, 1);
+							}
+						} else if (socketMessage.cmd == 'globalVisible') {
+							//  status = 1的时候,用户消息自可见,其他消息丢失}
+
+						} else if (socketMessage.cmd == 'singleVisible') {
+							//status = 1的时候,用户消息自可见,其他消息丢失
+
+						} else if (socketMessage.cmd == 'entry') {
+							try {
+								if (!this.liveUserCalled) {
+									await this.getliveUser(false);
+									this.liveUserCalled = true;
+								}
+								const userIdToEntry = socketMessage.userId;
+								const existingIndex = this.liveViewersData.findIndex((item) => item.userId ===
+									userIdToEntry);
+
+								if (existingIndex === -1) {
+									const liveViewers = {
+										userId: socketMessage.userId,
+										nickName: socketMessage.nickName,
+										avatar: socketMessage.avatar
+									};
+									this.liveViewersData.push(liveViewers);
+									this.liveUserTotal++;
+								}
+
+								// 解析用户ID(根据实际接口字段调整,此处假设data含userId)
+								const userData = JSON.parse(socketMessage.data || '{}');
+								const userId = userData.userId || socketMessage.userId; // 兼容不同字段
+								if (!userId) return; // 无用户ID不处理
+
+								// 仅新用户(未显示过)才触发提示
+								if (!this.shownEntryUsers.has(userId)) {
+									this.inAndOut = socketMessage;
+									this.showWelcomeMessage = true;
+									this.shownEntryUsers.add(userId); // 加入已显示集合
+
+									// 3秒后隐藏提示(可调整时长)
+									if (this.welcomeTimer) clearTimeout(this.welcomeTimer);
+									this.welcomeTimer = setTimeout(() => {
+										this.showWelcomeMessage = false;
+									}, 3000);
+								}
+							} catch (err) {
+								console.error('解析entry用户数据失败:', err);
+							}
+						} else if (socketMessage.cmd == 'out') {
+							if (this.liveUserTotal > 0) {
+								const userIdToRemove = socketMessage.userId;
+								const index = this.liveViewersData.findIndex((item) => item.userId === userIdToRemove);
+								if (index !== -1) {
+									this.liveViewersData.splice(index, 1);
+									this.liveUserTotal--; // 根据userId删除对应的用户数据
+								}
+							}
+							this.inAndOut = socketMessage;
+							this.showWelcomeMessage = true;
+
+							// 3秒后隐藏提示
+							if (this.welcomeTimer) clearTimeout(this.welcomeTimer);
+							this.welcomeTimer = setTimeout(() => {
+								this.showWelcomeMessage = false;
+							}, 3000);
+						} else if (socketMessage.cmd == 'sendTopMsg') {
+							clearInterval(this.noticeTimer);
+							console.log("公告消息>>>>", socketMessage)
+							const noticeData = socketMessage.data ? JSON.parse(socketMessage.data) : {};
+							this.notice = noticeData || {};
+							this.isShowNotice = true
+							if (this.isShowNotice) {
+								this.noticeTimer = setInterval(() => {
+									const noticeCountdown = this.handleTime(this.notice.endTime, 0);
+									if (!noticeCountdown) {
+										this.isShowNotice = false;
+										clearInterval(this.noticeTimer);
+									}
+								}, 1000);
+							}
+
+						} else if (socketMessage.cmd == 'live_start' || socketMessage.cmd == 'live_end') {
+							// 开始直播,关闭直播
+							if (this.liveStartTimer) {
+								clearInterval(this.liveStartTimer);
+								this.liveStartTimer = null;
+							}
+							if (this.redTimer) {
+								clearInterval(this.redTimer);
+								this.redTimer = null;
+							}
+							//  请求最新直播间数据
+							await this.getliving(this.liveId);
+						} else if (socketMessage.cmd == 'Integral') {
+							this.integral = {
+								msg: socketMessage.msg,
+								status: true
+							};
+						} else if (socketMessage.cmd == 'LotteryDetail') {
+							try {
+								this.prizeInfo = Array.isArray(JSON.parse(socketMessage.data || '[]')) ? JSON.parse(
+									socketMessage.data || '[]') : [];
+							} catch (err) {
+								console.error('解析抽奖结果失败:', err);
+								this.prizeInfo = [];
+							}
+							this.isShowPrize = true;
+							this.isShowLottery = false;
+							this.isShowLotteryPop = false;
+						} else if (socketMessage.cmd == 'blockUser') {
+							uni.removeStorage({
+								key: 'AppToken',
+								success: () => {
+									uni.reLaunch({
+										url: '/pages/auth/login'
+									});
+								}
+							});
+						}
+					} else {
+						uni.showToast({
+							title: data.msg,
+							icon: 'none'
+						});
+					}
+				} catch (error) {
+					console.error('Socket消息处理失败:', error);
+				}
+			},
+			onBarrage(item) {
+				// 防止连续点击发送两次(800ms短时锁定)
+				if (this.isSending) return;
+				this.isSending = true;
+				setTimeout(() => {
+					this.isSending = false;
+				}, 800);
+				const text = (item || '').trim();
+				if (!text) {
+					uni.showToast({
+						title: '不能发送空消息',
+						icon: 'none'
+					});
+					return;
+				}
+				if (!this.isSocketAvailable()) {
+					if (retries > 0) {
+						uni.showToast({
+							title: `连接不稳定,正在重试(${retries}次)...`,
+							icon: 'none'
+						});
+						// 延迟500ms重试,重试次数减1
+						setTimeout(() => this.sendMsg(retries - 1), 500);
+					} else {
+						uni.showToast({
+							title: '连接已断开,发送失败',
+							icon: 'none'
+						});
+					}
+					return;
+				}
+				const liveId = this.liveId;
+				// 构造发送给服务端的消息数据
+				const data = {
+					liveId,
+					userId: this.userData.userId,
+					userType: 0,
+					cmd: 'sendMsg',
+					msg: text,
+					nickName: this.userData.nickname || '未命名',
+					avatar: this.userData.avatar || '/static/images/avatar.png'
+				};
+				// 发送socket消息
+				try {
+					this.socket.send({
+						data: JSON.stringify(data),
+						success: () => {
+							// 发送成功后强制滚动到底部,无论当前滚动位置如何
+							this.forceScrollToBottomOnSend();
+						},
+						fail: (err) => {
+							console.error('消息发送失败:', err);
+							if (retries > 0) {
+								uni.showToast({
+									title: `发送失败,正在重试(${retries}次)`,
+									icon: 'none'
+								});
+								setTimeout(() => this.sendMsg(retries - 1), 500);
+							} else {
+								uni.showToast({
+									title: '发送失败,请稍后再试',
+									icon: 'none'
+								});
+							}
+						}
+					});
+				} catch (err) {
+					console.error('发送消息异常:', err);
+					if (retries > 0) {
+						setTimeout(() => this.sendMsg(retries - 1), 500);
+					} else {
+						uni.showToast({
+							title: '发送失败,请稍后再试',
+							icon: 'none'
+						});
+					}
+				}
+			},
+			sendMsg(retries = 1) {
+				// 防止连续点击发送两次(800ms短时锁定)
+				if (this.isSending) return;
+				this.isSending = true;
+				setTimeout(() => {
+					this.isSending = false;
+				}, 800);
+				const text = (this.value || '').trim();
+				if (!text) {
+					uni.showToast({
+						title: '不能发送空消息',
+						icon: 'none'
+					});
+					return;
+				}
+				if (!this.isSocketAvailable()) {
+					if (retries > 0) {
+						uni.showToast({
+							title: `连接不稳定,正在重试(${retries}次)...`,
+							icon: 'none'
+						});
+						// 延迟500ms重试,重试次数减1
+						setTimeout(() => this.sendMsg(retries - 1), 500);
+					} else {
+						uni.showToast({
+							title: '连接已断开,发送失败',
+							icon: 'none'
+						});
+						this.value = text; // 恢复输入框内容
+					}
+					return;
+				}
+				const liveId = this.liveId;
+				this.value = ''; // 立即清空输入框
+				// 构造发送给服务端的消息数据
+				const data = {
+					liveId,
+					userId: this.userData.userId,
+					userType: 0,
+					cmd: 'sendMsg',
+					msg: text,
+					nickName: this.userData.nickname || '未命名',
+					avatar: this.userData.avatar || '/static/images/avatar.png'
+				};
+				// 发送socket消息
+				try {
+					this.socket.send({
+						data: JSON.stringify(data),
+						success: () => {
+							this.value = '';
+							// 发送成功后强制滚动到底部,无论当前滚动位置如何
+							this.forceScrollToBottomOnSend();
+						},
+						fail: (err) => {
+							console.error('消息发送失败:', err);
+							if (retries > 0) {
+								uni.showToast({
+									title: `发送失败,正在重试(${retries}次)`,
+									icon: 'none'
+								});
+								setTimeout(() => this.sendMsg(retries - 1), 500);
+							} else {
+								uni.showToast({
+									title: '发送失败,请稍后再试',
+									icon: 'none'
+								});
+								this.value = text; // 恢复输入框内容
+							}
+						}
+					});
+				} catch (err) {
+					console.error('发送消息异常:', err);
+					if (retries > 0) {
+						setTimeout(() => this.sendMsg(retries - 1), 500);
+					} else {
+						uni.showToast({
+							title: '发送失败,请稍后再试',
+							icon: 'none'
+						});
+						this.value = text;
+					}
+				}
+			},
+			// formatUserNum() {
+
+			// 	let userTotal = 0;
+			// 	if (!this.liveUserTotal) {
+			// 		this.liveUserTotal = 0;
+			// 	}
+			// 	if (this.liveUserTotal > 0) {
+			// 		userTotal = this.liveUserTotal = 0;
+			// 	}
+			// 	if (this.liveUserTotal > 10000) {
+			// 		userTotal = (this.liveUserTotal / 10000.0).toFixed(1);
+			// 		userTotal = userTotal + "万";
+			// 	}
+			// 	console.log("qxj userTotal", userTotal);
+			// 	return userTotal;
+			// }
+
+		},
+
+
+	};
+</script>
+
+<style scoped lang="scss">
+	/* 输入框容器GPU加速优化 */
+	.input-container-optimized {
+		transform: translateZ(0);
+		will-change: transform;
+		backface-visibility: hidden;
+		perspective: 1000px;
+		/* 强制GPU加速,避免重排重绘 */
+	}
+
+
+	/* 聊天区域容器优化 */
+	.chat-area-container {
+		position: fixed;
+		width: 100%;
+		bottom: 0;
+		z-index: 999;
+		transform: translateZ(0);
+		will-change: transform;
+		backface-visibility: hidden;
+	}
+
+	.barrage {
+		background: rgba(0, 0, 0, 0.3);
+		padding: 12rpx 20rpx;
+		color: #fff;
+		margin: 30rpx 20rpx 0 20rpx;
+		border-radius: 30rpx;
+		white-space: nowrap;
+	}
+
+	.chat-area-focused {
+		transform: translateY(calc(-1 * var(--keyboard-height, 0rpx))) translateZ(0);
+		z-index: 1000;
+	}
+
+	.chat-content {
+		height: 36vh;
+		overflow: hidden;
+		padding-left: 20rpx;
+		transform: translateZ(0);
+		will-change: height;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.chat-content-focused {
+		height: 64rpx;
+	}
+
+	.notice-message {
+		// flex: 1;
+		// position: absolute;
+		// bottom: 30vh;
+		max-width: 80%;
+		padding: 24rpx;
+		background: linear-gradient(135deg,
+				rgba(255, 220, 41, 0.8) 0%,
+				rgba(218, 187, 30, 0.4) 100%);
+		margin-bottom: 10rpx;
+		border-radius: 20rpx;
+		color: #ffffff;
+	}
+
+
+	/* 输入框性能优化 */
+	.input-optimized {
+		border: none !important;
+		font-size: 32rpx !important;
+		color: #ffffff !important;
+		background: transparent !important;
+		width: 70% !important;
+		transform: translateZ(0);
+		will-change: contents, width;
+		backface-visibility: hidden;
+		/* 移除transition动画,避免闪动 */
+		/* GPU加速,优化输入性能 */
+	}
+
+	/* 输入框焦点状态 - 100%宽度 */
+	.input-container-optimized .input-optimized.input-focused,
+	.input-optimized.input-focused {
+		width: auto !important;
+		flex: 1 !important;
+		min-width: 0 !important;
+		margin-left: 10rpx !important;
+		max-width: none !important;
+		/* 使用flex:1让输入框占据剩余空间,减少左边距 */
+	}
+
+	/* 输入框容器焦点状态优化 */
+	.input-container-optimized.input-container-focused,
+	.input-container-focused {
+		width: calc(100% - 20rpx) !important;
+		max-width: calc(100% - 20rpx) !important;
+		min-width: calc(100% - 20rpx) !important;
+		margin-right: 20rpx !important;
+		padding: 10rpx 10rpx 10rpx 20rpx !important;
+		justify-content: flex-start !important;
+		gap: 20rpx !important;
+		flex: 1 !important;
+		flex-grow: 1 !important;
+		flex-shrink: 0 !important;
+		flex-basis: calc(100% - 20rpx) !important;
+		/* 焦点状态下改变布局方式,让输入框可以扩展,保持右边距 */
+	}
+
+
+	.skeleton-item {
+		display: flex;
+		padding: 20rpx;
+		background: #fff;
+		margin-bottom: 16rpx;
+		border-radius: 16rpx;
+	}
+
+	.skeleton-img {
+		width: 200rpx;
+		height: 200rpx;
+		background: #f0f0f0;
+		border-radius: 8rpx;
+		margin-right: 24rpx;
+		animation: pulse 1.5s ease-in-out infinite;
+	}
+
+	.skeleton-content {
+		flex: 1;
+	}
+
+	.skeleton-line {
+		height: 20rpx;
+		background: #f0f0f0;
+		margin-bottom: 16rpx;
+		border-radius: 4rpx;
+		animation: pulse 1.5s ease-in-out infinite;
+	}
+
+	.skeleton-line.short {
+		width: 60%;
+	}
+
+	.skeleton-line.medium {
+		width: 80%;
+	}
+
+	.skeleton-line.long {
+		width: 95%;
+	}
+
+	@keyframes pulse {
+		0% {
+			opacity: 1;
+		}
+
+		50% {
+			opacity: 0.5;
+		}
+
+		100% {
+			opacity: 1;
+		}
+	}
+
+	::v-deep .u-icon--right {
+		justify-content: flex-end !important;
+	}
+
+	// 无头像用户文字样式
+	.text-white {
+		color: #ffffff;
+	}
+
+	.text-xs {
+		font-size: 18rpx;
+	}
+
+	.text-sm {
+		font-size: 24rpx;
+	}
+
+	.w52,
+	.w72 {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.swiper-wrapper {
+		position: relative;
+		width: 100%;
+		height: 100vh;
+		overflow: hidden;
+		background-color: #000000;
+
+		.live-bg {
+			position: absolute;
+			top: 0;
+			width: 100%;
+			height: 100%;
+		}
+
+		.container {
+			width: 100%;
+			height: 100%;
+			position: relative;
+			transition: opacity 0.3s ease;
+			transform: translateZ(0);
+			will-change: opacity;
+		}
+	}
+
+	.welcome-message {
+		width: 100%;
+		color: white;
+		border-radius: 20px;
+		z-index: 10;
+		transition: opacity 0.3s ease;
+	}
+
+
+
+	/* 减少重绘和重排 */
+	.talk-list,
+	.viewer-item,
+	.message-item {
+		will-change: transform;
+		contain: layout style paint;
+		backface-visibility: hidden;
+		transform: translateZ(0);
+	}
+
+	.talk-list {
+		will-change: transform; // 提示浏览器优化
+		contain: layout style paint; // 限制渲染范围
+		max-width: 100%;
+		border-radius: 30rpx;
+		background: rgba(0, 0, 0, 0.3);
+		padding: 10rpx 30rpx;
+	}
+
+	.talk-item {
+		line-height: 1.4;
+		word-break: break-all;
+		word-wrap: break-word;
+		overflow-wrap: break-word;
+	}
+
+	.content {
+		position: relative;
+		z-index: 2;
+		height: 100%;
+		width: 100%;
+		top: 0;
+		left: 0;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+
+		.activity-box {
+			position: fixed;
+			top: 188rpx;
+			left: 30rpx;
+			z-index: 999999;
+			display: flex;
+			align-items: center;
+
+			.item-box {
+				-webkit-transform: translateZ(0);
+				/* 硬件加速 */
+				transform: translateZ(0);
+				border-radius: 16rpx;
+				background-color: rgba(77, 77, 77, 0.5);
+				width: 90rpx;
+				height: 100rpx;
+				margin-right: 20rpx;
+				position: relative;
+				z-index: 999;
+
+				.tip {
+					position: absolute;
+					width: 100%;
+					bottom: 0;
+					color: #fafcff;
+					font-size: 26rpx;
+					background-color: rgba(15, 15, 15, 0.8);
+					border-radius: 16rpx;
+					text-align: center;
+				}
+
+				.item {
+					margin: 0 auto;
+					padding: 10rpx 0;
+
+					.img {
+						height: 100%;
+					}
+				}
+			}
+		}
+
+		.complaint-box {
+			width: 140rpx;
+			margin-top: 20rpx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			background: rgba(0, 0, 0, 0.3);
+			padding: 16rpx 0;
+			color: #fff;
+			border-radius: 28rpx;
+			z-index: 999;
+		}
+
+		.end {
+			display: flex;
+			flex-direction: column;
+			align-items: flex-end;
+		}
+
+		// 减少重绘
+		.side-group,
+		.content-top {
+			will-change: transform;
+		}
+
+		.side-group {
+			position: absolute;
+			top: 52%;
+			right: 24rpx;
+			z-index: 1000;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+
+			.side-item {
+				font-weight: 500;
+				font-size: 22rpx;
+				color: #ffffff;
+				margin-bottom: 26rpx;
+				text-align: center;
+
+				.button-reset::after {
+					border: none !important;
+					padding: 0 !important;
+					margin: 0 !important;
+				}
+
+				.button-reset {
+					background-color: transparent !important;
+					padding: 0 !important;
+					line-height: 1 !important;
+					margin: 0 !important;
+					width: auto !important;
+
+					font-weight: 500 !important;
+					border-radius: none !important;
+				}
+
+				.image {
+					width: 72rpx;
+					height: auto;
+				}
+			}
+		}
+
+		.top2 {
+			top: 65%;
+		}
+
+		.top3 {
+			top: 55%;
+		}
+
+		.content-top {
+			width: 100%;
+			margin-top: 48rpx;
+			display: flex;
+			justify-content: space-between;
+			padding: 0 24rpx;
+			box-sizing: border-box;
+
+			.sum {
+				width: 80rpx;
+				height: 52rpx;
+				background: rgba(0, 0, 0, 0.5);
+				border-radius: 26rpx 26rpx 26rpx 26rpx;
+				font-size: 30rpx;
+				color: #ffffff;
+				text-align: center;
+				line-height: 52rpx;
+			}
+		}
+
+		.follow-btn {
+			padding: 8rpx 16rpx;
+			background: linear-gradient(270deg, #ff5c03 0%, #ffac64 100%);
+			border-radius: 26rpx;
+			font-weight: 500;
+			font-size: 26rpx;
+			color: #ffffff;
+		}
+	}
+
+	.prize-card {
+		width: 504rpx;
+		padding: 40rpx 40rpx 30rpx;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
+		border-radius: 20rpx;
+		align-items: center;
+		background: linear-gradient(180deg, #f7823f 0%, #ffd4be 27%, #ffffff 100%);
+		position: relative;
+
+		.nav-img {
+			width: 311rpx;
+			position: absolute;
+			top: -122rpx;
+			left: 50%;
+			transform: translateX(-50%);
+		}
+
+		.title {
+			color: #c32008;
+			font-size: 34rpx;
+			font-weight: 600;
+			margin: 20rpx 0 40rpx;
+		}
+
+		.prize-content {
+			width: 100%;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			font-size: 28rpx;
+			margin: 10rpx 0;
+
+			.txt {
+				font-weight: 600;
+			}
+		}
+
+		.tip {
+			font-size: 28rpx;
+			color: #414141;
+			margin: 40rpx 0;
+		}
+
+		.button {
+			width: 200rpx;
+			height: 70rpx;
+			line-height: 70rpx;
+			background: linear-gradient(180deg, #ff7c30 0%, #ff3a1e 100%);
+			border-radius: 28rpx;
+			font-weight: 500;
+			font-size: 32rpx;
+			color: #ffffff;
+			text-align: center;
+		}
+	}
+
+	.no-prize-card {
+		width: 504rpx;
+		padding: 40rpx 40rpx 30rpx;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
+		border-radius: 20rpx;
+		align-items: center;
+		position: relative;
+
+		.img {
+			margin-top: 40rpx;
+			width: 300rpx;
+			height: 300rpx;
+		}
+
+		.tip {
+			font-size: 36rpx;
+			color: #414141;
+			margin: 40rpx 0;
+		}
+
+		.button {
+			width: 220rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			background: linear-gradient(180deg, #fdfbb8 0%, #b79243 100%);
+			border-radius: 28rpx;
+			font-weight: 500;
+			font-size: 32rpx;
+			color: #ffffff;
+			text-align: center;
+		}
+	}
+
+	.red-card {
+		width: 550rpx;
+		height: 636rpx;
+		position: relative;
+
+		.img {
+			position: absolute;
+			width: 100%;
+			height: 100%;
+		}
+
+		.red-content {
+			position: relative;
+			z-index: 5;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+
+			.title {
+				font-size: 36rpx;
+				color: #ff3a1e;
+				margin: 180rpx 0 90rpx;
+			}
+
+			.txt {
+				font-size: 28rpx;
+				color: #ffecc3;
+				margin: 80rpx 0 40rpx;
+			}
+
+			.button {
+				width: 392rpx;
+				height: 96rpx;
+				line-height: 96rpx;
+				background: linear-gradient(180deg, #fff4d5 0%, #ffe5b1 100%);
+				border-radius: 48rpx 48rpx 48rpx 48rpx;
+				font-weight: 600;
+				font-size: 36rpx;
+				color: #c32008;
+				text-align: center;
+			}
+		}
+	}
+
+	.integral-box {
+		min-width: 400rpx;
+		max-width: 600rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		border-radius: 20rpx;
+		overflow: hidden;
+
+		.top {
+			width: 100%;
+			position: relative;
+
+			.title {
+				width: 100%;
+				font-weight: 600;
+				font-size: 40rpx;
+				color: #ffffff;
+				text-shadow: 0px 4px 8px rgba(255, 89, 2, 0.8);
+				position: absolute;
+				top: 50rpx;
+				text-align: center;
+			}
+
+			.photo {
+				width: 100%;
+			}
+		}
+
+		.item {
+			padding: 20rpx;
+
+			.title {
+				font-weight: 500;
+				font-size: 32rpx;
+				text-align: center;
+			}
+
+			.button {
+				font-size: 32rpx;
+				margin-top: 20rpx;
+				background: linear-gradient(270deg, #ff4702 0%, #fe6304 100%);
+				color: #fff;
+				text-align: center;
+				padding: 18rpx 60rpx;
+				border-radius: 10rpx;
+				font-weight: 500;
+			}
+		}
+	}
+
+	.coupon-pop {
+		position: fixed;
+		bottom: 140rpx;
+		right: 100rpx;
+		z-index: 5;
+		border-radius: 20rpx;
+		width: 320rpx;
+
+		.coupon-block {
+			width: 100%;
+			position: relative;
+
+			.item {
+				width: 100%;
+				position: absolute;
+				top: 20rpx;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				color: #fff;
+
+				.title {
+					font-weight: 500;
+					font-size: 30rpx;
+					margin: 16rpx 0 12rpx;
+				}
+
+				.price {
+					font-size: 40rpx;
+
+					.bold {
+						font-size: 56rpx;
+						font-weight: 600;
+					}
+				}
+
+				.txt {
+					font-weight: 500;
+					font-size: 30rpx;
+					margin: 5rpx 0;
+				}
+
+				.button {
+					background: linear-gradient(270deg, #fffce1 0%, #ffeaaf 100%);
+					color: #ff0004;
+					text-align: center;
+					padding: 16rpx 0;
+					border-radius: 40rpx;
+					font-weight: 500;
+					font-size: 30rpx;
+					width: 70%;
+					margin-top: 26rpx;
+				}
+			}
+
+			.bg {
+				height: 452rpx;
+				width: 100%;
+			}
+
+			.nav {
+				position: absolute;
+				height: 120rpx;
+				top: -120rpx;
+				left: 0;
+				width: 100%;
+				z-index: 6;
+			}
+
+			.close {
+				position: absolute;
+				right: 10rpx;
+				top: 10rpx;
+			}
+		}
+	}
+
+	.list {
+		width: 80%;
+		margin-bottom: 20rpx;
+		animation: simpleFade 0.2s;
+	}
+
+	@keyframes simpleFade {
+		from {
+			opacity: 0;
+		}
+
+		to {
+			opacity: 1;
+		}
+	}
+
+	.shop-prompt {
+		width: auto;
+		display: inline-flex !important;
+		max-width: max-content;
+		padding: 6rpx 20rpx;
+		background: rgba(230, 154, 34, 0.7);
+		border-radius: 24rpx;
+		z-index: 9;
+		font-weight: 500;
+		color: #ffffff;
+		transition: opacity 0.3s ease;
+	}
+
+	.view-box {
+		position: relative;
+		height: 40vh;
+		padding: 40rpx 0rpx;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
+
+		.scroll-content {
+			flex: 1;
+			margin-top: 50rpx;
+			overflow-y: auto;
+			padding: 0 40rpx;
+		}
+
+		.bottom {
+			padding: 20rpx 40rpx;
+			position: absolute;
+			bottom: 0;
+			width: 100%;
+			box-shadow: 0rpx -4rpx 10rpx 0rpx rgba(195, 195, 195, 0.3);
+			background: #fff;
+		}
+	}
+
+	// 抽奖
+	.prize-box {
+		position: relative;
+
+		.nav-img {
+			width: 311rpx;
+			position: absolute;
+			top: -122rpx;
+			left: 50%;
+			transform: translateX(-50%);
+		}
+
+		.bg-img {
+			position: absolute;
+			top: 0;
+			left: 0;
+			width: 100%;
+			height: 100%;
+			z-index: 1;
+		}
+
+		.prize-content {
+			position: relative;
+			z-index: 2;
+			padding: 24rpx 0 68rpx;
+
+			.item {
+				flex: 1;
+				text-align: center;
+			}
+
+			.white-item {
+				width: 40rpx;
+				height: 40rpx;
+				text-align: center;
+				overflow: hidden;
+				background: #ffffff;
+				box-shadow: inset 0rpx 2rpx 8rpx 0rpx #ffebb2;
+				border-radius: 8rpx;
+				margin: 4rpx;
+				font-weight: 600;
+				font-size: 24rpx;
+				color: #f85d22;
+				line-height: 40rpx;
+			}
+
+			.item-group {
+				width: 100%;
+			}
+
+			.point-group {
+				margin: 20rpx 0 50rpx;
+				display: flex;
+				gap: 6rpx;
+
+				.item {
+					width: 20rpx;
+					height: 8rpx;
+					background: rgba(255, 255, 255, 0.5);
+					border-radius: 4rpx 4rpx 4rpx 4rpx;
+				}
+
+				.selected {
+					background: #ffeb66;
+				}
+			}
+
+			.button {
+				margin-top: 30rpx;
+				width: 520rpx;
+				height: 88rpx;
+				line-height: 88rpx;
+				background: linear-gradient(180deg, #fff4d6 0%, #ffeb66 100%);
+				box-shadow: 0rpx 10rpx 8rpx 4rpx rgba(246, 82, 25, 0.5);
+				border-radius: 44rpx;
+				font-weight: 500;
+				font-size: 36rpx;
+				color: #f4410b;
+				text-align: center;
+			}
+		}
+	}
+
+	
+	.more-block {
+		border-radius: 20rpx 0 0 20rpx;
+		padding: 70rpx 30rpx;
+		display: flex;
+		justify-content: space-between;
+
+		.item {
+			text-align: center;
+		}
+	}
+</style>

File diff suppressed because it is too large
+ 923 - 578
pages_course/living.vue


+ 4 - 2
pages_course/livingold.vue

@@ -209,7 +209,8 @@
 							<view class="send" @click="sendMsg()">发送</view>
 						</view>
 						<view class="justify-between  align-center" v-if="!isFocus">
-							<view :class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-bg','ml20']" @click="isMore=true,shopping=false">
+							<view :class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-bg','ml20']"
+								@click="isMore=true,shopping=false">
 								<image src="/static/images/more-icon.png" class="w48 h48" />
 							</view>
 						</view>
@@ -332,7 +333,8 @@
 						<view class="txt item">{{item.prizeLevel}}等奖</view>
 					</view>
 					<view class="tip">请填写收货地址,主播将会将奖品发给您</view>
-					<view class="button" @click="navgetTo('/pages_shopping/live/confirmCreateOrder&type=win'),confirm()">填写地址</view>
+					<view class="button"
+						@click="navgetTo('/pages_shopping/live/confirmCreateOrder&type=win'),confirm()">填写地址</view>
 				</view>
 				<view class="no-prize-card" v-else>
 					<image class="img" src="/static/images/no-prize.png" mode="widthFix" />

+ 0 - 161
pages_course/reward.vue

@@ -1,161 +0,0 @@
-<template>
-	<view class="answerPopup-box bg">
-		<!-- 正确 -->
-		<image class="tipimg" src="https://zkzh-2025.oss-cn-beijing.aliyuncs.com/shop/images/course_answer_img.png"
-			mode="aspectFill"></image>
-		<view class="answerPopup-title">恭喜你,回答正确</view>
-		<view class="answerPopup-desc">您有一份奖励待领取哦</view>
-		<view class="answerPopup-btn" @click="handleReceive">领取</view>
-		<!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
-	</view>
-</template>
-
-<script>
-	// import wx from 'jweixin-module';
-	// import { initJssdk } from "@/utils/common.js"
-	export default {
-		data() {
-			return {
-				mchId:'',
-				packageInfo: ''
-			}
-		},
-		methods: {
-			handleReceive() {
-				this.packageInfo = uni.getStorageSync('receive_package') || ''
-				this.mchId = uni.getStorageSync('mchId') || ''
-				// this.initWXConfig(this.packageInfo)
-				this.$nextTick(()=>{
-					this.handleTest()
-				})
-			},
-			handleTest() {
-				const that = this
-				// console.log(that.mchId)
-				// console.log('wx3de90a39feb8107a',wx.getAccountInfoSync().miniProgram.appId)
-				// console.log(that.packageInfo)
-				if (wx.canIUse('requestMerchantTransfer')) {
-				  wx.requestMerchantTransfer({
-				    mchId:that.mchId,
-				    appId:wx.getAccountInfoSync().miniProgram.appId,
-				    package:that.packageInfo,
-				    success: (res) => {
-				    },
-				    fail: (res) => {
-				    },
-				  });
-				} else {
-				  wx.showModal({
-				    content: '你的微信版本过低,请更新至最新版本。',
-				    showCancel: false,
-				  });
-				}
-				// wx.ready(() => {
-				// 	// config信息验证后会执行ready方法,所有接口调用都必须在config之后
-				// 	wx.checkJsApi({
-				// 		jsApiList: ['requestMerchantTransfer'],
-				// 		success: function(res) {
-				// 			if (res.checkResult['requestMerchantTransfer']) {
-				// 				WeixinJSBridge.invoke('requestMerchantTransfer', {
-				// 						mchId: that.mchId,
-				// 						appId: appId,
-				// 						package: packageVal,
-				// 					},
-				// 					function(res) {
-				// 						if (res.err_msg === 'requestMerchantTransfer:ok') {
-				// 							// res.err_msg将在页面展示成功后返回应用时返回success,并不代表付款成功
-				// 						}
-				// 					}
-				// 				);
-				// 			} else {
-				// 				alert('你的微信版本过低,请更新至最新版本。');
-				// 			}
-				// 		}
-				// 	});
-				// });
-				// wx.error(function(res){
-				//   // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
-				// });
-			},
-			initWXConfig(packageVal) {
-				const isWechat = String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
-				if(isWechat) {
-					let url = window.location.href.split('#')[0]
-					initJssdk((data)=>{
-						this.handleTest(packageVal,data.appId,data.mchId)
-					},url)
-				} else {
-					uni.showToast({
-						title: '请在微信浏览器中打开'
-					})
-				}
-			}
-		}
-	}
-</script>
-
-<style scoped lang="scss">
-	@mixin u-flex($flexD, $alignI, $justifyC) {
-		display: flex;
-		flex-direction: $flexD;
-		align-items: $alignI;
-		justify-content: $justifyC;
-	}
-	.footer-tips {
-		width: 100%;
-		position: absolute;
-		left: 0;
-		bottom: 14rpx;
-		text-align: center;
-		font-family: PingFang SC,PingFang SC;
-		font-weight: 500;
-		font-size: 12px;
-		color: #bbb;
-	}
-	.answerPopup {
-		&-box {
-			width: 100%;
-			height: 100vh;
-			background: linear-gradient(180deg, #FFFAF6 50%, #FEECD8 100%);
-			background-color: #fff;
-			font-weight: 400;
-			box-sizing: border-box;
-			position: relative;
-			@include u-flex(column, center, center);
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-	
-			.tipimg {
-				width: 206rpx;
-				height: 206rpx;
-				margin-bottom: 16rpx;
-			}
-		}
-	
-		&-title {
-			font-weight: 600;
-			font-size: 36rpx;
-			color: #222222;
-		}
-	
-		&-desc {
-			margin-top: 30rpx;
-			font-size: 28rpx;
-			color: #757575;
-		}
-	
-		&-btn {
-			width: 464rpx;
-			height: 84rpx;
-			margin-top: 10vh;
-			margin-bottom: 16vh;
-			background: #FF5C03;
-			border-radius: 42rpx;
-			font-weight: 500;
-			font-size: 32rpx;
-			color: #FFFFFF;
-			text-align: center;
-			line-height: 84rpx;
-		}
-	}
-</style>

+ 0 - 2135
pages_course/video.vue

@@ -1,2135 +0,0 @@
-<template>
-	<view class="content">
-		<view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
-			<view class="arrow-left-warning" @click="feedback">
-				<image :src="baseUrl+'/app/image/warning.png'"></image>
-				<text>投诉</text>
-			</view>
-			<view class="header-title" :style="{width:menuButtonLeft + 'px',height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">{{courseInfo.title}}</view>
-		</view>
-		<view class="video-box">
-			<image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
-			</image>
-			<video 
-			@timeupdate="onTimeUpdate" 
-			@progress="progressChange" 
-			@error="videoErrorCallback" 
-			@play="getPlay"
-			@pause="getPause" 
-			@ended="getEnded" 
-			@fullscreenchange="fullscreenchange"
-			@controlstoggle="controlstoggle"
-			@waiting="getWaiting"
-			:title="courseInfo.title"
-			style="width: 100%;height: 420rpx;" 
-			:poster="poster"  
-			id="video-content-box"  
-			controls
-			:show-fullscreen-btn="true"
-			:auto-pause-if-open-native="true"
-			:auto-pause-if-navigate="true"
-			:enable-progress-gesture="false" 
-			:show-progress="true"
-			:picture-in-picture-mode="[]"
-			:show-background-playback-button="false"
-			:src="videoUrl"
-			>
-			<!-- :danmu-list="danmuList"
-			enable-danmu
-			danmu-btn -->
-			<!-- 弹幕展示 -->
-			<template v-if="showDanmu==1&&openCommentStatus==2">
-				<text v-for="(item, index) in activeDanmus" :key="item.commentId" class="danmu-item danmuMove"
-					:style="item.danmustyle" @animationend="animationend(item,index)">
-					{{ item.content }}
-				</text>
-			</template>
-				<cover-view class="video-danmu-btnbox" :style="{display: openCommentStatus==2&&isfull&&crtShow&&isLogin&&isAddKf==1 ? 'block':'none'}">
-					<cover-image class="video-danmu-image"
-					 :src="baseUrl+'/app/image/danmu_set.png'"
-					 @click="openDanmu(1)"></cover-image>
-				</cover-view>
-			</video>
-		</view>
-		<!-- 弹幕方法 -->
-		<commentBox
-			v-if="openCommentStatus==2"
-			ref="danmuBox" 
-			:height="height" 
-			:urlOption="urlOption" 
-			:time="playTime"
-			:showDanmu="showDanmu"
-			:viewCommentNum="viewCommentNum"
-			:openCommentStatus="openCommentStatus"
-			@setInputText="setInputText" 
-			@getScrollTop="getScrollTop"
-			@getMore="getMore"
-			@getActiveDanmus="getActiveDanmus"></commentBox>
-		<view id="title-contentnav">
-			<view class="title-content" v-if="openCommentStatus!=1">
-				<!-- 答题时展示小节课程名,其他展示课程名 -->
-				<!-- 小节课程名 -->
-				<view class="subtitlebox" v-if="isLogin&&isAddKf==1">
-					{{courseInfo.title|| ''}}
-				</view>
-				<!-- 课程名字 -->
-				<view class="miantitlebox" v-else>
-					{{courseInfo.courseName|| ''}}
-				</view>
-				<!-- 投诉 -->
-				<!-- <view class="warning" @click="feedback" v-if="isLogin&&videoId">
-					<image :src="baseUrl+'/app/image/warning.png'"></image>
-					<text>投诉</text>
-				</view> -->
-			</view>
-			<view class="tabbox-bar" v-if="openCommentStatus==1">
-				<view class="tabbox">
-					<view :class="currentTab == nav.id ? 'tabbox-active':''" v-for="nav in navList" :key="nav.id" @click="handleTab(nav.id)">{{nav.name}}</view>
-				</view>
-				<!-- 投诉 -->
-				<!-- <view class="warning" @click="feedback">
-					<image :src="baseUrl+'/app/image/warning.png'"></image>
-					<text>投诉</text>
-				</view> -->
-			</view>
-		</view>
-		<scroll-view
-		class="scroll-view" 
-		:style="{height: height}" 
-		:scroll-top="scrollTop" 
-		:scroll-y="true" 
-		:refresher-enabled="currentTab == 2"
-		:refresher-triggered="triggered"
-		@refresherrefresh="handleRefresher">
-			<template v-if="openCommentStatus==1">
-				<view v-show="currentTab==0">
-					<descInfoNav ref="descInfoNav" :isLogin="isLogin" :isAddKf="isAddKf" :courseInfo="courseInfo"></descInfoNav>
-				</view>
-				<view v-show="currentTab==2">
-					<commentBox 
-					ref="commentBox" 
-					:height="height" 
-					:urlOption="urlOption" 
-					:time="playTime"
-					:flagTime="flagTime"
-					:showDanmu="showDanmu"
-					:viewCommentNum="viewCommentNum"
-					:openCommentStatus="openCommentStatus"
-					@setInputText="setInputText" 
-					@getScrollTop="getScrollTop"
-					@getMore="getMore"></commentBox>
-				</view>
-			</template>
-			<view v-show="currentTab==1">
-				<template v-if="openCommentStatus!=1">
-					<!-- 介绍 -->
-					<descInfo ref="descInfo" :isLogin="isLogin" :isAddKf="isAddKf" :courseInfo="courseInfo"></descInfo>
-				</template>
-				<!-- 问题 -->
-				<template v-if="isLogin&&isAddKf==1">
-					<ques ref="ques" :quesList="quesList" :openCommentStatus="openCommentStatus" @handleAnswer="handleAnswer"></ques>
-				</template>
-			</view>
-		</scroll-view>
-		<!-- 线路 -->
-		<view class="video-line" v-if="isLogin&&isAddKf==1" @click="openPop">
-			<image :src="baseUrl+'/app/image/changePlayer-icon.png'"></image>
-			<text>线路{{numberToChinese(lineIndex + 1)}}</text>
-		</view>
-		<!-- 线路弹窗 -->
-		<uni-popup ref="popup" type="bottom"  class="full-width-popup">
-			<view class="popupbox">
-				<view class="popupbox-head">
-					<text>线路选择</text>
-					<image class="close-icon" :src="baseUrl+'/app/image/tc_close_icon.png'" mode="aspectFill" @click="close">
-					</image>
-				</view>
-				<view class="popupbox-content">
-					<view :class="lineIndex == index ? 'line-item line-active': 'line-item'"
-						v-for="(it,index) in lineList" :key="index" @click="handleLine(index)">
-						线路{{numberToChinese(index + 1)}}</view>
-				</view>
-			</view>
-		</uni-popup>
-		<!-- 发送弹幕 -->
-		<view class="video-line danmu-line" v-if="isLogin&&isAddKf==1&&openCommentStatus==2" @click="openDanmu(0)" >
-			<image class="set_image" :src="baseUrl+'/app/image/danmu_set_black'" mode="aspectFill"></image>
-			<text>发弹幕</text>
-		</view>
-		<!-- 发送弹幕弹窗 -->
-		<uni-popup ref="danmuPopup" type="bottom" style="z-index: 999;" @change="changeShowPopup">
-			<view class="danmuPopup" :style="{marginLeft:isfull ? statusBarHeight+'px': 0,marginBottom: danmuboxHeight+'px'}">
-				<view class="danmuPopup-head border-line">
-					<image class="danmu-icon" :src="showDanmu==0?baseUrl+'/app/image/danmu-off.png':baseUrl+'/app/image/danmu-on.png'" mode="heightFix" @click="switchDanmu()"></image>
-					<view class="u-border">
-						<u-input 
-						class="danmuPopup-input" 
-						placeholder="发个弹幕吧~" 
-						border="border"
-						:focus="focus"
-						:adjustPosition="false" 
-						:autoBlur="true" 
-						maxlength="50"
-						v-model.trim="inputText">
-						</u-input>
-						<text style="font-size: 24rpx;color: #bbb;margin-left: 10rpx;">{{inputText?inputText.trim().length:0}}/50</text>
-					</view>
-					<button class="danmuPopup-send" @click="handleChatInput">发送</button>
-				</view>
-			</view>
-		</uni-popup>
-		<!-- 答题弹窗 -->
-		<uni-popup ref="answerPopup" type="center" :show="answerPopup">
-			<view :class="errTitle == '恭喜你,回答正确' ? 'answerPopup-box bg':'answerPopup-box'">
-				<!-- 正确 -->
-				<image class="tipimg" v-if="errTitle == '恭喜你,回答正确'" :src="baseUrl+'/app/image/course_answer_img.png'"
-					mode="aspectFill"></image>
-				<!-- 错误 -->
-				<image class="tipimg" v-else :src="baseUrl+'/app/image/course_answer_incorrectly_img.png'" mode="aspectFill">
-				</image>
-				<view class="answerPopup-title">{{errTitle}}</view>
-				<view class="answerPopup-desc" v-html="errDesc"></view>
-				<!-- 选择奖励 -->
-				<view class="reward-list" v-if="errTitle == '恭喜你,回答正确'">
-					<radio-group class="reward-list-group" @change="rewardChange">
-						<label class="reward-list-option" v-for="(item, index) in rewardType" :key="item.value">
-							<radio :value="item.value+ ''" :checked="item.value == currentReward"
-								activeBorderColor="#FF5C03" activeBackgroundColor="#FF5C03"
-								style="transform:scale(0.7)" />
-							<view :style="{color: item.value == currentReward ? '#FF5C03':''}">{{item.name}}</view>
-						</label>
-					</radio-group>
-				</view>
-				<!-- 错误题目 -->
-				<view class="errQuesbox" v-if="errQues&&errQues.length>0">
-					<view class="errQuesbox-item textOne" v-for="(it,index) in errQues" :key="index">{{it.title}}</view>
-				</view>
-				<view class="answerPopup-btn" v-if="errTitle == '恭喜你,回答正确'" @click="closeAnswerPopup">确认</view>
-				<view class="tipsPopup-btn-box" v-else
-					:style="{marginTop: errQues&&errQues.length>0 ? '40rpx':'54rpx'}">
-					<view class="tipsPopup-btn" @click="closeAnswerPopup">{{remain > 0 ? '重新答题': '确认'}}</view>
-				</view>
-			</view>
-		</uni-popup>
-		<!-- 客服二维码弹窗 -->
-		<uni-popup ref="kfPopup" type="center" :mask-click="false">
-			<view class="kfqrcode-box">
-				<image class="kfqrcode" :src="qrcode" show-menu-by-longpress="true"></image>
-				<view v-show="qrcodeMsg" style="margin-top: 30rpx;" v-html="qrcodeMsg"></view>
-				<image class="kfqrcode-close" :src="baseUrl+'/app/image/course_close_white_icon.png'" mode="aspectFill"
-					@click="closeKFPop"></image>
-			</view>
-		</uni-popup>
-		<!-- 可以答题提示 -->
-		<view class="answerTip" v-if="currentTab!=1&&openCommentStatus==1&&showAnswerTip" @click="handleTab(1)">
-			可以答题啦
-		</view>
-		<!-- footer -->
-		<view class="footer" v-show="currentTab!=2&&videoId">
-			<view class="footer-btn" v-if="!isLogin || isAddKf !=1" @click="submit">
-				<text>立即学习</text>
-			</view>
-			<view v-if="isLogin&&isAddKf==1&&currentTab==1&&quesList&&quesList.length>0" class="footer-btn footer-btn-border" @click="submit">
-				<!-- <image class="footer-btn-img" :src="baseUrl+'/app/image/red_envelope_btnimg.png'" mode="aspectFill"></image> -->
-				<text>提交答案领取奖励</text>
-			</view>
-			<!-- <view @click="checked=!checked" class="agreement" v-if="!isLogin">
-				<radio value="r1" :checked="checked" color="#ff5c03" activeBorderColor="#ff5c03"
-					style="transform:scale(0.6);" />
-				<view>阅读并同意<text style="color: #ff5c03;" @click.stop="goWeb(0)">《用户协议》</text>和<text
-						style="color: #ff5c03;" @click.stop="goWeb(1)">《隐私协议》</text></view>
-			</view> -->
-			<!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
-		</view>
-		<view v-show="currentTab==2">
-			<view class="chatinput" :style="{bottom:danmuboxHeight>0?danmuboxHeight+'px':'calc(var(--window-bottom) + 24rpx)'}">
-				<input class="uni-input" v-model.trim="inputText" :adjustPosition="false" :autoBlur="false" maxlength="140" placeholder="发消息···" confirm-type="send" @confirm="handleChatInput" />
-				<button class="send" @click="handleChatInput">发送</button>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import { mapGetters } from 'vuex';
-	import ques from "./components/ques.vue"
-	import descInfo from "./components/descInfo.vue"
-	import descInfoNav from "./components/descInfoNav.vue"
-	import commentBox from "./components/commentBox.vue"
-	import dayjs from 'dayjs';
-	import {
-		getErrMsg,
-		getH5CourseByVideoId,
-		getH5CourseVideoDetails,
-		courseAnswer,
-		getFinishCourseVideo,
-		getIsAddKf,
-		internetTraffic,
-		getIntegralByH5Video,
-		sendReward,
-		loginByMp,
-		getRealLink,
-		errorLogUpload,
-	} from "@/api/course.js"
-	import {handleFsUserWx} from '@/api/courseLook.js'
-	export default {
-		components: {
-			descInfoNav,
-			descInfo,
-			commentBox,
-			ques,
-		},
-		data() {
-			return {
-				baseUrl:uni.getStorageSync('requestImagesPath'),
-				// 1 红包 2 积分
-				rewardType: [{
-					name: '红包奖励',
-					value: 1
-				}, {
-					name: '积分奖励',
-					value: 2
-				}],
-				currentReward: 1,
-				player: null,
-				loading: true,
-				progress: 0,
-				code: null,
-				statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
-				scrollTop: 0,
-				height: '0px',
-				isLogin: false,
-				videoUrl: "",
-				videoId: "",
-				//现在的时长
-				playTime: 0,
-				//总时长
-				duration: 0,
-				playDuration: 0,
-				// 用于续播
-				playDurationSeek: 0,
-				// 温馨提醒时间节点,
-				tipsTime: 0,
-				tipsOpen: false,
-				config: {},
-				courseInfo: {},
-				quesList: [],
-				lineList: [],
-				// 错题
-				errQues: [],
-				// 答题机会
-				remain: 0,
-				errTitle: "",
-				errDesc: "",
-				showPlay: true,
-				showControls: false,
-				playStatus: "",
-				isfull: false,
-				isAddKf: 0,
-				lineIndex: 0,
-				textHeight: 0, //文本高度
-				qwUserId: "",
-				qrcode: "",
-				corpId: "",
-				qrcodeMsg: "",
-				urlOption: {},
-				bufferRate: 0, // 缓冲时间
-				uuId: "",
-				isEnded: false,
-				// 是否允许拖动进度条
-				linkType: 0,
-				ip: null,
-				checked: true,
-				isFinish: 0, // 是否完课
-				interval: null,
-				intervalIntegral: null, // 积分定时
-				options: {
-					sources: [{
-						src: ""
-					}],
-					poster: "",
-					live: false /* 是否直播 */ ,
-					controls: true,
-					autoplay: false,
-					licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323137866_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl,
-					LicenseKey: 'bcc5bd9a14b798b48c52ff005a21d926',
-					controlBar: {
-						volumePanel: false,
-						playbackRateMenuButton: false,
-						QualitySwitcherMenuButton: false,
-						// progressControl: false
-					},
-					plugins: {
-						// ProgressMarker: false,
-						ContextMenu: {
-							statistic: false
-						}
-					},
-				},
-				poster: "",
-				// 错误请求次数
-				errorCount: 0,
-				answerPopup: false,
-				sortLink:"",
-				// 课程是否过期
-				isExpire: false,
-				menuButtonLeft: 281,
-				menuButtonH: 45,
-				timer: null,
-				flag: false,
-				focus: false,
-				openDanmuType: 0,
-				danmuboxHeight: 0,
-				user: {},
-				crtShow: true,
-				// 是否获取到对应观看者的真实链接
-				isCheckRealUrl: false,
-				courseLogo: '',
-				isfull: false,
-				navList:[{
-					id: 0,
-					name: '介绍'
-				},{
-					id: 1,
-					name: '答题'
-				},{
-					id: 2,
-					name: '评论'
-				}],
-				currentTab: 1,
-				triggered: false,
-				// 没有更多
-				isMore: false,
-				inputText:"",
-				// 获取最多历史评论条数
-				viewCommentNum: 200,
-				// 1-开启评论;2-开启弹幕;3-关闭
-				openCommentStatus: 3,
-				showAnswerTip: false,
-				showDanmu: 1,
-				activeDanmus:[],
-				flagTime: 0,
-				projectCode:''
-			}
-		},
-		computed:{
-			...mapGetters(['coureLogin']),
-		},
-		watch: {
-		    coureLogin: {
-		      immediate: true,          // 页面一进入就检查一次
-		      handler(val) {
-		        if (val == 2&&this.isLogin) {
-					console.log("看课AppToken失效,请重新登录")
-					this.isLogin = false
-					this.isAddKf = 0
-					this.goLogin()
-		        }
-		      }
-		    }
-		},
-		onLoad(option) {
-			console.log("onLoad===")
-			this.urlOption = option.course ? JSON.parse(option.course) : {}
-			this.videoId = this.urlOption.videoId || ''
-			this.qwUserId = this.urlOption.qwUserId || ''
-			this.corpId = this.urlOption.corpId || ''
-			this.linkType = this.urlOption.linkType || 0
-			this.projectCode = this.urlOption.projectCode || ''
-			this.sortLink = this.urlOption.link || ''
-			
-			uni.$on('usercode',(data)=>{
-				if(data) {
-					this.code=data.code
-					this.goLogin(data)
-				}
-			})
-			this.getMenuButton()
-			// #ifndef H5
-			uni.onKeyboardHeightChange(this.keyboardHeightChange);
-			// #endif
-		},
-		onShow() {
-			console.log("==onShow===")
-			this.baseUrl=uni.getStorageSync('requestImagesPath')
-			this.tipsOpen = false
-			this.uuId = this.utils.generateRandomString(16)
-			if(uni.getStorageSync('auto_userInfo') && JSON.stringify(uni.getStorageSync('auto_userInfo'))!='{}') {
-				this.user = JSON.parse(uni.getStorageSync('auto_userInfo'))
-			} else {
-				this.user = {}
-			}
-			if(!this.sortLink||!this.projectCode){
-				uni.showToast({
-					title: '链接有误',
-					icon: 'none'
-				});
-				return
-			} 
-			this.utils.getDomain({projectCode:this.projectCode}).then(res=>{
-				if(res.code == 200) {
-					if (this.videoId) {
-						this.getH5CourseByVideo()
-					}
-					if(this.sortLink){
-						this.getLink()
-					}
-				}
-			})
-		},
-		mounted() {
-			this.getIP()
-			this.getHeight()
-		},
-		onHide() {
-			// this.player = uni.createVideoContext('video-content-box');
-			if (this.player) {
-				this.player.pause()
-			}
-			// if (this.interval != null) {
-			// 	clearInterval(this.interval)
-			// 	this.interval = null
-			// }
-		},
-		onUnload() {
-			uni.$off('usercode')
-			if (this.interval != null) {
-				clearInterval(this.interval)
-				this.interval = null
-			}
-			this.clearIntegral()
-			// #ifndef H5
-			uni.offKeyboardHeightChange(this.keyboardHeightChange);
-			// #endif
-		},
-		beforeDestroy() {
-			uni.$off('usercode')
-			this.player = uni.createVideoContext('video-content-box');
-			if (this.player) {
-				this.player.stop()
-				this.player = null
-			}
-			if (this.interval != null) {
-				clearInterval(this.interval)
-				this.interval = null
-			}
-			this.clearIntegral()
-			// #ifndef H5
-			uni.offKeyboardHeightChange(this.keyboardHeightChange);
-			// #endif
-		},
-		methods: {
-			numberToChinese(number) {
-				if (number) {
-					const chineseNumber = ['一', '二', '三', '四', '五', '六', '七', '八', '九'];
-					return chineseNumber[number - 1];
-				} else {
-					return ''
-				}
-			},
-			keyboardHeightChange(res) {
-				// #ifndef H5
-				console.log("this.danmuboxHeight",this.danmuboxHeight)
-				 this.danmuboxHeight = res.height
-				// #endif
-			},
-			getMenuButton(){
-				const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
-				this.menuButtonLeft = menuButtonInfo.left
-				this.menuButtonH = menuButtonInfo.height
-			},
-			//播放时间更新事件方法
-			onTimeUpdate(e){
-				let currentTime = Math.round(e.detail.currentTime)
-				if (this.playDurationSeek > 0) {
-					this.playTime = this.playDurationSeek
-					this.throttle(() => this.changeTime(this), 1000, false)
-				} else {
-					if (this.linkType != 1 && (currentTime - this.playTime > 3 || currentTime - this.playTime < -3)&&this.isFinish!=1) {
-						uni.showToast({
-							title: '不能快进哦',
-							icon: 'none',
-						});
-						currentTime = this.playTime
-						this.player.seek(this.playTime);
-					}
-					this.playTime = currentTime
-				}
-				if(this.isEnded||this.playTime >= this.duration - 60) {
-					this.showAnswerTip = true
-				} else {
-					this.showAnswerTip = false
-				}
-				if (Math.floor(e.detail.currentTime) != this.flagTime &&this.openCommentStatus == 2) {
-					this.flagTime = Math.floor(e.detail.currentTime)
-					this.$refs.danmuBox&&this.$refs.danmuBox.checkDanmu(this.flagTime)
-				}
-			},
-			changeTime(that,e) {
-				that.playDurationSeek = 0
-			},
-			videoErrorCallback(e) {
-				this.errorCount++
-				if (this.errorCount > 3) return
-				if (this.interval != null) {
-					clearInterval(this.interval)
-				}
-				this.clearIntegral()
-				console.log(e)
-				this.getErrMsg(e.target.errMsg)
-				this.getH5CourseVideoDetails('error')
-			},
-			// 当开始/继续播放时触发play事件
-			getPlay() {
-				this.errorCount = 0
-				// this.judgeDuration()
-			},
-			getPause() {
-				this.clearIntegral()
-			},
-			getEnded() {
-				this.clearIntegral()
-				this.isEnded = true
-				this.showAnswerTip = true
-				this.isFinish = 1
-				this.getFinishCourseVideo()
-			},
-			getWaiting() {
-				this.getErrMsg('','waiting')
-			},
-			fullscreenchange(event) {
-				this.isfull = event.detail.fullScreen
-				if(this.isfull) {
-					this.$refs.danmuBox&&this.$refs.danmuBox.initTracks()
-				}
-			},
-			controlstoggle(event) {
-				this.crtShow =  event.detail.show
-			},
-			getIP() {
-				uni.request({
-					url: 'https://ipinfo.io/json', //仅为示例,并非真实接口地址。
-					method: 'GET',
-					success: (res) => {
-						this.ip = res.data.ip
-					}
-				});
-			},
-			getHeight() {
-				setTimeout(()=>{
-					const query = uni.createSelectorQuery().in(this);
-					query
-						.select("#title-contentnav")
-						.boundingClientRect((data) => {
-							if(data) {
-								this.height =
-									`calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 80px - 88rpx)`
-							}
-						})
-						.exec();
-				},200)
-			},
-			numberToLetter(num) {
-				// 将数字转换为字母的 ASCII 码
-				let letterCode = num + 65;
-				// 将 ASCII 码转换为大写字母
-				let letter = String.fromCharCode(letterCode);
-				return letter;
-			},
-			updateTime() {
-				var that = this;
-				if (this.interval != null) {
-					clearInterval(this.interval)
-				}
-				this.interval = setInterval(function() {
-					that.getFinishCourseVideo()
-					that.getInternetTraffic()
-				}, 60000);
-			},
-			judgeDuration() {
-				var that = this;
-				if (this.intervalIntegral != null) {
-					clearInterval(this.intervalIntegral)
-					this.intervalIntegral = null
-				}
-				// 观看10分钟获得积分
-				this.intervalIntegral = setInterval(function() {
-					that.getIntegralByH5Video()
-				}, 600000);
-			},
-			clearIntegral() {
-				if (this.intervalIntegral != null) {
-					clearInterval(this.intervalIntegral)
-					this.intervalIntegral = null
-				}
-			},
-			getH5CourseByVideo() {
-				this.loading = true
-				getH5CourseByVideoId({
-					videoId: this.videoId
-				}).then(res => {
-						this.loading = false
-						if (res.code == 200) {
-							this.courseInfo = res.data
-							uni.setNavigationBarTitle({
-								title: this.courseInfo && this.courseInfo.title ? this.courseInfo.title : ''
-							});
-						}
-						this.getHeight()
-						this.$nextTick(()=>{
-							this.$refs.descInfo&&this.$refs.descInfo.getDescHeight()
-							this.$refs.descInfoNav&&this.$refs.descInfoNav.getDescHeight()
-						})
-					},
-					rej => {
-						this.loading = false
-					}
-				).catch(() => {
-					this.loading = false
-				})
-			},
-			getH5CourseVideoDetails(type) {
-				getH5CourseVideoDetails(this.urlOption).then(res => {
-						if (res.code == 200) {
-							this.config = res.config || {}
-							this.isFinish = res.isFinish || 0
-							this.duration = res.course && res.course.duration ? res.course.duration : 0
-							this.playDuration = res.playDuration || 0
-							this.tipsTime = res.tipsTime || 0
-							let lineList = []
-							if (res.course && res.course.lineOne) {
-								lineList.push(res.course.lineOne)
-							}
-							if (res.course && res.course.lineTwo) {
-								lineList.push(res.course.lineTwo)
-							}
-							if (res.course && res.course.lineThree) {
-								lineList.push(res.course.lineThree)
-							}
-							this.lineList = lineList
-							this.courseLogo = res.config&&res.config.courseLogo
-							this.viewCommentNum = res.config&&res.config.viewCommentNum || 200
-							if(this.openCommentStatus == 3) {
-								this.$refs.commentBox&&this.$refs.commentBox.closeWSocket()
-								this.$refs.danmuBox&&this.$refs.danmuBox.closeWSocket()
-							}
-							const status = res.config&&res.config.openCommentStatus || 3
-							if(status != this.openCommentStatus) {
-								this.openCommentStatus = status
-							}
-							this.currentTab = 1
-							if(this.openCommentStatus!=2 || this.showDanmu!=1) {
-								this.activeDanmus = []
-							}
-							if (!this.player || type == 'error') {
-								this.lineIndex = this.config.defaultLine
-								this.videoUrl = lineList[this.lineIndex]
-								this.poster= res.course && res.course.imgUrl ? res.course.imgUrl : ''
-								// this.options.sources = [{
-								// 	src: this.videoUrl
-								// }]
-								// this.options.poster = res.course && res.course.imgUrl ? res.course.imgUrl : ''
-								// this.initVideo()
-								this.playTime = this.playDuration >= this.duration ? 0 : this.playDuration
-								this.playDurationSeek = this.playTime
-								setTimeout(()=>{
-									this.player = uni.createVideoContext('video-content-box');
-									this.player.seek(this.playTime)
-									this.player.play();
-								},500);
-							} else {
-								// let div = document.querySelector(".vjs-progress-control");
-								// if(div) {
-								// 	if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
-								// 		div.style.pointerEvents = "auto";
-								// 	} else {
-								// 		div.style.pointerEvents = "none"; //禁止所有事件
-								// 	}
-								// }
-								this.playTime = this.playTime > this.playDuration ? this.playTime : this.playDuration >= this.duration ? 0 : this.playDuration
-								this.playDurationSeek = this.playTime
-								this.player.seek(this.playTime)
-								this.player.play();
-							}
-							this.updateTime();
-							this.quesList = res.questions && res.questions.length > 0 ? res.questions : [],
-								this.quesList = this.quesList.map(item => ({
-									...item,
-									questionOption: JSON.parse(item.question),
-									answer: ''
-								}))
-						}
-						this.getHeight()
-						this.$nextTick(()=>{
-							this.$refs.descInfo&&this.$refs.descInfo.getDescHeight()
-							this.$refs.descInfoNav&&this.$refs.descInfoNav.getDescHeight()
-						})
-					},
-					rej => {}
-				)
-			},
-			handleAnswer(val) {
-				let {item, option,index} = val
-				let time = this.playTime
-				if(this.isEnded||this.isFinish==1) {
-					time = this.duration
-				} else {
-					if(time < this.playDuration&&this.isFinish!=1) {
-						// 没完课且小于续播的时间
-						time = this.playDuration
-					}
-				}
-				if(Number(this.duration || 0) == 0 || time < this.duration - 60) {
-					uni.showToast({
-						title: "请先观看完整课程再答题哦~",
-						icon: "none"
-					})
-					return
-				}
-
-				if (this.quesList[index].type == 1) {
-					// 单选option
-					this.quesList[index].answer = option.name
-				} else if (this.quesList[index].type == 2) {
-					// 多选
-					let answer = this.quesList[index].answer ? this.quesList[index].answer.split(',') : []
-					if (answer.indexOf(option.name) === -1) {
-						answer.push(option.name)
-						this.quesList[index].answer = answer.join(',')
-					} else {
-						answer.splice(answer.indexOf(option.name), 1)
-						this.quesList[index].answer = answer.join(',')
-					}
-				}
-			},
-			submit() {
-				if(this.isExpire){
-					uni.showToast({
-						title: '课程已过期或链接无效',
-						icon: 'none'
-					});
-					return
-				}
-				// 登录
-				this.utils.isLoginCourseAuto().then(
-					res => {
-						if(res){
-							if (this.isAddKf == 1&&this.isCheckRealUrl) {
-								// 答题
-								// 您已提交过答案,请领取红包
-								this.courseAnswer()
-							} else {
-								// 添加客服
-								if (this.videoId && this.qwUserId) {
-									this.getIsAddKf()
-								} else {
-									uni.showToast({
-										title: '请添加客服',
-										icon: 'none'
-									})
-								}
-							} 
-						} else{
-							this.goLogin()
-						}
-					},
-					rej => {}
-				);
-			},
-			// 答题
-			courseAnswer() {
-				let time = this.playTime
-				if (this.isEnded || this.isFinish==1) {
-					time = this.duration
-				} else {
-					if (time < this.playDuration && this.isFinish != 1) {
-						// 没完课且小于续播的时间
-						time = this.playDuration
-					}
-				}
-				if (Number(this.duration || 0) == 0 || time < this.duration - 60) {
-					uni.showToast({
-						title: "请先观看完整课程再答题哦~",
-						icon: "none"
-					})
-					return
-				}
-				if (this.quesList.some(item => !item.answer)) {
-					uni.showToast({
-						title: "请确认是否答完所有题目",
-						icon: "none"
-					})
-					return
-				}
-				const questions = this.quesList.map(obj => {
-					const {
-						questionOption,
-						...rest
-					} = obj;
-					return rest;
-				});
-				if(!this.isCheckRealUrl) return;
-				const param = {
-					...this.urlOption,
-					questions: questions,
-					videoId: this.videoId,
-					duration: this.playTime,
-				}
-				this.errTitle = ""
-				this.errDesc = ""
-				this.errQues = []
-				courseAnswer(param).then(res => {
-						if (res.code == 200) {
-							if (res.incorrectQuestions) {
-								// 答题失败
-								if (res.incorrectQuestions.length > 0) {
-									this.errQues = res.incorrectQuestions
-								}
-								this.remain = res.remain || 0
-								if (res.remain > 0) {
-									this.errTitle = "很遗憾答错了"
-									this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
-									this.$refs.answerPopup.open("center")
-								}
-							} else {
-								// 答题成功
-								this.errTitle = "恭喜你,回答正确"
-								this.errDesc = `请选择奖励`
-								// this.$refs.answerPopup.open("center")
-								this.closeAnswerPopup()
-							}
-						} else {
-							if (res.msg == "该课题到达答错次数限制") {
-								this.errTitle = "答题次数超过限制"
-								this.errDesc = "以后的课程要认真学习哦"
-								this.$refs.answerPopup.open("center")
-							} else {
-								uni.showToast({
-									title: res.msg,
-									icon: "none"
-								})
-							}
-						}
-					},
-					rej => {}
-				)
-			},
-			// 选择
-			rewardChange(e) {
-				this.currentReward = e.detail.value
-			},
-			closeAnswerPopup() {
-				this.$refs.answerPopup.close()
-				if(!this.isCheckRealUrl) return;
-				if (this.errTitle == '恭喜你,回答正确') {
-					const param = {
-						...this.urlOption,
-						// rewardType: Number(this.currentReward),
-						source: 2,
-						appId:getApp().globalData.appId
-					}
-					sendReward(param).then(res => {
-						if(res.isNew&&res.isNew==1) {
-							const packageInfo = res.data.packageInfo || ''
-							if(packageInfo) {
-								uni.setStorageSync('receive_package',packageInfo);
-								if(res.mchId) uni.setStorageSync('mchId',res.mchId);
-								uni.navigateTo({
-									url: '/pages_course/reward'
-								})
-							}
-						} else {
-							uni.showToast({
-								title: res.msg,
-								icon: 'none'
-							})
-						}
-					})
-				}
-			},
-			// 线路
-			openPop() {
-				this.$refs.popup.open('bottom')
-			},
-			close() {
-				this.$refs.popup.close()
-			},
-			handleLine(index) {
-				var that=this;
-				if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
-					this.close()
-					return
-				} else {
-					// let div = document.querySelector(".vjs-progress-control");
-					// if(div) {
-					// 	if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
-					// 		div.style.pointerEvents = "auto";
-					// 	} else {
-					// 		div.style.pointerEvents = "none"; //禁止所有事件
-					// 	}
-					// }
-					this.lineIndex = index
-					this.videoUrl = this.lineList[index]
-					this.tipsOpen = false
-					this.playDurationSeek = this.playTime || 0
-					this.player = uni.createVideoContext('video-content-box');
-					setTimeout(function(){
-						that.player.seek(that.playDurationSeek)
-						that.player.play();
-					},500);
-					// this.player.src(this.lineList[index])
-					// this.player.one('loadedmetadata', () => {
-					// 	this.player.currentTime(this.playDurationSeek);
-					// 	this.player.play();
-					// });
-					this.close()
-				}
-
-			},
-			// 客服
-			getIsAddKf() {
-				this.qrcode = ''
-				this.qrcodeMsg = ''
-				this.isAddKf = 0
-				// {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
-				getIsAddKf(this.urlOption).then(res => {
-						if (res.code == 200) {
-							this.isAddKf = 1
-							this.isCheckRealUrl = true
-							this.getH5CourseVideoDetails()
-						} else if (res.code == 400) {
-							this.isAddKf = 0
-							this.isCheckRealUrl = false
-							this.qrcode = res.qrcode
-							this.qrcodeMsg = res.msg
-							this.$refs.kfPopup.open()
-						} else if (res.code == 504) {
-							// 登录
-							this.isCheckRealUrl = false
-							this.goLogin()
-						} else if (res.code == 566) {
-							// 官方群发通用链接
-							const url = res.courseLink.realLink.split('?course=')[1]
-							this.urlOption = JSON.parse(url)
-							this.isAddKf = 1
-							this.isCheckRealUrl = true
-							this.getH5CourseVideoDetails()
-						} else if (res.code == 567) {
-							// 群聊通用链接
-							this.urlOption = {
-								...this.urlOption,
-								qwExternalId: res.qwExternalId
-							}
-							this.isAddKf = 1
-							this.isCheckRealUrl = true
-							this.getH5CourseVideoDetails()
-						} else {
-							this.isCheckRealUrl = false
-							this.isAddKf = 0
-							uni.showToast({
-								title: res.msg,
-								icon: 'none'
-							});
-						}
-					},
-					err => {}
-				);
-			},
-			closeKFPop() {
-				this.$refs.kfPopup.close()
-			},
-			getFinishCourseVideo() {
-				if (!this.isLogin||!this.playTime || !this.isCheckRealUrl) return
-				// {videoId: this.videoId,duration:this.playTime}
-				const param = {
-					duration: this.playTime,
-					...this.urlOption
-				}
-				getFinishCourseVideo(param)
-			},
-			// 每十分钟获得积分
-			getIntegralByH5Video() {
-				if(!this.isLogin||!this.isCheckRealUrl) return
-				const param = {
-					duration: this.playTime,
-					...this.urlOption
-				}
-				getIntegralByH5Video(param).then(res => {
-					if (res.code == 200) {
-						uni.showToast({
-							title: "积分+10",
-							icon: "none"
-						})
-					}
-				})
-			},
-			progressChange(e) {
-				this.bufferRate = Math.ceil(e.detail.buffered)
-			},
-			// 缓冲
-			getInternetTraffic() {
-				if(!this.isLogin||!this.isCheckRealUrl) return
-				const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
-				if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
-					this.bufferRate = playVideoTime
-				}
-				if(this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
-				const param = {
-					...this.urlOption,
-					uuId: dayjs().format('YYYYMMDD') + this.uuId,
-					duration: this.playTime,
-					bufferRate: Number(this.bufferRate.toFixed(2)),
-				}
-				if(!param.bufferRate) return
-				internetTraffic(param)
-			},
-			getErrMsg(err,type) {
-				let msgerr = {
-					errType: type || 'error',
-					videoUrl: this.videoUrl,
-					lineIndex: this.lineIndex,
-					errTime: new Date(),
-					ip: this.ip,
-					errMsg: err || ''
-				}
-				getErrMsg({
-					msg: JSON.stringify(msgerr)
-				})
-			},
-			goLogin(data) {
-				if (this.player) {
-					this.player.pause()
-				}
-				if(!this.sortLink||!this.projectCode){
-					uni.showToast({
-						title: '链接有误',
-						icon: 'none'
-					});
-					return
-				} 
-				this.loginFsUserWx(data)
-				return
-				this.utils.getProvider().then(provider=>{
-					console.log('当前的环境商',provider)
-					if (!provider) {
-					  reject()
-					}
-					uni.login({
-						provider: provider,
-						success: async loginRes => {
-							console.log(loginRes)
-							uni.getUserInfo({
-							   provider: provider,
-							   success: (infoRes)=> {
-								    uni.showToast({
-										title: '处理中...',
-										icon: 'loading'
-								    });
-									loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId:getApp().globalData.appId}).then(res=>{
-										 uni.hideLoading();
-										 if (res.code == 200) {
-											this.$store.commit('setCoureLogin', 1);
-											uni.setStorageSync(this.utils.TOKEN_KEYAuto, res.token);
-											uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
-											this.user = res.user
-											this.isLogin = true
-											this.getIsAddKf() 
-										 } else {
-											uni.showToast({
-												title: res.msg,
-												icon: 'none'
-											});
-										 }
-									 }).catch(err=>{
-										uni.hideLoading();
-										uni.showToast({
-											icon:'none',
-											title: "登录失败,请重新登录",
-										});
-									});
-							   }
-							});
-						}
-					})
-				}).catch(err => {})
-			},
-			getLink() {
-				let that = this;
-				getRealLink({sortLink:this.sortLink}).then(res=>{
-					if(res.code == 200) {
-						this.isExpire = false
-						// 如果响应中包含真实链接,则跳转到真实链接
-						// window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
-						if (this.isLogin && this.isAddKf == 1&&this.isCheckRealUrl) {
-							this.getH5CourseVideoDetails()
-						}
-						if (this.videoId &&(this.isAddKf != 1 || !this.isCheckRealUrl)) {
-							this.utils.isLoginCourseAuto().then(
-								isLogin => {
-									this.isLogin = isLogin
-									if(isLogin){
-										this.getIsAddKf() 
-									} else {
-										this.goLogin()
-									}
-								},
-								rej => {}
-							);
-						}
-					} else {
-						this.isExpire = true
-						uni.showToast({
-							title: '课程已过期或链接无效',
-							icon: 'none'
-						});
-					}
-				}).catch(err=>{
-					this.isExpire = true
-					uni.showToast({
-						title: '发生错误,请稍后再试',
-						icon: 'none'
-					});
-				})
-			},
-			/**
-			 * 节流原理:在一定时间内,只能触发一次
-			 *
-			 * @param {Function} func 要执行的回调函数
-			 * @param {Number} wait 延时的时间
-			 * @param {Boolean} immediate 是否立即执行
-			 * @return null
-			 */
-			throttle(func, wait = 500, immediate = true) {
-			    if (immediate) {
-			        if (!this.flag) {
-			            this.flag = true
-			            // 如果是立即执行,则在wait毫秒内开始时执行
-			            typeof func === 'function' && func()
-			            this.timer = setTimeout(() => {
-			                this.flag = false
-			            }, wait)
-			        }
-			    } else if (!this.flag) {
-			        this.flag = true
-			        // 如果是非立即执行,则在wait毫秒内的结束处执行
-			        this.timer = setTimeout(() => {
-			            this.flag = false
-			            typeof func === 'function' && func()
-			        }, wait)
-			    }
-			},
-			// 弹幕
-			openDanmu(type) {
-				this.openDanmuType = type
-				this.inputText = ''
-				if(type == 1) {
-					this.player.exitFullScreen()
-				}
-				this.$refs.danmuPopup.open()
-			},
-			changeShowPopup(val) {
-				this.focus = val.show
-			},
-			switchDanmu() {
-				this.showDanmu = this.showDanmu == 1 ? 0:1
-				if(this.showDanmu == 0&&this.$refs.danmuBox) {
-					this.$refs.danmuPopup.close()
-					this.activeDanmus = []
-					this.$refs.danmuBox.activeDanmus = []
-					this.$refs.danmuBox.initTracks()
-				}
-			},
-			getScrollTop(res) {
-				if(this.currentTab == 2) {
-					this.scrollTop = res
-				} else {
-					this.scrollTop = 0
-				}
-			},
-			handleTab(index) {
-				this.currentTab = index
-				if(this.currentTab==2) {
-					if(this.$refs.commentBox) {
-						this.$refs.commentBox.msgs = []
-						this.$refs.commentBox.pageNum = 1
-						this.$refs.commentBox.getComments()
-					}
-				} else {
-					setTimeout(()=>{
-						this.scrollTop = 0
-					},100)
-				}
-			},
-			handleRefresher() {
-				this.triggered = true;
-				if (!this.isMore&&this.currentTab==2&&this.openCommentStatus==1) {
-					this.$nextTick(()=>{
-						this.$refs.commentBox&&this.$refs.commentBox.getComments()
-					})
-				}
-				setTimeout(() => {
-					this.triggered = false;
-				}, 500);
-			},
-			getMore(val) {
-				this.triggered = false;
-				this.isMore = val == 1
-			},
-			handleChatInput() {
-				this.inputText = this.inputText.trim()
-				if (this.inputText == "" || this.inputText.trim() == "") {
-					uni.showToast({
-						title: '请输入评论',
-						icon: "none"
-					})
-					return;
-				}
-				if(this.openCommentStatus==1) {
-					this.$refs.commentBox&&this.$refs.commentBox.handleInput(this.inputText)
-				} else if(this.openCommentStatus==2) {
-					this.$refs.danmuBox&&this.$refs.danmuBox.handleInput(this.inputText)
-				}
-			},
-			setInputText() {
-				this.inputText = ""
-				if(this.openCommentStatus==2) {
-					this.$refs.danmuPopup.close()
-				}
-			},
-			getActiveDanmus(val) {
-				this.activeDanmus = val.map(item=>({
-					...item,
-					danmustyle: {
-						top: item.top + 'px',
-						...item.style, 
-						'animation-duration': '8s'
-					}
-				}))
-			},
-			animationend(moveItem, i) {
-				// 移除动画结束的弹幕(性能优化)
-				if(this.openCommentStatus==2) {
-					this.$refs.danmuBox&&this.$refs.danmuBox.animationend(moveItem, i)
-				}
-			},
-			feedback() {
-				const userId = this.user.userId || ''
-				const courseId = this.urlOption.courseId || ''
-				const videoId = this.urlOption.videoId || ''
-				uni.navigateTo({
-					url: './feedback?userId='+userId+'&courseId='+courseId+'&videoId='+videoId+'&projectCode='+this.projectCode
-				})
-			},
-			// H5授权绑定关系
-			async loginFsUserWx(data){
-				if(data){
-					let token = uni.getStorageSync('TOKEN_WEXIN');
-					let user = uni.getStorageSync('userInfo')
-
-					uni.setStorageSync(this.utils.TOKEN_KEYAuto, token);
-					uni.setStorageSync('auto_userInfo', JSON.stringify(user));
-					this.user = user
-					this.isLogin = true
-				}else{
-					uni.setStorageSync('H5course',{
-						companyId: this.urlOption.companyId,
-						companyUserId:this.urlOption.companyUserId,
-						type: 1, //1自动,其他手动
-					})
-					uni.showLoading({ title: '加载中' });
-										
-					try {
-					  await this.utils.getDomain({ projectCode: this.projectCode}); // code 换成你的业务标识
-					  await this.utils.getConfigKey();
-					  uni.navigateTo({
-					  	url:'/pages_course/webview?H5course='+uni.getStorageSync('H5course')
-					  })
-					} catch (err) {
-					  console.error('初始化失败', err);
-					  uni.showToast({ title: '请求失败', icon: 'none' });
-					} finally {
-					  uni.hideLoading();
-					}
-				}
-			}
-		}
-	}
-</script>
-
-<style scoped>
-.full-width-popup {
-  width: 100%;
-}
-</style>
-<style lang="scss" scoped>
-	@mixin u-flex($flexD, $alignI, $justifyC) {
-		display: flex;
-		flex-direction: $flexD;
-		align-items: $alignI;
-		justify-content: $justifyC;
-	}
-	.footer-tips {
-		margin-top: 14rpx;
-		text-align: center;
-		font-family: PingFang SC,PingFang SC;
-		font-weight: 500;
-		font-size: 12px;
-		color: #bbb;
-	}
-	.textOne {
-		overflow: hidden;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-	}
-
-	.textTwo {
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: -webkit-box;
-		-webkit-line-clamp: 2;
-		-webkit-box-orient: vertical;
-	}
-	.header-nav {
-		height: 88rpx;
-		@include u-flex(row, center, flex-start);
-		overflow: hidden;
-		background-color: #fff;
-		box-sizing: border-box;
-		.header-title {
-			text-align: center;
-			overflow: hidden;
-			white-space: nowrap;
-			text-overflow: ellipsis;
-			padding: 0 10rpx 0 100rpx;
-			font-family: PingFang SC,PingFang SC;
-			font-weight: 500;
-			font-size: 15px;
-			color: #000;
-			box-sizing: border-box;
-		}
-	}
-	.reward-list {
-		width: 100%;
-		margin-top: 20rpx;
-		margin-bottom: -40rpx;
-
-		&-group {
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-			font-size: 14px;
-			color: #222222;
-			@include u-flex(row, center, center);
-		}
-
-		&-option {
-			@include u-flex(row, center, flex-start);
-
-			&:first-child {
-				margin-right: 40rpx;
-			}
-		}
-	}
-
-	.err {
-		color: #f56c6c !important;
-	}
-
-	.kfqrcode-box {
-		background-color: #fff;
-		border-radius: 16rpx;
-		max-width: 560rpx;
-		padding: 60rpx 40rpx;
-		margin-top: -100rpx;
-		box-sizing: border-box;
-		@include u-flex(column, center, flex-start);
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 400;
-		font-size: 34rpx;
-		color: #222;
-		position: relative;
-		text-align: center;
-
-		.kfqrcode {
-			height: 460rpx;
-			width: 460rpx;
-		}
-	}
-
-	.kfqrcode-close {
-		width: 64rpx;
-		height: 64rpx;
-		position: absolute;
-		bottom: -100rpx;
-		left: 50%;
-		transform: translateX(-50%);
-	}
-
-	.tipsPopup-mask {
-		position: relative;
-		width: 560rpx;
-		background-color: transparent;
-
-		.red_envelope_top {
-			width: 480rpx;
-			height: 360rpx;
-			margin: 0 auto;
-			display: inherit;
-		}
-	}
-
-	.tipsPopup-btn-box {
-		width: 456rpx;
-		height: 104rpx;
-		padding: 4rpx;
-		box-sizing: border-box;
-		background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
-		border-radius: 52rpx;
-	}
-
-	.tipsPopup-btn {
-		width: 100%;
-		height: 100%;
-		background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
-		border-radius: 52rpx 52rpx 52rpx 52rpx;
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 500;
-		font-size: 36rpx;
-		color: #FFFFFF;
-		line-height: 96rpx;
-		text-align: center;
-	}
-
-	.tipsPopup {
-		width: 560rpx;
-		padding: 12rpx;
-		margin-top: -72rpx;
-		box-sizing: border-box;
-		background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
-		border-radius: 32rpx 32rpx 32rpx 32rpx;
-		position: relative;
-
-		&-close {
-			width: 64rpx;
-			height: 64rpx;
-			position: absolute;
-			right: 0;
-			top: -188rpx;
-		}
-
-		&-line {
-			padding: 3rpx;
-			box-sizing: border-box;
-			background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
-			border-radius: 24rpx;
-		}
-
-		&-box {
-			padding: 0 40rpx 40rpx 40rpx;
-			box-sizing: border-box;
-			background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
-			border-radius: 24rpx;
-			@include u-flex(column, center, flex-start);
-		}
-
-		&-head {
-			@include u-flex(row, center, center);
-
-			&-title {
-				width: 364rpx;
-				height: auto;
-				margin-top: -22rpx;
-			}
-		}
-
-		&-content {
-			margin: 48rpx 0;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 32rpx;
-			color: #222222;
-			text-align: center;
-
-			&-title {
-				margin-bottom: 26rpx;
-				font-weight: 600;
-				font-size: 40rpx;
-				color: #FF5C03;
-			}
-		}
-	}
-
-	.video-controls-box {
-		width: 100%;
-		height: 420rpx;
-		overflow: hidden;
-		position: absolute;
-		bottom: 0;
-		left: 0;
-		z-index: 2;
-		background: rgba(0, 0, 0, 0.2);
-
-		.video-play {
-			height: 72rpx;
-			width: 72rpx;
-			position: absolute;
-			top: 50%;
-			left: 50%;
-			transform: translate(-50%, -50%);
-		}
-	}
-
-	.video-controls {
-		width: 100%;
-		height: 80rpx;
-		padding: 0 28rpx;
-		box-sizing: border-box;
-		position: absolute;
-		bottom: 0;
-		left: 0;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		background: linear-gradient(to top, #222 0%, transparent 80%);
-
-		.video-icon {
-			height: 44rpx;
-			width: 44rpx;
-		}
-	}
-
-	.errQuesbox {
-		width: 100%;
-		max-height: 260rpx;
-		overflow-y: auto;
-		margin-top: 24rpx;
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 500;
-		font-size: 30rpx;
-		color: #222222;
-
-		&-item {
-			width: 100%;
-			height: 128rpx;
-			line-height: 128rpx;
-			margin-bottom: 24rpx;
-			padding: 0 30rpx;
-			box-sizing: border-box;
-			overflow: hidden;
-			background: #fff;
-			border-radius: 16rpx 16rpx 16rpx 16rpx;
-			position: relative;
-
-			&::after {
-				content: "题目";
-				min-width: 64rpx;
-				height: 36rpx;
-				padding: 0 12rpx;
-				line-height: 36rpx;
-				background: #FF5C03;
-				box-sizing: border-box;
-				border-radius: 0rpx 0rpx 16rpx 0rpx;
-				text-align: center;
-				font-family: PingFang SC, PingFang SC;
-				font-weight: 500;
-				font-size: 20rpx;
-				color: #fff;
-				position: absolute;
-				left: 0;
-				top: 0;
-			}
-		}
-	}
-
-	.bg {
-		background: #fff !important;
-	}
-
-	.answerPopup {
-		&-box {
-			width: 560rpx;
-			background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
-			border-radius: 32rpx 32rpx 32rpx 32rpx;
-			background-color: #fff;
-			font-weight: 400;
-			padding: 32rpx;
-			box-sizing: border-box;
-			position: relative;
-			@include u-flex(column, center, flex-start);
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-
-			.tipimg {
-				width: 206rpx;
-				height: 206rpx;
-				margin-bottom: 16rpx;
-			}
-		}
-
-		&-title {
-			font-weight: 600;
-			font-size: 36rpx;
-			color: #222222;
-		}
-
-		&-desc {
-			margin-top: 10rpx;
-			font-size: 28rpx;
-			color: #757575;
-		}
-
-		&-btn {
-			width: 464rpx;
-			height: 84rpx;
-			margin-top: 54rpx;
-			margin-bottom: 16rpx;
-			background: #FF5C03;
-			border-radius: 42rpx;
-			font-weight: 500;
-			font-size: 32rpx;
-			color: #FFFFFF;
-			text-align: center;
-			line-height: 84rpx;
-		}
-	}
-
-	.popupbox {
-		width: 100%;
-		background-color: #fff;
-		border-radius: 16rpx 16rpx 0 0;
-		padding: 24rpx 32rpx;
-		position: relative;
-
-		&-head {
-			height: 60rpx;
-			margin-bottom: 30rpx;
-			text-align: center;
-			overflow-y: auto;
-			color: #414858;
-			font-size: 32rpx;
-			font-weight: bold;
-			position: relative;
-
-			.close-icon {
-				position: absolute;
-				right: 0;
-				top: 0;
-				height: 40rpx;
-				width: 40rpx;
-			}
-		}
-
-		&-content {
-			height: 20vh;
-			overflow-y: auto;
-			display: flex;
-			align-items: flex-start;
-			flex-wrap: wrap;
-			gap: 32rpx;
-
-			.line-item {
-				display: inline-block;
-				min-width: 200rpx;
-				min-height: 60rpx;
-				padding: 0 20rpx;
-				box-sizing: border-box;
-				border-radius: 50rpx;
-				overflow: hidden;
-				background-color: #f7f7f7;
-				text-align: center;
-				color: #414858;
-				font-size: 28rpx;
-				line-height: 60rpx;
-			}
-
-			.line-active {
-				color: #f56c6c !important;
-				background-color: #fef0f0 !important;
-			}
-		}
-	}
-
-	.content {
-		padding-bottom: calc(var(--window-bottom));
-		.video-box {
-			width: 100%;
-			height: 420rpx;
-			overflow: hidden;
-			position: relative;
-
-			#myVideo {
-				width: 100%;
-				height: 100%;
-			}
-		}
-
-		.video-poster {
-			width: 100%;
-			height: 420rpx;
-		}
-
-		.miantitlebox {
-			padding: 30rpx 0;
-			border-bottom: 2rpx solid #F5F7FA;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 36rpx;
-			color: #222222;
-		}
-
-		.subtitlebox {
-			padding: 30rpx 0;
-			border-bottom: 2rpx solid #F5F7FA;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 36rpx;
-			color: #222222;
-		}
-
-		.title-content {
-			padding: 0 32rpx;
-			background-color: #fff;
-			font-size: 28rpx;
-			line-height: 1.6;
-			box-sizing: border-box;
-			@include u-flex(row, center, space-between);
-			.title {
-				font-size: 36rpx;
-				font-weight: 500;
-				color: #414858;
-			}
-
-			.time-or-subtitle {
-				margin-top: 12rpx;
-				color: #666666;
-			}
-		}
-		.warning {
-			flex-shrink: 0;
-			color: #888;
-			font-size: 24rpx;
-			@include u-flex(column, center, center);
-			image {
-				flex-shrink: 0;
-				height: 36rpx;
-				width: 36rpx;
-			}
-		}
-		.video-line {
-			min-width: 140rpx;
-			max-width: 200rpx;
-			height: 60rpx;
-			padding: 0 20rpx;
-			box-sizing: border-box;
-			border-radius: 50rpx 0 0 50rpx;
-			overflow: hidden;
-			background-color: #fff;
-			text-align: center;
-			color: #888;
-			font-size: 28rpx;
-			line-height: 60rpx;
-			display: inline-flex;
-			align-items: center;
-			justify-content: center;
-			position: fixed;
-			right: 0;
-			z-index: 9;
-			bottom: calc(var(--window-bottom) + 280rpx);
-			box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
-
-			image {
-				flex-shrink: 0;
-				height: 34rpx;
-				width: 34rpx;
-				margin-right: 6rpx;
-			}
-		}
-		.danmu-line {
-			bottom: calc(var(--window-bottom) + 370rpx);
-			word-break: keep-all;
-			.set_image {
-				height: 40rpx;
-				width: 40rpx;
-			}
-		}
-		.footer {
-			border-top: 1rpx solid #ededef;
-			background: #fff;
-			width: 100%;
-			position: fixed;
-			bottom: 0;
-			padding: 32rpx;
-			padding-bottom: calc(var(--window-bottom) + 14rpx);
-			box-sizing: border-box;
-			z-index: 9;
-
-			&-btn {
-				width: 100%;
-				height: 98rpx;
-				background: #FF5C03;
-				border-radius: 49rpx 49rpx 49rpx 49rpx;
-				line-height: 98rpx;
-				text-align: center;
-				font-family: PingFang SC, PingFang SC;
-				font-weight: 600;
-				font-size: 32rpx;
-				color: #FFFFFF;
-				@include u-flex(row, center, center);
-
-				&-img {
-					flex-shrink: 0;
-					width: 144rpx;
-					height: 144rpx;
-					margin-right: 8rpx;
-					margin-top: -24rpx;
-				}
-			}
-
-			&-btn-border {
-				position: relative;
-
-				&::after {
-					content: "";
-					background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
-					position: absolute;
-					top: -2rpx;
-					left: 0;
-					height: 103rpx;
-					width: 100%;
-					z-index: -1;
-					border-radius: 49rpx 49rpx 49rpx 49rpx;
-					box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
-					overflow: hidden;
-				}
-			}
-		}
-	}
-
-	.agreement {
-		display: inline-flex;
-		margin-top: 16rpx;
-		font-size: 24rpx;
-		color: #525252;
-		align-items: center;
-		justify-content: center;
-	}
-	.video-danmu-btnbox {
-		width: 50px;
-		height: 50px;
-		border-radius: 50%;
-		overflow: hidden;
-		position: absolute;
-		right: 10px;
-		bottom: calc(50% - 50px);
-		transform: translateY(-50%);
-		padding: 8px;
-		box-sizing: border-box;
-	}
-	.video-danmu-image {
-		width: 100%;
-		height: 100%;
-	}
-	.danmuPopup {
-		background-color: #fff;
-		padding-bottom: calc(var(--window-bottom) + 10px);
-		.u-border {
-			flex: 1;
-			@include u-flex(row,center,flex-start);
-			padding: 0 6rpx;
-			border-radius: 6px;
-		}
-		&-head {
-			width: 100%;
-			padding: 10px;
-			box-sizing: border-box;
-			overflow: hidden;
-			@include u-flex(row,center,flex-start);
-			.danmu-icon {
-				height: 24px;
-				width: 24px;
-				margin-right: 10px;
-			}
-		}
-		&-input {
-			flex: 1;
-			height: 35px;
-		}
-		&-send {
-			flex-shrink: 0;
-			height: 35px;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			padding: 5px 15px;
-			box-sizing: border-box;
-			background: #FF5C03 !important;
-			border-radius: 6px;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 15px;
-			color: #fff !important;
-			margin-left: 12px;
-			&::after {
-				border: none;
-			}
-		}
-		&-con {
-			background-color: #F5F7FA;
-			padding: 24px 12px 48px 12px;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-			font-size: 14px;
-			color: #757575;
-		}
-	}
-	.danmu-icon{
-		height: 24px;
-		width: 24px;
-		margin-right: 12px;
-	}
-	.logo {
-		display: inline-block;
-		width: 30px;
-		height: auto;
-		margin: 20px 0 0 10px;
-		pointer-events: none;
-		object-fit: cover;
-	}
-	.logo-full {
-		display: inline-block;
-		width: 40px;
-		height: auto;
-		margin: 50px 0 0 30px;
-		pointer-events: none;
-		object-fit: cover;
-	}
-	.tabbox-bar {
-		@include u-flex(row, center, flex-start);
-		background-color: #fff;
-		.warning {
-			flex-shrink: 0;
-			padding-right: 20rpx;
-		}
-	}
-	.tabbox {
-		flex: 1;
-		@include u-flex(row, center, center);
-		border-bottom: 2rpx solid #F5F7FA;
-		height: 44px;
-		background-color: #fff;
-		view {
-			flex: 1;
-			padding: 20rpx 0;
-			margin-right: 40rpx;
-			text-align: center;
-		}
-		&-active {
-			position: relative;
-			&::after {
-				position: absolute;
-				bottom: 0;
-				left: 50%;
-				transform: translateX(-50%);
-				content: "";
-				width: 3rem;
-				border-bottom: 4px solid #FF5C03;
-			}
-		}
-	}
-	.chatinput {
-		position: fixed;
-		left: 32rpx;
-		right: 32rpx;
-		z-index: 999;
-		height: 96rpx;
-		background-color: green;
-		background: #FFFFFF;
-		box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
-		border-radius: 24rpx 24rpx 24rpx 24rpx;
-		@include u-flex(row, center, center);
-		padding: 0 24rpx;
-		box-sizing: border-box;
-		.uni-input {
-			flex: 1;
-			margin-right: 32rpx;
-			font-size: 30rpx;
-		}
-	
-		.send {
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-			font-size: 28rpx;
-			color: #FFFFFF !important;
-			flex-shrink: 0;
-			padding: 0 20rpx;
-			height: 72rpx;
-			background: #FF5C03 !important;
-			border-radius: 8rpx 8rpx 8rpx 8rpx;
-			&::after {
-				border: none;
-			}
-		}
-	}
-	.answerTip {
-		position: fixed;
-		right: 0;
-		z-index: 9;
-		bottom: calc(var(--window-bottom) + 380rpx);
-		box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
-		border-radius: 24rpx 24rpx 24rpx 24rpx;
-		background-color: #ff5c03;
-		color: #fff;
-		border-radius: 50%;
-		height: 100rpx;
-		width: 100rpx;
-		font-size: 25rpx;
-		text-align: center;
-		padding: 10rpx;
-		@include u-flex(row, center, center);
-	}
-	.danmu-item {
-		position: absolute;
-		top: 0;
-		white-space: nowrap;
-		font-size: 16px;
-		height: 20px;
-		display: inline-flex;
-		box-sizing: border-box;
-		align-items: center;
-	}
-	.danmuMove {
-		// animation: mymove 8s linear forwards;
-		// animation-duration: 8s;
-		animation-timing-function: linear;
-		animation-delay: 0s;
-		animation-iteration-count: 1;
-		animation-direction: normal;
-		animation-fill-mode: forwards;
-		animation-play-state: running;
-		animation-name: mymove;
-		will-change: transform;
-	}
-	
-	@keyframes mymove {
-		from {
-			transform: translateX(100vw);
-		}
-	
-		to {
-			transform: translateX(-100%);
-		}
-	}
-	.arrow-left-warning {
-		position: absolute;
-		left: 24rpx;
-		height: 88rpx;
-		overflow: hidden;
-		color: #888;
-		font-size: 24rpx;
-		@include u-flex(column, center, center);
-		image {
-			flex-shrink: 0;
-			height: 36rpx;
-			width: 36rpx;
-		}
-	}
-</style>

+ 0 - 2535
pages_course/videovip.vue

@@ -1,2535 +0,0 @@
-<template>
-	<view class="content ">
-		<view class="header-nav"
-			:style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
-			<u-icon name="arrow-left" size="28" @click="tosales" v-if="appToken"></u-icon>
-			<view class="header-title"
-				:style="{width:menuButtonLeft + 'px',height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">
-				{{courseInfo.title}}</view>
-		</view>
-		<view class="video-box">
-			<image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
-			</image>
-			<video @timeupdate="onTimeUpdate" @progress="progressChange" @error="videoErrorCallback" @play="getPlay"
-				@pause="getPause" @ended="getEnded" @fullscreenchange="fullscreenchange" :title="courseInfo.title"
-				style="width: 100%;height: 420rpx;" :poster="poster" id="video-content-box" controls
-				:auto-pause-if-open-native="true" :auto-pause-if-navigate="true" :enable-progress-gesture="false"
-				:show-progress="true" :picture-in-picture-mode="[]" :show-background-playback-button="false"
-				:src="videoUrl">
-				<!-- <cover-image v-if="courseLogo" :class="isFull?'logo-full':'logo'" :src="courseLogo" mode="widthFix"></cover-image> -->
-			</video>
-		</view>
-
-		<view class="justify-start align-center fs24 base-color-9" v-if="userInfo.userId">
-			<view>{{nameuser?nameuser:'暂未授权昵称'}}#</view>
-			<view>{{userInfo.userId}}</view>
-		</view>
-		<view class="title-content" id="title-content">
-			<!-- 答题时展示小节课程名,其他展示课程名 -->
-			<!-- 小节课程名 -->
-			<view class="subtitlebox " v-if="isLogin&&isAddKf==1">
-				{{courseInfo.title}}
-			</view>
-			<!-- 课程名字 -->
-			<view class="miantitlebox" v-else>
-				{{courseInfo.courseName}}
-			</view>
-		</view>
-		<scroll-view class="scroll-view" :style="{height: height}" :scroll-top="scrollTop" scroll-y="true">
-			<!-- 介绍 -->
-			<view class="descbox">
-				<template v-if="!isLogin||isAddKf!=1">
-					<view class="descbox-title">{{courseInfo.title}}</view>
-					<view class="descbox-info">
-						<!-- <view class="descbox-info-l">
-							<view>{{courseInfo.views}}次播放</view>
-							<view class="descbox-info-time">总时长:{{courseInfo.totalDuration}}</view>
-						</view> -->
-						<view class="descbox-info-r expand" v-if="textHeight > 21">
-							<text @click="handleExpand">{{isExpand ? '收起简介' : '展开简介'}}</text>
-							<image :src="imgPath+'/app/image/course_arrow_up_icon.png'" v-show="isExpand"></image>
-							<image :src="imgPath+'/app/image/course_arrow_down_icon.png'" v-show="!isExpand"></image>
-						</view>
-					</view>
-				</template>
-				<view class="descbox-desc" id="descbox-desc" :style="{height: isExpand ? 'auto': '42rpx'}">
-					<text>{{courseInfo.description==null?'暂无简介':courseInfo.description}}</text>
-					<view :class="isExpand ? 'expand': 'expand expand-ab'" v-if="isLogin&&isAddKf==1&&textHeight > 21">
-						<text @click="handleExpand">{{isExpand ? '收起简介' : '展开简介'}}</text>
-						<image :src="imgPath+'/app/image/course_arrow_up_icon.png'" v-show="isExpand"></image>
-						<image :src="imgPath+'/app/image/course_arrow_down_icon.png'" v-show="!isExpand"></image>
-					</view>
-				</view>
-			</view>
-			<!-- 无效或者已过期 -->
-			<view class="nocourse" v-if="msg">
-				<image :src="imgPath+'/app/image/course_expiration_img.png'" mode="widthFix"></image>
-				<view>{{msg}}</view>
-			</view>
-			<!-- 问题 -->
-			<view class="ques-content" v-if="isLogin&&isAddKf==1">
-				<view class="ques-content-tit" v-if="isLogin &&!isquestion">问答题</view>
-				<view v-for="(item,index) in quesList" :key="index">
-					<view class="ques-title">
-						<text>{{index + 1}}.</text>
-						<view class="ques-type" v-show="item.type == 1 || item.type == 2">
-							{{item.type == 1 ? '单选' : item.type == 2 ? '多选' : ''}}
-						</view>
-						<text class="fs40">{{item.title}}</text>
-					</view>
-					<view :class="isAnswer(item,option.name) ?'ques-option ques-option-active':'ques-option'"
-						v-for="(option,idx) in item.questionOption" :key="idx" @click="handleAnswer(item,option)">
-						<view class="fs40">
-							{{numberToLetter(idx)}}.
-						</view>
-						<view class="fs40">{{option.name}}</view>
-					</view>
-				</view>
-			</view>
-		</scroll-view>
-		<!-- 线路 -->
-		<!-- <view class="video-line" @click="openPop" v-if="isLogin&&isAddKf==1">
-			<image :src="imgPath+'/app/image/changePlayer-icon.png'"></image>
-			<text>线路{{lineIndex + 1 | numberToChinese}}</text>
-		</view> -->
-		<!-- 线路弹窗 -->
-		<!-- <uni-popup ref="popup" type="bottom"  class="full-width-popup">
-			<view class="popupbox">
-				<view class="popupbox-head">
-					<text>线路选择</text>
-					<image class="close-icon" :src="imgPath+'/app/image/tc_close_icon.png'" mode="aspectFill" @click="close">
-					</image>
-				</view>
-				<view class="popupbox-content">
-					<view :class="lineIndex == index ? 'line-item line-active': 'line-item'"
-						v-for="(it,index) in lineList" :key="index" @click="handleLine(index)">
-						线路{{index + 1 | numberToChinese}}</view>
-				</view>
-			</view>
-		</uni-popup> -->
-		<!-- 温馨提示弹窗 -->
-		<u-popup :show="tipsPopup" mode="center" :closeOnClickOverlay='true' @close='tipsPopup=!tipsPopup'
-			:safeAreaInsetBottom='false' round='12'>
-			<view class="tipsPopup-mask">
-				<image class="red_envelope_top" :src="imgPath+'/app/image/red_envelope_img.png'" mode="aspectFill">
-				</image>
-				<view class="tipsPopup">
-					<image class="tipsPopup-close" :src="imgPath+'/app/image/course_close_white_icon.png'"
-						mode="aspectFill" @click="closeTipsPop"></image>
-					<view class="tipsPopup-line">
-						<view class="tipsPopup-box">
-							<view class="tipsPopup-head">
-								<image class="tipsPopup-head-title" :src="imgPath+'/app/image/tips_title_img.png'"
-									mode="widthFix"></image>
-							</view>
-							<view class="tipsPopup-content">
-								<view class="tipsPopup-content-title">亲爱的用户,</view>
-								<view>您已经观看课程{{timepath}}的时间了,请注意休息并保持专注。</view>
-							</view>
-							<view class="tipsPopup-btn-box">
-								<view class="tipsPopup-btn" @click="closeTipsPop">继续观看领奖励</view>
-							</view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</u-popup>
-		<!-- 答题弹窗 -->
-		<u-popup :show="answerPopup" mode="center" @close="closepop()" @open="open" closeOnClickOverlay
-			:safeAreaInsetBottom='false' round='12'>
-			<view :class="errTitle == '恭喜你,回答正确' ? 'answerPopup-box bg':'answerPopup-box'">
-				<!-- 正确 -->
-				<image class="tipimg" v-if="errTitle == '恭喜你,回答正确'" :src="imgPath+'/app/image/course_answer_img.png'"
-					mode="aspectFill"></image>
-				<!-- 错误 -->
-				<image class="tipimg" v-else :src="imgPath+'/app/image/course_answer_incorrectly_img.png'"
-					mode="aspectFill">
-				</image>
-				<view class="answerPopup-title">{{errTitle}}</view>
-				<view class="answerPopup-desc" v-html="errDesc"></view>
-				<!-- 选择奖励 -->
-				<!-- 错误题目 -->
-				<view class="errQuesbox" v-if="errQues&&errQues.length>0">
-					<view class="errQuesbox-item textOne" v-for="(it,index) in errQues" :key="index">{{it.title}}</view>
-				</view>
-				<!-- <view class="answerPopup-btn" v-if="errTitle == '恭喜你,回答正确'" @click="closeAnswerPopup">点击领取红包</view> -->
-				<view class="answerPopup-btn" v-if="errTitle == '恭喜你,回答正确'" @click="nvtored">点击领取红包</view>
-				<view class="tipsPopup-btn-box" v-else
-					:style="{marginTop: errQues&&errQues.length>0 ? '40rpx':'54rpx'}">
-					<view class="tipsPopup-btn" @click="closeAnswerPopup">{{remain > 0 ? '重新答题': '确认'}}</view>
-				</view>
-			</view>
-		</u-popup>
-		<!-- 客服二维码弹窗 -->
-		<u-popup :show="kfPopup" mode="center" :mask-click="false" round='12' @close="kefpop">
-			<view class="kfqrcode-box">
-				<view class="justify-start align-center fs24 base-color-9">
-					<view>{{nameuser}}#</view>
-					<view>{{userInfo.userId}}</view>
-				</view>
-				<view>请添加客服</view>
-				<image class="kfqrcode" :src="qrcode" show-menu-by-longpress="true" mode="aspectFit"></image>
-				<!-- <view v-show="qrcodeMsg" style="margin-top: 30rpx;" v-html="qrcodeMsg"></view> -->
-				<!-- <image class="kfqrcode-close" :src="imgPath+'/app/image/course_close_white_icon.png'" mode="aspectFill"
-					@click="closeKFPop"></image> -->
-			</view>
-		</u-popup>
-		<u-popup :show="timepop" mode="center" round='12'>
-			<view class="timepopbox center column">
-				<view class="fs40 bold ">不在看课时间范围内</view>
-				<view class="mtb20">看课时间</view>
-				<view>{{videocont.startDateTime}}</view>
-				<view>至</view>
-				<view>{{videocont.endDateTime}}</view>
-				<view class="base-bg-orange colorf p20 radius50 mt20" @click="getH5CourseVideoDetails">刷新时间</view>
-			</view>
-		</u-popup>
-		<u-popup :show="userlogo" mode="bottom" round='12'>
-			<view class="userlogo column">
-				<view class="mtb30 justify-start align-center ml20">
-					<u-avatar :src="imgPath+'/app/image/logo.png'" size="50"></u-avatar>
-					<!-- <view class="bold mlr20">{{imgname}}</view> -->
-					<view>申请</view>
-				</view>
-				<view class="bold fs36 ml20">授权你的昵称头像信息</view>
-				<view class="mtb20 justify-between align-center  plr20">
-					<view class="justify-start align-center">
-						<view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
-							<view v-if="userinfos.nickname">√</view>
-						</view>
-						<view class="ml20">
-							<view class="base-color-3 bold">第一步</view>
-							<view class="fs32 base-color-9">请点击授权微信昵称</view>
-						</view>
-					</view>
-					<view class="button-container">
-						<input type="nickname" class="hidden-input" @blur="onNickNameInput" @input="onNickNameInput" />
-						<button class="custom-button"
-							:class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button>
-					</view>
-				</view>
-				<view class="mtb20 justify-between align-center  plr20 mt40">
-					<view class="justify-start align-center">
-						<view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
-							<view v-if="userinfos.avatar">√</view>
-						</view>
-						<view class="ml20">
-							<view class="base-color-3 bold">第二步</view>
-							<view class="fs32 base-color-9">请点击授权微信头像</view>
-						</view>
-					</view>
-					<view class="button-container">
-						<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="hidden-input"
-							v-if="nameuser">
-							允许授权
-						</button>
-						<button class="custom-button sub" @click="shouquan" v-if="nameuser==''">允许授权</button>
-						<button class="custom-button " :class="avataruser==''?'subname':'subavt'"
-							v-else>{{avataruser?"已授权":'允许授权'}}</button>
-					</view>
-				</view>
-				<view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
-			</view>
-		</u-popup>
-		<!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
-		<!-- footer -->
-		<view class="footer" v-if="videoId">
-			<view class="btns">
-				<!-- 				<button
-					class="author-btn"
-					open-type="getPhoneNumber"
-					@getphonenumber="phoneLogin"  v-if="!isquestion&&authType==1">{{isLogin&&isAddKf==1 ? '提交答案领取奖励' : '立即学习'}}</button>
-				<button
-					class="author-btn"
-					open-type="getUserInfo" :disabled="userdisabled"
-					@getuserinfo="userInfologin"  v-if="authType==0&&!isquestion">{{isLogin&&isAddKf==1 ? '提交答案领取奖励' : '立即学习'}}</button> -->
-				<button class="author-btn" v-if="!isquestion||(!isLogin&&isAddKf==0)"
-					@click="submit">{{isLogin&&isAddKf==1 ?'提交答案领取奖励' : '立即学习'}}</button>
-			</view>
-		</view>
-		<view>
-			<u-modal :show="showfalse" title="提示" :content='contentmsg' @confirm='showfalse=false'></u-modal>
-		</view>
-		<u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="24"
-			:loading-text="loadingtext"></u-loading-page>
-	</view>
-</template>
-
-<script>
-	import { mapGetters } from 'vuex';
-	import {
-		generateRandomString
-	} from "@/utils/common.js"
-	import dayjs from 'dayjs';
-	import {
-		getErrMsg,
-		getH5CourseByVideoId,
-		getH5CourseVideoDetails,
-		courseAnswer,
-		getFinishCourseVideo,
-		getIsAddKf,
-		getInternetTraffic,
-		getIntegralByH5Video,
-		sendReward,
-		getRealLink,
-		loginByMiniApp,
-		handleFsUserWx,
-		getUserInfoLook
-	} from "@/api/courseLook.js"
-	import {
-		getConfigByKey
-	} from "@/api/course.js"
-	export default {
-		data() {
-			return {
-				imgPath: uni.getStorageSync('requestImagesPath'),
-				videoItem: {},
-				viewload: true,
-				loadingtext: "数据加载中...",
-				baseUrl: uni.getStorageSync('requestPath'),
-				// 1 红包 2 积分
-				rewardType: [{
-					name: '红包奖励',
-					value: 1
-				}, {
-					name: '积分奖励',
-					value: 2
-				}],
-				currentReward: 1,
-				player: null,
-				loading: true,
-				progress: 0,
-				code: null,
-				statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
-				scrollTop: 0,
-				height: '0px',
-				isLogin: false,
-				videoUrl: "",
-				videoId: "",
-				//现在的时长
-				playTime: 0,
-				//总时长
-				duration: 0,
-				playDuration: 0,
-				// 用于续播
-				playDurationSeek: 0,
-				// 温馨提醒时间节点,
-				tipsTime: 0,
-				tipsOpen: false,
-				config: {},
-				courseInfo: {},
-				quesList: [],
-				lineList: [],
-				// 错题
-				errQues: [],
-				// 答题机会
-				remain: 0,
-				errTitle: "",
-				errDesc: "",
-				showPlay: true,
-				showControls: false,
-				playStatus: "",
-				isFull: false,
-				isAddKf: 0,
-				lineIndex: 0,
-				// 是否展开
-				isExpand: true,
-				textHeight: 0, //文本高度
-				qwUserId: "",
-				qrcode: "",
-				corpId: "",
-				periodId: "", //营期id
-				companyUserId: "", //销售id
-				companyId: "", //公司id
-				courseId: "", //课程id
-				qrcodeMsg: "",
-				urlOption: {},
-				bufferRate: 0, // 缓冲时间
-				uuId: "",
-				isEnded: false,
-				// 是否允许拖动进度条
-				linkType: 0,
-				ip: null,
-				checked: true,
-				isFinish: 0, // 是否完课
-				interval: null,
-				intervalIntegral: null, // 积分定时
-				options: {
-					sources: [{
-						src: ""
-					}],
-					poster: "",
-					live: false /* 是否直播 */ ,
-					controls: true,
-					autoplay: false,
-					licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323137866_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl,
-					LicenseKey: 'bcc5bd9a14b798b48c52ff005a21d926',
-					controlBar: {
-						volumePanel: false,
-						playbackRateMenuButton: false,
-						QualitySwitcherMenuButton: false,
-						// progressControl: false
-					},
-					plugins: {
-						// ProgressMarker: false,
-						ContextMenu: {
-							statistic: false
-						}
-					},
-				},
-				// 错误请求次数
-				errorCount: 0,
-				answerPopup: false,
-				sortLink: "",
-				// 课程是否过期
-				isExpire: false,
-				menuButtonLeft: 281,
-				menuButtonH: 45,
-				timer: null,
-				flag: false,
-				msg: '',
-				poster: '',
-				userInfo: {},
-				timeid: '',
-				videocont: {},
-				timepop: false,
-				appToken: '',
-				kfPopup: false,
-				iskftype: 0,
-				iskftypemsg: '',
-				courseLogo: '',
-				isquestion: false,
-				tipsPopup: false,
-				timepath: '3分之1',
-				tipsTime2: 0,
-				userlogo: false,
-				userinfos: {
-					nickname: "",
-					avatar: ""
-				},
-				headImg: '',
-				authType: 0, //0微信登录 1手机号登录
-				userdisabled: false,
-				projectId: '',
-				showfalse: false,
-				contentmsg: null,
-			}
-		},
-		filters: {
-			numberToChinese(number) {
-				if (number) {
-					const chineseNumber = ['一', '二', '三', '四', '五', '六', '七', '八', '九'];
-					return chineseNumber[number - 1];
-				} else {
-					return ''
-				}
-			},
-		},
-		computed: {
-			isAnswer() {
-				return (item, name) => {
-					if (item.type == 1) {
-						return item.answer == name
-					} else if (item.type == 2) {
-						const array = item.answer.split(',')
-						return array.some(i => i == name)
-					} else {
-						return false
-					}
-				}
-			},
-			// imgname() {
-			//   return this.$store.state.logoname
-			// },
-			appid() {
-				return this.$store.state.appid
-			},
-			nameuser() {
-				return this.userinfos.nickname
-			},
-			avataruser() {
-				return this.userinfos.avatar
-			},
-			...mapGetters(['coureLogin']),
-		},
-		watch: {
-		    coureLogin: {
-		      immediate: true,          // 页面一进入就检查一次
-		      handler(val) {
-		        if (val == 2&&this.isLogin) {
-					console.log("看课AppToken失效,请重新登录")
-					this.isLogin = false
-					this.isAddKf = 0
-					this.goLogin()
-		        }
-		      }
-		    }
-		},
-		onLoad(option) {
-
-			this.getWebviewUrl()
-			uni.$on('usercode', (data) => {
-				console.log('huoqu ',data)
-				if(data) {
-					this.code=data.code
-					this.goLogin(data)
-				}
-			})
-			uni.$on('vipMsg', (data) => {
-				console.log(4444, data)
-				this.contentmsg = data
-				this.showfalse = true
-				uni.showToast({
-					icon: 'none',
-					title: data,
-					duration: 5000
-				});
-			})
-			this.videoContext = uni.createVideoContext('video-content-box', this)
-			this.code = option.code
-			if (uni.getStorageSync('userInfo') && JSON.stringify(uni.getStorageSync('userInfo')) != '{}') {
-				this.userInfo = uni.getStorageSync('userInfo')
-			} else {
-				this.userInfo = {}
-			}
-			this.appToken = uni.getStorageSync('companyUserInfo')
-			if (!option.course) {
-				const keys = decodeURIComponent(Object.keys(option)[0]);
-				this.urlOption = JSON.parse(keys.split('course=')[1])
-			} else {
-				this.urlOption = option.course ? JSON.parse(option.course) : {}
-			}
-			uni.setStorageSync('H5course', this.urlOption)
-			console.log('lll', this.urlOption)
-			this.videoId = this.urlOption.videoId
-			this.courseId = this.urlOption.courseId
-			this.periodId = this.urlOption.periodId
-			this.companyId = this.urlOption.companyId
-			this.companyUserId = this.urlOption.companyUserId
-			this.projectId = this.urlOption.projectId
-			this.timeid = this.urlOption.id
-			console.log(this.urlOption)
-			console.log(decodeURIComponent(option.course))
-			// this.sortLink = this.urlOption.link || ''
-			this.getMenuButton()
-			// #ifdef MP-WEIXIN
-			// if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userinfos')){
-			// 	this.userlogo=true
-			// }
-			console.log(uni.getStorageSync('userinfos'))
-			// if(!uni.getStorageSync('userinfos')&&this.$store.state.logoname=='乐氏本源'){
-			// 	uni.navigateTo({
-			// 		url:'/pages_course/webview'
-			// 	})
-			// 	return
-			// }
-			// #endif
-		},
-		onShow() {
-			this.userinfos = uni.getStorageSync('userinfos')
-			this.userinfo = uni.getStorageSync('userInfo')
-			this.tipsOpen = false
-			this.isExpand = true
-			this.uuId = generateRandomString(16)
-			if (this.videoId) {
-				this.getH5CourseByVideo()
-			}
-			const AppToken = uni.getStorageSync('TOKEN_WEXIN')
-			console.log(this.code,AppToken)
-			if (AppToken&&!this.code) {
-				console.log("console.log(AppToken,this.userinfo)===",this.userinfo)
-				this.isLogin=true
-				this.getUserInfoLooks()
-				if (this.isAddKf == 1 && this.userinfo.userId) {
-					console.log(1233)
-					this.getH5CourseVideoDetails()
-				} else {
-					// this.checkUserInfoA()
-					this.getIsAddKf()
-				}
-			}
-			// if(this.sortLink){
-			// 	this.getLink()
-			// } else {
-			// 	uni.showToast({
-			// 		title: 'sortLink is not found',
-			// 		icon: 'none'
-			// 	});
-			// }	
-			console.log("uuid是什么>>>",this.uuId)
-				console.log("bufferRate是什么>>>",Number(this.bufferRate.toFixed(2)))
-				console.log("duration是什么>>>",this.playTime)
-				console.log("periodId是什么>>>",this.periodId)
-		},
-		mounted() {
-			// this.getIP()
-			this.getHeight()
-
-		},
-		onHide() {
-			// this.player = uni.createVideoContext('video-content-box');
-			if (this.player) {
-				this.player.pause()
-			}
-			// if (this.interval != null) {
-			// 	clearInterval(this.interval)
-			// 	this.interval = null
-			// }
-		},
-		onUnload() {
-			if (this.interval != null) {
-				clearInterval(this.interval)
-				this.interval = null
-			}
-			this.clearIntegral()
-			uni.$off('usercode')
-		},
-		beforeDestroy() {
-			this.player = uni.createVideoContext('video-content-box');
-			if (this.player) {
-				this.player.stop()
-				this.player = null
-			}
-			if (this.interval != null) {
-				clearInterval(this.interval)
-				this.interval = null
-			}
-			this.clearIntegral()
-		},
-		methods: {
-			getUserInfoLooks() {
-				getUserInfoLook({userId:this.userinfo.userId}).then(res => {
-					if (res.code == 200) {
-						this.userinfos.nickname = res.user.nickname
-						this.userInfo = res.user;
-					}
-					console.log(res)
-				})
-			},
-			getWebviewUrl() {
-				var data = {
-					key: 'course.config'
-				}
-				getConfigByKey(data).then(res => {
-					if (res.code == 200) {
-						console.log("getConfigByKey====", JSON.parse(res.data))
-						let data = JSON.parse(res.data, )
-						uni.setStorageSync('weixinOauth', data.userCourseAuthDomain)
-					} else {
-						uni.showToast({
-							icon: 'none',
-							title: res.msg,
-						});
-					}
-				})
-			},
-			goLogin(data) {
-				this.isAddKf = 0
-				if (data) {
-					console.log('huoqu1222', data)
-					uni.showLoading({
-						title: '加载中'
-					})
-					uni.login({
-						provider: "weixin",
-						success: async loginRes => {
-							let code = loginRes.code // 获取开发code
-							handleFsUserWx({
-									code: code,
-									appId: this.appid,
-									userId: data.userId
-								})
-								.then(res => {
-									if (res.code == 200) {
-										console.log(res)
-										uni.hideLoading();
-										uni.showToast({
-											icon: 'none',
-											title: "登录成功",
-										});
-										this.userinfos = uni.getStorageSync('userinfos')
-										uni.getStorageSync('TOKEN_WEXIN');
-										this.userInfo = uni.getStorageSync('userInfo');
-										this.isLogin = true
-										this.code = ''
-										// this.getH5CourseVideoDetails()
-										// setTimeout(()=>{
-											this.getIsAddKf()
-										// },200)
-									} else if (res.code == 406) {
-										uni.hideLoading();
-										uni.showToast({
-											icon: 'none',
-											title: '该用户已成为其他销售会员',
-										});
-									} else {
-										uni.hideLoading();
-										uni.showToast({
-											icon: 'none',
-											title: res.msg,
-										});
-									}
-
-								})
-						},
-					})
-				} else {
-					uni.navigateTo({
-						url: '/pages_course/webview?H5course=' + uni.getStorageSync('H5course')
-					})
-				}
-
-			},
-			shouquan() {
-				if (this.userinfos.nickname == '') {
-					uni.showToast({
-						icon: 'none',
-						title: "请先授权微信昵称",
-					});
-				}
-			},
-			confimrname() {
-				if (this.userinfos.nickname == '') {
-					uni.showToast({
-						icon: 'none',
-						title: "请授权微信昵称",
-					});
-					return
-				}
-				if (this.userinfos.avatar == '') {
-					uni.showToast({
-						icon: 'none',
-						title: "请授权微信头像",
-					});
-					return
-				}
-				uni.setStorageSync('userinfos', this.userinfos)
-				this.editUserA()
-				this.userlogo = false
-			},
-			onChooseAvatar(e) {
-				this.userinfos.avatar = e.detail.avatarUrl
-				uni.uploadFile({
-					url: uni.getStorageSync('requestPath') + '/app/common/uploadOSS', //仅为示例,非真实的接口地址
-					filePath: e.detail.avatarUrl,
-					name: 'file',
-					formData: {
-						'user': 'test' // 上传附带参数
-					},
-					success: (uploadFileRes) => {
-						console.log(uploadFileRes)
-						// 根据接口具体返回格式   赋值具体对应url
-						var data = JSON.parse(uploadFileRes.data)
-						this.headImg = uni.getStorageSync('requestPath') + data.fileName
-						this.userinfos.avatar = data.url
-					}
-				});
-			},
-			onNickNameInput(e) {
-				console.log(e)
-				this.userinfos.nickname = e.detail.value
-			},
-			kefpop() {
-				if (this.appToken) {
-					this.kfPopup == false
-				}
-			},
-			tosales() {
-				uni.switchTab({
-					url: "/pages/index/index"
-				})
-			},
-			closepop() {
-				this.answerPopup = false
-			},
-			open() {
-
-			},
-			userInfologin(e) {
-				console.log(e)
-				this.userdisabled = true
-				uni.showLoading({
-					title: "处理中..."
-				});
-				if (e.mp.detail.errMsg == 'getUserInfo:ok') {
-					this.utils.getProvider()
-						.then(provider => {
-							if (!provider) {
-								this.userdisabled = false
-								reject()
-							}
-							// uni登录
-							uni.login({
-								provider: provider,
-								success: async loginRes => {
-									console.log(loginRes)
-									console.log(e)
-									let code = loginRes.code // 获取开发code
-									this.userinfos = uni.getStorageSync('userinfos') ? uni.getStorageSync(
-										'userinfos') : this.userinfos
-									loginByMiniApp({
-											encryptedData: e.mp.detail.encryptedData,
-											iv: e.mp.detail.iv,
-											code: code,
-											companyId: this.companyId || '',
-											companyUserId: this.companyUserId || 0,
-											nickname: this.userinfos.nickname || '',
-											avatar: this.userinfos.avatar || '',
-											authType: this.authType,
-											appId: this.appid,
-											projectId: this.projectId
-										})
-										.then(res => {
-											this.userdisabled = false
-											if (res.code == 200) {
-												console.log(res)
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: "登录成功",
-												});
-												uni.setStorageSync('TOKEN_WEXIN', res.token);
-												uni.setStorageSync('userInfo', JSON.stringify(res
-													.user));
-												this.userInfo = res.user;
-												uni.hideLoading()
-												// this.checkUserInfoA()
-												// this.isLogin = true
-
-											} else if (res.code == 406) {
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: '该用户已成为其他销售会员',
-												});
-											} else {
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: res.msg,
-												});
-											}
-
-										})
-										.catch(res => {
-											this.userdisabled = false
-										})
-								},
-								fail() {
-									this.userdisabled = false
-								}
-							})
-						})
-						.catch(err => {
-							this.userdisabled = false
-							uni.showToast({
-								icon: 'none',
-								title: err,
-							});
-						})
-
-				} else {
-					this.userdisabled = false
-					uni.showToast({
-						title: '已拒绝授权',
-						icon: 'none',
-						duration: 2000,
-					})
-				}
-			},
-			phoneLogin(e) {
-				console.log(e)
-				this.userdisabled = false
-				uni.showLoading({
-					title: "处理中..."
-				});
-				if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
-					this.utils.getProvider()
-						.then(provider => {
-							if (!provider) {
-								this.userdisabled = false
-								reject()
-							}
-							// uni登录
-							uni.login({
-								provider: provider,
-								success: async loginRes => {
-									this.userdisabled = false
-									console.log(loginRes)
-									console.log(e)
-									let code = loginRes.code // 获取开发code
-									this.userinfos = uni.getStorageSync('userinfos') ? uni.getStorageSync(
-										'userinfos') : this.userinfos
-									loginByMiniApp({
-											encryptedData: e.mp.detail.encryptedData,
-											iv: e.mp.detail.iv,
-											code: code,
-											companyId: this.companyId || '',
-											companyUserId: this.companyUserId || 0,
-											nickname: this.userinfos.nickname || '',
-											avatar: this.userinfos.avatar || "",
-											authType: this.authType,
-											appId: this.appid,
-											projectId: this.projectId
-										})
-										.then(res => {
-											this.userdisabled = false
-											if (res.code == 200) {
-												console.log(res)
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: "登录成功",
-												});
-												uni.setStorageSync('TOKEN_WEXIN', res.token);
-												uni.setStorageSync('userInfo', JSON.stringify(res
-													.user));
-												this.userInfo = res.user;
-												uni.hideLoading()
-												// this.checkUserInfoA()
-												// this.isLogin = true
-												// setTimeout(()=>{
-												// 	this.getIsAddKf()
-												// },200)
-											} else if (res.code == 406) {
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: '该用户已成为其他销售会员',
-												});
-											} else {
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: res.msg,
-												});
-											}
-
-										})
-										.catch(res => {
-											this.userdisabled = false
-										})
-								},
-								fail() {
-									this.userdisabled = false
-								}
-							})
-
-						})
-						.catch(err => {
-							this.userdisabled = false
-							uni.showToast({
-								icon: 'none',
-								title: err,
-							});
-						})
-
-				} else {
-					this.userdisabled = false
-					uni.showToast({
-						title: '已拒绝授权',
-						icon: 'none',
-						duration: 2000,
-					})
-				}
-
-			},
-			getMenuButton() {
-				const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
-				this.menuButtonLeft = menuButtonInfo.left
-				this.menuButtonH = menuButtonInfo.height
-			},
-			//播放时间更新事件方法
-			onTimeUpdate(e) {
-				let currentTime = Math.round(e.detail.currentTime)
-				if (this.playDurationSeek > 0) {
-					this.playTime = this.playDurationSeek
-					this.throttle(() => this.changeTime(this), 1000, false)
-				} else {
-					// console.log(this.isFinish)
-					if (this.linkType != 1 && (currentTime - this.playTime > 3 || currentTime - this.playTime < -3) && this
-						.isFinish != 1) {
-						uni.showToast({
-							title: '不能快进哦',
-							icon: 'none',
-						});
-						currentTime = this.playTime
-						this.player.seek(this.playTime);
-					}
-
-					if (Math.floor(e.detail.currentTime) != this.flagTime) {
-						this.flagTime = Math.floor(e.detail.currentTime)
-						// 中途弹窗逻辑
-						if (!this.tipsOpen && this.tipsTime && this.playTime == this.tipsTime) {
-							this.timepath = '33%'
-							this.openTipsPop()
-						}
-						if (!this.tipsOpen && this.tipsTime2 && this.playTime == this.tipsTime2) {
-							this.timepath = '66%'
-							this.openTipsPop()
-						}
-					}
-					this.playTime = currentTime
-
-				}
-			},
-			changeTime(that, e) {
-				that.playDurationSeek = 0
-			},
-			videoErrorCallback(e) {
-				this.clearIntegral()
-				this.errorCount++
-				if (this.errorCount > 3) return
-				console.log(e)
-				this.getErrMsg(e.target.errMsg)
-				this.getH5CourseVideoDetails('error')
-			},
-			// 当开始/继续播放时触发play事件
-			getPlay() {
-				this.errorCount = 0
-				// this.judgeDuration()
-			},
-			getPause() {
-				this.clearIntegral()
-			},
-			getEnded() {
-				this.clearIntegral()
-				this.isEnded = true
-				this.isFinish = 1
-				this.getFinishCourseVideo()
-			},
-			getIP() {
-				uni.request({
-					url: 'https://ipinfo.io/json', //仅为示例,并非真实接口地址。
-					method: 'GET',
-					success: (res) => {
-						this.ip = res.data.ip
-					}
-				});
-			},
-			getHeight() {
-				this.$nextTick(() => {
-					const query = uni.createSelectorQuery().in(this);
-					query
-						.select("#title-content")
-						.boundingClientRect((data) => {
-							this.height =
-								`calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 120rpx )`
-						})
-						.exec();
-				})
-			},
-			getDescHeight() {
-				this.$nextTick(() => {
-					const query = uni.createSelectorQuery().in(this);
-					query
-						.select("#descbox-desc")
-						.boundingClientRect((data) => {
-							this.textHeight = data.height
-						})
-						.exec();
-				})
-			},
-			numberToLetter(num) {
-				// 将数字转换为字母的 ASCII 码
-				let letterCode = num + 65;
-				// 将 ASCII 码转换为大写字母
-				let letter = String.fromCharCode(letterCode);
-				return letter;
-			},
-			updateTime() {
-				var that = this;
-				if (this.interval != null) {
-					clearInterval(this.interval)
-				}
-				this.interval = setInterval(function() {
-					that.getFinishCourseVideo()
-					that.getInternetTraffic()
-				}, 60000);
-			
-			},
-			judgeDuration() {
-				var that = this;
-				if (this.intervalIntegral != null) {
-					clearInterval(this.intervalIntegral)
-					this.intervalIntegral = null
-				}
-				// 观看10分钟获得积分
-				this.intervalIntegral = setInterval(function() {
-					that.getIntegralByH5Video()
-				}, 600000);
-			},
-			clearIntegral() {
-				if (this.intervalIntegral != null) {
-					clearInterval(this.intervalIntegral)
-					this.intervalIntegral = null
-				}
-			},
-			// 展开简介
-			handleExpand() {
-				this.isExpand = !this.isExpand
-			},
-			getH5CourseByVideo() {
-				this.loading = true
-				getH5CourseByVideoId({
-					videoId: this.videoId
-				}).then(res => {
-						this.loading = false
-						if (res.code == 200) {
-							this.viewload = false
-							this.courseInfo = res.data
-							uni.setNavigationBarTitle({
-								title: this.courseInfo && this.courseInfo.title ? this.courseInfo.title : ''
-							});
-						}
-						this.getHeight()
-						this.getDescHeight()
-					},
-					rej => {
-						this.loading = false
-					}
-				).catch(() => {
-					this.loading = false
-				})
-			},
-			getH5CourseVideoDetails(type) {
-				uni.showLoading({
-					title: '加载中'
-				})
-				console.log(this.userInfo)
-				const data = {
-					videoId: this.videoId,
-					fsUserId: this.userInfo.userId,
-					courseId: this.courseId,
-					companyUserId: this.companyUserId,
-					periodId: this.periodId,
-					id: this.timeid
-				}
-				getH5CourseVideoDetails(data).then(res => {
-						if (res.code == 200) {
-							this.config = res.data.courseConfig || {}
-							this.isFinish = res.data.isFinish || 0
-							this.duration = res.data.courseVideoDetails &&
-								res.data.courseVideoDetails.duration ? res.data.courseVideoDetails.duration : 0
-							this.courseLogo = this.config && JSON.stringify(this.config) != '{}' ? this.config
-								.courseLogo : ''
-							this.playDuration = res.data.playDuration || 0
-							this.playDurationSeek = res.data.playDuration || 0
-							// this.tipsTime =  38
-							this.tipsTime = res.data.tipsTime || 0
-							this.tipsTime2 = res.data.tipsTime2 || 0
-							let lineList = []
-							// if (res.course && res.course.lineOne) {
-							// 	lineList.push(res.course.lineOne)
-							// }
-							// if (res.course && res.course.lineTwo) {
-							// 	lineList.push(res.course.lineTwo)
-							// }
-							// if (res.course && res.course.lineThree) {
-							// 	lineList.push(res.course.lineThree)
-							// }
-							this.lineList = lineList
-							if (!this.player || type == 'error') {
-								uni.hideLoading();
-								this.lineIndex = this.config.defaultLine
-								this.videoUrl = res.data.courseVideoDetails.videoUrl
-								this.poster = res.data.courseVideoDetails &&
-									res.data.courseVideoDetails.thumbnail ? res.data.courseVideoDetails.thumbnail : ''
-								this.videocont = res.data
-								// this.options.sources = [{
-								// 	src: this.videoUrl
-								// }]
-								// this.options.poster = res.course && res.course.imgUrl ? res.course.imgUrl : ''
-								// this.initVideo()
-								this.playTime = this.playDuration >= this.duration ? 0 : this.playDuration
-								if (this.videocont.rang) {
-									setTimeout(() => {
-										this.player = uni.createVideoContext('video-content-box');
-										this.player.seek(this.playTime)
-										this.player.play();
-									}, 500);
-									this.timepop = false
-								} else {
-									this.timepop = true
-								}
-
-							} else {
-								// let div = document.querySelector(".vjs-progress-control");
-								// if(div) {
-								// 	if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
-								// 		div.style.pointerEvents = "auto";
-								// 	} else {
-								// 		div.style.pointerEvents = "none"; //禁止所有事件
-								// 	}
-								// }
-								this.playTime = this.playTime > this.playDuration ? this.playTime : this
-									.playDuration >= this.duration ? 0 : this.playDuration
-								this.player.seek(this.playTime)
-								this.player.play();
-							}
-							this.updateTime();
-							if (res.data.courseVideoDetails.questionBankList.length == 0) {
-								this.isquestion = true
-							} else {
-								this.isquestion = false
-							}
-							console.log('题目', res.data.courseVideoDetails.questionBankList)
-							this.quesList = res.data.courseVideoDetails.questionBankList &&
-								res.data.courseVideoDetails.questionBankList.length > 0 ? res.data.courseVideoDetails
-								.questionBankList : [],
-								this.quesList = this.quesList.map(item => ({
-									...item,
-									questionOption: JSON.parse(item.question),
-									answer: ''
-								}))
-						}
-						this.getHeight()
-						this.getDescHeight()
-					},
-					rej => {}
-				)
-			},
-			handleAnswer(item, option, idx) {
-				let time = this.playTime
-				if (this.isEnded || this.isFinish == 1) {
-					time = this.duration
-				} else {
-					if (time < this.playDuration && this.isFinish != 1) {
-						// 没完课且小于续播的时间
-						time = this.playDuration
-					}
-				}
-				if (Number(this.duration || 0) == 0 || time < this.duration - 60) {
-					uni.showToast({
-						title: "请先观看完整课程再答题哦~",
-						icon: "none"
-					})
-					return
-				}
-
-				if (item.type == 1) {
-					// 单选option
-					item.answer = option.name
-				} else if (item.type == 2) {
-					// 多选
-					let answer = item.answer ? item.answer.split(',') : []
-					if (answer.indexOf(option.name) === -1) {
-						answer.push(option.name)
-						item.answer = answer.join(',')
-					} else {
-						answer.splice(answer.indexOf(option.name), 1)
-						item.answer = answer.join(',')
-					}
-				}
-			},
-			submit() {
-				if (this.isExpire) {
-					uni.showToast({
-						title: '课程已过期或链接无效',
-						icon: 'none'
-					});
-					return
-				}
-				// 登录
-				this.$isLoginCourse().then(
-					res => {
-						console.log(res)
-						if (res) {
-							console.log(res)
-							if (this.isAddKf == 1) {
-								// 答题
-								// 您已提交过答案,请领取红包
-								console.log(1223)
-								this.courseAnswer()
-							} else {
-								// 添加客服
-								if (this.videoId && this.isLogin) {
-									console.log(12223131)
-									this.getIsAddKf()
-								} else if (this.iskftype == 1) {
-									uni.showToast({
-										title: this.iskftypemsg,
-										icon: 'none'
-									})
-								} else {
-									// this.kfPopup=true
-									uni.removeStorageSync('TOKEN_WEXIN')
-									uni.showToast({
-										title: '已清除缓存,请重新进入页面!',
-										icon: 'none'
-									})
-									this.goLogin()
-								}
-							}
-						} else {
-							this.goLogin()
-						}
-					},
-					rej => {}
-				);
-
-			},
-			nvtored() {
-				const packageInfo = uni.getStorageSync('receive_package', packageInfo)
-				const mchId = uni.getStorageSync('mchId', res.mchId)
-				uni.navigateToMiniProgram({
-					appId: 'wxc89db69a69a79011',
-					path: '/pages_course/reward?mchId=' + mchId + '&packageInfo=' + packageInfo,
-					success(res) {
-						this.answerPopup = false
-						// this.$refs.appPopup.close()
-					}
-				})
-			},
-			// 答题
-			courseAnswer() {
-				let time = this.playTime
-				if (this.isEnded || this.isFinish == 1) {
-					time = this.duration
-				} else {
-					if (time < this.playDuration && this.isFinish != 1) {
-						// 没完课且小于续播的时间
-						time = this.playDuration
-					}
-				}
-				if (Number(this.duration || 0) == 0 || time < this.duration - 60) {
-					uni.showToast({
-						title: "请先观看完整课程再答题哦~",
-						icon: "none"
-					})
-					return
-				}
-				if (this.quesList.some(item => !item.answer)) {
-					uni.showToast({
-						title: "请确认是否答完所有题目",
-						icon: "none"
-					})
-					return
-				}
-				const questions = this.quesList.map(obj => {
-					const {
-						questionOption,
-						...rest
-					} = obj;
-					return rest;
-				});
-				const param = {
-					...this.urlOption,
-					userId: this.userInfo.userId,
-					questions: questions,
-					videoId: this.videoId,
-					duration: this.playTime,
-				}
-				this.errTitle = ""
-				this.errDesc = ""
-				this.errQues = []
-				courseAnswer(param).then(res => {
-						if (res.code == 200) {
-							if (res.incorrectQuestions) {
-								// 答题失败
-								if (res.incorrectQuestions.length > 0) {
-									this.errQues = res.incorrectQuestions
-								}
-								this.remain = res.remain || 0
-								if (res.remain > 0) {
-									this.answerPopup = true
-									this.errTitle = "很遗憾答错了"
-									this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
-									// this.$refs.answerPopup.open("center")
-									// this.answerPopup=true
-								}
-							} else {
-								// 答题成功
-								this.errTitle = "恭喜你,回答正确"
-								// this.errDesc = `请选择奖励`
-								// this.$refs.answerPopup.open("center")
-								// this.answerPopup=true
-								if (res.msg == '答题成功') {
-									uni.login({
-										provider: 'weixin',
-										success: async loginRes => {
-											console.log(loginRes)
-											var code = loginRes
-											this.closeAnswerPopup(loginRes.code)
-										}
-									})
-								}
-							}
-						} else {
-							if (res.msg == "该课题到达答错次数限制") {
-								this.errTitle = "答题次数超过限制"
-								this.errDesc = "以后的课程要认真学习哦"
-								// this.$refs.answerPopup.open("center")
-								this.answerPopup = true
-							} else {
-								uni.showToast({
-									title: res.msg,
-									icon: "none"
-								})
-							}
-						}
-					},
-					rej => {}
-				)
-			},
-			// 选择
-			rewardChange(e) {
-				this.currentReward = e.detail.value
-			},
-			closeAnswerPopup() {
-				// this.$refs.answerPopup.close()
-				uni.showLoading({
-					title: "加载中..."
-				})
-				if (this.errTitle == '恭喜你,回答正确') {
-					const param = {
-						...this.urlOption,
-						userId: this.userInfo.userId,
-						// rewardType: Number(this.currentReward),
-						source: 2, // 小程序
-						appId: this.appid
-					}
-					sendReward(param).then(res => {
-						if (res.code == 200) {
-							uni.hideLoading()
-							console.log('红包', res)
-							if (res.isNew && res.isNew == 1) {
-								console.log('红包配置', res)
-								const packageInfo = res.data.packageInfo || ''
-								if (packageInfo) {
-									this.answerPopup = true
-									uni.setStorageSync('receive_package', packageInfo)
-									uni.setStorageSync('mchId', res.mchId)
-									uni.navigateTo({
-										url: '/pages_course/reward'
-									})
-								}
-							} else {
-								uni.showToast({
-									title: res.msg,
-									icon: 'none'
-								})
-							}
-						} else {
-							uni.hideLoading()
-							uni.showToast({
-								title: res.msg,
-								icon: 'none'
-							})
-						}
-						// if(res.code == 200) {
-						// 	//重构 发红包,后台通过OPENID发零钱到 账
-						// 	//this.initWXConfig(res.package)
-						// }else {
-						// 	uni.showToast({
-						// 		title: res.msg,
-						// 		icon: 'none'
-						// 	})
-						// }
-					})
-				} else {
-					uni.hideLoading()
-					this.answerPopup = !this.answerPopup
-				}
-			},
-			// 线路
-			openPop() {
-				this.$refs.popup.open('bottom')
-			},
-			close() {
-				this.$refs.popup.close()
-			},
-			handleLine(index) {
-				var that = this;
-				if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
-					this.close()
-					return
-				} else {
-					// let div = document.querySelector(".vjs-progress-control");
-					// if(div) {
-					// 	if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
-					// 		div.style.pointerEvents = "auto";
-					// 	} else {
-					// 		div.style.pointerEvents = "none"; //禁止所有事件
-					// 	}
-					// }
-					this.lineIndex = index
-					this.videoUrl = this.lineList[index]
-					this.tipsOpen = false
-					this.playDurationSeek = this.playTime || 0
-					this.player = uni.createVideoContext('video-content-box');
-					setTimeout(function() {
-						that.player.seek(that.playDurationSeek)
-						that.player.play();
-					}, 500);
-					// this.player.src(this.lineList[index])
-					// this.player.one('loadedmetadata', () => {
-					// 	this.player.currentTime(this.playDurationSeek);
-					// 	this.player.play();
-					// });
-					this.close()
-				}
-
-			},
-			// 温馨提示
-			openTipsPop() {
-				// this.$refs.tipsPopup.open()
-				this.tipsPopup = true
-				// 暂停视频
-				this.videoContext.pause()
-				// this.tipsOpen = true
-				// this.pause()
-			},
-			closeTipsPop() {
-				// this.$refs.tipsPopup.close()
-				this.videoContext.play()
-				this.tipsPopup = !this.tipsPopup
-			},
-			// 客服
-			getIsAddKf() {
-				this.qrcode = ''
-				this.qrcodeMsg = ''
-				this.isAddKf = 0
-				const data = {
-					videoId: this.videoId,
-					userId: this.userInfo.userId,
-					companyUserId: this.companyUserId,
-					companyId: this.companyId,
-					courseId: this.courseId,
-					periodId: this.periodId,
-					projectId: this.projectId
-				}
-				// {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
-				getIsAddKf(data).then(res => {
-						if (res.code == 200) {
-							if (res.data) {
-								this.isAddKf = 1
-								if (this.userInfo.userId) {
-									this.getH5CourseVideoDetails()
-									console.log(123223)
-								}
-
-							}
-							// else{
-							// 	uni.showToast({
-							// 		title: '请联系管理员,注册为会员!',
-							// 		icon: 'none'
-							// 	});
-							// }
-						} else if (res.code == 1002) {
-							this.isAddKf = 0
-							this.qrcode = res.ext
-							this.kfPopup = true
-							uni.showToast({
-								title: "请添加管理员微信,成为会员!",
-								icon: 'none'
-							});
-						} else if (res.code == 505) {
-							this.isAddKf = 0
-							this.qrcode = res.ext
-							this.kfPopup = true
-							uni.showToast({
-								title: "管理员开启了会员审核,请等待审核!",
-								icon: 'none'
-							});
-						} else if (res.code == 406) {
-							uni.hideLoading();
-							uni.showToast({
-								icon: 'none',
-								title: '该用户已成为其他销售会员',
-							});
-						} else if (res.code == 504) {
-							this.isAddKf = 0
-							this.iskftype = 1
-							this.iskftypemsg = res.msg
-							uni.showToast({
-								title: res.msg,
-								icon: 'none'
-							});
-						} else {
-							this.isAddKf = 0
-							uni.showToast({
-								title: res.msg,
-								icon: 'none'
-							});
-						}
-					},
-					err => {}
-				);
-			},
-			closeKFPop() {
-				// this.$refs.kfPopup.close()
-				// this.kfPopup=!this.kfPopup
-			},
-			getFinishCourseVideo() {
-				if (!this.playTime) return
-				// {videoId: this.videoId,duration:this.playTime}
-				const param = {
-					duration: this.playTime,
-					videoId: this.videoId,
-					userId: this.userInfo.userId,
-					companyUserId: this.companyUserId
-				}
-				getFinishCourseVideo(param)
-			},
-			// 每十分钟获得积分
-			getIntegralByH5Video() {
-				const param = {
-					duration: this.playTime,
-					...this.urlOption
-				}
-				getIntegralByH5Video(param).then(res => {
-					if (res.code == 200) {
-						uni.showToast({
-							title: "积分+10",
-							icon: "none"
-						})
-					}
-				})
-			},
-			progressChange(e) {
-				this.bufferRate = Math.ceil(e.detail.buffered)
-				// console.log('缓冲结果',this.bufferRate)
-				// console.log('缓冲',this.playTime,this.duration)
-			},
-			// 缓冲
-			getInternetTraffic() {
-				const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
-				// console.log('播放百分比',playVideoTime)
-				if (this.bufferRate == 0 || this.bufferRate < playVideoTime) {
-					this.bufferRate = playVideoTime
-					console.log(this.bufferRate)
-				}
-				if (this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
-				
-				const param = {
-					uuId: dayjs().format('YYYYMMDD') + this.uuId,
-					duration: this.playTime,
-					bufferRate: Number(this.bufferRate.toFixed(2)),
-					userId: this.userId,
-					periodId: this.periodId,
-					...this.urlOption
-				}
-				getInternetTraffic(param)
-			},
-			getErrMsg(err) {
-				let msgerr = {
-					videoUrl: this.videoUrl,
-					lineIndex: this.lineIndex,
-					errTime: new Date(),
-					// ip: this.ip,
-					errMsg: err
-				}
-				getErrMsg({
-					msg: JSON.stringify(msgerr)
-				})
-			},
-			getLink() {
-				this.goLogin()
-				return
-				let that = this;
-				this.msg = ''
-				getRealLink({
-					sortLink: this.sortLink
-				}).then(res => {
-					if (res.code == 200) {
-						this.isExpire = false
-						// 如果响应中包含真实链接,则跳转到真实链接
-						// window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
-						if (this.isLogin && this.isAddKf == 1) {
-							this.getH5CourseVideoDetails()
-						}
-						if (this.videoId && this.isAddKf != 1) {
-							this.$isLoginCourse().then(
-								isLogin => {
-									this.isLogin = isLogin
-									if (isLogin) {
-										this.getIsAddKf()
-									} else {
-										this.goLogin()
-									}
-								},
-								rej => {}
-							);
-						}
-					} else {
-						this.isExpire = true
-						this.msg = '课程已过期或链接无效'
-						uni.showToast({
-							title: '课程已过期或链接无效',
-							icon: 'none'
-						});
-					}
-				}).catch(err => {
-					this.isExpire = true
-					this.msg = '发生错误,请稍后再试'
-					uni.showToast({
-						title: '发生错误,请稍后再试',
-						icon: 'none'
-					});
-				})
-			},
-			/**
-			 * 节流原理:在一定时间内,只能触发一次
-			 *
-			 * @param {Function} func 要执行的回调函数
-			 * @param {Number} wait 延时的时间
-			 * @param {Boolean} immediate 是否立即执行
-			 * @return null
-			 */
-			throttle(func, wait = 500, immediate = true) {
-				if (immediate) {
-					if (!this.flag) {
-						this.flag = true
-						// 如果是立即执行,则在wait毫秒内开始时执行
-						typeof func === 'function' && func()
-						this.timer = setTimeout(() => {
-							this.flag = false
-						}, wait)
-					}
-				} else if (!this.flag) {
-					this.flag = true
-					// 如果是非立即执行,则在wait毫秒内的结束处执行
-					this.timer = setTimeout(() => {
-						this.flag = false
-						typeof func === 'function' && func()
-					}, wait)
-				}
-			}
-		}
-	}
-</script>
-
-<style scoped>
-	.full-width-popup {
-		width: 100%;
-	}
-</style>
-<style lang="scss" scoped>
-	.subname {
-		background-color: #00aa00;
-		color: #fff;
-	}
-
-	.subavt {
-		background-color: #fff;
-		border: 2rpx #0a0 solid;
-		color: #00aa00;
-	}
-
-	.boxweixin {
-		width: 44rpx;
-		height: 44rpx;
-		border-radius: 50%;
-		text-align: center;
-		line-height: 34rpx;
-		color: #0a0;
-	}
-
-	.boxnosel {
-		border: #757575 4rpx solid;
-	}
-
-	.boxsel {
-		border: #0a0 4rpx solid;
-	}
-
-	.button-container {
-		position: relative;
-		width: 240rpx;
-	}
-
-	.hidden-input {
-		position: absolute;
-		top: 0;
-		left: 0;
-		width: 100%;
-		height: 100%;
-		opacity: 0;
-		z-index: 2;
-	}
-
-	.custom-button {
-		position: relative;
-		z-index: 1;
-		/* 其他样式 */
-		width: 100%;
-		margin: 0 auto;
-		height: 80rpx;
-		line-height: 60rpx;
-		font-size: 28rpx;
-		padding: 10rpx 20rpx;
-	}
-
-	.submitname {
-		width: 90%;
-
-		margin: 0 auto;
-		text-align: center;
-		padding: 30rpx;
-		margin-top: 40rpx;
-	}
-
-	.sub {
-		background-color: #f0f0f0;
-		color: #0a0;
-	}
-
-	.subact {
-		background-color: #0a0;
-		color: #fff;
-	}
-
-	.userlogo {
-		height: 760rpx;
-	}
-
-	.getlogo {
-		width: 240rpx;
-		background-color: #fff;
-		// padding: 10rpx 20rpx;
-	}
-
-	@mixin u-flex($flexD, $alignI, $justifyC) {
-		display: flex;
-		flex-direction: $flexD;
-		align-items: $alignI;
-		justify-content: $justifyC;
-	}
-
-	.footer-tips {
-		position: fixed;
-		width: 100%;
-		bottom: 144rpx;
-		text-align: center;
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 500;
-		font-size: 12px;
-		color: #bbb;
-		transform: scale(0.8);
-	}
-
-	.btns {
-		position: relative;
-		width: 100%;
-		height: 80rpx;
-
-		.author-btn {
-			z-index: 100;
-			position: absolute;
-			width: 100%;
-			height: 80rpx;
-			background: #ff5c03;
-			border-radius: 40rpx;
-			font-size: 36rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			text-align: center;
-			line-height: 80rpx;
-			color: rgba(255, 255, 255, 1);
-		}
-	}
-
-	.textOne {
-		overflow: hidden;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-	}
-
-	.textTwo {
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: -webkit-box;
-		-webkit-line-clamp: 2;
-		-webkit-box-orient: vertical;
-	}
-
-	.header-nav {
-		height: 88rpx;
-		@include u-flex(row, center, flex-start);
-		overflow: hidden;
-		background-color: #fff;
-		box-sizing: border-box;
-
-		.header-title {
-			text-align: center;
-			overflow: hidden;
-			white-space: nowrap;
-			text-overflow: ellipsis;
-			padding: 0 10rpx 0 100rpx;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 15px;
-			color: #000;
-			box-sizing: border-box;
-		}
-	}
-
-	.reward-list {
-		width: 100%;
-		margin-top: 20rpx;
-		margin-bottom: -40rpx;
-
-		&-group {
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-			font-size: 14px;
-			color: #222222;
-			@include u-flex(row, center, center);
-		}
-
-		&-option {
-			@include u-flex(row, center, flex-start);
-
-			&:first-child {
-				margin-right: 40rpx;
-			}
-		}
-	}
-
-	.err {
-		color: #f56c6c !important;
-	}
-
-	.kfqrcode-box {
-		background-color: #fff;
-		border-radius: 16rpx;
-		max-width: 560rpx;
-		padding: 60rpx 40rpx;
-		margin-top: -100rpx;
-		box-sizing: border-box;
-		@include u-flex(column, center, flex-start);
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 400;
-		font-size: 34rpx;
-		color: #222;
-		position: relative;
-		text-align: center;
-
-		.kfqrcode {
-			// height: 460rpx;
-			width: 460rpx;
-		}
-	}
-
-	.kfqrcode-close {
-		width: 64rpx;
-		height: 64rpx;
-		position: absolute;
-		bottom: -100rpx;
-		left: 50%;
-		transform: translateX(-50%);
-	}
-
-	.tipsPopup-mask {
-		position: relative;
-		width: 560rpx;
-		background-color: transparent;
-
-		.red_envelope_top {
-			width: 480rpx;
-			height: 360rpx;
-			margin: 0 auto;
-			display: inherit;
-		}
-	}
-
-	.tipsPopup-btn-box {
-		width: 456rpx;
-		height: 104rpx;
-		padding: 4rpx;
-		box-sizing: border-box;
-		background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
-		border-radius: 52rpx;
-	}
-
-	.tipsPopup-btn {
-		width: 100%;
-		height: 100%;
-		background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
-		border-radius: 52rpx 52rpx 52rpx 52rpx;
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 500;
-		font-size: 36rpx;
-		color: #FFFFFF;
-		line-height: 96rpx;
-		text-align: center;
-	}
-
-	.tipsPopup {
-		width: 560rpx;
-		padding: 12rpx;
-		margin-top: -72rpx;
-		box-sizing: border-box;
-		background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
-		border-radius: 32rpx 32rpx 32rpx 32rpx;
-		position: relative;
-
-		&-close {
-			width: 64rpx;
-			height: 64rpx;
-			position: absolute;
-			right: 0;
-			top: -188rpx;
-		}
-
-		&-line {
-			padding: 3rpx;
-			box-sizing: border-box;
-			background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
-			border-radius: 24rpx;
-		}
-
-		&-box {
-			padding: 0 40rpx 40rpx 40rpx;
-			box-sizing: border-box;
-			background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
-			border-radius: 24rpx;
-			@include u-flex(column, center, flex-start);
-		}
-
-		&-head {
-			@include u-flex(row, center, center);
-
-			&-title {
-				width: 364rpx;
-				height: auto;
-				margin-top: -22rpx;
-			}
-		}
-
-		&-content {
-			margin: 48rpx 0;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 32rpx;
-			color: #222222;
-			text-align: center;
-
-			&-title {
-				margin-bottom: 26rpx;
-				font-weight: 600;
-				font-size: 40rpx;
-				color: #FF5C03;
-			}
-		}
-	}
-
-	.video-controls-box {
-		width: 100%;
-		height: 420rpx;
-		overflow: hidden;
-		position: absolute;
-		bottom: 0;
-		left: 0;
-		z-index: 2;
-		background: rgba(0, 0, 0, 0.2);
-
-		.video-play {
-			height: 72rpx;
-			width: 72rpx;
-			position: absolute;
-			top: 50%;
-			left: 50%;
-			transform: translate(-50%, -50%);
-		}
-	}
-
-	.video-controls {
-		width: 100%;
-		height: 80rpx;
-		padding: 0 28rpx;
-		box-sizing: border-box;
-		position: absolute;
-		bottom: 0;
-		left: 0;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		background: linear-gradient(to top, #222 0%, transparent 80%);
-
-		.video-icon {
-			height: 44rpx;
-			width: 44rpx;
-		}
-	}
-
-	.errQuesbox {
-		width: 100%;
-		max-height: 260rpx;
-		overflow-y: auto;
-		margin-top: 24rpx;
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 500;
-		font-size: 30rpx;
-		color: #222222;
-
-		&-item {
-			width: 100%;
-			height: 128rpx;
-			line-height: 128rpx;
-			margin-bottom: 24rpx;
-			padding: 0 30rpx;
-			box-sizing: border-box;
-			overflow: hidden;
-			background: #fff;
-			border-radius: 16rpx 16rpx 16rpx 16rpx;
-			position: relative;
-
-			&::after {
-				content: "题目";
-				min-width: 64rpx;
-				height: 36rpx;
-				padding: 0 12rpx;
-				line-height: 36rpx;
-				background: #FF5C03;
-				box-sizing: border-box;
-				border-radius: 0rpx 0rpx 16rpx 0rpx;
-				text-align: center;
-				font-family: PingFang SC, PingFang SC;
-				font-weight: 500;
-				font-size: 20rpx;
-				color: #fff;
-				position: absolute;
-				left: 0;
-				top: 0;
-			}
-		}
-	}
-
-	.bg {
-		background: #fff !important;
-	}
-
-	.timepopbox {
-		width: 560rpx;
-		padding: 32rpx;
-		box-sizing: border-box;
-	}
-
-	.answerPopup {
-		&-box {
-			width: 560rpx;
-			background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
-			border-radius: 32rpx 32rpx 32rpx 32rpx;
-			background-color: #fff;
-			font-weight: 400;
-			padding: 32rpx;
-			box-sizing: border-box;
-			position: relative;
-			@include u-flex(column, center, flex-start);
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-
-			.tipimg {
-				width: 206rpx;
-				height: 206rpx;
-				margin-bottom: 16rpx;
-			}
-		}
-
-		&-title {
-			font-weight: 600;
-			font-size: 36rpx;
-			color: #222222;
-		}
-
-		&-desc {
-			margin-top: 10rpx;
-			font-size: 28rpx;
-			color: #757575;
-		}
-
-		&-btn {
-			width: 464rpx;
-			height: 84rpx;
-			margin-top: 54rpx;
-			margin-bottom: 16rpx;
-			background: #FF5C03;
-			border-radius: 42rpx;
-			font-weight: 500;
-			font-size: 32rpx;
-			color: #FFFFFF;
-			text-align: center;
-			line-height: 84rpx;
-		}
-	}
-
-	.popupbox {
-		width: 100%;
-		background-color: #fff;
-		border-radius: 16rpx 16rpx 0 0;
-		padding: 24rpx 32rpx;
-		position: relative;
-
-		&-head {
-			height: 60rpx;
-			margin-bottom: 30rpx;
-			text-align: center;
-			overflow-y: auto;
-			color: #414858;
-			font-size: 32rpx;
-			font-weight: bold;
-			position: relative;
-
-			.close-icon {
-				position: absolute;
-				right: 0;
-				top: 0;
-				height: 40rpx;
-				width: 40rpx;
-			}
-		}
-
-		&-content {
-			height: 20vh;
-			overflow-y: auto;
-			display: flex;
-			align-items: flex-start;
-			flex-wrap: wrap;
-			gap: 32rpx;
-
-			.line-item {
-				display: inline-block;
-				min-width: 200rpx;
-				min-height: 60rpx;
-				padding: 0 20rpx;
-				box-sizing: border-box;
-				border-radius: 50rpx;
-				overflow: hidden;
-				background-color: #f7f7f7;
-				text-align: center;
-				color: #414858;
-				font-size: 28rpx;
-				line-height: 60rpx;
-			}
-
-			.line-active {
-				color: #f56c6c !important;
-				background-color: #fef0f0 !important;
-			}
-		}
-	}
-
-	.content {
-		padding-bottom: calc(var(--window-bottom) + 100rpx);
-
-		.video-box {
-			width: 100%;
-			height: 420rpx;
-			overflow: hidden;
-			position: relative;
-
-			#myVideo {
-				width: 100%;
-				height: 100%;
-			}
-		}
-
-		.video-poster {
-			width: 100%;
-			height: 420rpx;
-		}
-
-		.miantitlebox {
-			padding: 30rpx 0;
-			border-bottom: 2rpx solid #F5F7FA;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 40rpx;
-			color: #222222;
-		}
-
-		.subtitlebox {
-			padding: 30rpx 0;
-			border-bottom: 2rpx solid #F5F7FA;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 500;
-			font-size: 40rpx;
-			color: #222222;
-		}
-
-		.title-content {
-			padding: 0 32rpx;
-			background-color: #fff;
-			font-size: 28rpx;
-			line-height: 1.6;
-
-			.title {
-				font-size: 36rpx;
-				font-weight: 500;
-				color: #414858;
-			}
-
-			.time-or-subtitle {
-				margin-top: 12rpx;
-				color: #666666;
-			}
-		}
-
-		.descbox {
-			padding: 36rpx 32rpx;
-			margin-bottom: 20rpx;
-			background-color: #fff;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-			font-size: 28rpx;
-			color: #222222;
-			line-height: 42rpx;
-			word-break: break-word;
-
-			&-title {
-				margin-bottom: 24rpx;
-				font-weight: 500;
-				font-size: 32rpx;
-			}
-
-			&-info {
-				margin-bottom: 24rpx;
-				@include u-flex(row, center, space-between);
-				font-size: 26rpx;
-				color: #757575;
-
-				&-l {
-					flex: 1;
-					@include u-flex(row, center, flex-start);
-				}
-
-				&-time {
-					margin-left: 18rpx;
-					padding-left: 18rpx;
-					position: relative;
-
-					&::after {
-						content: "";
-						width: 4rpx;
-						height: 4rpx;
-						background: #999999;
-						border-radius: 50%;
-						position: absolute;
-						left: 0;
-						top: 50%;
-						transform: translateY(-50%);
-					}
-				}
-
-				&-r {
-					background: transparent;
-				}
-			}
-
-			&-desc {
-				overflow: hidden;
-				position: relative;
-			}
-		}
-
-		.expand {
-			flex-shrink: 0;
-			@include u-flex(row, center, flex-end);
-			color: #FF5C03;
-			font-weight: 400;
-			font-size: 24rpx;
-
-			image {
-				width: 32rpx;
-				height: 32rpx;
-			}
-		}
-
-		.expand-ab {
-			position: absolute;
-			top: 0;
-			right: 0;
-			box-shadow: -50rpx 0 20rpx 8rpx #FFFFFF;
-			background-color: #fff;
-		}
-
-		.ques-content {
-			background-color: #fff;
-			padding: 40rpx 32rpx;
-			box-sizing: border-box;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-			font-size: 28rpx;
-			color: #222222;
-		}
-
-		.ques-content-tit {
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 600;
-			font-size: 36rpx;
-			color: #222222;
-		}
-
-		.ques-title {
-			margin: 48rpx 0 34rpx 0;
-			font-weight: 500;
-			font-size: 32rpx;
-			white-space: normal;
-		}
-
-		.ques-type {
-			flex-shrink: 0;
-			min-width: 72rpx;
-			min-height: 40rpx;
-			padding: 0 12rpx;
-			margin: 0 12rpx;
-			box-sizing: border-box;
-			background: #FF5C03;
-			border-radius: 8rpx 8rpx 8rpx 8rpx;
-			line-height: 40rpx;
-			text-align: center;
-			font-family: PingFang SC, PingFang SC;
-			font-weight: 400;
-			font-size: 24rpx;
-			color: #FFFFFF;
-			display: inline-block;
-		}
-
-		.ques-option {
-			min-height: 88rpx;
-			padding: 24rpx 32rpx;
-			box-sizing: border-box;
-			margin-bottom: 24rpx;
-			background: #F5F7FA;
-			border-radius: 16rpx 16rpx 16rpx 16rpx;
-			display: flex;
-			align-items: center;
-
-			&-active {
-				color: #FF5C03 !important;
-				background: #FCF0E7 !important;
-			}
-		}
-
-		.video-line {
-			min-width: 140rpx;
-			max-width: 200rpx;
-			height: 60rpx;
-			padding: 0 20rpx;
-			box-sizing: border-box;
-			border-radius: 50rpx 0 0 50rpx;
-			overflow: hidden;
-			background-color: #fff;
-			text-align: center;
-			color: #888;
-			font-size: 28rpx;
-			line-height: 60rpx;
-			display: inline-flex;
-			align-items: center;
-			justify-content: center;
-			position: fixed;
-			right: 0;
-			z-index: 9;
-			bottom: calc(var(--window-bottom) + 280rpx);
-			box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
-
-			image {
-				flex-shrink: 0;
-				height: 30rpx;
-				width: 30rpx;
-				margin-right: 6rpx;
-			}
-		}
-
-		.footer {
-			border-top: 1rpx solid #ededef;
-			background: #fff;
-			width: 100%;
-			position: fixed;
-			bottom: 0;
-			padding: 32rpx;
-			// padding-bottom: calc(var(--window-bottom) + 14rpx);
-			box-sizing: border-box;
-			z-index: 0;
-
-			&-btn {
-				width: 100%;
-				height: 98rpx;
-				background: #FF5C03;
-				border-radius: 49rpx 49rpx 49rpx 49rpx;
-				line-height: 98rpx;
-				text-align: center;
-				font-family: PingFang SC, PingFang SC;
-				font-weight: 600;
-				font-size: 32rpx;
-				color: #FFFFFF;
-				@include u-flex(row, center, center);
-
-				&-img {
-					flex-shrink: 0;
-					width: 144rpx;
-					height: 144rpx;
-					margin-right: 8rpx;
-					margin-top: -24rpx;
-				}
-			}
-
-			&-btn-border {
-				position: relative;
-
-				&::after {
-					content: "";
-					background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
-					position: absolute;
-					top: -2rpx;
-					left: 0;
-					height: 103rpx;
-					width: 100%;
-					z-index: -1;
-					border-radius: 49rpx 49rpx 49rpx 49rpx;
-					box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
-					overflow: hidden;
-				}
-			}
-		}
-	}
-
-	.agreement {
-		display: inline-flex;
-		margin-top: 16rpx;
-		font-size: 24rpx;
-		color: #525252;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.nocourse {
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		padding-bottom: 88rpx;
-		justify-content: center;
-		font-family: PingFang SC, PingFang SC;
-		font-weight: 400;
-		font-size: 32rpx;
-		color: #757575;
-		line-height: 48rpx;
-		text-align: center;
-
-		image {
-			width: 328rpx;
-			height: auto;
-			margin-bottom: 30rpx;
-		}
-	}
-
-	.logo {
-		display: inline-block;
-		width: 30px;
-		height: auto;
-		margin: 20px 0 0 10px;
-		pointer-events: none;
-		object-fit: cover;
-	}
-
-	.logo-full {
-		display: inline-block;
-		width: 40px;
-		height: auto;
-		margin: 50px 0 0 30px;
-		pointer-events: none;
-		object-fit: cover;
-	}
-</style>

+ 0 - 209
pages_course/webview.vue

@@ -1,209 +0,0 @@
-<template>
-  <view class="container">
-    <!-- 加载提示 -->
-   <view class="loading2" v-if="loading">
-      <text>加载中...</text>
-    </view>
-    <!-- web-view组件 -->
-	<web-view
-	  :src="webviewUrl" 
-	  @message="handleMessage"
-	  @load="onLoads"
-	  @error="onError"
-	></web-view>
-  </view>
-</template>
-
-<script>
-import { H5logoinApp} from '@/api/courseLook.js'
-export default {
-  data() {
-    return {
-      loading: false,
-	  // webviewUrl: uni.getStorageSync('authUrl'),//
-	  // webviewUrl: 'https://company.h5.test.ylrztop.com/avatarAuth/weixinOauth.html',//云联融智
-	  // webviewUrl: 'https://authdrk.ylrztop.com/weixinOauth',//青岛德瑞康
-	  // webviewUrl: 'https://wxmpauth.zkwlyf.com/weixinOauth',//中康智慧
-	  // webviewUrl:'https://userappkyt.ylrzcloud.com/weixinOauth',
-	  // webviewUrl:'https://uviewui.com/components/popup.html',
-      userinfos:{
-      	nickname:"",
-      	avatar:""
-      },
-	  usercode:{},
-	  h5Appid:'',
-	  redirect_uri: '',
-	  appid:'',
-	  webviewUrl:''
-    }
-  },
-  onLoad(options) {
-	  this.appid = getApp().globalData.appId
-	  this.webviewUrl = uni.getStorageSync('weixinOauth')
-	  if(options.code){
-		  // uni.$emit('us ercode', {  code: options.code });
-		  this.loginweixin(options.code)
-	  }
-	  console.log(this.webviewUrl)
-    // 生成带参的H5授权页面URL
-    // this.webviewUrl = this.generateAuthUrl()
-  },
-  methods: {
-	  // 截取url中的参数方法
-	  getUrlParam() {
-	      var url = this.webviewUrl;
-	      var theRequest = new Object();
-	      if (url.indexOf("?") != -1) {
-	          var str = url.substr(1);
-	          var strs = str.split("&");
-	          for (var i = 0; i < strs.length; i++) {
-	              theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
-	          }
-	      }
-	      return theRequest;
-	  },
-	  loginweixin(datas){
-		 const h5course=uni.getStorageSync('H5course')
-		  var data = {
-		  	code: datas,
-			appId:this.appid,
-			companyId:h5course.companyId,
-			companyUserId:h5course.companyUserId,
-			projectId:h5course.projectId
-		  }
-		  // 自动看课调courseLoginByMp接口,其他变
-		  let type = h5course.type==1 ? 1 : 0 
-		  H5logoinApp(data,type).then(res => {
-		  		  this.res=res
-		  		uni.hideLoading();
-		  		if (res.code == 200) {
-		  			console.log(res)
-					this.$store.commit('setCoureLogin', 1);
-		  			uni.hideLoading();
-		  			uni.showToast({
-		  				icon:'none',
-		  				title: "成功获取用户信息",
-		  			});
-					this.userinfos.nickname=res.user.nickname
-					this.userinfos.avatar=res.user.avatar
-					uni.setStorageSync("userinfos",this.userinfos)
-					uni.setStorageSync('userInfo', res.user);
-					uni.setStorageSync('TOKEN_WEXIN', res.token);
-					this.usercode.code=datas
-					this.usercode.userId=res.user.userId
-		  			uni.$emit('usercode',this.usercode)
-		  			uni.navigateBack({
-		  				delta: 1
-		  			});
-		  		} else {
-					uni.hideLoading();
-		  			uni.showToast({
-		  			  title: res.msg || '获取用户信息失败',
-		  			  icon: 'none'
-		  			})
-					setTimeout(()=>{
-						uni.navigateBack({
-							delta: 1
-						});
-					},2000)
-		  		}
-		  	},
-		  	err => {}
-		  ).catch(err=>{
-		  	uni.hideLoading();
-		  		uni.showToast({
-		  			icon:'none',
-		  			title: "获取用户信息失败",
-		  		});
-		  });
-	  },
-    // 生成授权页面URL,附带小程序传递的参数
-    generateAuthUrl() {
-      // 获取当前小程序的场景值,用于后续业务处理
-      const scene = uni.getLaunchOptionsSync().scene
-      
-      // 这里替换为你的uniapp H5项目域名
-      
-      // 拼接参数,可包含小程序特有的信息
-	  this.h5Appid = this.getUrlParam().appid
-	  this.redirect_uri = this.webviewUrl
-      const params = {
-        scene,
-        appid: this.h5Appid, // 公众号AppID
-        redirect_uri: encodeURIComponent(this.redirect_uri),
-        scope: 'snsapi_userinfo',
-        state: 'wechat_redirect'
-      }
-      
-      // 微信公众号授权URL
-      return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${params.appid}&redirect_uri=${params.redirect_uri}&response_type=code&scope=${params.scope}&state=${params.state}#wechat_redirect`
-    },
-    
-    // 处理web-view向小程序发送的消息
-    handleMessage(e) {
-      console.log('收到web-view消息:', e.detail)
-      console.log('收到web-view消息:', e)
-      // 获取H5页面传递过来的用户信息
-      if (e.detail && e.detail.type === 'user_info') {
-        this.userInfo = e.detail.data
-         this.token= e.detail.token
-        // 存储用户信息到本地
-        uni.setStorageSync('userInfo', this.userInfo)
-		uni.setStorageSync('TOKEN_WEXIN', this.userInfo)
-        
-        // 返回上一页或跳转到首页
-        uni.showToast({
-          title: '登录成功',
-          icon: 'success'
-        })
-        
-        setTimeout(() => {
-          uni.navigateBack()
-        }, 1500)
-      }
-    },
-    
-    // web-view加载完成
-    onLoads() {
-      this.loading = false
-      console.log('web-view加载完成')
-    },
-    
-    // web-view加载失败
-    onError(e) {
-      this.loading = false
-      console.error('web-view加载失败:', e)
-      uni.showToast({
-        title: '页面加载失败',
-        icon: 'none'
-      })
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.container {
-  width: 100%;
-  height: 100%;
-  position: relative;
-}
-
-.loading2 {
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  background-color: #fff;
-  z-index: 100;
-}
-
-web-view {
-  width: 100%;
-  height: 100%;
-}
-</style>    

+ 43 - 16
pages_shopping/live/complaint.vue

@@ -4,7 +4,7 @@
 			<view class="color#{$5} ">投诉对象</view>
 			<view class="align-center mt30 mb50">
 				<image class="w100 h100 mr30" style="border-radius: 50%;" src="/static/images/logo.png"></image>
-				<text>芳华选</text>
+				<text>芳华选</text>
 			</view>
 		</view>
 		<view class="container" >
@@ -271,22 +271,49 @@
 					fileListLen++
 				}
 			},
+	
+			
 			uploadFilePromise(url) {
-				const projectCode = uni.getStorageSync('projectCode')
-				return new Promise((resolve, reject) => {
-					let a = uni.uploadFile({
-						url: uni.getStorageSync('addressUrl_' + projectCode) +
-						'/app/common/uploadOSS', // 仅为示例,非真实的接口地址
-						filePath: url,
-						name: 'file',
-						success: (res) => {
-							setTimeout(() => {
-								console.log(JSON.parse(res.data).url)
-								resolve(JSON.parse(res.data).url)
-							}, 1000)
-						}
-					});
-				})
+			  const projectCode = uni.getStorageSync('projectCode')
+			  // 添加日志检查关键参数
+			  // console.log('上传参数检查:', {
+			  //   projectCode: projectCode,
+			  //   addressUrl: uni.getStorageSync('addressUrl_' + projectCode),
+			  //   url: url
+			  // })
+			  
+			  return new Promise((resolve, reject) => {
+			    let a = uni.uploadFile({
+			      url:  uni.getStorageSync('requestPath')+ '/app/common/uploadOSS',
+			      filePath: url,
+			      name: 'file',
+			      formData: {
+			        // 可以添加其他必要参数
+			      'user': 'test'  // 上传附带参数
+			      },
+			      success: (res) => {
+			        console.log('上传成功响应:', res)
+			        if (res.statusCode === 200) {
+			          try {
+			            const data = JSON.parse(res.data)
+			            if (data.code === 200) {
+			              resolve(data.url)
+			            } else {
+			              reject(new Error(data.msg || '上传失败'))
+			            }
+			          } catch (e) {
+			            reject(new Error('解析响应数据失败'))
+			          }
+			        } else {
+			          reject(new Error(`HTTP错误: ${res.statusCode}`))
+			        }
+			      },
+			      fail: (err) => {
+			        console.error('上传失败:', err)
+			        reject(err)
+			      }
+			    });
+			  })
 			},
 			// goLogin(data) {
 			// 	if (!this.projectCode) {

+ 1 - 1
pages_shopping/live/complaintList.vue

@@ -4,7 +4,7 @@
 		<view class="list">
 			<view class="item" @click="toComplaint(item)" v-for="(item,index) in list" :key="index">
 				<view>{{item}}</view>
-				<image class="w16" src="/static/images/arrow_gray.png" mode="widthFix"></image>
+				<image class="w16 h16" src="/static/images/arrow4.png" mode="widthFix"></image>
 			</view>
 
 		</view>

+ 1 - 1
pages_shopping/live/confirmCreateOrder.vue

@@ -448,7 +448,7 @@
 			        }
 			        console.log("orderList>>", orderList)
 			        const orderListStr = encodeURIComponent(JSON.stringify(orderList));
-			        uni.navigateTo({
+			        uni.redirectTo({
 			            url: `/pages_shopping/live/paymentOrder?orderList=${orderListStr}&couponUserId=${this.couponUserId}&type=${this.type}`
 			        });
 			    } catch (error) {

+ 1 - 1
pages_shopping/live/storeOrderDetail.vue

@@ -190,7 +190,7 @@
 
 						<view class="item">
 							<text class="label">运费</text>
-							<text class="text" v-if="order.payPostage!=null">¥{{order.payPostage.toFixed(2)}}</text>
+							<text class="text" v-if="order.payDelivery!=null">¥{{order.payDelivery.toFixed(2)}}</text>
 						</view>
 						<!-- <view class="item">
 							<text class="label">服务费</text>

+ 5 - 5
pages_shopping/shopping/paymentOrder.vue

@@ -9,7 +9,7 @@
           <text class="num" >{{payMoney.toFixed(2)}}</text>
         </view>
         <text class="desc" v-if="payType==2">代收金额{{payDelivery.toFixed(2)}},请您在收到快递后支付尾款给快递人员。</text>
-        <text class="desc" v-if="payType==3">货到付款金额{{payDelivery.toFixed(2)}},请您在收到快递后支付给快递人员。</text>
+        <!-- <text class="desc" v-if="payType==3">货到付款金额{{payDelivery.toFixed(2)}},请您在收到快递后支付给快递人员。</text> -->
       </view>
       <!-- 支付方式 -->
       <view class="pay-type">
@@ -55,7 +55,7 @@
               <radio  :value="2" :checked="order.payType=='2'" />
             </label>
           </view>
-          <view class="item" v-if="user!=null&&user.level==1 ">
+          <!-- <view class="item" v-if="user!=null&&user.level==1 ">
             <view class="left">
               <image src="../../static/images/pay_1.png" mode=""></image>
               <text class="text">货到付款</text>
@@ -63,7 +63,7 @@
             <label>
               <radio  :value="3" :checked="order.payType=='3'" />
             </label>
-          </view>
+          </view> -->
         </radio-group>
         <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==2">
           <view class="item" v-if="payType==1||payType==4" >
@@ -84,7 +84,7 @@
               <radio  :value="2" :checked="order.payType=='2'" />
             </label>
           </view>
-          <view class="item" v-if="user!=null&&user.level==1 ">
+         <!-- <view class="item" v-if="user!=null&&user.level==1 ">
             <view class="left">
               <image src="../../static/images/pay_1.png" mode=""></image>
               <text class="text">货到付款</text>
@@ -92,7 +92,7 @@
             <label>
               <radio  :value="3" :checked="order.payType=='3'" />
             </label>
-          </view>
+          </view> -->
         </radio-group>
         <radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&&(order.orderCreateType==1)">
           <view class="item"  >

+ 3 - 3
pages_shopping/shopping/productDetails.vue

@@ -237,13 +237,13 @@
 		},
 		//发送给朋友
 		onShareAppMessage(res) {
-			if(this.utils.isLogin()){
+			// if(this.utils.isLogin()){
 				var user=JSON.parse( uni.getStorageSync('userInfo'))
 				return {
 					title: this.product.productName,
-					path: '/pages/shopping/productDetails?productId='+this.product.productId+"&userId="+user.userId,
+					path: '/pages_shopping/shopping/productDetails?productId='+this.product.productId+"&userId="+user.userId,
 				}
-			}
+			// }
 			
 		},
 		//分享到朋友圈

+ 1 - 1
pages_user/user/pay.vue

@@ -4,7 +4,7 @@
       <view class="inner">
         <view class="pay">
           <view class="title">
-            <text class="name">付款给 芳华选</text>
+            <text class="name">付款给 芳华选</text>
             <text class="desc">微信收款</text>
           </view>
           <view class="pay-money">

+ 2 - 2
pages_user/user/userTuiAdd.vue

@@ -1,12 +1,12 @@
 <template>
   <view>
 		<view class="form-box">
-			<view class="title">你为什么想成为芳华选健康推广?</view>
+			<view class="title">你为什么想成为芳华选健康推广?</view>
 			<view class="textarea-box">
 				<textarea v-model="question1" value="" placeholder="请输入..." maxlength="200" placeholder-class="textarea-place" />
 				<view class="num-box">{{ question1.length }}/200</view>
 			</view>
-			<view class="title">你是否了解芳华选健康推广大使?</view>
+			<view class="title">你是否了解芳华选健康推广大使?</view>
 			<view class="textarea-box">
 				<textarea v-model="question2" value="" placeholder="请输入..." maxlength="200" placeholder-class="textarea-place" />
 				<view class="num-box">{{ question1.length }}/200</view>

BIN
static/images/full_screen.png


BIN
static/images/half_screen.png


BIN
static/images/name.png


BIN
static/images/points_title.png


BIN
static/images/points_title2.png


BIN
static/images/problem.png


BIN
static/images/ranking1.png


BIN
static/images/ranking2.png


BIN
static/images/ranking3.png


BIN
static/images/trailer.png


BIN
static/images/viewer_title.png


Some files were not shown because too many files changed in this diff