changeRole.ftl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <#assign title="选择角色"/>
  2. <#include "/home/frag.head.ftl" />
  3. <div class="weui-tab">
  4. <div class="weui-tab__bd">
  5. <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
  6. <input id="uptownId" type="text" hidden="hidden" value=${uptown_id!}/>
  7. <input id="uptownName" type="text" hidden="hidden" value=${uptown_name!}/>
  8. <div class="weui-tab__bd-item weui-tab__bd-item--active">
  9. <div class="page__bd cx-reset-role">
  10. <header class="user-header">
  11. <#--<h1 class="user-title">家园互助平台</h1>-->
  12. <h1 class="user-title" style="padding: 10px 0;"><#if uptown_name ??>${uptown_name!''}</#if></h1>
  13. <h1 class="user-title"><#if user ??>${user.nickName!''}</#if>登录</h1>
  14. </header>
  15. <div class="weui-form" id="fromMsg">
  16. <div class="weui-cells weui-cells_checkbox" style="margin-top: 0">
  17. <label class="weui-cell weui-cell_active weui-check__label" for="s11">
  18. <div class="weui-cell__hd">
  19. <input type="radio" name="radio" value="1" class="weui-check" id="s11">
  20. <i class="weui-icon-checked"></i>
  21. </div>
  22. <div class="weui-cell__bd">
  23. <p id="homeName">员工</p>
  24. </div>
  25. </label>
  26. <label class="weui-cell weui-cell_active weui-check__label" for="s12">
  27. <div class="weui-cell__hd">
  28. <input type="radio" name="radio" value="2" class="weui-check" id="s12">
  29. <i class="weui-icon-checked"></i>
  30. </div>
  31. <div class="weui-cell__bd">
  32. <p id="adminName">管理员</p>
  33. </div>
  34. </label>
  35. </div>
  36. <br/>
  37. <div class="weui-form__opr-area">
  38. <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="login();"
  39. id="login">用户登录</a>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </body>
  48. <#include "/home/frag.foot.ftl" />
  49. <script>
  50. (function ($){
  51. if ($("#uptownId").val() == '1238790987234') {
  52. $("#adminName").text('管理员');
  53. $("#homeName").text('员工');
  54. }
  55. })(jQuery);
  56. function login() {
  57. var userType = $('input:radio:checked').val();
  58. if (!userType) {
  59. $.alert("请选择用户角色!")
  60. return false;
  61. }
  62. <#if (type?? )&&(type = 1) >window.location.href = "/user/homeIndex.html?userId=" + $("#userId").val() + "&userType=" + userType + "&type=1";</#if>
  63. <#if (type?? )&&(type = 2) >window.location.href = "/user/homeIndex.html?userId=" + $("#userId").val() + "&userType=" + userType + "&type=2";</#if>
  64. }
  65. </script>