| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- var openid = helper.cookies.get("openid");
- // var type = helper.request.queryString("type");
- //项目名称
- $(function() {
-
- //返回上一步
- $("#login-last").on('tap', function() {
- $(".progress-img1").show();
- $(".progress-img2").hide();
- $(".progress-div1").show();
- $(".progress-div2").hide();
- $("#login-submit").hide();
- $("#login-next").show();
- $("#login-last").hide();
- })
-
- //登陆验证
- $("#login-next").on('tap', function() {
- var identityCard= /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; //身份证号
- var userNameReg= /^[\u4E00-\u9FA5\uf900-\ufa2d(·|•)s]{2,20}$/;//2-20位包含少数名族
- // alert(IDcard);
- // if (!$("#nickname").val()) {
- // mui.alert("昵称不能为空");
- // } else if(!$("#fullname").val()){
- // mui.alert("姓名不能为空");
- // }else if(!userNameReg.test($("#fullname").val())){
- // mui.alert("姓名为2到20个字符");
- // } else if(!$("#idcard").val()){
- // mui.alert("身份证号不能为空");
- // } else if(!identityCard.test($("#idcard").val())){
- // mui.alert("身份证号格式错误");
- // }else if($(!"#order_rengin").val()){
- // mui.alert("项目不能为空");
- // }else if (!$("#room").val()){
- // mui.alert("房间号不能为空");
- // }else{
- //
- //
- // }
- $(".progress-img2").show();
- $(".progress-img1").hide();
- $(".progress-div2").show();
- $(".progress-div1").hide();
- $("#login-next").hide();
- $("#login-submit").show();
- $("#login-last").show();
-
- })
- $("#login-submit").on('tap', function() {
- if ($("#usercode").val()=="") {
- mui.alert("手机号不能为空");
- } else if($("#password").val()==""){
- mui.alert("密码不能为空");
- } else if($("#passwordrep").val()==""){
- mui.alert("确认密码不能为空");
- }else{
-
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + 'WxLogin/Register',
- async: true,
- dataType: 'json',
- data: {
- nickname: $("#nickname").val(), //昵称
- fullname: $("#fullname").val(), //姓名
- usercode: $("#usercode").val(), //手机号
- password: $("#password").val(), //密码
- passwordrep: $("#passwordrep").val(), //重复密码
- project: $("#order_rengin").attr('data-index'), //项目ID
- room: $("#room").val(), //房间号
- idcard: $("#idcard").val(), //身份证号
- openid: openid,
- openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var UserType = data.data.usertype;
- var UserCode = data.data.usercode;
- UserWord = $("#password").val();
- var FullName = data.data.fullname;
- var NickName = data.data.nickname;
- helper.cookies.set("usercode", UserCode, 7);
- helper.cookies.set("usertype", UserType, 7);
- helper.cookies.set("userword", UserWord, 7);
- helper.cookies.set("fullname", FullName, 7);
- helper.cookies.set("nickname", NickName, 7);
- debugger
- mui.alert("注册成功");
- window.location.href = "user/client_index.html";
- // var btnArray = ['否', '是'];
- // mui.confirm( '完成注册', btnArray, function(e) {
- // if (e.index == 1) {
- // window.location.href = "user/client_index.html";
- // }
- // })
- } else {
- mui.alert(data.message);
- }
- }
- })
- }
- })
-
- var areaList = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'CusRegionCategory/GetListTreeDrop',
- async: false,
- data: {},
- dataType: 'json',
- success: function(data) {
- console.log(data)
- areaList = data.data;
- // alert(JSON.stringify(data));
- }
- });
- (function($, doc) {
- //项目名称
- var ZTiPickers = new $.PopPicker({
- layer: 3
- });
- var ZXs = doc.getElementById('project');
- var ZXResults = doc.getElementById('order_rengin');
- var ZXResults2 = doc.getElementById('order_pro');
- var ZXResults3 = doc.getElementById('order_floor');
- ZXs.addEventListener('tap', function(event) {
- ZTiPickers.setData(areaList);
- ZTiPickers.show(function(items) {
- console.log(items)
- if (items[2].text==undefined) {
- ZXResults.value = items[0].text + "-" + items[1].text;
- } else if (items[1].text==undefined) {
- ZXResults.value = items[0].text;
- } else{
- ZXResults.value = items[0].text + "-" + items[1].text + "-" + items[2].text
- }
- ZXResults.setAttribute("data-index", items[1].id);
-
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- })(mui, document);
- })
|