人人商城

permission.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {template 'header'}
  2. <ul class="we7-page-tab">
  3. <li class="active"><a href="{php echo $this->createWebUrl('permission', array('direct' => 1))}">商城访问权限</a></li>
  4. </ul>
  5. <div class="alert we7-page-alert blacklist-alert">
  6. <p class="color-red"> 请注意,白名单一旦开启,黑名单将自动关闭。 </p>
  7. </div>
  8. <div id="js-store-permission" ng-controller="storePermissionCtrl" ng-cloak>
  9. <div class="we7-form blacklist-tab">
  10. <input type="radio" id="1" ng-checked="type == 'black'">
  11. <label for="1" ng-click="changeType('black')">黑名单设置 <span ng-class="{'active': !permissionStatus.close && permissionStatus.blacklist}"></span></label>
  12. <input type="radio" id="2" ng-checked="type == 'white'">
  13. <label for="2" ng-click="changeType('white')">白名单设置<span ng-class="{'active': !permissionStatus.close && permissionStatus.whitelist}"></span></label>
  14. <input type="radio" id="3" ng-checked="type == 'close'">
  15. <label for="3" ng-click="changeType('close')">关闭权限设置<span ng-class="{'active': permissionStatus.close}"></span></label>
  16. </div>
  17. <div class="alert we7-page-alert blacklist-alert" ng-hide="type == 'close'">
  18. <div class="info" ng-show="type == 'black'">
  19. <p>黑名单开启关闭</p>
  20. <p class="color-default"><i class="wi wi-info-sign"></i><strong >将用户放入黑名单,用户登录就无权限进入“商城” </strong></p>
  21. </div>
  22. <div class="switch" ng-class="{'switchOn': !permissionStatus.close && permissionStatus.blacklist}" ng-show="type == 'black'" ng-click="changeStatus()"></div>
  23. <div class="info" ng-show="type == 'white'">
  24. <p>白名单开启关闭</p>
  25. <p class="color-default"><i class="wi wi-info-sign"></i><strong >将用户放入白名单,用户登录将有权限进入“商城” </strong></p>
  26. </div>
  27. <div class="switch" ng-class="{'switchOn': !permissionStatus.close && permissionStatus.whitelist}" ng-show="type == 'white'" ng-click="changeStatus()"></div>
  28. </div>
  29. <div class="we7-margin-bottom clearfix" ng-hide="type == 'close'">
  30. <div class="pull-right">
  31. <a href="#" class="btn btn-primary we7-padding-horizontal" data-toggle="modal" data-target="#balck" ng-show="type == 'black'">添加黑名单用户</a>
  32. <a href="#" class="btn btn-primary we7-padding-horizontal" data-toggle="modal" data-target="#balck" ng-show="type == 'white'">添加白名单用户</a>
  33. </div>
  34. </div>
  35. <table class="table we7-table table-hover site-list" ng-hide="type == 'close'">
  36. <col width=""/>
  37. <col width="90px"/>
  38. <tr>
  39. <th class="text-left">用户名</th>
  40. <th class="text-left">操作</th>
  41. </tr>
  42. <tr ng-repeat="list in blacklist" ng-show="blacklist && type == 'black'">
  43. <td class="vertical-middle">
  44. <span ng-bind="list"></span>
  45. </td>
  46. <td class="text-left">
  47. <div class="link-group text-left">
  48. <a href="javascript:;" ng-click="deleteUser(list)">删除</a>
  49. </div>
  50. </td>
  51. </tr>
  52. <tr ng-show="!blacklist && type == 'black'">
  53. <td colspan="2" class="text-center">暂无数据</td>
  54. </tr>
  55. <tr ng-repeat="list in whitelist" ng-show="whitelist && type == 'white'">
  56. <td class="vertical-middle">
  57. <span ng-bind="list"></span>
  58. </td>
  59. <td class="text-left">
  60. <div class="link-group text-left">
  61. <a href="javascript:;" ng-click="deleteUser(list)">删除</a>
  62. </div>
  63. </td>
  64. </tr>
  65. <tr ng-show="!whitelist && type == 'white'">
  66. <td colspan="2" class="text-center">暂无数据</td>
  67. </tr>
  68. </table>
  69. <div class="modal fade" id="balck" tabindex="-1" role="dialog">
  70. <div class="modal-dialog">
  71. <div class="modal-content">
  72. <div class="modal-header">
  73. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  74. <h4 class="modal-title" ng-show="type == 'black'">添加黑名单用户</h4>
  75. <h4 class="modal-title" ng-show="type == 'white'">添加白名单用户</h4>
  76. </div>
  77. <div class="modal-body we7-padding">
  78. <div class="form-group">
  79. <label class="control-label col-sm-2">用户名:</label>
  80. <div class="col-sm-8">
  81. <input type="text" ng-model="addUsername" class="form-control" placeholder="请填写用户名">
  82. <span class="help-block">输入用户名,点击确定即可。</span>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="modal-footer">
  87. <button type="submit" class="btn btn-primary" ng-click="addUser()">确定</button>
  88. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <script>
  95. angular.module('storeApp').value('config', {
  96. type: "{php echo !empty($_GPC['type']) ? $_GPC['type'] : 'black'}",
  97. blacklist : {php echo json_encode($blacklist)},
  98. whitelist : {php echo json_encode($whitelist)},
  99. permissionStatus: {php echo json_encode($permission_status)},
  100. links: {
  101. addUser: "{php echo $this->createWebUrl('permission', array('operation' => 'post', 'direct' =>1))}",
  102. deleteUser: "{php echo $this->createWebUrl('permission', array('operation' => 'delete', 'direct' =>1))}",
  103. changeStatus: "{php echo $this->createWebUrl('permission', array('operation' => 'change_status', 'direct' =>1))}",
  104. }
  105. });
  106. angular.bootstrap($('#js-store-permission'), ['storeApp']);
  107. </script>
  108. {template 'common/footer'}