You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

232 lines
4.2 KiB

4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
3 weeks ago
4 weeks ago
  1. <template>
  2. <view class="index-container">
  3. <view class="user-info" @click="jumpTo('/pages/userInfo/userInfo')">
  4. <view class="avatar" />
  5. <view>
  6. <view>{{ username }}</view>
  7. <view>{{ account }}</view>
  8. </view>
  9. </view>
  10. <view class="swiper1">
  11. <swiper circular autoplay interval="1000" indicator-dots indicator-color="#8f939c"
  12. indicator-active-color="#e43d33">
  13. <swiper-item>
  14. <img src="/static/bar/爱莉1.jpg" />
  15. </swiper-item>
  16. <swiper-item>
  17. <img src="/static/bar/原始黄其振.jpg" />
  18. </swiper-item>
  19. <swiper-item>
  20. <img src="/static/bar/真我光锥.jpg" />
  21. </swiper-item>
  22. </swiper>
  23. </view>
  24. <view class="layout-grid">
  25. <view class="grid-item" @click="jumpTo('/pages/payment/payment')">
  26. <view class="grid-icon icon1" />
  27. <view>缴费记录</view>
  28. </view>
  29. <view class="grid-item" @click="jumpTo('/pages/expense/expense')">
  30. <view class="grid-icon icon2" />
  31. <view>支出记录</view>
  32. </view>
  33. <view class="grid-item" @click="navigateTo('/pages/testInterface/testInterface')">
  34. <view class="grid-icon icon3" />
  35. <view>宿舍信息</view>
  36. </view>
  37. <view class="grid-item" @click="showTip">
  38. <view class="grid-icon icon4" />
  39. <view>没想好写啥</view>
  40. </view>
  41. </view>
  42. <view class="stats">
  43. <view class="stats-title">费用统计</view>
  44. <view class="stats-cards">
  45. <view class="stat-card">
  46. <view class="stat-value">¥150.00</view>
  47. <view class="stat-label">本月缴费</view>
  48. </view>
  49. <view class="stat-card">
  50. <view class="stat-value">¥50.00</view>
  51. <view class="stat-label">本月支出</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script setup>
  58. import {
  59. onShow
  60. } from '@dcloudio/uni-app'
  61. const userinfo = uni.getStorageSync('userinfo')
  62. const username = userinfo.adminName
  63. const account = userinfo.account
  64. const jumpTo = (url) => {
  65. uni.switchTab({
  66. url
  67. })
  68. }
  69. const navigateTo = (url) => {
  70. uni.navigateTo({
  71. url
  72. })
  73. }
  74. const showTip = () => {
  75. uni.showToast({
  76. title: '前面的功能以后再来探索吧',
  77. icon: 'none'
  78. })
  79. }
  80. onShow(() => {
  81. const isLogin = uni.getStorageSync('isLogin')
  82. console.log(isLogin)
  83. if (!isLogin) {
  84. uni.redirectTo({
  85. url: '/pages/login/login'
  86. })
  87. }
  88. })
  89. </script>
  90. <style scoped>
  91. .index-container {
  92. padding: 20rpx;
  93. height: 100vh;
  94. background-color: #f5f5f5;
  95. margin-top: 5vh;
  96. }
  97. .user-info {
  98. display: flex;
  99. align-items: center;
  100. background-color: #fff;
  101. border-radius: 16rpx;
  102. padding: 30rpx;
  103. margin-bottom: 30rpx;
  104. box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.1);
  105. background-color: #36bffa;
  106. }
  107. .avatar {
  108. width: 120rpx;
  109. height: 120rpx;
  110. border-radius: 50%;
  111. background-color: red;
  112. display: flex;
  113. align-items: center;
  114. justify-content: center;
  115. margin-right: 30rpx;
  116. }
  117. .swiper1 {
  118. width: 90vw;
  119. height: 20vh;
  120. padding: 0 5vw;
  121. .swiper1 swiper-item img {
  122. width: 100%;
  123. height: auto;
  124. }
  125. }
  126. .layout-grid {
  127. display: grid;
  128. grid-template-columns: repeat(2, 1fr);
  129. gap: 20rpx;
  130. margin-top: 2vh;
  131. margin-bottom: 30rpx;
  132. }
  133. .grid-item {
  134. background-color: #fff;
  135. border-radius: 16rpx;
  136. padding: 3vh;
  137. display: flex;
  138. flex-direction: column;
  139. align-items: center;
  140. justify-content: center;
  141. box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.1);
  142. }
  143. .grid-item:active {
  144. transform: scale(0.95);
  145. }
  146. .grid-icon {
  147. width: 22vw;
  148. height: 9vh;
  149. border-radius: 50%;
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. margin-bottom: 20rpx;
  154. }
  155. .icon1 {
  156. background-color: #fff0f0;
  157. }
  158. .icon2 {
  159. background-color: #f0f9ff;
  160. }
  161. .icon3 {
  162. background-color: #fff7e6;
  163. }
  164. .icon4 {
  165. background-color: #f6ffed;
  166. }
  167. .stats {
  168. background-color: #fff;
  169. border-radius: 16rpx;
  170. padding: 30rpx;
  171. box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.05);
  172. }
  173. .stats-title {
  174. font-size: 30rpx;
  175. font-weight: bold;
  176. margin-bottom: 30rpx;
  177. padding-bottom: 20rpx;
  178. border-bottom: 1px solid #eee;
  179. }
  180. .stats-cards {
  181. display: flex;
  182. justify-content: space-around;
  183. }
  184. .stat-card {
  185. display: flex;
  186. flex-direction: column;
  187. align-items: center;
  188. padding: 20rpx;
  189. }
  190. .stat-value {
  191. font-size: 36rpx;
  192. font-weight: bold;
  193. color: #36bffa;
  194. margin-bottom: 10rpx;
  195. }
  196. .stat-label {
  197. font-size: 26rpx;
  198. color: #666;
  199. }
  200. </style>