my.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="container" v-if="flag">
  3. <!-- 每一个选项 -->
  4. <view class="box" v-for="item in list" :key="item.id" @click="handleClick(item)">
  5. <view class="icon">
  6. <img :src="item.icon">
  7. </view>
  8. <view class="title">
  9. {{item.title}}
  10. </view>
  11. <view class="right">
  12. <img src="../../static/right.png">
  13. </view>
  14. </view>
  15. </view>
  16. <view class="container2" v-else>
  17. <view class="img">
  18. <img src="../../static/noPower.png">
  19. </view>
  20. <view class="info">
  21. 暂无权限
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. flag: false,
  30. list: [{
  31. id: 1,
  32. icon: "../../static/my1.png",
  33. title: "规则设置",
  34. url: "/pages/ruleSet/ruleSet"
  35. },
  36. {
  37. id: 2,
  38. icon: "../../static/my2.png",
  39. title: "权限设置",
  40. url: "/pages/powerSet/powerSet"
  41. },
  42. {
  43. id: 3,
  44. icon: "../../static/my3.png",
  45. title: "打卡记录",
  46. url: "/pages/cardRecord/cardRecord"
  47. },
  48. {
  49. id: 4,
  50. icon: "../../static/my4.png",
  51. title: "考勤组",
  52. url: "/pages/group/group?flag=1"
  53. },
  54. ]
  55. };
  56. },
  57. onLoad() {
  58. },
  59. onShow() {
  60. let flag = uni.getStorageSync("manager")
  61. let flag2 = uni.getStorageSync("sub-administrator")
  62. if(flag||flag2){
  63. this.flag = true
  64. }
  65. },
  66. methods: {
  67. handleClick(item) {
  68. // console.log(item.url);
  69. uni.navigateTo({
  70. url: item.url
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .container {
  78. padding-top: 30rpx;
  79. .box {
  80. display: flex;
  81. width: 750rpx;
  82. height: 110rpx;
  83. line-height: 110rpx;
  84. background-color: #fff;
  85. .icon {
  86. flex: 1;
  87. text-align: center;
  88. img {
  89. margin-top: 36rpx;
  90. width: 42rpx;
  91. height: 38rpx;
  92. }
  93. }
  94. .title {
  95. flex: 5;
  96. font-size: 30rpx;
  97. font-weight: 400;
  98. }
  99. .right {
  100. flex: 1;
  101. text-align: center;
  102. img {
  103. width: 24rpx;
  104. height: 32rpx;
  105. }
  106. }
  107. }
  108. }
  109. .container2 {
  110. width: 100vw;
  111. height: 100vh;
  112. text-align: center;
  113. background-color: #fff;
  114. .img {
  115. margin: 0 auto;
  116. padding-top: 288rpx;
  117. width: 480rpx;
  118. height: 508rpx;
  119. img {
  120. width: 100%;
  121. height: 100%;
  122. }
  123. }
  124. .info {
  125. color: #5792F0;
  126. }
  127. }
  128. </style>