apply.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <block name="content">
  2. <!DOCTYPE html>
  3. <html lang="zh-cmn-Hans">
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
  7. <title>入驻申请</title>
  8. <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/0.4.2/weui.min.css"/>
  9. </head>
  10. <body>
  11. <div class="weui_cells weui_cells_form">
  12. <form id="apply_form">
  13. <div class="weui_cell">
  14. <div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
  15. <div class="weui_cell_bd weui_cell_primary">
  16. <input class="weui_input" name="managerName" type="text" placeholder="请输入申请人姓名">
  17. </div>
  18. </div>
  19. <div class="weui_cell">
  20. <div class="weui_cell_hd"><label class="weui_label">手机号</label></div>
  21. <div class="weui_cell_bd weui_cell_primary">
  22. <input class="weui_input" name="managerMobile" type="text" placeholder="请输入申请人手机号">
  23. </div>
  24. </div>
  25. <div class="weui_cell">
  26. <div class="weui_cell_hd"><label class="weui_label">邮箱</label></div>
  27. <div class="weui_cell_bd weui_cell_primary">
  28. <input class="weui_input" name="managerEmail" type="text" placeholder="请输入申请人邮箱">
  29. </div>
  30. </div>
  31. <div class="weui_cell">
  32. <div class="weui_cell_hd"><label class="weui_label">店铺名称</label></div>
  33. <div class="weui_cell_bd weui_cell_primary">
  34. <input class="weui_input" name="businessName" type="text" placeholder="请输入店铺名称">
  35. </div>
  36. </div>
  37. <div class="weui_cell">
  38. <div class="weui_cell_hd"><label class="weui_label">所在城市</label></div>
  39. <div class="weui_cell_bd weui_cell_primary">
  40. <input class="weui_input" name="businessCity" type="text" placeholder="请输入所在城市">
  41. </div>
  42. </div>
  43. <div class="weui_cell">
  44. <div class="weui_cell_hd"><label class="weui_label">主营类目</label></div>
  45. <div class="weui_cell_bd weui_cell_primary">
  46. <select class="weui_select" name="businessMainCategory">
  47. <option selected="" value="">--请选择--</option>
  48. <?php foreach($goods_category as $category){ ?>
  49. <option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
  50. <?php } ?>
  51. </select>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="weui_cells_tips">请按要求填写以上表单,提交后客服会电话联系您!</div>
  56. <div class="weui_btn_area">
  57. <a class="weui_btn weui_btn_primary" href="javascript:" id="submit-btn">确定</a>
  58. </div>
  59. <div id="toast" style="display: none;">
  60. <div class="weui_mask_transparent"></div>
  61. <div class="weui_toast">
  62. <i class="weui_icon_toast"></i>
  63. <p class="weui_toast_content">已提交</p>
  64. </div>
  65. </form>
  66. </div>
  67. <script src="http://style.114jd.cn/style/js/global/lib/jquery/jquery-2.1.1.min.js" ></script>
  68. <script>
  69. $(document).ready(function(){
  70. $("#submit-btn").click(function(e){
  71. if(!$("input[name='managerName']").val()) {
  72. alert("请输入申请人姓名");
  73. return;
  74. }
  75. var managerMobile=$("input[name='managerMobile']").val();
  76. if(!managerMobile) {
  77. alert("请输入申请人手机号");
  78. return;
  79. }
  80. //手机号检查
  81. if(!managerMobile.match('^1[3|5|8|7][0-9]{9}$')){ alert("请输入正确的手机号码!");return false; }
  82. if(!$("input[name='managerEmail']").val()) {
  83. alert("请输入申请人邮箱");
  84. return;
  85. }
  86. if(!$("input[name='businessName']").val()) {
  87. alert("请输入店铺名称");
  88. return;
  89. }
  90. if(!$("select[name='businessMainCategory']").val()) {
  91. alert("请选择主营类目");
  92. return;
  93. }
  94. var params = $("#apply_form").serialize();
  95. var url="{:U('Seller/apply_post')}";
  96. var successFun=function(result){
  97. if(result.code=='200'){
  98. $('#toast').show();
  99. setTimeout(function () {
  100. $('#toast').hide();
  101. location.href="{:U('Index/index')}";
  102. }, 1500);
  103. }else{
  104. alert(result.data);
  105. }
  106. };
  107. $.ajax({
  108. type: "POST",
  109. url:url,
  110. data: params,
  111. dataType: "json",
  112. success: successFun
  113. });
  114. });
  115. });
  116. </script>
  117. </body>
  118. </html>
  119. </block>