Browse Source

修改配送费传值问题

liuam 7 years ago
parent
commit
18f86e8e86

+ 3 - 0
src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java

@@ -144,6 +144,9 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 				}
 			}
 		}
+		if (rule.getFareType() == 4) {
+			rule.setUniformPrice((double) 0);
+		}
 		distributionRuleDao.save(rule);
 		return ResultMap.success(null);
 	}

+ 42 - 20
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_maintain_ctrl.js

@@ -75,6 +75,11 @@ define(['app/app'], function (app) {
 			$scope.sampleStore.storeShortName = $scope.storeInfo.storeShortName;
             $scope.sampleStore.storeName = $scope.storeInfo.storeName;
 			$scope.sampleStore.description = $scope.storeInfo.description;
+
+            $scope.sampleStore.enPhone = '';
+            $scope.sampleStore.enWeixin = '';
+            $scope.sampleStore.enQQ = '';
+
 			$scope.sampleStore.enterprise = angular.copy($scope.storeInfo.enterprise);
 			$scope.sampleStore.enterprise.address = $scope.sampleStore.enterprise.address || $scope.storeInfo.enterprise.enAddress;
 			qulifications = angular.copy($scope.storeInfo.qualifications);
@@ -209,31 +214,45 @@ define(['app/app'], function (app) {
 		 * 验证手机号
          */
 		$scope.checkPhone = function () {
-            if ($scope.sampleStore.enterprise.enPhone) {
-                if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test($scope.sampleStore.enterprise.enPhone)) {
-                    toaster.pop('error', '请输入正确的手机号码');
-                    return false;
-                }
+            var enPhone = angular.element('.enPhone').val();
+            if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(enPhone) && enPhone) {
+                toaster.pop('error', '请输入正确的手机号码');
+                return false;
             }
+
         }
 
+        /**
+         * 验证微信号
+         */
+        $scope.checkWeixin = function () {
+            var enWeixin = angular.element('.enWeixin').val();
+            if (!/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/.test(enWeixin) && enWeixin) {
+                toaster.pop('error', '请输入正确的微信号');
+                return false;
+            }
+
+        }
 
         /**
          * 验证QQ号
          */
         $scope.checkQQ = function () {
-            if ($scope.sampleStore.enterprise.enQQ) {
-                if (!/^[1-9][0-9]{4,9}$/.test($scope.sampleStore.enterprise.enQQ)) {
-                    toaster.pop('error', '请输入正确的QQ号');
-                    return false;
-                }
+            var enQQ = angular.element('.enQQ').val();
+            if (!/^[1-9][0-9]{4,10}$/.test(enQQ) && enQQ) {
+                toaster.pop('error', '请输入正确的QQ号');
+                return false;
             }
+
         }
 
 		/**
 		 * 验证修改的基础信息
 		 */
 		var validateBasicInfo = function () {
+            var enPhone = angular.element('.enPhone').val();
+            var enWeixin = angular.element('.enWeixin').val();
+            var enQQ = angular.element('.enQQ').val();
 			if (!$scope.sampleStore) {
 				toaster.pop('error', '店铺信息不能为空');
 				return false;
@@ -258,17 +277,20 @@ define(['app/app'], function (app) {
 				toaster.pop('error', '请输入正确的电话号码');
 				return false;
 			}
-            if ($scope.sampleStore.enterprise.enPhone) {
-                if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test($scope.sampleStore.enterprise.enPhone)) {
-                    toaster.pop('error', '请输入正确的手机号码');
-                    return false;
-                }
+
+
+            if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(enPhone) && enPhone) {
+                toaster.pop('error', '请输入正确的手机号码');
+                return false;
+            }
+
+            if (!/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/.test(enWeixin) && enWeixin) {
+                toaster.pop('error', '请输入正确的微信号');
+                return false;
             }
-            if ($scope.sampleStore.enterprise.enQQ) {
-			    if (!/^[1-9][0-9]{4,9}$/.test($scope.sampleStore.enterprise.enQQ)) {
-                    toaster.pop('error', '请输入正确的QQ号');
-                    return false;
-                }
+            if (!/^[1-9][0-9]{4,10}$/.test(enQQ) && enQQ) {
+                toaster.pop('error', '请输入正确的QQ号');
+                return false;
             }
 			/*if (!$scope.sampleStore.enterprise.enFax || $scope.sampleStore.enterprise.enFax == '') {
 				toaster.pop('error', '请输入正确的企业传真');

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

@@ -846,8 +846,8 @@
 									</em>
 								</p>
 								<p><strong>店铺合计:</strong>
-									<em ng-if="order.status==501 && !(deliveryList && deliveryList[details[0].storeid].fareType == 4)" ng-bind="storePrice[key] + fareList[details[0].storeid] | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
-									<em ng-if="order.status==501 && deliveryList && deliveryList[details[0].storeid].fareType == 4" ng-bind="storePrice[key] | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+									<em ng-if="order.status==501" ng-bind="storePrice[key] + fareList[details[0].storeid] | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+
 									<em ng-if="order.status!=501" style="font-weight: bold">
 										<em ng-if="storeArray.length == 1" ng-bind="order.ensurePrice | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)"></em>
 										<em ng-if="storeArray.length != 1" ng-bind="storePrice[key] + deliveryList[details[0].storeid].fare | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)"></em>

+ 3 - 3
src/main/webapp/resources/view/vendor/forstore/vendor_store_maintain.html

@@ -742,7 +742,7 @@
 					<span>手&nbsp;&nbsp;&nbsp;&nbsp;机</span>
 				</div>
 				<div class="col-md-10 custom_col">
-					<input type="text" class="form-control" style="border-radius: inherit;" title="enPhone" ng-blur="checkPhone()" ng-model="sampleStore.enterprise.enPhone" maxlength="11"/>
+					<input type="text" class="form-control enPhone" style="border-radius: inherit;" title="enPhone" ng-pattern="/^1[3|4|5|6|7|8|9][0-9]{9}$/" ng-blur="checkPhone()" ng-model="sampleStore.enterprise.enPhone" maxlength="11"/>
 				</div>
 			</div>
 			<div class="row com_row" style="margin-top: 10px;">
@@ -750,7 +750,7 @@
 					<span>微&nbsp;&nbsp;&nbsp;&nbsp;信</span>
 				</div>
 				<div class="col-md-10 custom_col">
-					<input type="text" class="form-control" style="border-radius: inherit;" title="enWeixin" ng-model="sampleStore.enterprise.enWeixin"/>
+					<input type="text" class="form-control enWeixin" style="border-radius: inherit;" title="enWeixin" ng-pattern="/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/" ng-blur="checkWeixin()" ng-model="sampleStore.enterprise.enWeixin"/>
 				</div>
 			</div>
 			<div class="row com_row" style="margin-top: 10px;">
@@ -758,7 +758,7 @@
 					<span>Q&nbsp;&nbsp;&nbsp;&nbsp;Q</span>
 				</div>
 				<div class="col-md-10 custom_col">
-					<input type="text" class="form-control" style="border-radius: inherit;" title="enQQ" ng-blur="checkQQ()" ng-model="sampleStore.enterprise.enQQ" maxlength="10"/>
+					<input type="text" class="form-control enQQ" style="border-radius: inherit;" title="enQQ" ng-pattern="/^[1-9][0-9]{4,10}$/" ng-blur="checkQQ()" ng-model="sampleStore.enterprise.enQQ" maxlength="11"/>
 				</div>
 			</div>
 		</div><!-- 店铺基础信息输入 end -->