wechat.ejs 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.wx_openid !== null && accountData.wx_openid !== '') { %>
  14. <!--已绑定手机-->
  15. <div class="form-group">
  16. <label>微信账号</label>
  17. <input class="form-control-plaintext" readonly="" value="<%= accountData.wx_name %>">
  18. <a href="#remove-wechat" class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#remove-wechat">解绑</a>
  19. </div>
  20. <% } else { %>
  21. <div class="form-group">
  22. <label>微信账号</label>
  23. <input class="form-control-plaintext" readonly="" value="未绑定">
  24. </div>
  25. <% } %>
  26. <!--二维码-->
  27. <div class="form-group">
  28. <label>扫码或搜索 关注服务号</label>
  29. <div><img class="w-50" src="/public/images/wechat.png"></div>
  30. </div>
  31. <% if (accountData.wx_openid !== null && accountData.wx_openid !== '') { %>
  32. <!--短信通知开关(已有认证手机后显示)-->
  33. <div class="mt-5">
  34. <h4>通知类型</h4>
  35. <p class="text-muted">勾选您需要接收的微信类型。</p>
  36. <form id="sms-form" method="post" action="/profile/sms/type">
  37. <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
  38. <% const user_wxType = accountData.wx_type !== '' ? JSON.parse(accountData.wx_type) : null; %>
  39. <% for (const s in smsType) { %>
  40. <% if (smsType[s].wechat) { %>
  41. <div class="form-group row">
  42. <label class="col-auto col-form-label"><%= smsType[s].name %>
  43. <!--<a href="#sms-view" data-toggle="modal" data-target="#sms-view" class="ml-2"><i class="fa fa-info-circle"></i></a>-->
  44. </label>
  45. <div class="col-3">
  46. <% for (const c of smsType[s].children) { %>
  47. <div class="form-check ">
  48. <input class="form-check-input" id="<%= s %>_<%- c.value %>" type="checkbox" name="<%= s %>[]" value="<%= c.value %>" <% if (user_wxType !== null && user_wxType[s] !== undefined && user_wxType[s].indexOf(c.value.toString()) !== -1) { %>checked<% } %>>
  49. <label class="form-check-label" for="<%= s %>_<%- c.value %>"><%= c.title %></label>
  50. </div>
  51. <% } %>
  52. </div>
  53. </div>
  54. <% } %>
  55. <% } %>
  56. <input name="type" value="0" type="hidden">
  57. <button type="submit" class="btn btn-primary btn-sm">确认修改</button>
  58. </form>
  59. </div>
  60. <% } %>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <script type="text/javascript">
  68. const csrf = '<%= ctx.csrf %>';
  69. </script>
  70. <script type="text/javascript" src="/public/js/profile.js"></script>