sms.ejs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <% include ./sub_menu.ejs %>
  2. <div class="panel-content" id="app">
  3. <div class="panel-title">
  4. <div class="title-main">
  5. <h2>认证手机</h2>
  6. </div>
  7. </div>
  8. <div class="content-wrap">
  9. <div class="c-body">
  10. <div class="sjs-height-0">
  11. <div class="row m-0">
  12. <div class="col-5 my-3">
  13. <% if (accountData.auth_mobile !== '') { %>
  14. <!--已绑定手机-->
  15. <div class="form-group">
  16. <label>已认证手机</label>
  17. <div class="input-group mb-3">
  18. <input class="form-control form-control-sm" readonly="" value="<%= accountData.auth_mobile %>">
  19. <div class="input-group-append">
  20. <button class="btn btn-outline-secondary btn-sm" id="change-mobile">修改手机</button>
  21. </div>
  22. </div>
  23. </div>
  24. <% } %>
  25. <!--绑定手机-->
  26. <% if (accountData.auth_mobile === '') { %><div class="alert alert-warning">认证手机用户找回密码操作,请优先设置。</div><% } %>
  27. <form id="mobile-form" <% if (accountData.auth_mobile !== '') { %>style="display: none" <% } %>>
  28. <div class="form-group">
  29. <label>认证手机</label>
  30. <div class="input-group mb-3">
  31. <input class="form-control form-control-sm" placeholder="输入11位手机号码" value="" name="auth_mobile" maxlength="11"/>
  32. <div class="input-group-append">
  33. <button class="btn btn-outline-secondary btn-sm" type="button" id="get-code">获取验证码</button>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <div class="input-group mb-3">
  39. <input class="form-control form-control-sm" type="text" readonly="readonly" name="code" placeholder="输入短信中的6位验证码" />
  40. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  41. </div>
  42. </div>
  43. <button type="button" class="btn btn-secondary btn-sm disabled" id="bind-btn">确认绑定</button>
  44. </form>
  45. <% if (accountData.auth_mobile !== '' && false) { %>
  46. <!--短信通知开关(已有认证手机后显示)-->
  47. <div class="mt-5">
  48. <h4>通知类型</h4>
  49. <p class="text-muted">勾选您需要接收的短信类型。</p>
  50. <form id="sms-form" method="post" action="/profile/sms/type?csrf=<%- ctx.csrf %>">
  51. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  52. <% const user_smsType = accountData.sms_type !== '' ? JSON.parse(accountData.sms_type) : null; %>
  53. <% for (const s in smsType) { %>
  54. <% if (smsType[s].sms) { %>
  55. <div class="form-group row">
  56. <label class="col-auto col-form-label"><%= smsType[s].name %>
  57. <!--<a href="#sms-view" data-toggle="modal" data-target="#sms-view" class="ml-2"><i class="fa fa-info-circle"></i></a>-->
  58. </label>
  59. <div class="col-5">
  60. <% for (const c of smsType[s].children) { %>
  61. <div class="form-check ">
  62. <input class="form-check-input" id="<%= s %>_<%- c.value %>" type="checkbox" name="<%= s %>[]" value="<%= c.value %>" <% if (user_smsType !== null && user_smsType[s] !== undefined && user_smsType[s].indexOf(c.value.toString()) !== -1) { %>checked<% } %>>
  63. <label class="form-check-label" for="<%= s %>_<%- c.value %>"><%= c.title %></label>
  64. </div>
  65. <% } %>
  66. </div>
  67. </div>
  68. <% } %>
  69. <% } %>
  70. <input name="type" value="1" type="hidden">
  71. <button type="submit" class="btn btn-primary btn-sm">确认修改</button>
  72. </form>
  73. </div>
  74. <% } %>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <script type="text/javascript">
  82. const csrf = '<%= ctx.csrf %>';
  83. </script>
  84. <script type="text/javascript" src="/public/js/profile.js"></script>