liujiaxin hai 3 semanas
pai
achega
245828bc1f

+ 4 - 5
common/request.js

@@ -10,12 +10,11 @@ export default class Request {
 		// let path = 'https://test.userapp.store.cdwjyyh.com';
 		// let path = 'https://user.test.ylrztop.com/api';
 
-		// let path = 'https://userapp.klbycp.com/store'; //百域承品
-		// let path2 = 'https://userapp.klbycp.com'; //百域承品
+		let path = 'https://userapp.klbycp.com/store'; //百域承品
+		let path2 = 'https://userapp.klbycp.com'; //百域承品
 
-
-		let path = 'http://qeeaf625.natappfree.cc/store'; //本地
-		let path2 = 'http://qeeaf625.natappfree.cc'; //本地
+		// let path = 'http://qeeaf625.natappfree.cc/store'; //本地
+		// let path2 = 'http://qeeaf625.natappfree.cc'; //本地
 
 		let type = 0
 		uni.setStorageSync('requestPath', path2)

+ 9 - 9
pages/shopping/cart.vue

@@ -107,10 +107,10 @@
 				delCart(data).then(
 					res => {
 						if(res.code==200){
-							uni.showToast({
-								icon:'success',
-								title: "操作成功",
-							});
+							// uni.showToast({
+							// 	icon:'success',
+							// 	title: "操作成功",
+							// });
 							this.getCarts()
 						}else{
 							
@@ -170,10 +170,10 @@
 				cartNum(data).then(
 					res => {
 						if(res.code==200){
-							uni.showToast({
-								icon:'none',
-								title: "操作成功",
-							});
+							// uni.showToast({
+							// 	icon:'none',
+							// 	title: "操作成功",
+							// });
 							this.computedMoney();
 							
 						}else{
@@ -197,7 +197,7 @@
 			    if (isNaN(num) || value === '') {
 			        num = 1
 			        uni.showToast({
-			            title: "数量不能为",
+			            title: "数量不能为0",
 			            icon: "none",
 			            duration: 2000
 			        });

+ 106 - 20
pages/shopping/paymentOrder.vue

@@ -184,6 +184,22 @@
 			
 		// },
 		methods: {
+			// 防抖函数
+						debounce(func, wait = 1000) {
+							return (...args) => {
+								// 清除之前的定时器
+								if (this.payDebounceTimer) {
+									clearTimeout(this.payDebounceTimer);
+								}
+								
+								// 设置新的定时器
+								this.payDebounceTimer = setTimeout(() => {
+									func.apply(this, args);
+									this.payDebounceTimer = null;
+								}, wait);
+							};
+						},
+			
 			orderBindUser(orderId) {
 				uni.showLoading({
 					title: '加载中...'
@@ -289,6 +305,7 @@
 				var data = {orderId:this.orderId,payType:payType};
 				var that=this;
 				uni.showLoading();
+				
 				editPayType(data).then(
 					res => {
 						if(res.code==200){
@@ -314,12 +331,28 @@
 					url: '/pages_user/user/otherPaymentOrder?orderId='+this.orderId
 				})
 			},
-			payOrder(){
+			// 防抖后的支付方法
+						payOrder: function() {
+							// 创建防抖函数实例
+							const debouncedPay = this.debounce(function() {
+								this.executePay();
+							}, 1000); // 1秒防抖时间,可以根据需要调整
+							
+							// 执行防抖函数
+							debouncedPay();
+						},// 实际的支付执行逻辑
+			executePay() {
 				var data = {orderId:this.order.id,payType:this.order.payType};
 				var that=this;
+				
+				// 防止重复点击,可以添加加载状态
+				if (this.isPaying) return;
+				this.isPaying = true;
+				
 				uni.showLoading();
 				pay(data).then(
 					res => {
+						this.isPaying = false;
 						if(res.code==200){
 							 console.log(res);
 							 if(res.payType==1||res.payType==2||res.payType==3){
@@ -340,7 +373,7 @@
 								 	fail: function(err) {
 										uni.showToast({
 											icon:'none',
-											title:'fail:' + JSON.stringify(err),
+											title:'支付失败',
 										});
 								 		console.log('fail:' + JSON.stringify(err));
 								 		uni.hideLoading();
@@ -350,22 +383,6 @@
 									}
 								 });
 							 }
-							 // 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',
@@ -373,10 +390,79 @@
 							});
 						}
 					},
-					rej => {}
+					rej => {
+						this.isPaying = false;
+						uni.hideLoading();
+						uni.showToast({
+							icon:'none',
+							title: '网络请求失败',
+						});
+					}
 				);
+			},
+			// 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

@@ -181,12 +181,12 @@
 
 
 							<!-- 测试用下面的 -->
-							<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

+ 8 - 7
pages_course/living.vue

@@ -154,7 +154,6 @@
 					</view>
 
 					<view class="chat-content-wrapper" :class="{ 'chat-content-focused': isFocus }">
-						<!-- 公告 -->
 						<view class="notice-message" v-if="!isFocus&&isShowNotice"
 							:class="liveItem.showType == 1 ? 'horizontal-notice' : ''">
 							公告消息: {{notice.msg}}
@@ -1305,6 +1304,8 @@
 			// 		await this.getUserInfo();
 			// 	}
 			// },
+			
+			// 静默登录
 			goLogin(data) {
 				let provider = 'weixin'
 				uni.login({
@@ -4559,7 +4560,6 @@
 
 			// 聊天区域
 			.chat-area-container {
-				// height: var(--chat-height);
 				background: var(--chat-bg);
 				position: fixed;
 				width: 100%;
@@ -4568,8 +4568,6 @@
 				transform: translateZ(0);
 				will-change: transform;
 				backface-visibility: hidden;
-				// max-height: 50%;
-
 				&.chat-area-container2 {
 					flex: 1;
 					min-height: 0; // 重要:允许收缩到0
@@ -4581,19 +4579,20 @@
 				}
 
 				&.chat-area-container3 {
+					
 					max-height: 40%;
 					flex: 1;
 					min-height: 0; // 重要:允许收缩到0
-					position: relative;
+					// position: relative;
 					transform: none; // 移除之前的变换
 					will-change: auto;
 					display: flex;
 					flex-direction: column;
+					position: absolute;
 				}
 
 
 				&.chat-area-focused {
-					// max-height: 500rpx;
 					transform: translateY(calc(-1 * var(--keyboard-height, 0rpx))) translateZ(0);
 					z-index: 1000;
 				}
@@ -4627,7 +4626,9 @@
 						overflow: hidden;
 
 						&.horizontal-notice {
-							position: static;
+							top: 12rpx;
+							height: fit-content;
+							z-index: 2;
 						}
 					}
 

+ 4 - 1
pages_shopping/live/confirmCreateOrder.vue

@@ -64,7 +64,7 @@
 
 				<!-- 备注 -->
 				<view class="remarks">
-					<input type="text" v-model="form.mark" placeholder="备注留言(选填)" placeholder-class="input" />
+					<input type="text" v-model="orderData.remark" placeholder="备注留言(选填)" placeholder-class="input" />
 				</view>
 
 
@@ -309,6 +309,7 @@
 					productId: this.productId,
 					orderKey: this.orderKey,
 					totalNum: 1,
+					remark:this.orderData.remark
 				}
 				computedReward(data).then(res => {
 						if (res.code == 200) {
@@ -334,6 +335,7 @@
 					liveId: this.liveId,
 					orderKey: this.orderKey,
 					userName: this.address.realName,
+					remark:this.orderData.remark||'',
 					userPhone: this.address.phone,
 					userAddress: this.address.province + ' ' + this.address.city + ' ' + this.address.district + ' ' +
 						this.address
@@ -369,6 +371,7 @@
 					userAddress: this.address.province + ' ' + this.address.city + ' ' + this.address.district + ' ' +
 						this.address.detail,
 					cartId: "5",
+					remark:this.orderData.remark||'',
 					productId: this.productId,
 					totalNum: 1,
 					couponUserId: this.couponUserId,