liujiaxin 4 周之前
父節點
當前提交
81ef2990c9
共有 3 個文件被更改,包括 91 次插入24 次删除
  1. 2 1
      pages/home/productList.vue
  2. 2 2
      pages/user/index.vue
  3. 87 21
      pages_course/living.vue

+ 2 - 1
pages/home/productList.vue

@@ -50,7 +50,7 @@
 					</view>
 					<view class="info-box">
 						<view class="title ellipsis2">{{item.productName}}</view>
-						<view class="intro ellipsis">{{item.productInfo}}</view>
+						<!-- <view class="intro ellipsis">{{item.productInfo}}</view> -->
 						<view class="prce-num">
 							<view class="price">
 								<text class="unit">¥</text>
@@ -334,6 +334,7 @@
 			margin-bottom: 20upx;
 			padding: 40upx 30upx;
 			display: flex;
+			align-items: center;
 			.img-box{
 				width: 200upx;
 				height: 200upx;

+ 2 - 2
pages/user/index.vue

@@ -180,8 +180,8 @@
 							</view> -->
 
 
-							<!-- 测试用下面的
-							<! <view class="item no-marin-bottom align-top" @click="navgetTo('/pages_course/livingList')">
+							<!-- 测试用下面的 -->
+							<!-- <view class="item no-marin-bottom align-top" @click="navgetTo('/pages_course/livingList')">
 								<image
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/integral.png"
 									mode=""></image>

+ 87 - 21
pages_course/living.vue

@@ -29,7 +29,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="trailer-actions">
+				<view class="trailer-actions" v-if="!isFocus">
 					<button open-type="share" class="button-reset share-button">
 						<view class="action-button mr18" @click="handleAgreement">
 							<text>分享给好友</text>
@@ -93,7 +93,7 @@
 				<!-- 视频区域 -->
 				<view class="videolist" v-if="liveItem.status == 2">
 					<view class="video-container" :class="liveItem.showType == 1 ? 'horizontal-layout' : ''">
-						<video v-if="liveItem.videoUrl && liveItem.liveType == 2&&!generating" :id="`myVideo_${liveId}`"
+						<!-- <video v-if="liveItem.videoUrl && liveItem.liveType == 2&&!generating" :id="`myVideo_${liveId}`"
 							:autoplay="true" class="video-player" :src="liveItem.videoUrl" 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"
@@ -101,14 +101,48 @@
 							@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" :controls="isPlayback"></video>
+							type="application/x-mpegURL" :controls="isPlayback"></video> -->
+							<video 
+							  v-if="liveItem.videoUrl && liveItem.liveType == 2 && !generating" 
+							  :id="`myVideo_${liveId}`"
+							  :autoplay="true" 
+							  class="video-player" 
+							  :src="liveItem.videoUrl" 
+							  object-fit="contain"
+							  :custom-cache="false" 
+							  :enable-progress-gesture="false" 
+							  vslide-gesture-in-fullscreen="true"
+							  :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" 
+							  :controls="false"  
+							  show-fullscreen-btn  
+							  show-play-btn  
+							  show-mute-btn  
+							  enable-play-gesture="true"  
+							></video>
 						<view v-else class="txt">回放生成中...</view>
 						<view v-if="isPlayback" class="replay-label">回放</view>
 					</view>
-
 				</view>
 
 				<!-- 直播结束状态 -->
+				<!-- v-if="liveItem.status == 3" -->
 				<view class="videolist" v-if="liveItem.status == 3">
 					<view class="video-container" :class="liveItem.showType == 1 ? 'horizontal-layout' : ''">
 						<view class="live-end-message">直播已结束</view>
@@ -660,6 +694,9 @@
 		loginByMp,
 		getUserInfo
 	} from '@/api/living.js';
+	import {
+		editUser
+	} from '@/api/user'
 
 	// import {
 	// 	generateRandomString
@@ -844,7 +881,8 @@
 				userInfo: {}, //用户信息
 				userData: {},
 				diffTotalTime: '',
-				address: ''
+				address: '',
+				user:{}
 			};
 		},
 		async onLoad(options) {
@@ -911,7 +949,7 @@
 						const safeAreaBottom = this.systemInfo.safeAreaInsets ? this.systemInfo.safeAreaInsets
 							.bottom : 0;
 						if (safeAreaBottom > 0) {
-							calculatedHeight = calculatedHeight - (safeAreaBottom * 3.0); // 微调10rpx
+							calculatedHeight = calculatedHeight - (safeAreaBottom * 2.0); // 微调10rpx
 						}
 						this.keyboardHeight = Math.max(400, calculatedHeight);
 					} else {
@@ -931,7 +969,8 @@
 						if (this.systemInfo.brand == 'vivo') {
 							this.keyboardHeight = res.height * 2;
 						} else {
-							this.keyboardHeight = (res.height * 1.78) + 20;
+							// this.keyboardHeight = (res.height * 1.78) + 20;''
+							this.keyboardHeight = (res.height * 1.88) + 20;
 						}
 						console.log("高度是", this.keyboardHeight)
 					} else {
@@ -1223,7 +1262,7 @@
 		},
 		methods: {
 			shouquan() {
-				if (this.userinfo.nickname == '') {
+				if (this.user.nickname == '') {
 					uni.showToast({
 						icon: 'none',
 						title: "请先授权微信昵称",
@@ -1231,22 +1270,47 @@
 				}
 			},
 			confimrname() {
-				if (this.userInfo.nickname == '') {
+				if (this.user.nickname == '') {
 					uni.showToast({
 						icon: 'none',
 						title: "请授权微信昵称",
 					});
 					return
 				}
-
-				uni.setStorageSync('userInfo', this.userInfo)
-				// this.editUserA()
-				this.userlogo = false
+				this.editUser();
+				uni.setStorageSync('userInfo', this.userInfo);
+				this.userlogo = false;
+			},
+			
+			editUser() {
+				this.user.nickName = this.user.nickname;
+				editUser(this.user).then(
+					res => {
+						if (res.code == 200) {
+							uni.showToast({
+								icon: 'success',
+								title: "修改成功",
+							});
+							this.getUserInfo()
+							// setTimeout(function() {
+							// 	uni.navigateBack({
+							// 		delta: 1, //返回层数,2则上上页
+							// 	})
+							// }, 2000);
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
 			},
 			
 			onNickNameInput(e) {
 				console.log(e)
-				this.userInfo.nickname = e.detail.value
+				this.user.nickname = e.detail.value
 			},
 			async haveLogin() {
 				this.userInfo = uni.getStorageSync('userInfo');
@@ -2199,7 +2263,7 @@
 					userId: this.userInfo.userId,
 					templateId: this.templateId, // 模板ID
 					maOpenId:this.userInfo.maOpenId,
-					appid:this.appid,
+					appId:this.appid,
 					data: {
 						thing6: this.liveItem.liveName,
 						date7: this.liveItem.startTime
@@ -3904,7 +3968,6 @@
 									};
 									this.liveViewersData.push(liveViewers);
 									this.liveUserTotal++;
-									console.log("2人数是", this.liveUserTotal)
 								}
 
 								// 解析用户ID(根据实际接口字段调整,此处假设data含userId)
@@ -4149,9 +4212,11 @@
 		--video-height: 100vh;
 		--chat-height: 30vh;
 		--pop-bg: #333333;
+		--notice-bg:rgba(9, 9, 9, 0.4);
 	}
 
 	.swiper-wrapper.horizontal {
+		--notice-bg:#fefae8;
 		--pop-bg: #ECF5F4;
 		/* 默认变量(浅色主题) */
 		--bottom-color: #fff;
@@ -4199,10 +4264,9 @@
 				align-items: center;
 				color: var(--text-color);
 				padding: 20rpx;
-				z-index: 9999;
+				z-index: 999;
 				box-shadow: 0 8rpx 40rpx rgba(0, 0, 0, 0.12);
 				 transition: box-shadow 0.3s ease;
-
 				.trailer-video {
 					width: 100%;
 					height: 400rpx;
@@ -4442,7 +4506,7 @@
 							left: 50%;
 							transform: translate(-50%, -50%);
 							font-size: 36rpx;
-							color: #fff;
+							color: var(--text-color);
 						}
 
 						.replay-label {
@@ -4507,7 +4571,7 @@
 						bottom: 388rpx;
 						max-width: 80%;
 						padding: 24rpx;
-						background-color: rgba(0, 0, 0, 0.3);
+						background-color: var(--notice-bg);
 						margin: 0 0 20rpx 20rpx;
 						border-radius: 20rpx;
 						color: #ffda73;
@@ -4561,6 +4625,8 @@
 
 				// 输入和操作区域
 				.input-actions-container {
+					position: relative;
+					z-index: 999999;
 					background-color: var(--bottom-color);
 					display: flex;
 					justify-content: space-between;
@@ -4623,7 +4689,7 @@
 						}
 
 						.send-button {
-							background-color: #fafafa;
+							background-color: #ffffff;
 							border-radius: 28rpx;
 							padding: 14rpx 16rpx;
 							color: #181818;