Przeglądaj źródła

Merge branch 'master' of http://1.14.104.71:10880/lijunfeng/baiyuchengpin

李妹妹 20 godzin temu
rodzic
commit
da647be391

+ 2 - 2
pages_course/living.vue

@@ -4739,9 +4739,9 @@ import {CustomToast} from '@/components/custom-toast.vue';
 			// 去购买,跳商品详情
 			async goShop(productId, goodsId) {
 				if (!this.liveId) return;
-				// 检查限购
+				// 检查限购(跳转商品详情时,默认检查数量1)
 				try {
-					const res = await checkPurchaseLimit({ productId: productId });
+					const res = await checkPurchaseLimit({ productId: productId, num: 1 });
 					if (res.code !== 200) {
             this.$refs.customToast.show({
               title: res.msg || '该商品限购,目前剩余可购买数量不足',

+ 2 - 1
pages_shopping/live/storeOrderDetail.vue

@@ -422,6 +422,7 @@ import {CustomToast} from '@/components/custom-toast.vue';
 			async pay() {
 				// 直播订单,使用productId校验限购
 				let productId = null;
+				let num = this.order.totalNum || 1; // 获取订单数量
 				if(this.order.productId){
 					productId = this.order.productId;
 				} else if(this.product && this.product.productId){
@@ -438,7 +439,7 @@ import {CustomToast} from '@/components/custom-toast.vue';
 				// 如果获取到 productId,检查限购
 				if(productId){
 					try {
-						const res = await checkPurchaseLimit({ productId: productId });
+						const res = await checkPurchaseLimit({ productId: productId, num: num });
 						if (res.code !== 200) {
               this.$refs.customToast.show({
                 title: res.msg || '该商品限购,目前剩余可购买数量不足',

+ 2 - 1
pages_user/user/storeOrder.vue

@@ -369,6 +369,7 @@
 					if(item.orderType==2){
 						// 直播订单,限购逻辑不变,使用原有逻辑
 						let productId = null;
+						let num = item.totalNum || 1; // 获取订单数量
 						if(item.productId){
 							productId = item.productId;
 						} else if(item.itemJson){
@@ -383,7 +384,7 @@
 						// 如果获取到 productId,检查限购
 						if(productId){
 							try {
-								const res = await checkPurchaseLimit({ productId: productId });
+								const res = await checkPurchaseLimit({ productId: productId, num: num });
 								if (res.code !== 200) {
                   this.$refs.customToast.show({
                     title: res.msg || '该商品限购,目前剩余可购买数量不足',