qxj hace 2 semanas
padre
commit
04cfbaf416

+ 0 - 1
App.vue

@@ -67,7 +67,6 @@
 					let menuRight = result.screenWidth - menuButtonInfo.right + 'px'
 					let menuTop = menuButtonInfo.top + 'px'
 					let contentTop = result.statusBarHeight + 44 + 'px'
-			
 					let menuInfo = {
 						statusBarHeight: statusBarHeight,//状态栏高度----用来给自定义导航条页面的顶部导航条设计padding-top使用:目的留出系统的状态栏区域
 						menuWidth: menuWidth,//右侧的胶囊宽度--用来给自定义导航条页面的左侧胶囊设置使用

+ 5 - 0
pages/auth/login.vue

@@ -72,6 +72,9 @@ export default {
 		// #endif
 	 
 	},
+	onShow() {
+			console.log("跳到登录页面了")
+	},
 	onUnload() {
 	},
 	mounted() {
@@ -141,6 +144,7 @@ export default {
 				});
 				return false;
 			}
+		
 			uni.showLoading({
 				title:"处理中..."
 			})
@@ -175,6 +179,7 @@ export default {
 									uni.setStorageSync('AppToken',res.token);
 									uni.setStorageSync('userInfo',JSON.stringify(res.user));
 									uni.hideLoading()
+									
 									//that.getUserInfo()
 									uni.$emit('refreshLogin');
 									uni.navigateBack({

+ 1 - 1
pages/home/index.vue

@@ -9,7 +9,7 @@
 					<!-- 这里是状态栏 -->
 					<view class="status_bar" :style="{height: statusBarHeight}"></view>
 					<view class="top-title">
-						<view class="name">百域承品</view>
+						<view class="name" >百域承品</view>
 						<!-- <view class="dot">•</view><view class="sub-name">七彩互联网医院</view> -->
 					</view>
 					<!-- 搜索框、购物车、客服 -->

+ 92 - 93
pages/shopping/paymentOrder.vue

@@ -179,34 +179,52 @@
 				payLimitTime: null,
 				order: null,
 				user: null,
-				payParams:null
+				payParams: null,
+				userinfo: {},
+				isPaying: false, // 防止重复支付
+				payDebounceTimer: null // 防抖定时器
 			}
 		},
 		onLoad(option) {
+			this.getSafeUserInfo();
 			this.orderId = JSON.parse(option.orderId);
 			// this.orderBindUser(this.orderId)
 			this.getStoreOrderById();
 			this.getStoreConfig();
 			this.getUserInfo();
-			// uni.showShareMenu({
-			// 	withShareTicket:true,
-			// 	//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
-			// 	menus:["shareAppMessage"] //不设置默认发送给朋友
-			// })
 		},
 		onUnload() {
 			this.clearPayTypeFun()
 		},
-		//发送给朋友
-		// onShareAppMessage(res) {
-		// 	return {
-		// 		title: "帮TA支付",
-		// 		path: '/pages_user/user/otherPaymentOrder?orderId='+this.orderId,
-		// 		imageUrl: this.$store.state.imgpath+'/app/image/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
-		// 	}
-
-		// },
 		methods: {
+			getSafeUserInfo() {
+				try {
+					const userInfoStr = uni.getStorageSync('userInfo');
+					if (!userInfoStr) {
+						this.userinfo = {};
+						return;
+					}
+
+					// 如果是字符串,解析为对象
+					if (typeof userInfoStr === 'string') {
+						this.userinfo = JSON.parse(userInfoStr);
+					} else {
+						// 如果是对象,直接使用
+						this.userinfo = userInfoStr;
+					}
+
+					console.log('获取到的用户信息:', this.userinfo);
+				} catch (error) {
+					console.error('获取用户信息失败:', error);
+					this.userinfo = {};
+				}
+			},
+			redirectToLogin() {
+				// 直接跳转到登录页,不删除token和userInfo
+				uni.navigateTo({
+					url: '/pages/auth/login'
+				});
+			},
 			async clearPayTypeFun() {
 				this.payParams && this.payParams.orderId && await clearPayType(this.payParams)
 			},
@@ -238,11 +256,6 @@
 						this.getStoreOrderById();
 						this.getStoreConfig();
 						this.getUserInfo();
-						// uni.showShareMenu({
-						// 	withShareTicket:true,
-						// 	//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
-						// 	menus:["shareAppMessage"] //不设置默认发送给朋友
-						// })
 					} else {
 						uni.showToast({
 							icon: 'none',
@@ -366,15 +379,64 @@
 				})
 			},
 			// 防抖后的支付方法
-			payOrder: function() {
-				// 创建防抖函数实例
-				const debouncedPay = this.debounce(function() {
-					this.executePay();
-				}, 1000); // 1秒防抖时间,可以根据需要调整
-
-				// 执行防抖函数
-				debouncedPay();
-			}, // 实际的支付执行逻辑
+			// 修复后的支付方法
+			payOrder() {
+				// 1. 安全地获取用户信息
+				this.getSafeUserInfo();
+
+				// 2. 检查 maOpenId,但不要直接修改字符串
+				// 3. 检查用户信息是否有效
+				if (!this.userinfo || Object.keys(this.userinfo).length === 0) {
+					uni.showToast({
+						title: '用户信息异常,请重新登录',
+						icon: 'none'
+					});
+					
+					// 直接跳转到登录页
+					this.redirectToLogin();
+					return;
+				}
+				
+				// 4. 检查 maOpenId,如果不存在则提示重新登录
+				if (!this.userinfo.maOpenId) {
+					uni.showModal({
+						title: '提示',
+						content: '用户信息不完整,需要重新登录',
+						success: (res) => {
+							if (res.confirm) {
+								this.redirectToLogin();
+							}
+						}
+					});
+					return;
+				}
+
+				// 5. 检查登录状态
+				this.utils.isLogin().then(res => {
+					if (res) {
+						// 创建防抖函数实例
+						const debouncedPay = this.debounce(function() {
+							this.executePay();
+						}, 1000); // 1秒防抖时间
+
+						// 执行防抖函数
+						debouncedPay();
+					} else {
+						// 未登录,直接跳转到登录页
+						this.redirectToLogin();
+					}
+				}).catch(err => {
+					console.error('检查登录状态失败:', err);
+					uni.showToast({
+						title: '登录状态异常',
+						icon: 'none'
+					});
+					// 登录状态异常,也跳转到登录页
+					this.redirectToLogin();
+				});
+			},
+			
+			// 实际的支付执行逻辑
 			executePay() {
 				var data = {
 					orderId: this.order.id,
@@ -436,70 +498,7 @@
 						});
 					}
 				);
-			},
-			// payOrder(){
-			// 	var data = {orderId:this.order.id,payType:this.order.payType};
-			// 	var that=this;
-			// 	uni.showLoading();
-			// 	pay(data).then(
-			// 		res => {
-			// 			if(res.code==200){
-			// 				 console.log(res);
-			// 				 if(res.payType==1||res.payType==2||res.payType==3){
-			// 					 uni.requestPayment({
-			// 					 	provider: 'wxpay',
-			// 					 	timeStamp: res.result.timeStamp,
-			// 					 	nonceStr:res.result.nonceStr,
-			// 					 	package: res.result.packageValue,
-			// 					 	signType: res.result.signType,
-			// 					 	paySign: res.result.paySign,
-			// 					 	success: function(res) {
-			// 							console.log('yess:' + JSON.stringify(res));
-			// 					 		 uni.hideLoading();
-			// 							  uni.redirectTo({
-			// 							  	url:"success?order="+JSON.stringify(that.order)
-			// 							  }) 
-			// 					 	},
-			// 					 	fail: function(err) {
-			// 							uni.showToast({
-			// 								icon:'none',
-			// 								title:'fail:' + JSON.stringify(err),
-			// 							});
-			// 					 		console.log('fail:' + JSON.stringify(err));
-			// 					 		uni.hideLoading();
-			// 					 	},
-			// 						complete: (err) => {
-			// 							console.log('fail:' + JSON.stringify(err));
-			// 						}
-			// 					 });
-			// 				 }
-			// 				 // else if(res.payType==3){
-			// 					//  uni.hideLoading();
-			// 					//  if(that.order.isPrescribe){
-			// 					// 	 //如果是处方订单开处方
-			// 					// 	uni.redirectTo({
-			// 					// 		url:"prescribe?orderId="+that.order.id
-			// 					// 	})
-			// 					//  }
-			// 					//  else{
-			// 					// 	//如果是普通订单
-			// 					// 	uni.redirectTo({
-			// 					// 		url:"success?order="+JSON.stringify(that.order)
-			// 					// 	}) 
-			// 					//  }
-			// 				 // }
-
-			// 			}else{
-			// 				uni.showToast({
-			// 					icon:'none',
-			// 					title: res.msg,
-			// 				});
-			// 			}
-			// 		},
-			// 		rej => {}
-			// 	);
-
-			// }
+			}
 		}
 	}
 </script>

+ 2 - 2
pages/user/index.vue

@@ -180,12 +180,12 @@
 							</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>
 								<text class="text">直播</text>
-							</view>
+							</view> -->
 
 							<view class="item no-marin-bottom" @click="toManager()">
 								<image

+ 2 - 1
pages_company/order/confirmCompanyOrder.vue

@@ -119,7 +119,8 @@
 					if(this.inputTxt==0){
 						this.inputTxt=this.price.totalPrice.toFixed(2)
 					}
-					var data={createOrderKey:this.orderKey,token:uni.getStorageSync('CompanyUserToken'),money:this.inputTxt,payAmount:this.payAmount}
+					// ,payAmount:this.payAmount
+					var data={createOrderKey:this.orderKey,token:uni.getStorageSync('CompanyUserToken'),money:this.inputTxt}
 					updateSalseOrderMoney(data).then(
 						res => {
 							if(res.code==200){

+ 6 - 2
pages_company/storeProductPackageDetails.vue

@@ -162,10 +162,14 @@
 			}
 		},
 		onShow() {
-			console.log("onshow")
-			if(this.utils.isLogin()){
+			const token=uni.getStorageSync('AppToken')
+			if(token){
 				this.getOrderCount();
 			}
+			
+				
+			// 	if(this.utils.isLogin()){
+			// }
 			this.getStoreProductPackageDetails();
 		},
 		methods: {

+ 2 - 2
pages_course/components/like.vue

@@ -207,8 +207,8 @@
 		position: relative;
 		
 		.image {
-			width: 48rpx;
-			height: 48rpx;
+			width: 88rpx;
+			height: 88rpx;
 		}
 
 		/* 动画图标样式 */

+ 607 - 104
pages_course/living.vue

@@ -55,7 +55,7 @@
 
 			<view class="content" :class="{ 'horizontal-content': isFocus==1, 'trailer-content': liveItem.status==1  }">
 				<!-- 顶部信息栏 -->
-				<view class="top-info-bar" :class="liveItem.showType == 1 ? 'horizontal-top' : ''">
+				<view class="top-info-bar" v-if="!isFullscreen" :class="liveItem.showType == 1 ? 'horizontal-top' : ''">
 					<view class="user-info-section">
 						<image v-if="!scene" @click="goBack" class="back-icon mr4"
 							src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/return3.png" />
@@ -94,15 +94,6 @@
 				<!-- 视频区域 -->
 				<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}`"
-							: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"
-							@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="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"
@@ -111,13 +102,35 @@
 							@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>
+							:stash-time="0" type="application/x-mpegURL" :controls="false" :show-fullscreen-btn="false"
+							show-play-btn show-mute-btn enable-play-gesture="true"
+							@fullscreenchange="onFullscreenChange" x5-video-player-fullscreen="true"
+							x5-video-player-type="h5" x5-video-orientation="landscape" :webkit-playsinline="true"
+							playsinline="true" :x5-playsinline="true">
+						</video>
+
+						<!-- 全屏返回按钮 - 只在全屏状态下显示 -->
+						<!-- <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 v-if="showCustomControls && liveItem.showType==1 && !isFullscreen" class="custom-controls"
+							@click="toggleFullscreen">
+							<image src="/static/images/full_screen.png" class="control-icon" />
+						</view> -->
+
+						<!-- 投诉按钮 -->
+						<view v-if="liveItem.showType==2" 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 v-if="isPlayback" class="replay-label">回放</view>
 					</view>
 				</view>
-
 				<!-- 直播结束状态 -->
 				<!-- v-if="liveItem.status == 3" -->
 				<view class="videolist" v-if="liveItem.status == 3">
@@ -140,6 +153,25 @@
 						<view v-if="liveItem.videoUrl && liveItem.liveType == 3" class="replay-label">直播回放</view>
 					</view>
 				</view>
+				<view class="slide-group">
+					<view class="action-button-group" v-if="!isFocus">
+						<view :class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','ml20']">
+							<button open-type="share" class="action-icon button-reset">
+								<image class="action-icon"
+									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/weixin.png"
+									mode="widthFix" />
+							</button>
+						</view>
+					</view>
+					<view class="action-button-group" v-if="!isFocus">
+						<view
+							:class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','ml20','like-container']"
+							@click="onLike">
+							<LikeButton :initialCount="100" :heartsPerClick="5" @like="onLike" />
+							<view class="like-count">{{formattedLikeCount||0 }}</view>
+						</view>
+					</view>
+				</view>
 
 				<!-- 底部聊天区域 -->
 				<view class="chat-area-container" :class="{
@@ -151,6 +183,12 @@
 						<u-tabs :list="listTabs" @click="clickTabs" lineColor="#02B176"
 							:activeStyle="{color: '#02B176',fontWeight: 'bold',transform: 'scale(1.05)'}">
 						</u-tabs>
+						<!-- 投诉 -->
+						<view v-if="liveItem.showType==1" class="complaint-box"
+							@click="navgetTo('/pages_shopping/live/complaintList') ">
+							<image class="image w32 h32 mr10" src="/static/images/complaint2.png" mode="widthFix" />
+							<view class="fs26">投诉</view>
+						</view>
 					</view>
 
 					<view class="chat-content-wrapper" :class="{ 'chat-content-focused': isFocus }">
@@ -160,7 +198,12 @@
 						</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"
+<<<<<<< HEAD
 							:enable-back-to-top="false" class="message-scroll-view" :scroll-top="scrollTop"
+=======
+							:enable-back-to-top="false" class="message-scroll-view"
+							:class="liveItem.status == 1 ? 'message-scroll2' : ''" :scroll-top="scrollTop"
+>>>>>>> ec4703cedaff0cd705138bc3eab10dbc8ee4cfa6
 							:scroll-into-view="scrollIntoView" @scroll="onScroll" ref="scrollView">
 							<view class="message-list" v-for="(item, talkIndex) in (talklist || [])"
 								:key="item.uniqueId " :id="`list_${item.uniqueId }`" v-show="item.cmd != 'red' ">
@@ -200,7 +243,7 @@
 						<view class="action-buttons" v-if="!isFocus">
 							<view class="action-button-group" v-if="!isFocus">
 								<view
-									:class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','ml20']"
+									:class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','mr40']"
 									@click="isMore=true,shopping=false">
 									<!-- <image
 										src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/more-icon.png"
@@ -212,29 +255,13 @@
 										class="action-icon" />
 								</view>
 							</view>
-							<view class="action-button-group" v-if="!isFocus">
-								<view
-									:class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','ml20']">
-									<button open-type="share" class="action-icon button-reset">
-										<image class="action-icon"
-											src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/weixin.png"
-											mode="widthFix" />
-									</button>
-								</view>
-							</view>
-							<view class="icon-button " @tap="openCart()">
+
+							<view class="icon-button mr20" @tap="openCart()">
 								<image
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/shopping.png"
 									class="cart-icon" />
 							</view>
-							<view class="action-button-group" v-if="!isFocus">
-								<view
-									:class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','ml20','like-container']"
-									@click="onLike">
-									<LikeButton :initialCount="100" :heartsPerClick="5" @like="onLike" />
-									<view class="like-count">{{formattedLikeCount||0 }}</view>
-								</view>
-							</view>
+
 						</view>
 					</view>
 				</view>
@@ -267,18 +294,12 @@
 			<!-- :show="userlogo" -->
 			<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-between align-center  plr20">
 						<view class="button-container">
-							<input type="nickname" class="hidden-input" @blur="onNickNameInput" placeholder="请点击授权微信昵称"
-								@input="onNickNameInput" />
-							<!-- <button class="custom-button"
-								:class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button> -->
+							<input type="nickname" class="hidden-input"
+								placeholder-style="color:#ffffff; font-size:44rpx;" @blur="onNickNameInput"
+								placeholder="请点击授权微信昵称" @input="onNickNameInput" />
 						</view>
 					</view>
 					<view class="submitname" @click="confimrname">确定</view>
@@ -519,11 +540,11 @@
 			<!-- 更多操作弹窗 -->
 			<u-popup :show="isMore" @close="closeMore" round="20rpx" bgColor="#f3f5f9" zIndex="10076">
 				<view class="more-actions-popup">
-					<view class="more-action-item" @click="navgetTo('/pages_shopping/live/integral'), (isMore = false)">
+					<!-- <view class="more-action-item" @click="navgetTo('/pages_shopping/live/integral'), (isMore = false)">
 						<image class="action-icon"
 							src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/order.png" />
 						<view class="action-label">积分</view>
-					</view>
+					</view> -->
 					<view class="more-action-item"
 						@click="navgetTo('/pages_shopping/live/storeOrderRefundList?liveId=' + liveId), (isMore = false)">
 						<image class="action-icon"
@@ -686,6 +707,20 @@
 		},
 		data() {
 			return {
+<<<<<<< HEAD
+=======
+				isFullscreen: false,
+				isMuted: false,
+				showCustomControls: true,
+				videoContext: null,
+
+				isNow: false,
+				fakeAvatar: Array.from({
+						length: 11
+					}, (_, i) =>
+					`https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/avatar${i + 1}.jpg`),
+				virtualHuman: null,
+>>>>>>> ec4703cedaff0cd705138bc3eab10dbc8ee4cfa6
 				userlogo: false,
 				listTabs: [{
 					name: '讨论',
@@ -848,6 +883,7 @@
 			};
 		},
 		async onLoad(options) {
+			this.toggleFullscreen()
 			this.initTime()
 			this.getLocationByIP();
 			if (options.liveId) {
@@ -955,6 +991,20 @@
 			this.getliving(this.liveId);
 		},
 		mounted() {
+			// 获取 video 上下文
+			// 监听视频全屏事件
+			setTimeout(() => {
+				this.videoContext = uni.createVideoContext(`myVideo_${this.liveId}`, this);
+
+				// 添加全屏状态变化监听(更可靠的方式)
+				if (this.videoContext) {
+					// 使用 uni.onUserCaptureScreen 作为备选方案
+					uni.onUserCaptureScreen(() => {
+						console.log('用户截屏,可能是全屏状态');
+					});
+				}
+			}, 1000);
+
 			const systemInfo = uni.getSystemInfoSync();
 			this.isIOS = systemInfo.platform === 'ios';
 		},
@@ -1030,8 +1080,35 @@
 				this.totalTraffic = 0;
 			}
 			this.startTimer();
+<<<<<<< HEAD
+=======
+
+			this.$nextTick(() => {
+				if (!this.userInfo || !this.userInfo.updateTime) {
+					console.log('用户信息不完整,显示授权弹窗');
+					this.userlogo = true;
+					return;
+				}
+
+				// 重新计算 isNow
+				const isNowCalculated = dayjs(this.userInfo.updateTime).isSame(dayjs(), 'day');
+				console.log('重新计算 isNow:', isNowCalculated);
+
+				if (!isNowCalculated) {
+					console.log('不是今天更新过,显示授权弹窗');
+					this.userlogo = true;
+				}
+				setTimeout(() => {
+					this.videoContext = uni.createVideoContext(`myVideo_${this.liveId}`, this);
+					console.log('videoContext 初始化完成:', this.videoContext);
+				}, 1000);
+			});
+			// 初始化横屏支持
+			// this.initFullscreenSupport();
+>>>>>>> ec4703cedaff0cd705138bc3eab10dbc8ee4cfa6
 		},
 
+
 		//分享给好友
 		onShareAppMessage() {
 			return {
@@ -1045,7 +1122,9 @@
 					console.error('分享失败', err);
 				}
 			};
-		}, // 分享到朋友圈
+		},
+
+		// 分享到朋友圈
 		onShareTimeline() {
 			return {
 				title: '邀请你来观看直播:' + this.liveItem.liveName,
@@ -1177,6 +1256,11 @@
 			// 清理大数据和状态
 			this.clearBigData();
 			this.resetAllStates();
+			// 清理屏幕方向锁定
+			this.unlockOrientation();
+
+			// 移除屏幕方向监听
+			this.removeOrientationChangeListener();
 		},
 
 		mounted() {
@@ -1223,7 +1307,218 @@
 				immediate: true
 			}
 		},
-		methods: {
+		methods: { // 退出全屏
+			exitFullscreen() {
+				console.log('退出全屏按钮被点击');
+
+				if (!this.videoContext) {
+					console.log('创建 videoContext');
+					this.videoContext = uni.createVideoContext(`myVideo_${this.liveId}`, this);
+				}
+
+				if (!this.videoContext) {
+					console.error('videoContext 创建失败');
+					return;
+				}
+
+				if (this.isFullscreen) {
+					console.log('执行退出全屏操作');
+					this.videoContext.exitFullScreen();
+				} else {
+					console.log('当前不是全屏状态,无需退出');
+				}
+			},
+			// 添加屏幕方向变化监听
+			addOrientationChangeListener() {
+				if (window.addEventListener) {
+					window.addEventListener('orientationchange', this.handleOrientationChange);
+				}
+			},
+
+			// 移除屏幕方向变化监听
+			removeOrientationChangeListener() {
+				if (window.removeEventListener) {
+					window.removeEventListener('orientationchange', this.handleOrientationChange);
+				}
+			}, // 处理屏幕方向变化
+			handleOrientationChange() {
+				const orientation = window.orientation;
+				console.log('屏幕方向变化:', orientation);
+
+				// 0: 竖屏
+				// 90: 横屏(向左转)
+				// -90: 横屏(向右转)
+				// 180: 倒置(很少用)
+
+				if (this.isFullscreen && Math.abs(orientation) !== 90) {
+					// 全屏状态下,如果不是横屏,尝试退出全屏
+					console.log('全屏状态下屏幕方向不正确,尝试退出全屏');
+					if (this.videoContext) {
+						this.videoContext.exitFullScreen();
+					}
+				}
+			},
+
+			// 强制横屏全屏(备用方案)
+			forceLandscapeFullscreen() {
+				// 尝试多种全屏方式
+				try {
+					// 方案1: 使用video的requestFullScreen
+					if (this.videoContext) {
+						this.videoContext.requestFullScreen({
+							direction: 90
+						});
+						return true;
+					}
+				} catch (e) {
+					console.log('方案1失败:', e);
+				}
+
+				try {
+					// 方案2: 尝试DOM全屏API
+					const videoElement = document.getElementById(`myVideo_${this.liveId}`);
+					if (videoElement && videoElement.requestFullscreen) {
+						videoElement.requestFullscreen();
+						return true;
+					}
+				} catch (e) {
+					console.log('方案2失败:', e);
+				}
+
+				try {
+					// 方案3: 使用Web API全屏
+					if (document.documentElement.requestFullscreen) {
+						document.documentElement.requestFullscreen();
+						return true;
+					}
+				} catch (e) {
+					console.log('方案3失败:', e);
+				}
+
+				console.log('所有全屏方案都失败了');
+				uni.showToast({
+					title: '无法全屏播放,请尝试手动横屏',
+					icon: 'none'
+				});
+				return false;
+			},
+			// 初始化全屏支持
+			// initFullscreenSupport() {
+			// 	// 检测是否支持全屏API
+			// 	if (document.fullscreenEnabled) {
+			// 		console.log('浏览器支持全屏API');
+			// 	} else {
+			// 		console.log('浏览器不支持全屏API,使用备用方案');
+			// 	}
+			// },
+			// 切换全屏
+			// 切换全屏
+			toggleFullscreen() {
+				console.log('全屏按钮被点击');
+
+				// 确保 videoContext 存在
+				if (!this.videoContext) {
+					console.log('创建 videoContext');
+					this.videoContext = uni.createVideoContext(`myVideo_${this.liveId}`, this);
+				}
+
+				if (!this.videoContext) {
+					console.error('videoContext 创建失败');
+					return;
+				}
+
+				if (this.isFullscreen) {
+					this.exitFullscreen();
+				} else {
+					console.log('请求全屏(横屏模式)');
+					this.videoContext.requestFullScreen({
+						direction: 90 // 90表示横屏,0是竖屏
+					});
+				}
+			},
+			// 全屏状态变化监听
+			// 加强 onFullscreenChange 方法
+			// onFullscreenChange(e) {
+			// 	console.log('全屏状态变化事件:', e);
+
+			// 	// 确保正确获取状态
+			// 	const isFullScreen = e.detail && e.detail.fullScreen;
+			// 	console.log('全屏状态:', isFullScreen);
+
+			// 	this.isFullscreen = isFullScreen;
+
+			// 	// 全屏时隐藏自定义控制条
+			// 	this.showCustomControls = !this.isFullscreen;
+
+			// 	// 强制更新UI
+			// 	this.$forceUpdate();
+
+			// 	// 调试输出
+			// 	console.log('isFullscreen:', this.isFullscreen);
+			// 	console.log('showCustomControls:', this.showCustomControls);
+			// },
+			 onFullscreenChange(e) {
+			      const videoContainer = e.target.parentNode; // 获取视频父容器
+			      const isFullscreen = document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
+			      
+			      if (isFullscreen) {
+			        // 进入全屏:让图标容器也进入全屏,确保层级
+			        if (videoContainer.requestFullscreen) {
+			          videoContainer.requestFullscreen();
+			        } else if (videoContainer.webkitRequestFullscreen) {
+			          videoContainer.webkitRequestFullscreen();
+			        } else if (videoContainer.msRequestFullscreen) {
+			          videoContainer.msRequestFullscreen();
+			        }
+			        // 适配x5内核(微信等)
+			        document.documentElement.style.webkitTouchCallout = 'none';
+			        document.documentElement.style.webkitUserSelect = 'none';
+			      } else {
+			        // 退出全屏:退出容器的全屏
+			        if (document.exitFullscreen) {
+			          document.exitFullscreen();
+			        } else if (document.webkitExitFullscreen) {
+			          document.webkitExitFullscreen();
+			        } else if (document.msExitFullscreen) {
+			          document.msExitFullscreen();
+			        }
+			      }
+			    },
+			// 锁定屏幕方向为横屏
+			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);
+					}
+				}
+			},
+
 			shouquan() {
 				if (this.user.nickname == '') {
 					uni.showToast({
@@ -4209,6 +4504,139 @@
 </script>
 
 <style scoped lang="scss">
+	.fullscreen-exit-btn {
+		position: absolute;
+		bottom: 120rpx;
+		right: 40rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		z-index: 99999;
+		background: rgba(0, 0, 0, 0.6);
+		border-radius: 40rpx;
+		padding: 20rpx 24rpx;
+		transition: all 0.3s ease;
+
+		&:active {
+			transform: scale(0.95);
+			background: rgba(0, 0, 0, 0.8);
+		}
+
+		.exit-fullscreen-icon {
+			width: 40rpx;
+			height: 40rpx;
+			margin-bottom: 10rpx;
+		}
+
+		.exit-text {
+			color: #ffffff;
+			font-size: 22rpx;
+			white-space: nowrap;
+		}
+	}
+
+	// 全屏时的样式调整
+	.video-container.fullscreen-mode {
+		position: fixed;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		z-index: 999999;
+		background-color: #000;
+
+		.video-player {
+			width: 100%;
+			height: 100%;
+		}
+
+		.custom-controls {
+			position: absolute;
+			bottom: 42rpx;
+			right: 20rpx;
+			display: flex;
+			align-items: center;
+			z-index: 9999;
+			background: rgba(0, 0, 0, 0.5);
+			border-radius: 40rpx;
+			padding: 10rpx 20rpx;
+			transition: all 0.3s ease;
+
+			// 全屏状态下的样式调整
+			.fullscreen-mode & {
+				display: none;
+			}
+
+			&:active {
+				transform: scale(0.95);
+				background: rgba(0, 0, 0, 0.6);
+				opacity: 0.8;
+			}
+		}
+
+		// 全屏时其他元素隐藏
+		.complaint-box,
+		.replay-label {
+			display: none;
+		}
+	}
+
+	.video-container {
+		position: relative;
+		width: 100%;
+		height: 100%;
+		/* 根据需要调整 */
+	}
+
+	.video-player {
+		width: 100%;
+		height: 100%;
+	}
+
+	.custom-controls {
+		position: absolute;
+		bottom: 42rpx;
+		/* 调整位置,避免被其他元素覆盖 */
+		right: 20rpx;
+		display: flex;
+		align-items: center;
+		z-index: 9999;
+		/* 确保在最上层 */
+		background: rgba(0, 0, 0, 0.5);
+		border-radius: 40rpx;
+		padding: 10rpx 20rpx;
+	}
+
+	/* 优化全屏按钮样式 */
+	.custom-controls:active {
+		transform: scale(0.95);
+		background: rgba(0, 0, 0, 0.6);
+		opacity: 0.8;
+	}
+
+	.control-icon {
+		width: 46rpx;
+		height: 46rpx;
+	}
+
+	
+
+	@media screen and (orientation: landscape) {
+		.video-container.horizontal-layout {
+			width: 100%;
+			height: 100%;
+		}
+
+		.video-player {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+
+
+
 	// 重置按钮样式
 	.button-reset {
 		background-color: transparent !important;
@@ -4527,6 +4955,22 @@
 							// z-index: 99;
 						}
 
+						.complaint-box {
+							position: absolute;
+							top: 20%;
+							right: 20rpx;
+							width: 140rpx;
+							margin-top: 20rpx;
+							display: flex;
+							align-items: center;
+							justify-content: center;
+							background-color: rgba(77, 77, 77, 0.5);
+							padding: 16rpx 0;
+							color: #fff;
+							border-radius: 28rpx;
+							z-index: 999;
+						}
+
 						.txt {
 							text-align: center;
 							font-weight: 500;
@@ -4537,6 +4981,8 @@
 						.video-player {
 							width: 100%;
 							height: 100%;
+							position: relative;
+							z-index: 1;
 						}
 
 						.live-end-message {
@@ -4556,8 +5002,61 @@
 							padding: 6rpx 16rpx;
 							color: #fff;
 							border-radius: 15rpx;
+							z-index: 1;
+						}
+					}
+				}
+			}
+
+			// 侧边
+			.slide-group {
+				position: absolute;
+				right: 20rpx;
+				top: 60%;
+				z-index: 9000;
+
+				.action-button-group {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					margin-top: 50rpx;
+				}
+
+				.action-icon {
+					width: 88rpx;
+					height: 88rpx;
+				}
+
+				.icon-button {
+					// background: var(--normal-bg);
+					// border-radius: 50%;
+					width: 88rpx;
+					height: 88rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					transition: transform 0.2s ease;
+
+					// margin-left: 10rpx;
+
+					&.like-container {
+						display: flex;
+						flex-direction: column;
+						justify-content: center;
+						align-items: center;
+
+						.like-count {
+							position: absolute;
+							bottom: -40rpx;
+							font-size: 24rpx;
+							color: #FA341E;
+							padding: 6rpx 16rpx;
+							background: #FFFFFF;
+							border-radius: 30rpx;
 						}
 					}
+
+
 				}
 			}
 
@@ -4594,7 +5093,6 @@
 					position: absolute;
 				}
 
-
 				&.chat-area-focused {
 					transform: translateY(calc(-1 * var(--keyboard-height, 0rpx))) translateZ(0);
 					z-index: 1000;
@@ -4603,11 +5101,25 @@
 				.tabs_bg {
 					background-color: #fff;
 					padding: 20rpx 40rpx 0;
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+
+					.complaint-box {
+						width: 120rpx;
+						height: 48rpx;
+						background: #FFFFFF;
+						border-radius: 24rpx 24rpx 24rpx 24rpx;
+						border: 2rpx solid #EEEEEE;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+					}
 				}
 
 				.chat-content-wrapper {
 					flex: 1;
-					height: 368rpx;
+					height: 300rpx;
 					padding: 20rpx 0;
 					transform: translateZ(0);
 					will-change: height;
@@ -4618,6 +5130,7 @@
 					}
 
 					.notice-message {
+						font-size: 36rpx;
 						position: absolute;
 						bottom: 388rpx;
 						max-width: 80%;
@@ -4625,7 +5138,8 @@
 						background-color: var(--notice-bg);
 						margin: 0 0 20rpx 20rpx;
 						border-radius: 20rpx;
-						color: #ffda73;
+						color: #0d0b05;
+						font-weight: 500;
 						overflow: hidden;
 
 						&.horizontal-notice {
@@ -4643,11 +5157,18 @@
 						flex: 1;
 						flex-direction: column;
 						-webkit-overflow-scrolling: touch;
+<<<<<<< HEAD
+=======
+
+						&.message-scroll2 {
+							height: 300rpx;
+						}
+>>>>>>> ec4703cedaff0cd705138bc3eab10dbc8ee4cfa6
 					}
 
 					.message-list {
 						width: 80%;
-						margin-bottom: 4rpx;
+						margin-bottom: 16rpx;
 						animation: simpleFade 0.2s;
 
 						.message-item {
@@ -4774,50 +5295,17 @@
 							visibility: hidden;
 						}
 
-						.action-button-group {
-							display: flex;
-							justify-content: space-between;
-							align-items: center;
+						.action-icon {
+							width: 48rpx;
+							height: 48rpx;
 						}
 
-						.icon-button {
-							background: var(--normal-bg);
-							border-radius: 50%;
-							width: 88rpx;
-							height: 88rpx;
-							display: flex;
-							justify-content: center;
-							align-items: center;
-							transition: transform 0.2s ease;
-							margin-left: 10rpx;
-
-							&.like-container {
-								display: flex;
-								flex-direction: column;
-								justify-content: center;
-								align-items: center;
-
-								.like-count {
-									position: absolute;
-									bottom: -10rpx;
-									font-size: 14rpx;
-									color: #FA341E;
-									padding: 4rpx 6rpx;
-									background: #FFFFFF;
-									border-radius: 10rpx;
-								}
-							}
+						.cart-icon {
+							width: 58rpx;
+							height: 58rpx;
+						}
 
-							.action-icon {
-								width: 48rpx;
-								height: 48rpx;
-							}
 
-							.cart-icon {
-								width: 58rpx;
-								height: 58rpx;
-							}
-						}
 					}
 				}
 			}
@@ -4930,7 +5418,7 @@
 			}
 
 			.userlogo {
-				padding: 40rpx 20rpx;
+				padding: 60rpx 20rpx 40rpx;
 				color: #181818;
 
 				.boxweixin {
@@ -4944,27 +5432,42 @@
 
 				.button-container {
 					position: relative;
-					// width: 240rpx;
+					margin: auto;
 
-					.subname {
+					.hidden-input {
+						text-align: center;
 						background-color: #00aa00;
-						color: #fff;
+						padding: 40rpx 10rpx;
+						margin: 0 auto;
+						margin: 40rpx 0 20rpx;
+						font-size: 44rpx !important;
+						color: #1d1d1d !important;
+						/* 输入文字大小 */
+					}
+
+					/* 针对 placeholder 的样式 */
+					.hidden-input::placeholder {
+						font-size: 44rpx !important;
+						color: #1d1d1d !important;
 					}
 
-					.subavt {
-						background-color: #fff;
-						border: 2rpx #0a0 solid;
-						color: #00aa00;
+					/* 兼容微信小程序的 placeholder 样式 */
+					.hidden-input .placeholder {
+						font-size: 44rpx !important;
+						color: #1d1d1d !important;
 					}
 				}
 
 				.submitname {
-					background-color: #00aa00;
-					color: #fff;
-					width: 90%;
+					background-color: #ffffff;
+					border: 3rpx solid #00aa00;
+					border-radius: 16rpx;
+					color: #000000;
+					width: 70%;
+					font-size: 36rpx;
 					margin: 0 auto;
 					text-align: center;
-					padding: 30rpx;
+					padding: 20rpx;
 					margin-top: 40rpx;
 				}
 			}

+ 45 - 124
pages_shopping/live/complaint.vue

@@ -3,7 +3,7 @@
 		<view class="mt60 p34">
 			<view class="color#{$5} ">投诉对象</view>
 			<view class="align-center mt30 mb50">
-				<image class="w100 h100 mr30" style="border-radius: 50%;" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/logo.png"></image>
+				<image class="w98 h98 mr30" style="border-radius: 50%;" src="/static/logo.png"></image>
 				<text>百域承品</text>
 			</view>
 		</view>
@@ -39,11 +39,7 @@
 	import {
 		mapGetters
 	} from 'vuex';
-	// complaintRecord
-	// import {
-	// 	getTypeTree,
-	// 	loginByMp
-	// } from "@/api/course.js"
+	
 	export default {
 		data() {
 			return {
@@ -271,126 +267,51 @@
 					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) {
-			// 		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>

+ 47 - 28
pages_shopping/live/confirmCreateOrder.vue

@@ -38,7 +38,8 @@
 					</view>
 					<view class="right" style="align-items: baseline;">
 						<text class="price-info-unit">¥</text>
-						<text class="price-info-num">{{(orderData.totalPrice||0).toFixed(2)}}</text>
+						<text class="price-info-num">{{(safeOrderData.totalPrice||0).toFixed(2)}}</text>
+						<!-- <text class="price-info-num">{{(orderData.totalPrice||0).toFixed(2)}}</text> -->
 					</view>
 				</view>
 				<view class="points" @click="couponVisible = true;">
@@ -64,7 +65,8 @@
 
 				<!-- 备注 -->
 				<view class="remarks">
-					<input type="text" v-model="orderData.remark" placeholder="备注留言(选填)" placeholder-class="input" />
+					<input type="text" v-model="safeOrderData.remark" placeholder="备注留言(选填)"
+						placeholder-class="input" />
 				</view>
 
 
@@ -155,7 +157,8 @@
 		data() {
 			return {
 				orderData: {
-					totalPrice:null
+					totalPrice: null,
+					remark: ''
 				},
 				cityId: null,
 				address: null,
@@ -177,7 +180,7 @@
 				type: '',
 				isFirstLoad: true,
 				recordId: '',
-				productValueSelect:''
+				productValueSelect: ''
 			}
 		},
 
@@ -191,25 +194,31 @@
 			this.type = options.type;
 			this.isFirstLoad = true;
 			this.recordId = options.recordId || '';
-            this.productValueSelect=options.productValueSelect||''
+			this.productValueSelect = options.productValueSelect || ''
 			if (options.type == 'win') {
 				this.getKey()
 			}
-			
-			if (this.type == 'win') {
-				this.computedRewardOrder()
-			} else {
-				this.computedOrder();
+		},
+		computed: {
+			safeOrderData() {
+				return this.orderData || {
+					totalPrice: 0,
+					payPrice: 0,
+					payDelivery: 0,
+					remark: ''
+				};
 			}
 		},
 		onShow() {
 			this.openCoupon()
-			
-			if(!this.cityId){
-				this.getUserAddr();
+			if (this.type == 'win') {
+				this.computedRewardOrder()
+			} else {
+				this.computedOrder()
+			}
+			if (!this.cityId) {
+				this.getUserAddr()
 			}
-			
-		
 			// this.getUserAddr()
 			uni.$on('updateAddress', (e) => {
 				this.address = e;
@@ -219,7 +228,10 @@
 			});
 		},
 		mounted() {
-			
+			// uni.$on('updateAddress', (e) => {
+			// 	this.address = e;
+			// 	this.addressId = e.addressId;
+			// });
 		},
 		onUnload() {
 			uni.$off('updateAddress', this.handleAddressUpdate);
@@ -288,11 +300,12 @@
 					productId: this.productId,
 					orderKey: this.orderKey,
 					couponUserId: this.couponUserId || '',
-					attrValueId:this.productValueSelect
+					attrValueId: this.productValueSelect
 				}
+
 				computed(data).then(res => {
 						if (res.code == 200) {
-							console.log("qxj computedOrder订单信息>>>>", res.data)
+							console.log("查询创建订单信息>>>>", res.data)
 							this.orderData = res.data
 						} else {
 							uni.showToast({
@@ -311,12 +324,12 @@
 					productId: this.productId,
 					orderKey: this.orderKey,
 					totalNum: 1,
-					remark:this.orderData.remark
+					remark: this.orderData.remark || ''
 				}
 				computedReward(data).then(res => {
 						if (res.code == 200) {
 							console.log("查询创建订单信息>>>>", res.data)
-							this.orderData = res.data;
+							this.orderData = res.data || {}
 						} else {
 							uni.showToast({
 								title: res.msg,
@@ -328,22 +341,25 @@
 				);
 			},
 
+
 			// 创建订单
 			createLiveOrder() {
-                console.log("qxj orderData",this.orderData);
+
 				let data = {
 					cityId: this.cityId,
 					liveId: this.liveId,
 					orderKey: this.orderKey,
 					userName: this.address.realName,
-					remark:this.orderData.remark ||'',
+					 remark: (this.orderData && this.orderData.remark) || '', // 安全访问
 					userPhone: this.address.phone,
-					userAddress: this.address.province + ' ' + this.address.city + ' ' + this.address.district + ' ' +this.address.detail,
+					userAddress: this.address.province + ' ' + this.address.city + ' ' + this.address.district + ' ' +
+						this.address.detail,
 					cartId: "5",
 					productId: this.productId,
 					totalNum: this.totalNum,
 					couponUserId: this.couponUserId,
-					attrValueId:this.productValueSelect
+					attrValueId: this.productValueSelect
+
 				}
 
 				return createliveOrder(data).then(res => {
@@ -370,7 +386,7 @@
 					userAddress: this.address.province + ' ' + this.address.city + ' ' + this.address.district + ' ' +
 						this.address.detail,
 					cartId: "5",
-					remark:this.orderData.remark || '',
+					remark: this.orderData.remark || '',
 					productId: this.productId,
 					totalNum: 1,
 					couponUserId: this.couponUserId,
@@ -399,6 +415,7 @@
 				} else {
 					this.computedOrder()
 				}
+
 			},
 			// 自动选择最大优惠券
 			autoSelectMaxCoupon() {
@@ -447,7 +464,7 @@
 			openAddress() {
 				uni.navigateTo({
 					url: '/pages_user/user/address'
-				});
+				})
 			},
 			// 提交订单
 			async submitOrder() {
@@ -474,7 +491,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) {
@@ -508,9 +525,11 @@
 
 			.left {
 				width: 92%;
+
 				.name-box {
 					display: flex;
 					align-items: center;
+
 					.text {
 						font-size: 32rpx;
 						font-family: PingFang SC;
@@ -796,4 +815,4 @@
 		line-height: 0.44 * 100rpx;
 		background-color: red;
 	}
-</style>
+</style>

+ 1 - 2
pages_shopping/live/order.vue

@@ -168,10 +168,9 @@
 				this.mescroll.resetUpScroll()
 			},
 			goDetail(item) {
-				console.log("跳转", item)
 				if (item.status == -1) {
 					uni.navigateTo({
-						url: './refundOrderDetail?id=' + item.afterSaleId
+						url: './refundOrderDetail?id=' + item.afterSalesId
 					})
 
 				} else {

+ 118 - 54
pages_shopping/live/paymentOrder.vue

@@ -56,8 +56,6 @@
 				</view>
 				<view class="item">
 					<text class="label">订单金额</text>
-					<!-- <text class="text"
-						v-if="order!=null">{{order ? (Number(order.totalPrice) || 0).toFixed(2) : "0.00"}}</text> -->
 					<text class="text"
 						v-if="order!=null">{{order ? (Number(order.payPrice) || 0).toFixed(2) : "0.00"}}</text>
 				</view>
@@ -89,22 +87,24 @@
 	import {
 		payConfirmReward,
 	} from '@/api/order'
+	
 	export default {
 		data() {
 			return {
 				type: '',
 				payPrice: null,
 				newOrder: {},
-				payType: 2,
+				payType: 1, // 默认微信支付
 				order: null,
 				orderId: null,
 				payDelivery: 0,
 				payMoney: 0,
 				config: null,
-				payType: 1,
 				user: null,
 				couponUserId: null,
-				payParams:null
+				payParams: null,
+				userinfo: {}, // 添加用户信息存储
+				isPaying: false // 防止重复支付
 			}
 		},
 		computed: {
@@ -118,17 +118,13 @@
 			}
 		},
 		onLoad(options) {
-			// if (options.payPrice) {
-			// 	this.payPrice = options.payPrice;
-			// }
+			this.getSafeUserInfo(); // 页面加载时获取用户信息
+			
 			if (options.couponUserId) {
 				this.couponUserId = options.couponUserId;
 			}
 			console.log("支付订单是>>", options)
 			this.type = options.type;
-			// this.liveId = options.liveId
-			// this.productId=options.productId
-			// console.log("支付订单",options)
 
 			if (options.orderList) {
 				try {
@@ -143,27 +139,47 @@
 		onUnload() {
 			this.clearPayTypeFun()
 		},
-		// //发送给朋友
-		// onShareAppMessage(res) {
-		// 	const combinationOrderId = this.combinationOrderId ?
-		// 		`&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
-		// 	return {
-		// 		title: "帮TA支付",
-		// 		path: '/pages_user/user/otherPaymentOrder?orderId=' + this.orderId + combinationOrderId,
-		// 		imageUrl: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
-		// 	}
-
-		// },
 		methods: {
+			getSafeUserInfo() {
+				try {
+					const userInfoStr = uni.getStorageSync('userInfo');
+					if (!userInfoStr) {
+						this.userinfo = {};
+						return;
+					}
+
+					// 如果是字符串,解析为对象
+					if (typeof userInfoStr === 'string') {
+						this.userinfo = JSON.parse(userInfoStr);
+					} else {
+						// 如果是对象,直接使用
+						this.userinfo = userInfoStr;
+					}
+
+					console.log('获取到的用户信息:', this.userinfo);
+				} catch (error) {
+					console.error('获取用户信息失败:', error);
+					this.userinfo = {};
+				}
+			},
+			
+			redirectToLogin() {
+				// 直接跳转到登录页
+				uni.navigateTo({
+					url: '/pages/auth/login'
+				});
+			},
+			
 			async clearPayTypeFun() {
 				this.payParams && this.payParams.orderId && await clearPayType(this.payParams)
 			},
+			
 			weixinPayOrder() {
 				var data = {
 					orderId: this.order.orderId,
 					payType: 1
 				};
-
+				this.payParams = data
 				var that = this;
 				uni.showLoading();
 				weChatPayment(data).then(
@@ -182,17 +198,14 @@
 									paySign: result.paySign,
 									success: function(res) {
 										uni.hideLoading();
-
 										uni.redirectTo({
 											url: "./success?order=" + JSON.stringify(that.newOrder)
 										})
-
-
 									},
 									fail: function(err) {
 										uni.showToast({
 											icon: 'none',
-											title: 'fail:' + JSON.stringify(err),
+											title: '支付失败',
 										});
 										uni.hideLoading();
 									}
@@ -210,37 +223,84 @@
 				);
 
 			},
-
-
-
-
-
-
-
-
-
-
+			
+			// 修改后的支付方法
 			payOrder() {
-				if (this.type == 'win') {
-					this.toPayConfirmReward()
+				// 1. 防止重复点击
+				if (this.isPaying) return;
+				
+				// 2. 安全地获取用户信息
+				this.getSafeUserInfo();
+
+				// 3. 检查用户信息是否有效
+				if (!this.userinfo || Object.keys(this.userinfo).length === 0) {
+					uni.showToast({
+						title: '用户信息异常,请重新登录',
+						icon: 'none'
+					});
+					
+					// 直接跳转到登录页
+					this.redirectToLogin();
+					return;
+				}
+				// 4. 检查 maOpenId,如果不存在则提示重新登录
+				if (!this.userinfo.maOpenId) {
+					uni.showModal({
+						title: '提示',
+						content: '用户信息不完整,需要重新登录',
+						success: (res) => {
+							if (res.confirm) {
+								this.redirectToLogin();
+							}
+						}
+					});
+					return;
+				}
 
-				} else {
-					if (this.payType == 1) {
-						console.log("这个order", this.order)
-						const {
-							itemJson,
-							...newOrder
-						} = this.order;
-						this.newOrder = newOrder;
-						console.log("这个newOrder", this.newOrder)
-						this.weixinPayOrder()
+				// 5. 检查登录状态
+				this.utils.isLogin().then(res => {
+					if (res) {
+						// 设置支付状态防止重复点击
+						this.isPaying = true;
+						
+						// 执行支付逻辑
+						if (this.type == 'win') {
+							this.toPayConfirmReward()
+						} else {
+							if (this.payType == 1) {
+								console.log("这个order", this.order)
+								const {
+									itemJson,
+									...newOrder
+								} = this.order;
+								this.newOrder = newOrder;
+								console.log("这个newOrder", this.newOrder)
+								this.weixinPayOrder()
+							} else {
+								uni.showToast({
+									title: "暂时无可用支付",
+									icon: 'none'
+								})
+							}
+						}
+						
+						// 支付完成后重置状态
+						setTimeout(() => {
+							this.isPaying = false;
+						}, 2000);
 					} else {
-						uni.showToast({
-							title: "暂时无可用支付",
-							icon: 'none'
-						})
+						// 未登录,直接跳转到登录页
+						this.redirectToLogin();
 					}
-				}
+				}).catch(err => {
+					console.error('检查登录状态失败:', err);
+					uni.showToast({
+						title: '登录状态异常',
+						icon: 'none'
+					});
+					// 登录状态异常,也跳转到登录页
+					this.redirectToLogin();
+				});
 			},
 
 			// 选微信支付或者支付宝支付
@@ -248,6 +308,7 @@
 				this.payType = e.detail.value; // 获取选中的 value
 				console.log('当前选中:', this.payType);
 			},
+			
 			toPayConfirmReward() {
 				let data = {
 					orderId: this.order.orderId
@@ -294,6 +355,7 @@
 					rej => {}
 				);
 			},
+			
 			getStoreConfig() {
 				getStoreConfig().then(
 					res => {
@@ -305,6 +367,7 @@
 					rej => {}
 				);
 			},
+			
 			payTypeChange(e) {
 				if (this.combinationOrderId) {
 					this.editPayTypeByCombinationId(e.detail.value)
@@ -312,6 +375,7 @@
 					this.editPayType(e.detail.value)
 				}
 			},
+			
 			editPayType(payType) {
 				var data = {
 					orderId: this.orderId,

BIN
static/images/complaint.png


BIN
static/images/complaint2.png


BIN
static/images/full_screen.png


BIN
static/images/half_screen.png