setting.vue 4.0 KB

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