setting.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="setting-wrapper">
  3. <view class="top-banner justify-center align-center text-center">
  4. <view>
  5. <image width="130" src="../../static/personal-head.png"></image>
  6. <view class="userName">admin</view>
  7. <view>伍继智慧用电</view>
  8. </view>
  9. </view>
  10. <view class="cu-list menu-avatar">
  11. <view class="cu-item" @tap="goMessagePush()">
  12. <view
  13. class="cu-avatar"
  14. style="background-image: url(../../static/setting-icon1.png)"
  15. ></view>
  16. <view class="content">
  17. <view class="">消息推送设置</view>
  18. </view>
  19. <view class="nav-right">
  20. <view class="text-grey">
  21. <text class="icon iconfont margin-right-xs margin-left-lg"
  22. >&#xe629;</text
  23. >
  24. </view>
  25. </view>
  26. </view>
  27. <view class="cu-item" @tap="goSiteArchive()" v-if="permissionLabel != 4">
  28. <view
  29. class="cu-avatar"
  30. style="background-image: url(../../static/settingIconDa.png)"
  31. ></view>
  32. <view class="content">
  33. <view class="">现场档案</view>
  34. </view>
  35. <view class="nav-right">
  36. <view class="text-grey">
  37. <text class="icon iconfont margin-right-xs margin-left-lg"
  38. >&#xe629;</text
  39. >
  40. </view>
  41. </view>
  42. </view>
  43. <view class="cu-item" @tap="goSiteManage" v-if="permissionLabel == 1">
  44. <view
  45. class="cu-avatar"
  46. style="background-image: url(../../static/setting-icon2.png)"
  47. ></view>
  48. <view class="content">
  49. <view class="">站点管理</view>
  50. </view>
  51. <view class="nav-right">
  52. <view class="text-grey">
  53. <text class="icon iconfont margin-right-xs margin-left-lg"
  54. >&#xe629;</text
  55. >
  56. </view>
  57. </view>
  58. </view>
  59. <view class="cu-item" @tap="goAuthManage" v-if="permissionLabel == 1">
  60. <view
  61. class="cu-avatar"
  62. style="background-image: url(../../static/setting-icon4.png)"
  63. ></view>
  64. <view class="content">
  65. <view class="">权限管理</view>
  66. </view>
  67. <view class="nav-right">
  68. <view class="text-grey">
  69. <text class="icon iconfont margin-right-xs margin-left-lg"
  70. >&#xe629;</text
  71. >
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. permissionLabel: 0,
  83. };
  84. },
  85. onLoad() {
  86. this.getAuthorization();
  87. },
  88. methods: {
  89. async getAuthorization(params) {
  90. const res = await this.$myRequest({
  91. url: "Com/getAuthorization",
  92. showLoading: true,
  93. data: params,
  94. });
  95. console.log(res.data.permissionLabel);
  96. this.permissionLabel = res.data.permissionLabel;
  97. },
  98. goSiteArchive() {
  99. uni.navigateTo({
  100. url: "/pages/siteArchive/siteArchive",
  101. });
  102. },
  103. goSiteManage() {
  104. uni.navigateTo({
  105. url: "/pages/siteManage/siteManage?type=1",
  106. success: (res) => {},
  107. fail: () => {},
  108. complete: () => {},
  109. });
  110. },
  111. goDeviceManage() {
  112. uni.navigateTo({
  113. url: "/pages/siteManage/siteManage?type=2",
  114. success: (res) => {},
  115. fail: () => {},
  116. complete: () => {},
  117. });
  118. },
  119. goAuthManage() {
  120. uni.navigateTo({
  121. url: "/pages/authManage/authManage",
  122. success: (res) => {},
  123. fail: () => {},
  124. complete: () => {},
  125. });
  126. },
  127. goMessagePush() {
  128. // uni.showModal({
  129. // title: 'Tips',
  130. // content: '此模块开发中~',
  131. // showCancel: false,
  132. // success: function(res) {
  133. // if (res.confirm) {
  134. // } else if (res.cancel) {
  135. // }
  136. // }
  137. // });
  138. uni.navigateTo({
  139. url: "/pages/messagePush/messagePush",
  140. success: (res) => {},
  141. fail: () => {},
  142. complete: () => {},
  143. });
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="scss">
  149. .setting-wrapper {
  150. .top-banner {
  151. width: 100%;
  152. height: 380rpx;
  153. background: url(../../static/setting-bg.png) no-repeat;
  154. background-size: cover;
  155. color: #fff;
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. image {
  160. width: 130rpx;
  161. height: 130rpx;
  162. }
  163. .userName {
  164. margin-top: 30rpx;
  165. margin-bottom: 10rpx;
  166. }
  167. }
  168. .cu-avatar {
  169. width: 40rpx;
  170. height: 40rpx;
  171. background-color: #fff;
  172. }
  173. .cu-list.menu-avatar > .cu-item {
  174. height: 120rpx;
  175. .content {
  176. left: 70rpx;
  177. }
  178. .nav-right {
  179. margin-right: 10rpx;
  180. }
  181. }
  182. }
  183. </style>