Przeglądaj źródła

购物车结算页购买输入错误提示消息

hangb 8 lat temu
rodzic
commit
519f3ac291

+ 27 - 22
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_cart_ctrl.js

@@ -220,8 +220,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
 
 		// 输入购买量限制
 		$scope.blurNum = function (c) {
-			c.inputError = 0;
-			c.noInputError = 0;
+			// c.inputError = 0;
+			// c.noInputError = 0;
 			if(isNaN(c.number)) {
 				toaster.pop('info','提示','请输入数字');
 				c.number = c.goods.minBuyQty;
@@ -230,32 +230,36 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			if (c.number < c.goods.minBuyQty || !c.number) {
 				// toaster.pop("info", "提示", "该商品最少购买" + c.goods.minBuyQty + "件");
 				if (c.goods.breakUp) {
-					c.noInputError = 1;
+					toaster.pop('info','提示','最小起订量为' + c.goods.minBuyQty);
+					// c.noInputError = 1;
 					c.number = c.goods.minBuyQty;
-					$timeout(function () {
-						c.noInputError = 1;
-					}, 3000);
+					// $timeout(function () {
+					// 	c.noInputError = 1;
+					// }, 3000);
 				} else {
-					c.inputError = 1;
+					// c.inputError = 1;
+					toaster.pop('info','提示','最小起订量为' + c.goods.minBuyQty);
 					c.number = c.goods.minBuyQty;
-					$timeout(function () {
-						c.inputError = 0;
-					}, 3000);
+					// $timeout(function () {
+					// 	c.inputError = 0;
+					// }, 3000);
 				}
 			}else if(c.number > c.goods.reserve){
 				// toaster.pop("info", "提示", "库存不足");
 				if(c.goods.breakUp) {
-					c.noInputError = 2;
+					toaster.pop("info", "提示", "库存不足");
+					// c.noInputError = 2;
 					c.number = c.goods.reserve;
-					$timeout(function () {
-						c.noInputError = 0;
-					}, 3000);
+					// $timeout(function () {
+					// 	c.noInputError = 0;
+					// }, 3000);
 				}else {
-					c.inputError = 2;
+					// c.inputError = 2;
+					toaster.pop("info", "提示", "库存不足")
 					c.number = Number(NumberService.sub(c.goods.reserve, c.goods.reserve % c.goods.minPackQty));
-					$timeout(function () {
-						c.inputError = 0;
-					}, 3000);
+					// $timeout(function () {
+					// 	c.inputError = 0;
+					// }, 3000);
 				}
 				if(Number(c.number) < Number(c.goods.minBuyQty)) {
 					c.number = c.goods.minBuyQty;
@@ -264,12 +268,13 @@ define(["app/app", 'jquery-summernote'], function(app) {
 				if(!c.goods.breakUp) {
 					var remander = c.number % c.goods.minPackQty;
 					if(remander != 0) {
-						c.inputError = 3;
+						// c.inputError = 3;
+						toaster.pop("info", "提示", "不支持拆包且包装量为" + c.goods.minPackQty);
 						c.number = NumberService.sub(c.number, c.number % c.goods.minPackQty);
 						c.number = NumberService.add(c.number, c.goods.minPackQty);
-						$timeout(function () {
-							c.inputError = 0;
-						}, 3000);
+						// $timeout(function () {
+						// 	c.inputError = 0;
+						// }, 3000);
 					}
 					if(Number(c.number) > Number(c.goods.reserve)) {
 						c.number = NumberService.sub(c.goods.reserve, c.goods.reserve % c.goods.minPackQty);

+ 27 - 22
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -416,51 +416,56 @@ define(['app/app'], function(app) {
 
 		// 输入购买量限制
 		$scope.blurNum = function (detail) {
-			detail.inputError = 0;
-			detail.noInputError = 0;
+			// detail.inputError = 0;
+			// detail.noInputError = 0;
 			detail.number = Number(detail.number);
 			if (detail.number < detail.goodsHistory.minBuyQty || !detail.number) {
 				// toaster.pop("info", "提示", "该商品最少购买" + detail.goodsHistory.minBuyQty + "件");
 				if(detail.goodsHistory.breakUp) {
-					detail.noInputError = 1;
+					// detail.noInputError = 1;
+					toaster.pop('info','提示','最小起订量为' + detail.goodsHistory.minBuyQty);
 					detail.number = detail.goodsHistory.minBuyQty;
-					$timeout(function () {
-						c.noInputError = 0;
-					}, 3000);
+					// $timeout(function () {
+					// 	c.noInputError = 0;
+					// }, 3000);
 				}else{
-					detail.inputError = 1;
+					// detail.inputError = 1;
+					toaster.pop('info','提示','最小起订量为' + detail.goodsHistory.minBuyQty);
 					detail.number = detail.goodsHistory.minBuyQty;
-					$timeout(function () {
-						detail.inputError = 0;
-					},3000);
+					// $timeout(function () {
+					// 	detail.inputError = 0;
+					// },3000);
 				}
 			}else if(detail.number > detail.goodsHistory.reserve){
 				if(detail.goodsHistory.breakUp) {
-					detail.noInputError = 2;
+					// detail.noInputError = 2;
+					toaster.pop('info','提示','库存不足');
 					detail.number = detail.goodsHistory.reserve;
-					$timeout(function () {
-						c.noInputError = 0;
-					}, 3000);
+					// $timeout(function () {
+					// 	c.noInputError = 0;
+					// }, 3000);
 				}else{
-					detail.inputError = 2;
+					// detail.inputError = 2;
+					toaster.pop('info','提示','库存不足');
 					detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve % detail.goodsHistory.minPackQty));
-					$timeout(function () {
-						detail.inputError = 0;
-					},3000);
+					// $timeout(function () {
+					// 	detail.inputError = 0;
+					// },3000);
 				}
 				// toaster.pop('info', '提示','库存不足');
 			}else {
 				if(!detail.goodsHistory.breakUp) {
 					var remandar = detail.number % detail.goodsHistory.minPackQty;
 					if(remandar != 0) {
-						detail.inputError = 3;
+						// detail.inputError = 3;
+						toaster.pop("info", "提示", "不支持拆包且包装量为" + detail.goodsHistory.minPackQty);
 						detail.number = Number(NumberService.add(NumberService.sub(detail.number, detail.number % detail.goodsHistory.minPackQty), detail.goodsHistory.minPackQty));
 						if(detail.number > detail.goodsHistory.reserve) {
 							detail.number = NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve % detail.goodsHistory.minPackQty);
 						}
-						$timeout(function () {
-							detail.inputError = 0;
-						},3000);
+						// $timeout(function () {
+						// 	detail.inputError = 0;
+						// },3000);
 					}
 				}
 			}

+ 29 - 25
src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html

@@ -500,25 +500,29 @@
 		cursor: not-allowed;
 	}
 	/*添加是否可拆买、库存不足等提示*/
-	.shopCar .oder_list dl .line02 em.tip{
-		display: inline-block;
-		margin-top: 6px;
-		width: 165px;
-		text-align: left;
-		font-size: 12px;
-		font-weight: normal ;
-		line-height: 18px;
-		color: #e64040;
-	}
-	.shopCar .oder_list dl .line02 em.tip i{
-		font-size: 12px;
-		font-style: normal ;
-		color: #e64040;
-	}
-	.shopCar .oder_list dl .line02 em.tips{
-		width: 124px;
-		text-align: center;
-	}
+	/*.shopCar .oder_list dl .line02 em.tip{*/
+		/*display: inline-block;*/
+		/*margin-top: 6px;*/
+		/*width: 165px;*/
+		/*text-align: left;*/
+		/*font-size: 12px;*/
+		/*font-weight: normal ;*/
+		/*line-height: 18px;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.shopCar .oder_list dl .line02 em.tip i{*/
+		/*font-size: 12px;*/
+		/*font-style: normal ;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.shopCar .oder_list dl .line02 em.tips{*/
+		/*width: 124px;*/
+		/*text-align: center;*/
+	/*}*/
+	/*.shopCar .oder_list dl .line02 em.tip1{*/
+		/*width: 200px;*/
+		/*margin-left: -10px;*/
+	/*}*/
 </style>
 <div class="user_right fr" id="buyer_cart">
 	<!--订单中心-->
@@ -630,12 +634,12 @@
 										<input type="text" ng-disabled="cart.status == 1" ng-model="cart.number"  ng-blur="blurNum(cart)">
 										<a class="add" ng-disabled="cart.addDisabled || cart.status == 1" ng-click="add(cart)">+</a>
 									</span>
-									<!--<i ng-if="cart.status == 2" style="color: #f00; margin-left: 32px;">库存紧张</i>-->
-									<em class="tip" ng-if="!cart.goods.breakUp && cart.inputError == 3">不支持拆包且最小包装数量为<i ng-bind="cart.minPackQty"></i></em>
-									<em class="tip tips" ng-if="cart.goods.breakUp && cart.noInputError == 2">库存不足</em>
-									<em class="tip tips" ng-if="!cart.goods.breakUp && cart.inputError == 2">库存不足</em>
-									<em class="tip tips" ng-if="cart.goods.breakUp  && cart.noInputError == 1">最小起订量为<i ng-bind="cart.goods.minBuyQty"></i></em>
-									<em class="tip tips" ng-if="!cart.goods.breakUp && cart.inputError == 1">最小起订量为<i ng-bind="cart.goods.minBuyQty"></i></em>
+									<i ng-if="cart.status == 2" style="color: #f00; margin-left: 32px;">库存紧张</i>
+									<!--<em class="tip tip1" ng-if="!cart.goods.breakUp && cart.inputError == 3">不支持拆包且包装数量为<i ng-bind="cart.minPackQty"></i></em>-->
+									<!--<em class="tip tips" ng-if="cart.goods.breakUp && cart.noInputError == 2">库存不足</em>-->
+									<!--<em class="tip tips" ng-if="!cart.goods.breakUp && cart.inputError == 2">库存不足</em>-->
+									<!--<em class="tip tips" ng-if="cart.goods.breakUp  && cart.noInputError == 1">最小起订量为<i ng-bind="cart.goods.minBuyQty"></i></em>-->
+									<!--<em class="tip tips" ng-if="!cart.goods.breakUp && cart.inputError == 1">最小起订量为<i ng-bind="cart.goods.minBuyQty"></i></em>-->
 								</div>
 							</span>
 							<span class="wd02" style="position: relative">

+ 29 - 29
src/main/webapp/resources/view/usercenter/forstore/order_pay.html

@@ -582,29 +582,29 @@
 		color: #fff;
 	}
 	/*添加是否可拆买、库存不足等提示*/
-	.sure_oder .btn-wrap .tip{
-		display: inline-block;
-		margin-top: 4px;
-		width: 150px;
-		text-align: left;
-		font-size: 12px;
-		font-weight: normal ;
-		line-height: 18px;
-		color: #e64040;
-	}
-	.sure_oder .btn-wrap .tip1{
-		width: 165px;
-		margin-left: -20px;
-	}
-	.sure_oder .btn-wrap .tip i{
-		font-size: 12px;
-		font-style: normal ;
-		color: #e64040;
-	}
-	.sure_oder .btn-wrap em.tips{
-		width: 124px;
-		text-align: center;
-	}
+	/*.sure_oder .btn-wrap .tip{*/
+		/*display: inline-block;*/
+		/*margin-top: 4px;*/
+		/*width: 150px;*/
+		/*text-align: left;*/
+		/*font-size: 12px;*/
+		/*font-weight: normal ;*/
+		/*line-height: 18px;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.sure_oder .btn-wrap .tip1{*/
+		/*width: 200px;*/
+		/*margin-left: -10px;*/
+	/*}*/
+	/*.sure_oder .btn-wrap .tip i{*/
+		/*font-size: 12px;*/
+		/*font-style: normal ;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.sure_oder .btn-wrap em.tips{*/
+		/*width: 124px;*/
+		/*text-align: center;*/
+	/*}*/
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr" id="pay-cart">
@@ -750,12 +750,12 @@
                                 <input type="text" ng-model="detail.number" ng-readonly="order.status != 501" ng-blur="blurNum(detail)">
                                 <a href="javascript:void(0)" class="add" ng-click="add(detail)" ng-disabled="detail.addDisabled">+</a>
                             </span>
-							<em class="tip tip1" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 3">不支持拆包且最小包装数量为<i ng-bind="detail.goodsHistory.minPackQty"></i></em>
-							<em class="tip tips" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 2">库存不足</em>
-							<em class="tip tips" ng-if="detail.goodsHistory.breakUp && detail.noInputError == 2">库存不足</em>
-							<em class="tip tips" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 1">最小起订量为<i ng-bind="detail.goodsHistory.minBuyQty"></i></em>
-							<em class="tip tips" ng-if="detail.goodsHistory.breakUp && detail.noInputError == 1">最小起订量为<i ng-bind="detail.goodsHistory.minBuyQty"></i></em>
-								<!--<span ng-if="order.status != 501" ng-bind="detail.number" class="number" style="border: none;"></span>-->
+							<!--<em class="tip tip1" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 3">不支持拆包且包装数量为<i ng-bind="detail.goodsHistory.minPackQty"></i></em>-->
+							<!--<em class="tip tips" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 2">库存不足</em>-->
+							<!--<em class="tip tips" ng-if="detail.goodsHistory.breakUp && detail.noInputError == 2">库存不足</em>-->
+							<!--<em class="tip tips" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 1">最小起订量为<i ng-bind="detail.goodsHistory.minBuyQty"></i></em>-->
+							<!--<em class="tip tips" ng-if="detail.goodsHistory.breakUp && detail.noInputError == 1">最小起订量为<i ng-bind="detail.goodsHistory.minBuyQty"></i></em>-->
+							<span ng-if="order.status != 501" ng-bind="detail.number" class="number" style="border: none;"></span>
                             </div>
                         </span>
 							<span class="price-step"  style="width: 10%" ng-class="{'none': detail.goodsHistory.prices.length > 1}">