展品维保小程序前端代码接口
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.

195 lines
4.3 KiB

  1. <template>
  2. <view class="user-container">
  3. <!-- 顶部背景区域 -->
  4. <view class="header-bg">
  5. <!-- 用户信息区域 -->
  6. <view class="user-info">
  7. <view class="avatar-section">
  8. <image class="avatar" :src="userInfo.avatar" mode="aspectFill"></image>
  9. </view>
  10. <view class="info-section">
  11. <text class="username">{{userInfo.username}}</text>
  12. <text class="user-id">ID:{{userInfo.userId}}</text>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 常用功能模块 -->
  17. <view class="function-card">
  18. <view class="card-title">
  19. <text class="title-text">常用功能</text>
  20. </view>
  21. <view class="function-list">
  22. <!-- 基本信息 -->
  23. <view class="function-item" @click="goToBasicInfo">
  24. <view class="item-left">
  25. <uv-icon name="account" size="28" color="#C70019"></uv-icon>
  26. <text class="item-text">基本信息</text>
  27. </view>
  28. <uv-icon name="arrow-right" size="24" color="#000"></uv-icon>
  29. </view>
  30. <!-- 用户协议和隐私政策 -->
  31. <view class="function-item" @click="showPrivacyPolicy">
  32. <view class="item-left">
  33. <uv-icon name="file-text" size="28" color="#C70019"></uv-icon>
  34. <text class="item-text">用户协议和隐私政策</text>
  35. </view>
  36. <uv-icon name="arrow-right" size="24" color="#000"></uv-icon>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 用户协议和隐私政策弹窗 -->
  41. <uv-modal ref="privacyModal" title="用户协议和隐私政策" :show-cancel-button="false" confirm-text="我知道了" confirm-color="#C70019">
  42. <view class="privacy-content">
  43. <view>
  44. 待补充
  45. </view>
  46. </view>
  47. </uv-modal>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. userInfo: {
  55. avatar: '/static/默认头像.png',
  56. username: '请先登录',
  57. userId: 'XXXXX'
  58. }
  59. }
  60. },
  61. methods: {
  62. // 跳转到基本信息页面
  63. goToBasicInfo() {
  64. uni.navigateTo({
  65. url: '/subPages/user/profile'
  66. })
  67. },
  68. // 显示隐私政策弹窗
  69. showPrivacyPolicy() {
  70. this.$refs.privacyModal.open()
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .privacy-content {
  77. padding: 20rpx;
  78. .privacy-section {
  79. margin-bottom: 30rpx;
  80. .section-title {
  81. font-size: 32rpx;
  82. font-weight: bold;
  83. color: #333;
  84. display: block;
  85. margin-bottom: 20rpx;
  86. }
  87. .section-text {
  88. font-size: 28rpx;
  89. color: #666;
  90. line-height: 1.6;
  91. display: block;
  92. margin-bottom: 15rpx;
  93. }
  94. }
  95. }
  96. .user-container {
  97. min-height: 100vh;
  98. background: #f5f5f5;
  99. position: relative;
  100. }
  101. .header-bg {
  102. height: 513rpx;
  103. background: linear-gradient(156deg, #f56073 15%, #c70019 61%, #ffacb6 100%);
  104. position: relative;
  105. padding: 0 46rpx;
  106. .user-info {
  107. display: flex;
  108. align-items: center;
  109. padding-top: 177rpx;
  110. .avatar-section {
  111. margin-right: 22rpx;
  112. .avatar {
  113. width: 120rpx;
  114. height: 120rpx;
  115. border-radius: 60rpx;
  116. // border: 4rpx solid rgba(255, 255, 255, 0.3);
  117. }
  118. }
  119. .info-section {
  120. flex: 1;
  121. .username {
  122. display: block;
  123. font-size: 30rpx;
  124. // font-weight: bold;
  125. color: #fff;
  126. margin-bottom: 12rpx;
  127. }
  128. .user-id {
  129. font-size: 28rpx;
  130. color: #fff;
  131. }
  132. }
  133. }
  134. }
  135. .function-card {
  136. width: 88%;
  137. height: 709rpx;
  138. background: #ffffff;
  139. border-radius: 16rpx;
  140. margin: -152rpx auto 0;
  141. position: relative;
  142. z-index: 2;
  143. padding: 57rpx 28rpx;
  144. .card-title {
  145. // margin-bottom: 40rpx;
  146. .title-text {
  147. font-size: 32rpx;
  148. font-weight: bold;
  149. color: $primary-text-color;
  150. }
  151. }
  152. .function-list {
  153. .function-item {
  154. display: flex;
  155. align-items: center;
  156. justify-content: space-between;
  157. margin-top:44rpx ;
  158. border-bottom: 1rpx solid #f0f0f0;
  159. .item-left {
  160. display: flex;
  161. align-items: center;
  162. .item-text {
  163. font-size: 28rpx;
  164. color: $primary-text-color;
  165. margin-left: 14rpx;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. </style>