mine.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="container">
  3. <view class="header">
  4. <view class="avatar">
  5. <image class="avatar-img" src="/static/default-avatar.png" mode="aspectFill"></image>
  6. </view>
  7. <text class="username">用户昵称</text>
  8. </view>
  9. <view class="content">
  10. <view class="menu-list">
  11. <view class="menu-item" @click="handleMenuClick('profile')">
  12. <text class="menu-icon">👤</text>
  13. <text class="menu-text">个人信息</text>
  14. <text class="menu-arrow">›</text>
  15. </view>
  16. <view class="menu-item" @click="handleMenuClick('settings')">
  17. <text class="menu-icon">⚙️</text>
  18. <text class="menu-text">设置</text>
  19. <text class="menu-arrow">›</text>
  20. </view>
  21. <view class="menu-item" @click="handleMenuClick('about')">
  22. <text class="menu-icon">ℹ️</text>
  23. <text class="menu-text">关于</text>
  24. <text class="menu-arrow">›</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script setup>
  31. const handleMenuClick = (type) => {
  32. uni.showToast({
  33. title: `点击了${type}`,
  34. icon: 'none'
  35. })
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .container {
  40. min-height: 100vh;
  41. background-color: #f8f8f8;
  42. }
  43. .header {
  44. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  45. padding: 60rpx 40rpx 80rpx;
  46. text-align: center;
  47. .avatar {
  48. width: 140rpx;
  49. height: 140rpx;
  50. margin: 0 auto 20rpx;
  51. border-radius: 50%;
  52. background-color: #ffffff;
  53. overflow: hidden;
  54. .avatar-img {
  55. width: 100%;
  56. height: 100%;
  57. }
  58. }
  59. .username {
  60. display: block;
  61. font-size: 32rpx;
  62. font-weight: bold;
  63. color: #ffffff;
  64. }
  65. }
  66. .content {
  67. margin-top: -40rpx;
  68. padding: 0 40rpx;
  69. .menu-list {
  70. background-color: #ffffff;
  71. border-radius: 20rpx;
  72. overflow: hidden;
  73. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
  74. .menu-item {
  75. display: flex;
  76. align-items: center;
  77. padding: 30rpx 40rpx;
  78. border-bottom: 1rpx solid #f0f0f0;
  79. transition: background-color 0.3s;
  80. &:last-child {
  81. border-bottom: none;
  82. }
  83. &:active {
  84. background-color: #f5f5f5;
  85. }
  86. .menu-icon {
  87. font-size: 40rpx;
  88. margin-right: 24rpx;
  89. }
  90. .menu-text {
  91. flex: 1;
  92. font-size: 28rpx;
  93. color: #333333;
  94. }
  95. .menu-arrow {
  96. font-size: 48rpx;
  97. color: #cccccc;
  98. font-weight: 300;
  99. }
  100. }
  101. }
  102. }
  103. </style>