express.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <{include file="header.html"}>
  2. <!--公用标题居中显示-->
  3. <{include file="common_header.html"}>
  4. <div class="wrapper jsc-sidebar-content jsc-sidebar-pulled">
  5. <{if $upAction}>
  6. <div class="article_title center">&nbsp;</div>
  7. <div class="article_content center">您已成功领取奖品<br><{$prizeData.prize_name}></div>
  8. <div class="clear"></div>
  9. <br>
  10. <div class="common_btn_style center"><a href="<{$giftsUrl}>" class="submit_btn_style button">查看奖品</a></div>
  11. <{else}>
  12. <div class="article_title center">领取奖品</div>
  13. <div class="article_content">请认真填写您的收货地址,方便您收取奖品。奖品发货后,我们会将状态更新在“我的奖品”中。</div>
  14. <div class="join_submit_box">
  15. <div class="submit_cell"><input type="text" class="input_style" name="realname" value="<{$userExpress.user_name}>" placeholder="姓名"></div>
  16. <div class="submit_cell"><input type="text" class="input_style" name="phone" value="<{$userExpress.phone}>" placeholder="电话"></div>
  17. <div class="submit_cell"><input type="text" class="input_style" name="address" value="<{$userExpress.address}>" placeholder="收货地址"></div>
  18. <div class="submit_cell center" style="border:none; background:none"><button type="submit" class="button" id="sub_address">确认地址</button></div>
  19. </div>
  20. <{/if}>
  21. </div>
  22. <!--公用提示背景遮罩层-->
  23. <div class="a_cover"></div>
  24. <div class="v_tips_box v_tips_box2" id="error_tips_box">
  25. <div class="v_close_btn" id="tips_close_btn"></div>
  26. <p class="tips_msg" id="error_msg">错误信息</p>
  27. </div>
  28. <{include file="left.html"}>
  29. <script>
  30. KISSY.use('node, io', function (S, Node, IO) {
  31. $('#jsi-nav').sidebar({
  32. trigger: '#munu_icon'
  33. });
  34. $("input[type=text]").focus(function(){
  35. $(this).parent().find("span").hide();
  36. $(this).css("color","#000");
  37. });
  38. $("input[type=text]").blur(function(){
  39. if($(this).val() == ''){
  40. $(this).parent().find("span").show();
  41. }
  42. });
  43. // 提示
  44. function showTipsBox(msg,close){
  45. $("#error_msg").html(msg);
  46. $("#tips_close_btn").hide();
  47. if(close){
  48. $("#tips_close_btn").show();
  49. }
  50. $("#error_tips_box").fadeIn();
  51. $('.a_cover').fadeIn();
  52. }
  53. // 关闭提示
  54. $("#tips_close_btn").on('click', function(){
  55. $("#error_tips_box").fadeOut();
  56. $('.a_cover').fadeOut();
  57. });
  58. $('#sub_address').on('click', function () {
  59. var realname = S.trim($('input[name=realname]').val());
  60. if (realname == '') {
  61. showTipsBox('姓名不能为空',true);
  62. return false;
  63. }
  64. var phone = S.trim($('input[name=phone]').val());
  65. var regex = /^(1[0-9][0-9]|15[0-9]|18[02-9]|14[57])[0-9]{8}$/;
  66. if(!regex.test(phone)) {
  67. showTipsBox('请填写有效手机号码',true);
  68. return false;
  69. }
  70. var address = S.trim($('input[name=address]').val());
  71. if (address == '') {
  72. showTipsBox('请填写收货地址',true);
  73. return false;
  74. }
  75. IO.get('<{$web_cfg.domain}>/?c=Express&a=UpExpress'
  76. , {
  77. lottery_data_id: '<{$lotteryData.id}>',
  78. realname: realname,
  79. phone: phone,
  80. address: address
  81. }
  82. , function (data) {
  83. if (data.ok) {
  84. <{if $refer}>
  85. location.href ='<{$refer}>';
  86. <{else}>
  87. location.href ='<{$web_cfg.domain}>/?c=Express&lottery_data_id=<{$lotteryData.id}>&up=true';
  88. <{/if}>
  89. } else {
  90. showTipsBox(data.msg);
  91. return false;
  92. }
  93. }
  94. , 'json'
  95. );
  96. });
  97. });
  98. </script>
  99. <{include file="bottom.html"}>