mine.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="center">
  3. <view class="logo" >
  4. <image class="logo-img" src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"></image>
  5. <view class="flex margin-top-30" style="padding-left: 30rpx;">
  6. <view class="user-name">超级管理员</view>
  7. </view>
  8. </view>
  9. <view style="margin: 10rpx;" >
  10. <u-cell-group :border="false">
  11. <u-cell-item :border-top="false" @click="toService(item)" v-for="(item,index) in menuList1" :key="index" :title="item.name"></u-cell-item>
  12. <u-cell-item :border-bottom="false" @click="toSetting" v-for="(item,index) of menuList2" :key="index" :title="item"></u-cell-item>
  13. </u-cell-group>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. menuList1: [],
  22. menuList2: ["系统设置"]
  23. }
  24. },
  25. onLoad() {
  26. this.getMenu();
  27. },
  28. onPullDownRefresh(){
  29. this.getMenu();
  30. },
  31. methods: {
  32. toSetting(){
  33. uni.navigateTo({
  34. url: "../setting/setting"
  35. })
  36. },
  37. getMenu(){
  38. this.$api.permissions.menuList().then(res=>{
  39. console.log(res);
  40. for(let item of res.list){
  41. if(item.name=="物业管理"){
  42. this.menuList1= item.subList;
  43. }
  44. }
  45. });
  46. },
  47. toService(item){
  48. switch(item.name){
  49. case "服务人员管理":
  50. // uni.navigateTo({
  51. // url: "../fwry/fwry"
  52. // })
  53. this.$u.toast('即将开放');
  54. break;
  55. case "车辆管理":
  56. uni.navigateTo({
  57. url: "../car-manage/car-manage"
  58. })
  59. break;
  60. case "门禁管理":
  61. this.$u.toast('即将开放');
  62. break;
  63. default :
  64. let list= [];
  65. for(let element of item.subList){
  66. list.splice(list.length,0,element.name);
  67. }
  68. uni.navigateTo({
  69. url: "../service/service?list="+JSON.stringify(list)
  70. })
  71. }
  72. }
  73. }
  74. }
  75. </script>
  76. <style>
  77. page{
  78. background-color: #FFFFFF;
  79. }
  80. .cu-btn.sm {
  81. padding: 0 20upx;
  82. font-size: 20upx;
  83. height: 42upx;
  84. }
  85. .logo {
  86. display: flex;
  87. padding:0 20rpx 40rpx;
  88. background-color: #7dc7ae;
  89. }
  90. .logo-img {
  91. width: 120upx;
  92. height: 120upx;
  93. border-radius: 150upx;
  94. }
  95. .user-name {
  96. font-size: 38upx;
  97. color: #FFFFFF;
  98. }
  99. </style>