Browse Source

Merge branch '3.0.2_online'

Conflicts:
	web/users/js/login.js
zhangweicheng 5 years ago
parent
commit
c6448a6f78
4 changed files with 89 additions and 94 deletions
  1. 0 1
      config/gulpConfig.js
  2. 0 4
      gulpfile.js
  3. 1 1
      web/building_saas/unit_price_file/index.js
  4. 88 88
      web/users/js/login.js

+ 0 - 1
config/gulpConfig.js

@@ -239,7 +239,6 @@ module.exports = {
         'web/building_saas/complementary_ration_lib/js/explanatory.js',
         'web/building_saas/complementary_ration_lib/js/jobContent.js',
         'web/building_saas/complementary_ration_lib/js/annotation.js',
-        'public/web/scMathUtil.js',
         'public/web/common_ajax.js',
         'public/web/ztree_common.js',
         'public/web/ration_glj_units.js',

+ 0 - 4
gulpfile.js

@@ -117,7 +117,6 @@ let compleRation_rationOptions = {
     injectList: [
         'web/dest/scripts/compleRation_ration.all.min.' + version + '.js',
         'web/dest/css/compleRation_ration.all.min.' + version + '.css',
-        'web/dest/scripts/common.all.min.'+version+'.js',
         'web/dest/css/common.all.min.' + version + '.css'
     ]
 };
@@ -134,7 +133,6 @@ let compleRation_gljOptions = {
     injectList: [
         'web/dest/scripts/compleRation_glj.all.min.' + version + '.js',
         'web/dest/scripts/compleRation_glj.all.min.' + version + '.css',
-        'web/dest/scripts/common.all.min.'+version+'.js',
         'web/dest/css/common.all.min.' + version + '.css'
     ]
 };
@@ -151,7 +149,6 @@ let compleRation_coeOptions = {
     injectList: [
         'web/dest/scripts/compleRation_coe.all.min.' + version + '.js',
         'web/dest/scripts/compleRation_coe.all.min.' + version + '.css',
-        'web/dest/scripts/common.all.min.'+version+'.js',
         'web/dest/css/common.all.min.' + version + '.css'
     ]
 };
@@ -168,7 +165,6 @@ let compleRation_instOptions = {
     injectList: [
         'web/dest/scripts/compleRation_inst.all.min.' + version + '.js',
         'web/dest/scripts/compleRation_inst.all.min.' + version + '.css',
-        'web/dest/scripts/common.all.min.'+version+'.js',
         'web/dest/css/common.all.min.' + version + '.css'
     ]
 }

+ 1 - 1
web/building_saas/unit_price_file/index.js

@@ -365,7 +365,7 @@ let unitPriceObj = {
   },
   showSubDatas: function () {
     let parentData = this.getSelectedUnitPrice();
-    this.mixRatioList = mixRatioMap[gljUtil.getIndex(parentData)];
+    this.mixRatioList = parentData?mixRatioMap[gljUtil.getIndex(parentData)]:[];
     this.mixRatioList = this.mixRatioList ? this.mixRatioList : [];
     this.setMixRatioData(this.mixRatioList);
     let sel = this.subSheet.getSelections()[0];

+ 88 - 88
web/users/js/login.js

@@ -46,102 +46,102 @@ $(document).ready(function () {
     //         // captchaObj.getValidate();
     //     });
 
-        $("#login").click(function () {
-            if (!valid()) {
-                return false;
-            }
-            if ($('#changeLogin').attr('data-status') === 'user') {
-                let account = $("#inputEmail").val();
-                if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
+    $("#login").click(function () {
+        if (!valid()) {
+            return false;
+        }
+        if ($('#changeLogin').attr('data-status') === 'user') {
+            let account = $("#inputEmail").val();
+            if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
                     login();
-                } else {
-                    $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
-                }
             } else {
-                let account = $("#mobileLogin").val();
-                if(/^1[3456789]\d{9}$/.test(account)) {
+                $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
+            }
+        } else {
+            let account = $("#mobileLogin").val();
+            if(/^1[3456789]\d{9}$/.test(account)) {
                     login();
-                } else {
-                    $('#phoneHelp').text('您输入的 手机 格式不对');
-                }
+            } else {
+                $('#phoneHelp').text('您输入的 手机 格式不对');
             }
-            // let account = $("#inputEmail").val();
-            // let pw = $("#inputPassword").val();
-
-            // 判断输入的邮箱/手机是否格式正确
-            // if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
-            // // 先判断是否是专业版用户,是的话弹出短信验证
-            // $.ajax({
-            //     url: '/accountIsPro',
-            //     type: 'post',
-            //     async: true,
-            //     data: {"account": account, "pw": pw},
-            //     success: function (response) {
-            //         if (response.error === 0) {
-            //             const ispro = response.result;
-            //             if (!ispro) {
-            //                 login(captchaObj);
-            //             } else {
-            //                 $('#phonepass').modal('show');
-            //                 $('#proMobile').val(response.data);
-            //                 $('#pro_mobile').text(response.data.substr(0, 3) + '****' + response.data.substr(7, 11));
-            //             }
-            //         } else if(response.error === 2) {
-            //             $('#check_ssoId').val(response.ssoId);
-            //             $('#phone').modal('show');
-            //         } else {
-            //             let msg = response.msg !== undefined ? response.msg : '未知错误';
-            //             showError(msg, $("input"));
-            //         }
-            //     }
-            //     // });
-            // } else {
-            //     $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
-            // }
-        });
+        }
+        // let account = $("#inputEmail").val();
+        // let pw = $("#inputPassword").val();
 
-        // $('#loginPro').click(function () {
-        //     if ($('#smsCode').val() === '') {
-        //         showValidError('请输入验证码',$('#smsCode'));
-        //     } else {
-        //         login(captchaObj);
+        // 判断输入的邮箱/手机是否格式正确
+        // if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
+        // // 先判断是否是专业版用户,是的话弹出短信验证
+        // $.ajax({
+        //     url: '/accountIsPro',
+        //     type: 'post',
+        //     async: true,
+        //     data: {"account": account, "pw": pw},
+        //     success: function (response) {
+        //         if (response.error === 0) {
+        //             const ispro = response.result;
+        //             if (!ispro) {
+        //                 login(captchaObj);
+        //             } else {
+        //                 $('#phonepass').modal('show');
+        //                 $('#proMobile').val(response.data);
+        //                 $('#pro_mobile').text(response.data.substr(0, 3) + '****' + response.data.substr(7, 11));
+        //             }
+        //         } else if(response.error === 2) {
+        //             $('#check_ssoId').val(response.ssoId);
+        //             $('#phone').modal('show');
+        //         } else {
+        //             let msg = response.msg !== undefined ? response.msg : '未知错误';
+        //             showError(msg, $("input"));
+        //         }
         //     }
-        // });
+        //     // });
+        // } else {
+        //     $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
+        // }
+    });
 
-        $('#check-code').click(function () {
-            const mobile = $("#mobile").val();
-            const ssoId = $("#check_ssoId").val();
-            const code = $("#code").val();
-            if(!validMobile(mobile)) {
-                return false;
-            }
-            if(ssoId === undefined || ssoId === '') {
-                showValidError('账号有误!', $('#code'));
-                return false;
-            }
-            if($.trim(code) === '') {
-                showValidError('验证码不能为空!', $('#code'));
-                return false;
-            }
-            $.ajax({
-                url: '/sms/mobile',
-                type: 'post',
-                data: {ssoId: ssoId, mobile: mobile, code: code},
-                error: function() {
-                    showValidError('接口出错!',$('#code'));
-                },
-                beforeSend: function() {
-                },
-                success: function(response) {
-                    if (response.err === 0) {
-                        $("#login").click();
-                        $('#phone').modal('hide');
-                    } else {
-                        showValidError(response.msg,$('#code'));
-                    }
+    // $('#loginPro').click(function () {
+    //     if ($('#smsCode').val() === '') {
+    //         showValidError('请输入验证码',$('#smsCode'));
+    //     } else {
+    //         login(captchaObj);
+    //     }
+    // });
+
+    $('#check-code').click(function () {
+        const mobile = $("#mobile").val();
+        const ssoId = $("#check_ssoId").val();
+        const code = $("#code").val();
+        if(!validMobile(mobile)) {
+            return false;
+        }
+        if(ssoId === undefined || ssoId === '') {
+            showValidError('账号有误!', $('#code'));
+            return false;
+        }
+        if($.trim(code) === '') {
+            showValidError('验证码不能为空!', $('#code'));
+            return false;
+        }
+        $.ajax({
+            url: '/sms/mobile',
+            type: 'post',
+            data: {ssoId: ssoId, mobile: mobile, code: code},
+            error: function() {
+                showValidError('接口出错!',$('#code'));
+            },
+            beforeSend: function() {
+            },
+            success: function(response) {
+                if (response.err === 0) {
+                    $("#login").click();
+                    $('#phone').modal('hide');
+                } else {
+                    showValidError(response.msg,$('#code'));
                 }
-            })
-        });
+            }
+        })
+    });
     // };
 
     $("input").blur(function () {