人人商城

member-add.html 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {template 'common/header'}
  2. {if $do == 'add'}
  3. <ol class="breadcrumb we7-breadcrumb">
  4. <a href="{php echo url('mc/member/display')}"><i class="wi wi-back-circle"></i> </a>
  5. <li>
  6. <a href="{php echo url('mc/member/display')}">会员管理</a>
  7. </li>
  8. <li>
  9. 添加会员
  10. </li>
  11. </ol>
  12. <form action="./index.php?c=mc&a=member&do=add" method="post" class="we7-form" role="form" id="form1">
  13. <div class="form-group">
  14. <label class="col-sm-2 control-label">会员姓名</label>
  15. <div class="col-sm-9 col-xs-12">
  16. <input type="text" name="realname" value="" class="form-control"/>
  17. </div>
  18. </div>
  19. <div class="form-group">
  20. <label class="col-sm-2 control-label">手机号</label>
  21. <div class="col-sm-9 col-xs-12">
  22. <input type="text" name="mobile" value="" class="form-control"/>
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="col-sm-2 control-label">登录密码</label>
  27. <div class="col-sm-9 col-xs-12">
  28. <input type="password" name="password" value="" class="form-control"/>
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label class="col-sm-2 control-label">邮箱</label>
  33. <div class="col-sm-9 col-xs-12">
  34. <input type="text" name="email" value="" class="form-control"/>
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-sm-2 control-label">{$creditnames['credit1']['title']}</label>
  39. <div class="col-sm-9 col-xs-12">
  40. <input type="text" name="credit1" value="0" class="form-control"/>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-sm-2 control-label">{$creditnames['credit2']['title']}</label>
  45. <div class="col-sm-9 col-xs-12">
  46. <input type="text" name="credit2" value="0" class="form-control"/>
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <label class="col-sm-2 control-label">会员组</label>
  51. <div class="col-sm-9 col-xs-12">
  52. <select name="groupid" class="form-control we7-select">
  53. {loop $_W['account']['groups'] $group}
  54. <option value="{$group['groupid']}">{$group['title']}</option>
  55. {/loop}
  56. </select>
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <div class="">
  61. <input type="hidden" name="token" value="{$_W['token']}"/>
  62. <input type="hidden" name="form" value="{$_W['token']}"/>
  63. <input type="submit" value="提交" class="btn btn-primary"/>
  64. </div>
  65. </div>
  66. </form>
  67. <script>
  68. require(['validator'], function(){
  69. var credit2_title = "{$creditnames['credit2']['title']}";
  70. var credit1_title = "{$creditnames['credit1']['title']}";
  71. $(function(){
  72. $('#form1').bootstrapValidator({
  73. fields: {
  74. realname: {
  75. validators: {
  76. notEmpty: {
  77. message: '姓名不能为空'
  78. }
  79. }
  80. },
  81. mobile: {
  82. validators: {
  83. notEmpty: {
  84. message: '手机不能为空'
  85. },
  86. regexp: {
  87. regexp: /1\d{10}/,
  88. message: '手机号格式不正确'
  89. },
  90. remote: {
  91. url: "{php echo url('mc/member/add');}",
  92. data: function(validator) {
  93. return {
  94. type: 'mobile',
  95. data: validator.getFieldElements('mobile').val()
  96. };
  97. },
  98. message: '手机号已经被占用'
  99. }
  100. }
  101. },
  102. email: {
  103. validators: {
  104. regexp: {
  105. regexp: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i,
  106. message: '邮箱格式不正确'
  107. },
  108. remote: {
  109. url: "{php echo url('mc/member/add');}",
  110. data: function(validator) {
  111. return {
  112. type: 'email',
  113. data: validator.getFieldElements('email').val()
  114. };
  115. },
  116. message: '邮箱已经被占用'
  117. }
  118. }
  119. },
  120. password: {
  121. validators: {
  122. notEmpty: {
  123. message: '密码不能为空'
  124. },
  125. stringLength: {
  126. min: 8,
  127. max: 15,
  128. message: '密码最少为8位'
  129. }
  130. }
  131. },
  132. credit1: {
  133. validators: {
  134. regexp: {
  135. regexp: /^[0-9]\d*$/i,
  136. message: credit1_title + '格式不正确'
  137. }
  138. }
  139. },
  140. credit2: {
  141. validators: {
  142. regexp: {
  143. regexp: /^[0-9]\d*$/i,
  144. message: credit2_title + '格式不正确'
  145. }
  146. }
  147. }
  148. }
  149. });
  150. });
  151. });
  152. </script>
  153. {/if}
  154. {template 'common/footer'}