Ver Fonte

订单字段、直播userinfo修改

liujiaxin há 1 mês atrás
pai
commit
2780661188

+ 17 - 16
api/living.js

@@ -21,8 +21,8 @@ const api = {
 	liveRed: '/app/live/liveRed/claim', // 点击领红包
 	// 直播订单
 	liveStore: (liveId, key) => `/app/live/liveGoods/liveStore/${liveId}?key=${key}`, // 店铺展示
-	
-	
+
+
 	liveGoodsDetail: (productId) => `/app/live/liveGoods/liveGoodsDetail/${productId}`, // 商品详情
 	liveOrderUser: (liveId) => `/app/live/liveOrder/liveOrderUser/${liveId}`, // 正在购买
 	showGoods: (liveId) => `/app/live/liveGoods/showGoods/${liveId}`, // 弹出商品卡片
@@ -33,13 +33,14 @@ const api = {
 	liveList: '/app/live/liveList', //直播列表
 	// liveShareList: (companyId, pageSize, pageNum) =>
 	// 	`/app/live/liveList/${companyId}?pageSize=${pageSize}&pageNum=${pageNum}`, //销售端分享直播列表
-		// liveShareList: ( pageSize, pageNum) =>
-		// 	`/app/live/liveListAll?pageSize=${pageSize}&pageNum=${pageNum}`, //销售端分享直播列表
-			liveShareList: '/app/live/listToLiveNoEnd', //销售端分享直播列表
-	subNotifyLive: '/app/live/subNotifyLive' ,//订阅消息
-	coupon: '/app/live/coupon/claim' ,//领取优惠券
-	curCoupon: '/app/live/coupon/curCoupon' ,//优惠券列表
-	
+	// liveShareList: ( pageSize, pageNum) =>
+	// 	`/app/live/liveListAll?pageSize=${pageSize}&pageNum=${pageNum}`, //销售端分享直播列表
+	// listToLiveNoEnd
+	liveShareList: '/app/live/listToLiveNoEnd', //销售端分享直播列表
+	subNotifyLive: '/app/live/subNotifyLive', //订阅消息
+	coupon: '/app/live/coupon/claim', //领取优惠券
+	curCoupon: '/app/live/coupon/curCoupon', //优惠券列表
+
 	// export function getGotoWxAppLiveLink(data) {
 	// 	return request('/app/fs/course/getGotoWxAppLiveLink', data, 'GET', 'application/json;charset=UTF-8');
 	// }
@@ -162,7 +163,7 @@ export function liveList(data) {
 }
 
 //销售端分享直播列表
-export function liveShareList( data ) {
+export function liveShareList(data) {
 	return request(api.liveShareList, data, 'GET', 'application/json;charset=UTF-8');
 }
 
@@ -226,9 +227,9 @@ export function getGotoWxAppLiveLink(data) {
 
 
 export function loginByMp(data) {
- 	 return request('/liveAPP/app/wx/courseLogin',data,'POST','application/json;charset=UTF-8');
- }
- 
- export function getUserInfo() {
- 	 return request('/liveAPP/app/user/getUserInfo',null,'GET');
- }
+	return request('/liveAPP/app/wx/courseLogin', data, 'POST', 'application/json;charset=UTF-8');
+}
+
+export function getUserInfo() {
+	return request('/liveAPP/app/user/getUserInfo', null, 'GET');
+}

+ 220 - 18
components/Server.vue

@@ -1,11 +1,19 @@
 <template>
 	<view>
-		<view class="serve">
-			<image class="w130 h130"
-				src="/static/images/server.png"
-				mode=""></image>
-			<text class="text">官方客服</text>
-			<button class="contact-btn" open-type="contact"></button>
+		<view 
+			class="serve"
+			:style="{ left: left + 'rpx', top: top + 'rpx' }"
+			@touchstart="onTouchStart"
+			@touchmove="onTouchMove"
+			@touchend="onTouchEnd"
+		>
+			<view class="serve-content">
+				<image class="w130 h130"
+					src="/static/images/server.png"
+					mode="aspectFit"></image>
+				<text class="text">官方客服</text>
+				<button class="contact-btn" open-type="contact"></button>
+			</view>
 		</view>
 	</view>
 </template>
@@ -15,29 +23,223 @@
 		name:"Server",
 		data() {
 			return {
-
+				left: 0,
+				top: 0,
+				startX: 0,
+				startY: 0,
+				isDragging: false,
+				screenWidth: 0,
+				screenHeight: 0
 			};
+		},
+		mounted() {
+			this.getSystemInfo();
+			this.initPosition();
+		},
+		methods: {
+			// 初始化位置
+			initPosition() {
+				// 从本地存储加载位置
+				const position = uni.getStorageSync('server_position');
+				if (position) {
+					this.left = position.left;
+					this.top = position.top;
+				} else {
+					// 默认位置:右侧80%高度
+					this.left = 750 - 150 - 20; // 屏幕宽度 - 容器宽度 - 右边距
+					this.top = this.px2rpx(this.screenHeight * 0.8 - 75); // 80%高度,居中偏移
+				}
+			},
+			
+			// 获取系统信息
+			getSystemInfo() {
+				uni.getSystemInfo({
+					success: (res) => {
+						this.screenWidth = res.windowWidth;
+						this.screenHeight = res.windowHeight;
+					}
+				});
+			},
+			
+			// 触摸开始
+			onTouchStart(e) {
+				// 阻止事件冒泡,不影响其他元素
+				e.stopPropagation();
+				e.preventDefault();
+				
+				this.startX = e.touches[0].clientX;
+				this.startY = e.touches[0].clientY;
+				this.isDragging = false;
+			},
+			
+			// 触摸移动
+			onTouchMove(e) {
+				// 阻止事件冒泡和默认行为
+				e.stopPropagation();
+				e.preventDefault();
+				
+				if (!this.startX || !this.startY) return;
+				
+				const currentX = e.touches[0].clientX;
+				const currentY = e.touches[0].clientY;
+				
+				const diffX = currentX - this.startX;
+				const diffY = currentY - this.startY;
+				
+				// 判断是否开始拖拽(移动超过5px)
+				if (!this.isDragging && (Math.abs(diffX) > 5 || Math.abs(diffY) > 5)) {
+					this.isDragging = true;
+				}
+				
+				if (this.isDragging) {
+					// 计算新的位置(rpx)
+					const newLeft = this.rpx2px(this.left) + diffX;
+					const newTop = this.rpx2px(this.top) + diffY;
+					
+					// 边界检查
+					const boundedLeft = Math.max(10, Math.min(newLeft, this.screenWidth - this.rpx2px(150)));
+					const boundedTop = Math.max(10, Math.min(newTop, this.screenHeight - this.rpx2px(150)));
+					
+					// 转换回rpx
+					this.left = this.px2rpx(boundedLeft);
+					this.top = this.px2rpx(boundedTop);
+					
+					// 更新起始位置
+					this.startX = currentX;
+					this.startY = currentY;
+				}
+			},
+			
+			// 触摸结束
+			onTouchEnd(e) {
+				// 阻止事件冒泡
+				e.stopPropagation();
+				e.preventDefault();
+				
+				if (this.isDragging) {
+					// 吸边效果
+					this.attachToEdge();
+					// 保存位置
+					this.savePosition();
+				}
+				this.startX = 0;
+				this.startY = 0;
+				this.isDragging = false;
+			},
+			
+			// 吸边效果
+			attachToEdge() {
+				const containerWidth = 150; // 容器宽度
+				const screenWidthRpx = 750;
+				const centerX = screenWidthRpx / 2;
+				
+				// 根据当前位置决定吸附到左边还是右边
+				if (this.left < centerX) {
+					this.left = 20; // 吸附到左边
+				} else {
+					this.left = screenWidthRpx - containerWidth - 20; // 吸附到右边
+				}
+			},
+			
+			// 保存位置到本地存储
+			savePosition() {
+				uni.setStorageSync('server_position', {
+					left: this.left,
+					top: this.top
+				});
+			},
+			
+			// rpx转px
+			rpx2px(rpx) {
+				return rpx / 750 * this.screenWidth;
+			},
+			
+			// px转rpx
+			px2rpx(px) {
+				return px * 750 / this.screenWidth;
+			}
 		}
 	}
 </script>
 
-<style  lang="scss" scoped>
+<style lang="scss" scoped>
 .serve{
 	position: fixed;
-	right: 20rpx;
-	top: 80%;
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	z-index: 9;
+	z-index: 9999;
+	width: 150rpx;
+	height: 150rpx;
+	
+	// 确保拖拽时不影响其他元素
+	touch-action: none;
+	user-select: none;
+	-webkit-user-select: none;
+	
+	.serve-content {
+		width: 100%;
+		height: 100%;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+		
+		// 拖拽时的视觉反馈
+		&:active {
+			opacity: 0.9;
+			transition: opacity 0.2s ease;
+		}
+	}
+	
+	.w130 {
+		width: 130rpx !important;
+		height: 130rpx !important;
+		flex-shrink: 0; // 防止图片变形
+	}
+	
+	.h130 {
+		width: 130rpx !important;
+		height: 130rpx !important;
+		flex-shrink: 0; // 防止图片变形
+	}
+	
 	.text{
-		margin-top: 10rpx;
+		margin-top: 8rpx;
 		font-weight: 500;
 		font-size: 24rpx;
 		color: #333;
-		background: rgba(255, 255, 255, 0.8);
-		padding: 8rpx 16rpx;
+		background: rgba(255, 255, 255, 0.9);
+		padding: 6rpx 12rpx;
 		border-radius: 20rpx;
+		white-space: nowrap;
+		flex-shrink: 0; // 防止文字变形
+		border: 1rpx solid rgba(0, 0, 0, 0.1);
+		backdrop-filter: blur(10rpx);
 	}
+	
+	.contact-btn {
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		opacity: 0;
+		z-index: 10;
+		// 确保按钮不变形
+		border: none;
+		border-radius: 0;
+		background: transparent;
+		padding: 0;
+		margin: 0;
+		
+		&::after {
+			border: none;
+		}
+	}
+}
+
+// 防止拖拽时页面滚动
+page {
+	overflow: hidden;
+	height: 100%;
 }
-</style>
+</style>

+ 1 - 1
pages/home/productList.vue

@@ -57,7 +57,7 @@
 								<text class="num">{{item.price.toFixed(2)}} </text>
 							</view>
 							<view class="cart-img" @click="navgetTo('../shopping/cart')">
-								<view class="sale">已售 {{item.sales}} {{item.unitName}}</view>
+								<view class="sale">已售 {{item.sales||'0'}} {{item.unitName||''}}</view>
 							</view>
 						</view>
 					</view>

+ 2 - 0
pages/shopping/confirmOrder.vue

@@ -182,6 +182,7 @@
 			}
 		},
 		onLoad(option) {
+			console.log("确认订单option是",option)
 			this.form.companyId=option.companyId;
 			this.form.companyUserId=option.companyUserId;
 			this.cartIds=option.cartIds;
@@ -191,6 +192,7 @@
 			uni.$on('updateAddress', (e) => {
 				this.address=e;
 				this.form.addressId=e.id;
+				this.computed();
 			})
 			this.getWeixinOrderTemps();
 		},

+ 6 - 6
pages/user/index.vue

@@ -32,7 +32,7 @@
 							<view class="msg-box" @click="navgetTo('/pages_user/user/message')">
 								<image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/icon-msg.png" mode=""></image>
 							</view>
-
+							
 						</uni-badge> -->
 					</view>
 				</view>
@@ -145,7 +145,7 @@
 								<text class="text">资质证书</text>
 							</view> -->
 							<!-- v-if="user.bindCompanyUserId" -->
-							<view  class="item no-marin-bottom" @click="navgetTo('/pages_shopping/live/order')">
+							<view class="item no-marin-bottom" @click="navgetTo('/pages_shopping/live/order')">
 								<image
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/live.png"
 									mode=""></image>
@@ -181,7 +181,7 @@
 
 
 							<!-- 测试用下面的 -->
-							<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>
@@ -217,9 +217,9 @@
 				<!-- 退出登录按钮 -->
 
 			</view>
-
+			<Server />
 		</view>
-		<Server/>
+
 	</view>
 </template>
 
@@ -684,4 +684,4 @@
 		margin: 10px;
 		border-radius: 20rpx;
 	}
-</style>
+</style>

+ 1 - 1
pages_company/order/productList.vue

@@ -58,7 +58,7 @@
 								<text class="num">{{item.price.toFixed(2)}} </text>
 							</view>
 							<view class="cart-img" @click="navgetTo('../shopping/cart')">
-								<view class="sale">已售 {{item.sales}} {{item.unitName||''}}</view>
+								<view class="sale">已售 {{item.sales||'0'}} {{item.unitName||''}}</view>
 							</view>
 						</view>
 					</view>

+ 4 - 4
pages_company/shareLive.vue

@@ -85,7 +85,7 @@
 			// })
 			this.companyId = options.companyId;
 			this.companyUserId = options.companyUserId;
-			this.userinfo = JSON.parse(uni.getStorageSync("userInfo"))
+			this.userinfo = uni.getStorageSync("userInfo")
 		},
 		computed: {
 			appid() {
@@ -273,13 +273,13 @@
 					if (res.code == 200) {
 						//设置列表数据
 						if (page.num == 1) {
-							that.dataList = res.data.list;
+							that.dataList = res.rows;
 
 						} else {
-							that.dataList = that.dataList.concat(res.data.list);
+							that.dataList = that.dataList.concat(res.rows);
 
 						}
-						that.mescroll.endBySize(res.data.list.length, res.data.total);
+						that.mescroll.endBySize(res.rows.length, res.total);
 
 					} else {
 						uni.showToast({

+ 73 - 78
pages_course/living.vue

@@ -143,7 +143,7 @@
 
 					<view class="chat-content-wrapper" :class="{ 'chat-content-focused': isFocus }">
 						<!-- 公告 -->
-						<view class="notice-message" v-if="!isFocus&&isShowNotice">
+						<view class="notice-message" v-if="!isFocus&&isShowNotice" :class="liveItem.showType == 1 ? 'horizontal-notice' : ''">
 							公告消息: {{notice.msg}}
 						</view>
 						<scroll-view id="msgScroll" v-if="Array.isArray(talklist)" enable-flex scroll-y="true"
@@ -261,16 +261,7 @@
 					</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="userData.nickname==''?'boxnosel':'boxsel'">
-								<view v-if="userData.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">
+												<view class="button-container">
 							<input type="nickname" class="hidden-input" @blur="onNickNameInput" placeholder="请点击授权微信昵称"
 								@input="onNickNameInput" />
 							<!-- <button class="custom-button"
@@ -433,7 +424,7 @@
 			<u-popup :show="isShowPopMsg" round="20rpx" mode="center" zIndex="10076">
 				<view class="message-popup">
 					<image class="message-close-icon"
-						src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/del2.png" />
+						src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/del2.png" @click="isShowPopMsg = false" />
 					<view class="message-title">消息通知</view>
 					<view class="message-content">{{popMsg}}</view>
 					<view class="message-confirm-button" @click="isShowPopMsg = false">确认</view>
@@ -849,7 +840,7 @@
 				timestamp: '',
 				showadd: false,
 				liveId: null,
-				userinfo: {}, //用户信息
+				userInfo: {}, //用户信息
 				userData: {},
 				diffTotalTime: '',
 				address: ''
@@ -872,14 +863,15 @@
 					this.liveId = params.a;
 				});
 				if (params.b && params.c) {
+					console.log("扫码参数",params)
 					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');
+			this.userinfo = uni.getStorageSync('userinfo');
+			// this.userData = uni.getStorageSync('userData');
 			console.log('全部参数', options);
 			try {
 				const isLogin = await this.utils.checkLiveToken();
@@ -1013,7 +1005,7 @@
 			// 恢复播放和连接
 			await this.resumePageActivity();
 			// this.userinfo = JSON.parse(uni.getStorageSync('userInfo'));
-			this.userinfo = uni.getStorageSync('userInfo');
+			this.userinfo = uni.getStorageSync('userinfo');
 			this.isAgreement = uni.getStorageSync('isAgreement');
 
 			this.$nextTick(() => {
@@ -1041,7 +1033,7 @@
 		onShareAppMessage() {
 			return {
 				title: '邀请你来观看直播:' + this.liveItem.liveName,
-				path: '/pages_course/living?companyId=-2&companyUserId=' + this.userData.userId + '&liveId=' + this.liveId,
+				path: '/pages_course/living?companyId=-2&companyUserId=' + this.userInfo.userId + '&liveId=' + this.liveId,
 				imageUrl: '/static/logo.png',
 				success(res) {
 					console.log('分享成功', res);
@@ -1054,7 +1046,7 @@
 		onShareTimeline() {
 			return {
 				title: '邀请你来观看直播:' + this.liveItem.liveName,
-				query: 'companyId=-2&companyUserId=' + this.userData.userId + '&liveId=' + this.liveId
+				query: 'companyId=-2&companyUserId=' + this.userInfo.userId + '&liveId=' + this.liveId
 			};
 		},
 		computed: {
@@ -1076,39 +1068,54 @@
 				return safeLiveViewers.slice(0, 3);
 			},
 			isCurrentUserWon() {
-				if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
+				if (!Array.isArray(this.prizeInfo) || !this.userInfo?.userId) {
 					return false;
 				}
 				return this.prizeInfo.some((item) => {
-					return String(item.userId) === String(this.userData.userId);
+					return String(item.userId) === String(this.userInfo.userId);
 				});
 			},
 			getCurrentUserPrizeProductId() {
-				if (!Array.isArray(this.prizeInfo) || !this.userData?.userId) {
+				if (!Array.isArray(this.prizeInfo) || !this.userInfo?.userId) {
 					return null;
 				}
 				// 在 prizeInfo 中查找当前用户的中奖记录
 				const userPrize = this.prizeInfo.find(item => {
-					return String(item.userId) == String(this.userData.userId);
+					return String(item.userId) == String(this.userInfo.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;
+			  console.log('=== getCurrentUserPrizeRecordId 调试信息 ===');
+			  console.log('this.prizeInfo:', this.prizeInfo);
+			  console.log('this.userInfo:', this.userInfo);
+			  console.log('this.userInfo.userId:', this.userInfo?.userId);
+			  
+			  if (!Array.isArray(this.prizeInfo) || !this.userInfo?.userId) {
+			    console.log('条件不满足,返回null');
+			    return null;
+			  }
+			  
+			  const userPrize = this.prizeInfo.find(item => {
+			    const match = String(item.userId) == String(this.userInfo.userId);
+			    console.log('查找匹配:', {
+			      itemUserId: item.userId,
+			      currentUserId: this.userInfo.userId,
+			      match: match,
+			      itemRecordId: item.recordId
+			    });
+			    return match;
+			  });
+			  
+			  console.log('找到的用户奖品:', userPrize);
+			  console.log('最终返回的recordId:', userPrize ? userPrize.recordId : null);
+			  
+			  return userPrize ? userPrize.recordId : null;
 			},
 			nameuser() {
-				return this.userData.nickname
+				return this.userInfo.nickname
 			},
 
 		},
@@ -1215,7 +1222,7 @@
 		},
 		methods: {
 			shouquan() {
-				if (this.userData.nickname == '') {
+				if (this.userinfo.nickname == '') {
 					uni.showToast({
 						icon: 'none',
 						title: "请先授权微信昵称",
@@ -1223,7 +1230,7 @@
 				}
 			},
 			confimrname() {
-				if (this.userData.nickname == '') {
+				if (this.userInfo.nickname == '') {
 					uni.showToast({
 						icon: 'none',
 						title: "请授权微信昵称",
@@ -1231,36 +1238,18 @@
 					return
 				}
 
-				uni.setStorageSync('userData', this.userData)
+				uni.setStorageSync('userInfo', this.userInfo)
 				// this.editUserA()
 				this.userlogo = false
 			},
-			// 授权头像
-			// onChooseAvatar(e) {
-			// 	this.userData.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.userData.avatar = data.url
-			// 		}
-			// 	});
-			// },
+			
 			onNickNameInput(e) {
 				console.log(e)
-				this.userData.nickname = e.detail.value
+				this.userInfo.nickname = e.detail.value
 			},
 			async haveLogin() {
-				this.userinfo = uni.getStorageSync('userInfo');
-				this.userData = uni.getStorageSync('userData');
+				this.userInfo = uni.getStorageSync('userInfo');
+				// this.userData = uni.getStorageSync('userData');
 				await this.getUserInfo();
 				// this.initTime();
 				if (this.liveId) {
@@ -1311,7 +1300,7 @@
 										uni.setStorageSync('AppToken', res.token);
 										uni.setStorageSync('userInfo', JSON.stringify(res
 											.user));
-										this.userinfo = uni.getStorageSync('userInfo');
+										this.userInfo = uni.getStorageSync('userInfo');
 										// uni.setStorageSync('auto_userInfo', JSON.stringify(res.user));
 										// this.user = res.user
 										this.$store.commit('setCoureLogin', 1);
@@ -1985,7 +1974,7 @@
 				if (!this.liveId) return;
 				const currentTime = (this.stayTime / this.liveItem.duration) * 100;
 				const param = {
-					userId: this.userData.userId || '',
+					userId: this.userInfo.userId || '',
 					liveId: this.liveId || '',
 					uuId: dayjs().format('YYYYMMDD') + this.uuId,
 					internetTraffic: this.totalTraffic
@@ -1994,12 +1983,12 @@
 			},
 			// 回放、预告缓冲
 			getInternetTraffic() {
-				if (!this.liveId || !this.liveId || !this.userData.userId || !this.uuId) return;
+				if (!this.liveId || !this.liveId || !this.userInfo.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,
+					userId: this.userInfo.userId,
 					liveId: this.liveId,
 					uuId: dayjs().format('YYYYMMDD') + this.uuId,
 					duration: this.liveItem.duration,
@@ -2157,7 +2146,7 @@
 				await getUserInfo().then(
 					(res) => {
 						if (res.code == 200) {
-							this.userData = res.user;
+							this.userInfo = res.user;
 						} else {
 							uni.showToast({
 								icon: 'none',
@@ -2203,11 +2192,12 @@
 				});
 			},
 			async callSendMessageApi() {
-				if (!this.userData.userId) return;
+				if (!this.userInfo.userId) return;
 				const templateData = {
 					liveId: this.liveId,
-					userId: this.userData.userId,
+					userId: this.userInfo.userId,
 					templateId: this.templateId, // 模板ID
+					maOpenId:this.userInfo.maOpenId,
 					data: {
 						thing6: this.liveItem.liveName,
 						date7: this.liveItem.startTime
@@ -2241,7 +2231,7 @@
 					const heartBeatMsg = JSON.stringify({
 						cmd: 'heartbeat',
 						msg: 'ping',
-						userId: this.userData.userId || '',
+						userId: this.userInfo.userId || '',
 						liveId: this.liveId,
 						timestamp: this.lastHeartBeatTime,
 						networkType: this.networkType
@@ -2667,7 +2657,7 @@
 				}
 				let data = {
 					liveId: this.liveId,
-					userId: this.userData.userId,
+					userId: this.userInfo.userId,
 					redId: this.redInfo.redId
 				};
 				liveRed(data).then((res) => {
@@ -3525,7 +3515,7 @@
 					console.error('缺失直播间ID,无法初始化WebSocket');
 					return;
 				}
-				if (!this.userData || !this.userData.userId) {
+				if (!this.userInfo || !this.userInfo.userId) {
 					console.error('用户信息缺失,无法初始化WebSocket');
 					return;
 				}
@@ -3542,12 +3532,12 @@
 
 				setTimeout(() => {
 					this.getliveUser(false);
-				}, 200);
+				},1000);
 
 				const now = new Date();
 				this.timestamp = now.getTime(); // 生成签名
 				const signature = CryptoJS.HmacSHA256(
-					`${this.liveId}${this.userData.userId}${this.userType}${this.timestamp}`, this.timestamp.toString()
+					`${this.liveId}${this.userInfo.userId}${this.userType}${this.timestamp}`, this.timestamp.toString()
 				).toString(CryptoJS.enc.Hex);
 
 				try {
@@ -3556,7 +3546,7 @@
 					// const baseWsUrl = 'ws://d6998672.natappfree.cc/ws/app/webSocket';
 					// const baseWsUrl = 'ws://nd967d83.natappfree.cc/ws/app/webSocket';
 					let wsUrl =
-						`${baseWsUrl}?userId=${this.userData.userId}&liveId=${this.liveId}&userType=${this.userType}&timestamp=${this.timestamp}&signature=${signature}`;
+						`${baseWsUrl}?userId=${this.userInfo.userId}&liveId=${this.liveId}&userType=${this.userType}&timestamp=${this.timestamp}&signature=${signature}`;
 
 					// let wsUrl =
 					// 	'ws://q96d9752.natappfree.cc/ws/app/webSocket?liveId=128&userId=9769&userType=1&timestamp=1762501143712&signature=0498c66c3fca64ab009586200c04d51312ce44e36d5639e99b22e34f3bac8d13';
@@ -3759,7 +3749,7 @@
 				//console.log(`添加消息前: 当前消息数量=${this.talklist.length}, 是否达到限制=${wasAtLimit}`);
 
 				// 检查是否是自己发送的消息
-				const isMyMessage = message.userId === this.userData.userId;
+				const isMyMessage = message.userId === this.userInfo.userId;
 				//console.log(`消息来源: ${isMyMessage ? '自己' : '他人'}, userId=${message.userId}`);
 
 				// 给消息添加唯一ID
@@ -3916,8 +3906,8 @@
 								}
 
 								// 解析用户ID(根据实际接口字段调整,此处假设data含userId)
-								const userData = JSON.parse(socketMessage.data || '{}');
-								const userId = userData.userId || socketMessage.userId; // 兼容不同字段
+								const userInfo = JSON.parse(socketMessage.data || '{}');
+								const userId = userInfo.userId || socketMessage.userId; // 兼容不同字段
 								if (!userId) return; // 无用户ID不处理
 
 								// 仅新用户(未显示过)才触发提示
@@ -4048,12 +4038,12 @@
 				// 构造发送给服务端的消息数据
 				const data = {
 					liveId,
-					userId: this.userData.userId,
+					userId: this.userInfo.userId,
 					userType: 0,
 					cmd: 'sendMsg',
 					msg: text,
-					nickName: this.userData.nickname || '未命名',
-					avatar: this.userData.avatar ||
+					nickName: this.userInfo.nickname || '未命名',
+					avatar: this.userInfo.avatar ||
 						'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/avatar.png'
 				};
 				// 发送socket消息
@@ -4512,13 +4502,17 @@
 
 					.notice-message {
 						position: absolute;
-						bottom: 30vh;
+						bottom: 388rpx;
 						max-width: 80%;
 						padding: 24rpx;
 						background-color: rgba(0, 0, 0, 0.3);
 						margin: 0 0 20rpx 20rpx;
 						border-radius: 20rpx;
 						color: #ffda73;
+						overflow: hidden;
+						&.horizontal-notice{
+							position: static;
+						}
 					}
 
 					.message-scroll-view {
@@ -5234,6 +5228,7 @@
 
 				.message-close-icon {
 					position: absolute;
+					z-index: 9;
 					top: 14rpx;
 					right: 14rpx;
 					width: 50rpx;

+ 2 - 2
pages_doctor/index.vue

@@ -246,8 +246,8 @@
 		display: flex;
 		justify-content: space-between;
 		.item{
-			width: 346upx;
-			height: 150upx;
+			width: 100%;
+			height: 300upx;
 			position: relative;
 			.bg-img,
 			.inner{

+ 1 - 1
pages_shopping/live/order.vue

@@ -67,7 +67,7 @@
 								<view class="txt">适用于乏力、头晕等人群,通过问诊可明确诊断给予专业性指导意见。</view>
 								<view class="num">
 									<text>{{JSON.parse(item.itemJson).sales}} 人已购</text>
-									<text class="grey">x{{JSON.parse(item.itemJson).totalNum}}</text>
+									<text class="grey">x{{item.totalNum}}</text>
 								</view>
 							</view>
 						</view>

+ 1 - 1
pages_shopping/shopping/activityDetails.vue

@@ -49,7 +49,7 @@
 									<text class="num">{{item.price.toFixed(2)}} </text>
 								</view>
 								<view class="cart-img" @click="navgetTo('../shopping/cart')">
-									<view class="sale">已售 {{item.sales}} {{item.unitName}}</view>
+									<view class="sale">已售 {{item.sales||'0'}} {{item.unitName||''}}</view>
 								</view>
 							</view>
 						</view>

+ 1 - 1
pages_shopping/shopping/productList.vue

@@ -48,7 +48,7 @@
 								<text class="num">{{item.price.toFixed(2)}} </text>
 							</view>
 							<view class="cart-img" @click="navgetTo('../shopping/cart')">
-								<view class="sale">已售 {{item.sales}} {{item.unitName}}</view>
+								<view class="sale">已售 {{item.sales||'0'}} {{item.unitName||''}}</view>
 							</view>
 						</view>
 					</view>