my_set.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <{include file="header.html"}>
  2. <link rel="stylesheet" type="text/css" href="<{$web_cfg.cdn}>/haili/css/setting.css" />
  3. <header><a href="javascript:history.go(-1)" class="back"></a>资料设置</header>
  4. <section class="applycont">
  5. <form>
  6. <input type="text" id="realname" name="realname" placeholder="真实姓名" name="<{$my.user_name}>">
  7. <select id="sex" name="sex" >
  8. <option <{if $my.sex != 2 && $my.sex != 3}>selected<{/if}>>性别</option>
  9. <option <{if $my.sex == 2}>selected<{/if}>>男</option>
  10. <option <{if $my.sex == 3}>selected<{/if}>>女</option>
  11. </select>
  12. <input type="text" id="phone" name="phone" placeholder="手机号" name="<{$my.phone}>">
  13. <textarea placeholder="通信地址" id="address" name="address" name="<{$my.address}>"></textarea>
  14. <section class="button-wrapper">
  15. <a class="button" id="sub_address">保存</a>
  16. </section>
  17. </form>
  18. </section>
  19. <!--公用提示背景遮罩层-->
  20. <div class="a_cover"></div>
  21. <div class="v_tips_box v_tips_box2" id="error_tips_box">
  22. <div class="v_close_btn" id="tips_close_btn"></div>
  23. <p class="tips_msg" id="error_msg">错误信息</p>
  24. </div>
  25. <{include file="bottom.html"}>
  26. <script>
  27. KISSY.use('node, io', function (S, Node, IO) {
  28. $("input[type=text]").focus(function(){
  29. $(this).parent().find("span").hide();
  30. $(this).css("color","#000");
  31. });
  32. $("input[type=text]").blur(function(){
  33. if($(this).val() == ''){
  34. $(this).parent().find("span").show();
  35. }
  36. });
  37. $('#sub_address').on('click', function () {
  38. var realname = S.trim($('input[name=realname]').val());
  39. if (realname == '') {
  40. showTipsBox('真实姓名不能为空',true);
  41. return false;
  42. }
  43. var phone = S.trim($('input[name=phone]').val());
  44. var regex = /^(1[0-9][0-9]|15[0-9]|18[02-9]|14[57])[0-9]{8}$/;
  45. if(!regex.test(phone)) {
  46. showTipsBox('请填写有效手机号码',true);
  47. return false;
  48. }
  49. var address = S.trim($('input[name=address]').val());
  50. if (address == '') {
  51. showTipsBox('请填写收货地址',true);
  52. return false;
  53. }
  54. var sex = S.trim($('select[name=sex]').val());
  55. if (!sex) {
  56. showTipsBox('请选择性别',true);
  57. return false;
  58. }
  59. IO.get('<{$web_cfg.domain}>/?c=Express&a=UpExpress'
  60. , {
  61. lottery_data_id: '<{$lotteryData.id}>',
  62. realname: realname,
  63. phone: phone,
  64. address: address,
  65. sex:sex
  66. }
  67. , function (data) {
  68. if (data.ok) {
  69. location.reload();
  70. } else {
  71. showTipsBox(data.msg);
  72. return false;
  73. }
  74. }
  75. , 'json'
  76. );
  77. });
  78. });
  79. </script>