huanggang 6 years ago
parent
commit
c9b4c4b31d

File diff suppressed because it is too large
+ 1 - 1
data/resource/mobile/talk/css/weui.css


+ 69 - 26
mobile/templates/default/talk/school_certs.php

@@ -46,6 +46,7 @@
 
         .weui-cells_form {
             padding-bottom: 43px;
+            background: #F2F2F2;
         }
 
         .uploader_bg {
@@ -142,7 +143,7 @@
             <div class="weui-cell">
                 <div class="weui-cell__bd uploader">
                     <div class="uploader_bg" onclick='uploader.click()'></div>
-                    <input type='file' name='file' enctype='multipart/form-data' id='uploader' style="display: none;">
+                    <input type='file' data-label="管理员身份证明" name='file' enctype='multipart/form-data' id='uploader' style="display: none;">
                     <p class="uploader_tip">推荐尺寸800*800,支持jpg/png/jpeg/bmp格式,大小不超过1M</p>
                 </div>
                 <input type="hidden" data-label="管理员身份证明" name="file_path" value="">
@@ -184,8 +185,8 @@
                 </div>
             </div>
         </div>
-        <label for="weuiAgree" class="weui-agree">
-            <input id="agree" type="checkbox" data-label="请同意《熊猫美妆平台协议》" name="agree" class="weui-agree__checkbox">
+        <label for="agree" class="weui-agree">
+            <input id="agree" type="checkbox" data-label="《熊猫美妆平台协议》" name="agree" class="weui-agree__checkbox">
             <span class="weui-agree__text">统一并遵守《熊猫美妆平台协议》</span>
         </label>
         <div class="weui-btn-area">
@@ -204,6 +205,7 @@
 <script type="text/javascript">
     $(function () {
         var talk_id = getHrefArguments('talk_id');
+        var ctype = getHrefArguments('ctype');
 
         var InputVerify = function(){
 
@@ -218,24 +220,34 @@
                         $.alert(elLabel+'不能为空');
                         return false;
                     }
+                    return true;
                 },
                 email:function (el) {
-                    var emailreg = /^\w+((-\w+)|(\.\w+))*\@("@")[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
+                    var emailreg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
                     if (!emailreg.test($(el).val()))
                     {
-                        $.alert('邮箱不能为空');
+                        $.alert('邮箱格式不正确');
                         return false;
                     }
-
+                    return true;
                 },
                 mobile:function(el)
                 {
                     var reg = /^1[3|4|5|7|8]\d{9}$/;
-                    if (reg.test($(el).val()))
+                    if (!reg.test($(el).val()))
                     {
-                        $.alert('手机号码不能为空');
+                        $.alert('手机号码格式不正确');
+                        return false;
+                    }
+                    return true;
+                },
+                checked:function(el){
+                    if(!$(el).is(":checked")) {
+                        var elLabel = $(el).attr('data-label');
+                        $.alert("请同意"+elLabel);
                         return false;
                     }
+                    return true;
                 }
             };
 
@@ -268,7 +280,9 @@
                                         break;
                                 }
                                 case "agree":{
-
+                                        if(!_self.verifyfn.checked(_self.inputs[i])){
+                                            return false;
+                                        }
                                         break;
                                 }
                                 default:{
@@ -327,29 +341,58 @@
             ajaxFileUpload();
         });
 
-        $("#submit").click(function ()
+
+        $('.get_code').on('click',function()
+        {
+            var text = $(".get_code").text();
+            if (text == '重新发送' || text == '获取验证码') {
+                var $mobile = $('input[name="cmobile"]').eq(0);
+                if(inputVerify.verifyfn.mobile($mobile)) {
+                    $.post("/mobile/index.php?act=login&op=getcodex&client_type=ajax",{
+                        mobile: $mobile.val(),
+                        type:'register'
+                    },function (res) {
+                        var datas = JSON.parse(res);
+                        if(datas.code == 200) {
+                            $.toast('短信发送成功',1500);
+                        }
+                        else {
+                            $.alert(datas.message);
+                        }
+                    });
+                    var time = 60,
+                        a = setInterval(function () {
+                            time = time - 1;
+                            $(".get_code").text(time);
+                            if (time == 0) {
+                                clearInterval(a);
+                                $(".get_code").text('重新发送');
+                            }
+                        }, 1000);
+                }
+            }
+        });
+
+        $("#submit").on('click',function ()
         {
             if(!inputVerify.verify()) {
                 return;
             }
-
-            $.get('/mobile/index.php?act=member_talk&op=commit_certs', {
-                cmobile:'13917679728',
-                code:"0101",
-                ctype:'1',
-                room_id:talk_id,
-                short_name:"123",
-                full_name:"123123",
-                cmail:"hd-123@fox.com",
-                cname:'cname',
-                cinfo:'cinfo',
-                file_path: cimage,
+            var inputs = {
+                cmobile:$('input[name="cmobile"]').val(),
+                code:$('input[name="code"]').val(),
+                short_name:$('textarea[name="short_name"]').val(),
+                full_name:$('input[name="full_name"]').val(),
+                cmail:$('input[name="cmail"]').val(),
+                cname:$('input[name="cname"]').val(),
+                cinfo:$('input[name="cinfo"]').val(),
+                file_path:$('input[name="file_path"]').val(),
                 client_type: 'ajax'
-            }, function (res) {
-                alert(res);
+            };
+            $.get('/mobile/index.php?act=member_talk&op=commit_certs', inputs, function (res) {
+                console.log(res);
             });
-        })
-
+        });
     });
 </script>
 </body>