setting.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 class="cu-avatar " style="background-image:url(../../static/setting-icon1.png)"></view>
  13. <view class="content">
  14. <view class="">消息推送</view>
  15. </view>
  16. <view class="nav-right">
  17. <view class="text-grey">
  18. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="cu-item" @tap="goSiteManage" v-if="permissionLabel==1">
  23. <view class="cu-avatar " style="background-image:url(../../static/setting-icon2.png)"></view>
  24. <view class="content">
  25. <view class="">站点管理</view>
  26. </view>
  27. <view class="nav-right">
  28. <view class="text-grey">
  29. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="cu-item" @tap="goAuthManage" v-if="permissionLabel==1">
  34. <view class="cu-avatar " style="background-image:url(../../static/setting-icon4.png)"></view>
  35. <view class="content">
  36. <view class="">权限管理</view>
  37. </view>
  38. <view class="nav-right">
  39. <view class="text-grey">
  40. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. permissionLabel:0
  52. }
  53. },
  54. onLoad() {
  55. this.getAuthorization()
  56. },
  57. methods: {
  58. async getAuthorization(params) {
  59. const res = await this.$myRequest({
  60. url: 'Com/getAuthorization',
  61. showLoading: true,
  62. data: params
  63. })
  64. console.log(res.data.permissionLabel)
  65. this.permissionLabel = res.data.permissionLabel
  66. },
  67. goSiteManage() {
  68. uni.navigateTo({
  69. url: '/pages/siteManage/siteManage?type=1',
  70. success: res => {},
  71. fail: () => {},
  72. complete: () => {}
  73. });
  74. },
  75. goDeviceManage() {
  76. uni.navigateTo({
  77. url: '/pages/siteManage/siteManage?type=2',
  78. success: res => {},
  79. fail: () => {},
  80. complete: () => {}
  81. });
  82. },
  83. goAuthManage() {
  84. uni.navigateTo({
  85. url: '/pages/authManage/authManage',
  86. success: res => {},
  87. fail: () => {},
  88. complete: () => {}
  89. });
  90. },
  91. goMessagePush() {
  92. uni.showModal({
  93. title: 'Tips',
  94. content: '此模块开发中~',
  95. showCancel: false,
  96. success: function(res) {
  97. if (res.confirm) {
  98. } else if (res.cancel) {
  99. }
  100. }
  101. });
  102. // uni.navigateTo({
  103. // url: '/pages/messagePush/messagePush',
  104. // success: res => {},
  105. // fail: () => {},
  106. // complete: () => {}
  107. // });
  108. },
  109. }
  110. }
  111. </script>
  112. <style lang="scss">
  113. .setting-wrapper {
  114. .top-banner {
  115. width: 100%;
  116. height: 380rpx;
  117. background: url(../../static/setting-bg.png) no-repeat;
  118. background-size:cover;
  119. color: #fff;
  120. display: flex;
  121. justify-content: center;
  122. align-items: center;
  123. image {
  124. width: 130rpx;
  125. height: 130rpx;
  126. }
  127. .userName {
  128. margin-top: 30rpx;
  129. margin-bottom: 10rpx;
  130. }
  131. }
  132. .cu-avatar {
  133. width:40rpx;height:40rpx;
  134. background-color:#fff;
  135. }
  136. .cu-list.menu-avatar>.cu-item {
  137. height:120rpx;
  138. .content{
  139. left:70rpx;
  140. }
  141. .nav-right{
  142. margin-right:10rpx;
  143. }
  144. }
  145. }
  146. </style>