123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <{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="真实姓名" value="<{$my.user_name}>">
- <select id="sex" name="sex" >
-
- <option <{if $my.sex != 2 && $my.sex != 3}>selected<{/if}> value="1">性别</option>
- <option <{if $my.sex == 2}>selected<{/if}> value="2">男</option>
- <option <{if $my.sex == 3}>selected<{/if}> value="3">女</option>
- </select>
- <input type="text" id="phone" name="phone" placeholder="手机号" value="<{$my.phone}>">
- <textarea placeholder="通信地址" id="address" name="address" value="<{$my.address}>"><{$my.address}></textarea>
- <section class="button-wrapper">
- <a class="button" id="sub_address" style="cursor: pointer;">保存</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();
- }
- });
- // 提示
- function showTipsBox(msg,close){
- toast(msg, 1);
- return;
- $("#error_msg").html(msg);
- $("#tips_close_btn").hide();
- if(close){
- $("#tips_close_btn").show();
- }
- $("#error_tips_box").fadeIn();
- $('.a_cover').fadeIn();
- }
-
- $('#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($('textarea[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=UpExpressYes'
- , {
- //lottery_data_id: '<{$lotteryData.id}>',
- realname: realname,
- phone: phone,
- address: address,
- sex:sex
- }
- , function (data) {
- if (data.ok) {
- toast('修改成功');
- } else {
- showTipsBox(data.msg);
- return false;
- }
- }
- , 'json'
- );
-
- });
-
- });
- </script>
|