my.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. let flag = uni.getStorageSync("manager")
  59. let flag2 = uni.getStorageSync("sub-administrator")
  60. if(flag||flag2){
  61. this.flag = true
  62. }
  63. },
  64. methods: {
  65. handleClick(item) {
  66. // console.log(item.url);
  67. uni.navigateTo({
  68. url: item.url
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .container {
  76. padding-top: 30rpx;
  77. .box {
  78. display: flex;
  79. width: 750rpx;
  80. height: 110rpx;
  81. line-height: 110rpx;
  82. background-color: #fff;
  83. .icon {
  84. flex: 1;
  85. text-align: center;
  86. img {
  87. margin-top: 36rpx;
  88. width: 42rpx;
  89. height: 38rpx;
  90. }
  91. }
  92. .title {
  93. flex: 5;
  94. font-size: 30rpx;
  95. font-weight: 400;
  96. }
  97. .right {
  98. flex: 1;
  99. text-align: center;
  100. img {
  101. width: 24rpx;
  102. height: 32rpx;
  103. }
  104. }
  105. }
  106. }
  107. .container2 {
  108. width: 100vw;
  109. height: 100vh;
  110. text-align: center;
  111. background-color: #fff;
  112. .img {
  113. margin: 0 auto;
  114. padding-top: 288rpx;
  115. width: 480rpx;
  116. height: 508rpx;
  117. img {
  118. width: 100%;
  119. height: 100%;
  120. }
  121. }
  122. .info {
  123. color: #5792F0;
  124. }
  125. }
  126. </style>