Browse Source

"防抖优化'

Signed-off-by: 李妹妹 <1639016684@qq.com>
李妹妹 1 ngày trước cách đây
mục cha
commit
7b60a3c795

+ 2 - 2
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "百域佳选",
+    "name" : "云联精选",
     "appid" : "__UNI__A8490FA",
     "description" : "",
     "versionName" : "1.0.0",
@@ -52,7 +52,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx9bb2cd1e3afe714e",
+        "appid" : "wxcfd4cd6e2375e42f",
         "setting" : {
             "urlCheck" : false
         },

+ 3 - 3
pages.json

@@ -31,8 +31,8 @@
 		{
 			"path": "pages/home/index",
 			"style": {
-				//"navigationBarTitleText": "百域良品",
-				"navigationBarTitleText": "百域良品",
+				//"navigationBarTitleText": "云联精选",
+				"navigationBarTitleText": "云联精选",
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom",
 				"app-plus": {
@@ -1550,7 +1550,7 @@
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "百域良品",
+		"navigationBarTitleText": "云联精选",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#FFFFFF"
 	},

+ 1 - 1
pages/auth/login.vue

@@ -8,7 +8,7 @@
 		  		<!-- <image  :src="imgPath+'/app/images/logo.png'"></image> -->
 				<image  src="/static/logo.png"></image>
 		  	</view>
-		  	<view class="title">百域良品</view>
+		  	<view class="title">云联精选</view>
 		  </view>
         <!-- <open-data class="user-avatar" type="userAvatarUrl"></open-data>
         <open-data class="user-name" type="userNickName"></open-data> -->

+ 1 - 1
pages/common/launch.vue

@@ -5,7 +5,7 @@
 				<view class="circle"></view>
 				<image src="/static/logo.png"></image>
 			</view>
-			<text class="text">百域良品</text>
+			<text class="text">云联精选</text>
 		</view>
 	</view>
 </template>

+ 4 - 4
pages/home/index.vue

@@ -9,8 +9,8 @@
 					<!-- 这里是状态栏 -->
 					<view class="status_bar" :style="{height: statusBarHeight}"></view>
 					<view class="top-title">
-						<!-- <view class="name" >百域良品</view> -->
-						<view class="name" >百域良品</view>
+						<!-- <view class="name" >云联精选</view> -->
+						<view class="name" >云联精选</view>
 						<!-- <view class="dot">•</view><view class="sub-name">七彩互联网医院</view> -->
 					</view>
 					<!-- 搜索框、购物车、客服 -->
@@ -465,7 +465,7 @@
 		},
 		onShareAppMessage(res) {
 			return {
-				title: '百域良品-您的专属解决方案',
+				title: '云联精选-您的专属解决方案',
 				path: `/pages/common/launch`,
 				// imageUrl: this.$store.state.imgpath +'/app/image/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			imageUrl: '/static/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
@@ -478,7 +478,7 @@
 		//分享到朋友圈
 		onShareTimeline(res) {
 			return {
-				title: '百域良品-您的专属解决方案',
+				title: '云联精选-您的专属解决方案',
 				query: '', //页面参数
 				imageUrl: '/static/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 				// imageUrl: this.$store.state.imgpath +'/app/image/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4

+ 2 - 2
pages_company/order/confirmCompanyOrder.vue

@@ -86,7 +86,7 @@
 		//发送给朋友
 		onShareAppMessage(res) {
 			return {
-				title: "百域良品-您的专属解决方案",
+				title: "云联精选-您的专属解决方案",
 				path: '/pages_company/order/confirmOrder?orderKey='+this.orderKey,
 				imageUrl: '/static/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}
@@ -95,7 +95,7 @@
 		//分享到朋友圈
 		onShareTimeline(res) {
 			return {
-				title:"百域良品-您的专属解决方案",
+				title:"云联精选-您的专属解决方案",
 				query:'orderKey='+this.orderKey,
 				imageUrl:  '/static/logo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}

+ 1 - 1
pages_course/becomeVIP.vue

@@ -81,7 +81,7 @@
 			</view>
 		</u-popup>
 		<!--#endif-->
-		<view class="footer-tips">重庆百域良品提供技术支持</view>
+		<view class="footer-tips">重庆云联精选提供技术支持</view>
 	</view>
 </template>
 

+ 2 - 1
pages_course/components/like.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="like-container">
-		<image class="image" @click="handleLike" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/fs/20251231/dc4eccf12e3b45ec9a2a9b523f42300f.png" ref="likeBtn"></image>
+		<!-- <image class="image" @click="handleLike" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/fs/20251231/dc4eccf12e3b45ec9a2a9b523f42300f.png" ref="likeBtn"></image> -->
+		<image class="image" @click="handleLike" src="@/static/images/zan1.png" ref="likeBtn"></image>
 		<view v-for="(icon, index) in icons" :key="icon.id" class="animated-icon" :style="{
         top: icon.top + 'rpx',
         left: icon.left + 'rpx',  // 补充left属性的单位

+ 76 - 51
pages_course/living.vue

@@ -183,9 +183,12 @@
 					<view class="action-button-group end">
 						<view :class="[liveItem.showType === 1 ? 'horizontal' : 'vertical','icon-button','ml20']">
 							<button open-type="share" class="action-icon button-reset">
-								<image class="action-icon"
+								<!-- <image class="action-icon"
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/fs/20251231/de30446abc5644fdac8438e6aa7058b6.png"
-									mode="widthFix" />
+									mode="widthFix" /> -->
+									<image class="action-icon"
+										src="@/static/images/weixin1.png"
+										mode="widthFix" />
 							</button>
 						</view>
 					</view>
@@ -249,7 +252,7 @@
 
 					<!-- 底部输入和操作区域 -->
 					<view class="input-actions-container" :class="{ 'input-actions-focused': isFocus }">
-						<view v-if="liveItem.status!=3&&!isPlayback" class="input-container" :class="{ 
+						<view v-if="liveItem.status!=3&&!isPlayback&&!generating" class="input-container" :class="{ 
 													'input-container-focused': isFocus,
 													'input-container-normal': !isFocus
 												}">
@@ -901,7 +904,7 @@
 				networkType: 'unknown', // 当前网络类型
 				isNetworkAvailable: true, // 网络是否可用
 
-				templateId: 'lbCjbm04ic1Bc93Sn6p6-MdPwJ1DzntUUY8APGv2qh0', //百域良品
+				templateId: 'JO9ZKlZES7vqxza82uSVyepLk8jbgYO75EGGEzXzje4', //云联精选
 				//templateId: 'ELHbRqBdzSV7ttXTWw7RgnddnIqkj2-ld8dMU-gJmyU', //乐享优品
 				isAgreement: false,
 
@@ -1887,7 +1890,7 @@
 				this.countdownTimer = setInterval(() => {
 					this.updateCountdown();
 				}, 1000); // 每秒更新一次
-				console.log("this.completionPointsEnabled+++++++",this.liveItem.completionPointsEnabled,this.countdownPercentage,this.receiveStatus,this.hasReceived,this.isPreview)
+				//console.log("this.completionPointsEnabled+++++++",this.liveItem.completionPointsEnabled,this.countdownPercentage,this.receiveStatus,this.hasReceived,this.isPreview)
 			},
 			// 更新倒计时
 			updateCountdown() {
@@ -3226,17 +3229,31 @@
 					return;
 				}
 
+                // 如果流量计算已经在进行中,且 trafficStartTime 已存在,不重复启动
+				// 避免重复累计流量
+				if (this.trafficTimer && this.trafficStartTime > 0) {
+					console.log('流量计算已在进行中,跳过重复启动');
+					return;
+				}
 				// 清除已有定时器
 				if (this.trafficTimer) {
 					clearInterval(this.trafficTimer);
 					this.trafficTimer = null;
 				}
 
+				// 如果之前有流量计算,先提交当前流量数据,避免丢失
+				if (this.trafficStartTime > 0 && this.videoLoaded) {
+					const watchDuration = Math.floor((this.getServerTimeNow() - this.trafficStartTime) / 1000);
+					if (watchDuration > 0) {
+						this.submitTraffic(watchDuration);
+					}
+				}
+				
+				// 重置总流量
+				this.totalTraffic = 0;
 				// 记录流量计算开始时间
-				//this.trafficStartTime = Date.now();
 				this.trafficStartTime = this.getServerTimeNow();
 				var that = this;
-
 				// 立即提交一次10s流量(模拟10秒观看)
 				setTimeout(() => {
 					that.submitTraffic(10);
@@ -3395,7 +3412,7 @@
 				if (this.liveItem.liveType == 1) {
 					param.bufferRate = this.totalTraffic;
 				}
-				internetTraffic(param);
+				//internetTraffic(param);
 			},
 			scrollToBottom() {
 				const now = Date.now();
@@ -3460,7 +3477,7 @@
 						array.slice(-100).forEach((id) => this.shownEntryUsers.add(id));
 					}
 
-					console.log('内存清理完成');
+					console.log('内存清理完成——————————————————————',this.shownEntryUsers);
 				} catch (error) {
 					console.error('内存清理失败:', error);
 				}
@@ -3610,8 +3627,8 @@
 					maOpenId: this.userInfo.maOpenId,
 					appId: this.appid,
 					data: {
-						thing2: this.liveItem.liveName,
-						time4: this.liveItem.startTime,
+						thing4: this.liveItem.liveName,
+						time2: this.liveItem.startTime,
 						date7: this.liveItem.startTime
 					}
 				};
@@ -3947,8 +3964,8 @@
 				if (!createTimeStr) return;
 				// const createTime = new Date(createTimeStr.replace(/-/g, '/'));
 				// 使用服务器时间或本地时间
-				const now = useServerTime ? new Date(this.getServerTimeNow()) : new Date();
-				const timeDiffMs = now.getTime() - createTimeStr;
+				const now = useServerTime ? Number(this.getServerTimeNow()) : Date.now();
+				const timeDiffMs = now - createTimeStr;
 				const timeDiffSeconds = Math.floor(timeDiffMs / 1000);
 				return Math.max(0, timeDiffSeconds);
 			},
@@ -3967,13 +3984,6 @@
 					this.isHeight = true
 				}
 				const wH = (winH / winW) * 100;
-				// this.scale = wW / this.videoRatio;
-				// if (this.liveItem.showType == 2) {
-				// 	const videoRatio = (height / width) * 100;
-				// 	this.scale = wH / videoRatio;
-				// 	console.log("比例", this.videoRatio, width, height)
-				// } else if (this.isFullscreen) {
-				// }
 				this.videoProgressKey = `videoProgress_${this.liveId}`;
 				this.setVideoProgress();
 
@@ -3984,7 +3994,10 @@
 					this.lastVideoUpdateTime = Date.now();
 					// 延迟一下确保数据已加载
 					setTimeout(() => {
-						this.startTrafficCalculation();
+						// 只有在流量计算未启动时才启动,避免重复累计
+						if (!this.trafficTimer || this.trafficStartTime === 0) {
+							this.startTrafficCalculation();
+						}
 					}, 500);
 				}
 			},
@@ -4002,13 +4015,31 @@
 						currentTime = storedProgress >= this.liveItem.duration ? 0 : storedProgress || 0;
 						this.isPlayback = true;
 						this.hasPlayback = true;
+						if (this.isPlayback) {
+							const hasWatchedKey = `hasWatchedReplay_${this.liveId}`;
+							const hasWatched = uni.getStorageSync(hasWatchedKey);
+							
+							// 如果回放正在生成中,重置进度从头开始
+							if (this.generating) {
+								currentTime = 0;
+								// 清除存储的进度,确保从头开始
+								if (this.videoProgressKey) {
+									uni.removeStorageSync(this.videoProgressKey);
+								}
+							} else if (!hasWatched) {
+								// 首次观看且回放已生成完成(isPlayback = true),从0开始
+								currentTime = 0;
+								// 标记已观看过(只有在回放生成完成且 isPlayback = true 时才设置)
+								uni.setStorageSync(hasWatchedKey, true);
+							} else {
+								// 非首次观看,从存储中获取进度
+								const storedProgress = uni.getStorageSync(this.videoProgressKey);
+								currentTime = 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);
@@ -4016,27 +4047,13 @@
 					videoContext.seek(currentTime);
 				}
 			},
-
-			// 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();
+					// 录播:只有在流量计算未启动时才启动,避免重复累计
+					if (!this.trafficTimer || this.trafficStartTime === 0) {
+						this.startTrafficCalculation();
+					}
 				} else {
 					let that = this;
 					if (this.trafficInterval) {
@@ -4057,14 +4074,20 @@
 					this.waitingTimer = setTimeout(() => {
 						const waitingDuration = Date.now() - this.waitingStartTime;
 						const timeSinceLastUpdate = Date.now() - this.lastVideoUpdateTime;
-
+						const now = Date.now();
+						const timeSinceLastToast = now - this.lastNetworkUnstableToastTime;
+				
 						// 只有在等待超过5秒,且视频时间超过3秒没有更新时,才认为是真正的卡顿/黑屏
+						// 并且距离上次提示至少30秒,避免频繁弹出(特别是对于短时长的预告视频)
 						if (waitingDuration >= 5000 && timeSinceLastUpdate >= 3000) {
-							uni.showToast({
-								title: '当前您的网络不稳定',
-								icon: 'loading',
-								duration: 2000
-							});
+							// 防抖:30秒内只弹出一次提示
+							if (timeSinceLastToast >= 30000 || this.lastNetworkUnstableToastTime === 0) {
+								this.$refs.customToast.show({
+									title: '当前您的网络不稳定',
+									duration: 2000
+								});
+								this.lastNetworkUnstableToastTime = now;
+							}
 						}
 					}, 5000); // 延迟5秒检测
 				}
@@ -4352,8 +4375,10 @@
 					this.playVideo();
 				} else if (e.detail.code == 2004) {
 					this.calculateTimeDiff(this.liveItem);
-					// this.startTrafficCalculation(this.bitrateLive);
-					this.startTrafficCalculation();
+					// 直播:只有在流量计算未启动时才启动,避免重复累计
+					if (!this.trafficTimer || this.trafficStartTime === 0) {
+						this.startTrafficCalculation();
+					}
 				}
 				// 2001: 已经连接服务器
 				// 2002: 已经连接服务器,开始拉流

+ 1 - 1
pages_course/reward.vue

@@ -6,7 +6,7 @@
 		<view class="answerPopup-title">恭喜你,回答正确</view>
 		<view class="answerPopup-desc">您有一份奖励待领取哦</view>
 		<view class="answerPopup-btn" @click="handleReceive">领取</view>
-		<view class="footer-tips">重庆百域良品提供技术支持</view>
+		<view class="footer-tips">重庆云联精选提供技术支持</view>
 	</view>
 </template>
 

+ 1 - 1
pages_course/videovip.vue

@@ -247,7 +247,7 @@
 				<view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
 			</view>
 		</u-popup>
-		<view class="footer-tips">重庆百域良品提供技术支持</view>
+		<view class="footer-tips">重庆云联精选提供技术支持</view>
 		<!-- footer -->
 		<view class="footer" v-if="videoId">
 			<view class="btns"  >

+ 1 - 1
pages_manage/login.vue

@@ -29,7 +29,7 @@
 				</view>
 			 </view>
 		 </view>
-		 <view class="footer-tips">重庆百域良品提供技术支持</view>
+		 <view class="footer-tips">重庆云联精选提供技术支持</view>
 	</view>
 </template>
 

+ 1 - 1
pages_shopping/live/complaint.vue

@@ -4,7 +4,7 @@
 			<view class="color#{$5} ">投诉对象</view>
 			<view class="align-center mt30 mb50">
 				<image class="w98 h98 mr30" style="border-radius: 50%;" src="/static/logo.png"></image>
-				<text>百域良品</text>
+				<text>云联精选</text>
 			</view>
 		</view>
 		<view class="container" >

+ 2 - 2
pages_shopping/live/paymentOrder.vue

@@ -187,7 +187,7 @@
 			
 			weixinPayOrder() {
 				// 防止重复调用支付接口
-				if (this.isPaying && this.payParams && this.payParams.orderId === this.order.orderId) {
+				if (this.isPaying && this.payParams && this.payParams.orderId === this.order.id) {
 					uni.showToast({
 						icon: 'none',
 						title: '支付请求正在处理中,请勿重复点击',
@@ -196,7 +196,7 @@
 				}
 				
 				var data = {
-					orderId: this.order.orderId,
+					orderId: this.order.id,
 					payType: 1,
 					appId: wx.getAccountInfoSync().miniProgram.appId
 				};

+ 2 - 2
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">
@@ -58,7 +58,7 @@
 		},
 		onShareAppMessage(res) {
 			return {
-				title: '百域良品-收款',
+				title: '云联精选-收款',
 				path: `/pages_user/user/pay?companyId=`+this.companyId+"&companyUserId="+this.companyUserId
 			}
 		},

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 356 - 287
pages_user/user/storeOrder.vue


+ 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/weixin1.png


BIN
static/images/zan1.png


+ 3 - 3
store/index.js

@@ -18,9 +18,9 @@ export default new Vuex.Store({
 	// imgpath: 'https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com',//百域承品图片请求地址
 	imgpath: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com',//百域承品图片请求地址
 	// https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop  百域承品图片链接
-	logoname:'百域良品',
-	appid:'wx9bb2cd1e3afe714e',//百域良品	// logonam百域良品域臻品',
-	//appid:'wx9bb2cd1e3afe714e'
+	logoname:'云联精选',
+	appid:'wxcfd4cd6e2375e42f',//云联精选	// logonam云联精选域臻品',
+	//appid:'wxcfd4cd6e2375e42f'
 	
   },
   getters: {

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác