12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <{include file="header.html"}>
- <link rel="stylesheet" type="text/css" href="<{$web_cfg.cdn}>/haili/css/setting.css" />
- <header><a href="javascript:history.go(-1)" class="back"></a>资料设置</header>
- <section class="applycont">
- <form>
- <input type="text" id="realname" name="realname" placeholder="真实姓名" name="<{$my.user_name}>">
- <select id="sex" name="sex" >
-
- <option <{if $my.sex != 2 && $my.sex != 3}>selected<{/if}>>性别</option>
- <option <{if $my.sex == 2}>selected<{/if}>>男</option>
- <option <{if $my.sex == 3}>selected<{/if}>>女</option>
- </select>
- <input type="text" id="phone" name="phone" placeholder="手机号" name="<{$my.phone}>">
- <textarea placeholder="通信地址" id="address" name="address" name="<{$my.address}>"></textarea>
- <section class="button-wrapper">
- <a class="button" id="sub_address">保存</a>
- </section>
- </form>
- </section>
- <!--公用提示背景遮罩层-->
- <div class="a_cover"></div>
- <div class="v_tips_box v_tips_box2" id="error_tips_box">
- <div class="v_close_btn" id="tips_close_btn"></div>
- <p class="tips_msg" id="error_msg">错误信息</p>
- </div>
- <{include file="bottom.html"}>
- <script>
- KISSY.use('node, io', function (S, Node, IO) {
-
- $("input[type=text]").focus(function(){
- $(this).parent().find("span").hide();
- $(this).css("color","#000");
- });
- $("input[type=text]").blur(function(){
- if($(this).val() == ''){
- $(this).parent().find("span").show();
- }
- });
-
- $('#sub_address').on('click', function () {
- var realname = S.trim($('input[name=realname]').val());
- if (realname == '') {
- showTipsBox('真实姓名不能为空',true);
- return false;
- }
-
- var phone = S.trim($('input[name=phone]').val());
- var regex = /^(1[0-9][0-9]|15[0-9]|18[02-9]|14[57])[0-9]{8}$/;
- if(!regex.test(phone)) {
- showTipsBox('请填写有效手机号码',true);
- return false;
- }
-
- var address = S.trim($('input[name=address]').val());
- if (address == '') {
- showTipsBox('请填写收货地址',true);
- return false;
- }
- var sex = S.trim($('select[name=sex]').val());
- if (!sex) {
- showTipsBox('请选择性别',true);
- return false;
- }
-
- IO.get('<{$web_cfg.domain}>/?c=Express&a=UpExpress'
- , {
- lottery_data_id: '<{$lotteryData.id}>',
- realname: realname,
- phone: phone,
- address: address,
- sex:sex
- }
- , function (data) {
- if (data.ok) {
- location.reload();
- } else {
- showTipsBox(data.msg);
- return false;
- }
- }
- , 'json'
- );
-
- });
-
- });
- </script>
|