shish 1 rok pred
rodič
commit
bd795afba3
1 zmenil súbory, kde vykonal 18 pridanie a 3 odobranie
  1. 18 3
      mallApp/src/pages/member/recharge.vue

+ 18 - 3
mallApp/src/pages/member/recharge.vue

@@ -162,7 +162,9 @@ export default {
 			// 支付确认弹框相关
 			payConfirmShow: false,
 			// 福利选择弹框相关
-			welfareModalShow: false
+			welfareModalShow: false,
+			// 防重复请求相关
+			lastSelectWelfareTime: 0
 		}
 	},
 	watch: {
@@ -328,7 +330,7 @@ export default {
 				})
 			}else{
 				that.toPay()
-			}				
+			}
 		},
 		paySuccess() {
 			this.$util.pageTo({url: '/pages/member/rechargeResult?id='+this.id+'&salt='+this.salt,type: 2})
@@ -372,6 +374,19 @@ export default {
 		},
 		// 选择福利套餐
 		selectWelfare(info) {
+			// 防重复请求:5秒内禁止重复调用
+			const currentTime = Date.now()
+			const timeDiff = currentTime - this.lastSelectWelfareTime
+			
+			if (timeDiff < 5000 && this.lastSelectWelfareTime > 0) {
+				const remainingTime = Math.ceil((5000 - timeDiff) / 1000)
+				this.$msg(`请 ${remainingTime}秒 后再试`)
+				return
+			}
+			
+			// 更新最后调用时间
+			this.lastSelectWelfareTime = currentTime
+
 			this.amount = info.recharge.toString()
 			this.wexinPayFn()
 		},
@@ -1090,7 +1105,7 @@ export default {
 				.welfare-gift {
 					font-size: 30upx;
 					color: #ff6b6b;
-					font-weight: 550;
+					font-weight: 580;
 				}
 			}