mine.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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">{{role}}</view>
  7. <view @click="logout" style="position: absolute;right: 50rpx;top: 40rpx;">
  8. <image style="width: 40rpx;height: 40rpx;" src="/static/mine/logout1.png" mode=""></image>
  9. </view>
  10. </view>
  11. </view>
  12. <view @click="jump(item.path)" class="menu" v-for="(item,index) in menuList" :key="index">
  13. <view class="left">
  14. <u-icon :name="item.name" custom-prefix="custom-icon" size="90" :color="item.color"></u-icon>
  15. <view class="content">
  16. <text class="title">{{item.title}}</text>
  17. <view class="sub_title flex">
  18. <text class="">本月新增:{{item.monthCount}}</text>
  19. <view v-if="index==2" class=" padding-left-20">
  20. 待审核:
  21. <text class="text-red">{{item.applyUserReadyCheckCount}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="right">
  27. <text class="text-red">{{item.totalCount}}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. role:'admin',
  37. menuList:[
  38. {
  39. color:'#a1cece',
  40. title:"小区",
  41. name:'shequ',
  42. path:'/pages/residential/residential',
  43. monthCount:0,
  44. totalCount:0
  45. },
  46. {
  47. color:'#3dc159',
  48. title:"单元",
  49. name:'tesecanyin',
  50. path:'/pages/unit/unit',
  51. monthCount:0,
  52. totalCount:0
  53. },
  54. {
  55. color:'#de9964',
  56. title:"住户",
  57. name:'zhuhu',
  58. path:'/pages/user/user',
  59. monthCount:0,
  60. totalCount:0,
  61. applyUserReadyCheckCount:0
  62. },
  63. ]
  64. }
  65. },
  66. onLoad() {
  67. this.role=this.$cache.get('account').account
  68. this.getResidentialAccount()
  69. this.getUnitAccount()
  70. this.getUserAccount()
  71. },
  72. methods: {
  73. getResidentialAccount(){
  74. this.$api.dataStatistics.getResidentialAccount().then(res=>{
  75. Object.assign(this.menuList[0],res.data)
  76. })
  77. },
  78. getUnitAccount(){
  79. this.$api.dataStatistics.getUnitAccount().then(res=>{
  80. Object.assign(this.menuList[1],res.data)
  81. })
  82. },
  83. getUserAccount(){
  84. this.$api.dataStatistics.getUserAccount().then(res=>{
  85. Object.assign(this.menuList[2],res.data)
  86. this.getApplyUserReadyCheckCount()
  87. })
  88. },
  89. getApplyUserReadyCheckCount(){
  90. this.$api.dataStatistics.getApplyUserAccountWithCheckState().then(res=>{
  91. this.menuList[2].applyUserReadyCheckCount=res.data.total
  92. console.log(this.menuList[2]);
  93. })
  94. },
  95. logout(){
  96. this.$showModel('确定要退出系统?').then(res=>{
  97. uni.clearStorage()
  98. uni.reLaunch({
  99. url:"../login/login"
  100. })
  101. })
  102. },
  103. jump(url){
  104. uni.navigateTo({
  105. url
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss">
  112. page{
  113. background-color: #FFFFFF;
  114. }
  115. .menu{
  116. display: flex;
  117. justify-content: space-between;
  118. padding: 20rpx 30rpx;
  119. border-bottom: 1rpx solid #EEEEEE;
  120. .left{
  121. display: flex;
  122. }
  123. .right{
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. text{
  128. font-size: 32rpx;
  129. }
  130. }
  131. .content{
  132. padding-left: 20rpx;
  133. display: flex;
  134. flex-direction: column;
  135. justify-content: center;
  136. .title{
  137. font-size: 32rpx;
  138. }
  139. .sub_title{
  140. padding-top: 10rpx;
  141. font-size: 24rpx;
  142. color: #777;
  143. }
  144. }
  145. }
  146. .cu-btn.sm {
  147. padding: 0 20upx;
  148. font-size: 20upx;
  149. height: 42upx;
  150. }
  151. .logo {
  152. display: flex;
  153. padding:0rpx 20rpx 40rpx;
  154. background-color: #7dc7ae;
  155. }
  156. .logo-img {
  157. width: 120upx;
  158. height: 120upx;
  159. border-radius: 150upx;
  160. }
  161. .user-name {
  162. font-size: 40upx;
  163. color: #FFFFFF;
  164. }
  165. </style>