Browse Source

bug修改

yangc 7 years ago
parent
commit
c525ab6c00

+ 97 - 93
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -600,99 +600,103 @@ define(['app/app'], function(app) {
 		//确认付款
 		$scope.imperfect = false;//暂不完善
 		$scope.confirmPay = function() {
-            // 安全级别
-            if (!$scope.userInfo.pwdEnable || !$scope.userInfo.haveUserQuestion||!$scope.userInfo.emailValidCode || $scope.userInfo.emailValidCode != 2) {
-                $scope.openHomeCenterModel();
-            } else {
-                if($scope.order.status == 502 || $scope.order.status == 503) {
-                    var arr = [];
-                    if($scope.order.orderids) {
-                        arr = $scope.order.orderids.split(",");
-                    }else {
-                        arr.push($scope.order.orderid);
-                    }
-                    if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
-                        paymentEnsure(arr);
-                    } else if($scope.order.paytype == '1103') {
-                        $state.go('order_transfer', {orderid : enIdFilter(arr.join("-"))});
-                    }else {
-                        toaster.pop('info', '美元请线下付款');
-                    }
-                    return ;
-                }
-                var validRule = checkRule();
-                if (!validRule){
-                    toaster.pop("info", "当前地址部分卖家无法配送,请重新选择地址或与卖家协商处理");
-                    return ;
-                }
-                var validTakeSelf = checkTakeSelf();
-                if (!validTakeSelf){
-                    toaster.pop("info", "请选择一个自提点");
-                    return ;
-                }
-                var orderInfos = [], orderInfo;
-                orderInfo = generateOrderInfo();
-                if(orderInfo == null) {
-                    return ;
-                }
-                orderInfos.push(orderInfo);
-                if(!$scope.imperfect){
-                    var validBill = checkBill();
-                    if (!validBill){
-                        // toaster.pop('info', '请完善专票信息');
-                        $scope.showBillFrame = true;
-                        return ;
-                    }
-                }
-
-                Order.ensure({orderid: enIdFilter($scope.order.orderid)}, orderInfos, function(data){
-                    if(data.code == 1) {
-                        if (data.data && data.data[0]) {
-                            var arr = [];
-                            var batchCodes = [];
-                            for(var i = 0; i < data.data.length; i++) {
-                                arr.push(data.data[i].orderid);
-                                for(var j = 0; j < data.data[i].orderDetails.length; j++) {
-                                    batchCodes.push(data.data[i].orderDetails[j].batchCode);
-                                }
-                            }
-                            if(!$scope.order.buyNow) {
-                                Cart.deleteByBatchCode({}, batchCodes, function(data) {
-                                }, function(response) {
-                                });
-                            }
-                            if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
-                                paymentEnsure(arr);
-                            } else if($scope.order.paytype == '1103') {
-                                console.log(arr.length)
-                                if(arr.length != 1){
-                                    $state.go('downPayment', {orderid : enIdFilter(arr.join('-'))});
-                                }else {
-                                    $state.go('order_transfer', {orderid : enIdFilter(arr.join('-'))});
-                                }
-                            }else {
-                                toaster.pop('info', '美元请线下付款');
-                                $state.go('buyer_order');
-                            }
-
-                        }
-                    }else {
-                        if(data.code == 6) { //产品信息有更新
-                            toaster.pop('warning', data.message + ",请刷新界面之后重新操作");
-                        }else if(data.code == 7){
-                            toaster.pop('warning', data.message + ",将为您跳转到购物车界面");
-                            $timeout(function () {
-                                $state.go('buyer_cart');
-                            }, 1000);
-                        }else {
-                            toaster.pop('warning', data.message);
-                        }
-                    }
-
-                }, function(response) {
-                    toaster.pop('error', '确认订单失败,' + response.data);
-                });
-            }
+			if ($scope.userInfo) {
+				// 安全级别
+				if (!$scope.userInfo.pwdEnable || !$scope.userInfo.haveUserQuestion||!$scope.userInfo.emailValidCode || $scope.userInfo.emailValidCode != 2) {
+					$scope.openHomeCenterModel();
+				} else {
+					if($scope.order.status == 502 || $scope.order.status == 503) {
+						var arr = [];
+						if($scope.order.orderids) {
+							arr = $scope.order.orderids.split(",");
+						}else {
+							arr.push($scope.order.orderid);
+						}
+						if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
+							paymentEnsure(arr);
+						} else if($scope.order.paytype == '1103') {
+							$state.go('order_transfer', {orderid : enIdFilter(arr.join("-"))});
+						}else {
+							toaster.pop('info', '美元请线下付款');
+						}
+						return ;
+					}
+					var validRule = checkRule();
+					if (!validRule){
+						toaster.pop("info", "当前地址部分卖家无法配送,请重新选择地址或与卖家协商处理");
+						return ;
+					}
+					var validTakeSelf = checkTakeSelf();
+					if (!validTakeSelf){
+						toaster.pop("info", "请选择一个自提点");
+						return ;
+					}
+					var orderInfos = [], orderInfo;
+					orderInfo = generateOrderInfo();
+					if(orderInfo == null) {
+						return ;
+					}
+					orderInfos.push(orderInfo);
+					if(!$scope.imperfect){
+						var validBill = checkBill();
+						if (!validBill){
+							// toaster.pop('info', '请完善专票信息');
+							$scope.showBillFrame = true;
+							return ;
+						}
+					}
+
+					Order.ensure({orderid: enIdFilter($scope.order.orderid)}, orderInfos, function(data){
+						if(data.code == 1) {
+							if (data.data && data.data[0]) {
+								var arr = [];
+								var batchCodes = [];
+								for(var i = 0; i < data.data.length; i++) {
+									arr.push(data.data[i].orderid);
+									for(var j = 0; j < data.data[i].orderDetails.length; j++) {
+										batchCodes.push(data.data[i].orderDetails[j].batchCode);
+									}
+								}
+								if(!$scope.order.buyNow) {
+									Cart.deleteByBatchCode({}, batchCodes, function(data) {
+									}, function(response) {
+									});
+								}
+								if ($scope.order.currency == 'RMB' && $scope.order.paytype == '1102') {
+									paymentEnsure(arr);
+								} else if($scope.order.paytype == '1103') {
+									console.log(arr.length)
+									if(arr.length != 1){
+										$state.go('downPayment', {orderid : enIdFilter(arr.join('-'))});
+									}else {
+										$state.go('order_transfer', {orderid : enIdFilter(arr.join('-'))});
+									}
+								}else {
+									toaster.pop('info', '美元请线下付款');
+									$state.go('buyer_order');
+								}
+
+							}
+						}else {
+							if(data.code == 6) { //产品信息有更新
+								toaster.pop('warning', data.message + ",请刷新界面之后重新操作");
+							}else if(data.code == 7){
+								toaster.pop('warning', data.message + ",将为您跳转到购物车界面");
+								$timeout(function () {
+									$state.go('buyer_cart');
+								}, 1000);
+							}else {
+								toaster.pop('warning', data.message);
+							}
+						}
+
+					}, function(response) {
+						toaster.pop('error', '确认订单失败,' + response.data);
+					});
+				}
+			} else {
+				toaster.pop('error', '未获取到登录信息,请刷新页面后重试');
+			}
 		};
 
 		// 跳银盛支付页面

+ 2 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -912,7 +912,8 @@
 									类目:<a href="product/kind/{{::detail.kindUuid}}" target="_blank" ng-if="detail.uuid"><em ng-bind="::detail.kiName || '-'" title="{{::detail.kiName}}"></em></a><br ng-if="detail.uuid"/>
 									<a class="unstand" ng-if="!detail.uuid"><em ng-bind="detail.kiName || '-'" title="{{::detail.kiName}}"></em></a><br ng-if="!detail.uuid"/>
 									型号:<a href="store/productDetail/{{::detail.batchCode}}" target="_blank"><em ng-bind="::detail.cmpCode || '-'" title="{{::detail.cmpCode}}"></em></a>
-									<a  class="unstand" ng-if="!detail.uuid"><em ng-bind="detail.brName || '-'" title="{{::detail.brName}}"></em></a><br/>
+									<br/>
+									<!--<a  class="unstand" ng-if="!detail.uuid"><em ng-bind="detail.brName || '-'" title="{{::detail.brName}}"></em></a><br/>-->
 									规格:<a><em ng-bind="::detail.spec || '-'" title="{{::detail.spec}}"></em></a><br/>
 								</p>
 							</div>