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

202 lines
4.5 KiB

  1. <template>
  2. <view class="user-container">
  3. <!-- 顶部背景区域 -->
  4. <view class="header-bg" @click="goLogin">
  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. <!-- 如果是富文本 -->
  44. <rich-text :nodes="configParamTextarea('app_agreement')">
  45. </rich-text>
  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. goLogin() {
  64. uni.navigateTo({
  65. url: '/subPages/login/login'
  66. })
  67. },
  68. // 跳转到基本信息页面
  69. goToBasicInfo() {
  70. uni.navigateTo({
  71. url: '/subPages/user/profile'
  72. })
  73. },
  74. // 显示隐私政策弹窗
  75. showPrivacyPolicy() {
  76. this.$refs.privacyModal.open()
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .privacy-content {
  83. padding: 20rpx;
  84. .privacy-section {
  85. margin-bottom: 30rpx;
  86. .section-title {
  87. font-size: 32rpx;
  88. font-weight: bold;
  89. color: #333;
  90. display: block;
  91. margin-bottom: 20rpx;
  92. }
  93. .section-text {
  94. font-size: 28rpx;
  95. color: #666;
  96. line-height: 1.6;
  97. display: block;
  98. margin-bottom: 15rpx;
  99. }
  100. }
  101. }
  102. .user-container {
  103. min-height: 100vh;
  104. background: #f5f5f5;
  105. position: relative;
  106. }
  107. .header-bg {
  108. height: 513rpx;
  109. background: linear-gradient(156deg, #f56073 15%, #c70019 61%, #ffacb6 100%);
  110. position: relative;
  111. padding: 0 46rpx;
  112. .user-info {
  113. display: flex;
  114. align-items: center;
  115. padding-top: 177rpx;
  116. .avatar-section {
  117. margin-right: 22rpx;
  118. .avatar {
  119. width: 120rpx;
  120. height: 120rpx;
  121. border-radius: 60rpx;
  122. // border: 4rpx solid rgba(255, 255, 255, 0.3);
  123. }
  124. }
  125. .info-section {
  126. flex: 1;
  127. .username {
  128. display: block;
  129. font-size: 30rpx;
  130. // font-weight: bold;
  131. color: #fff;
  132. margin-bottom: 12rpx;
  133. }
  134. .user-id {
  135. font-size: 28rpx;
  136. color: #fff;
  137. }
  138. }
  139. }
  140. }
  141. .function-card {
  142. width: 88%;
  143. height: 709rpx;
  144. background: #ffffff;
  145. border-radius: 16rpx;
  146. margin: -152rpx auto 0;
  147. position: relative;
  148. z-index: 2;
  149. padding: 57rpx 28rpx;
  150. .card-title {
  151. // margin-bottom: 40rpx;
  152. .title-text {
  153. font-size: 32rpx;
  154. font-weight: bold;
  155. color: $primary-text-color;
  156. }
  157. }
  158. .function-list {
  159. .function-item {
  160. display: flex;
  161. align-items: center;
  162. justify-content: space-between;
  163. margin-top:44rpx ;
  164. border-bottom: 1rpx solid #f0f0f0;
  165. .item-left {
  166. display: flex;
  167. align-items: center;
  168. .item-text {
  169. font-size: 28rpx;
  170. color: $primary-text-color;
  171. margin-left: 14rpx;
  172. }
  173. }
  174. }
  175. }
  176. }
  177. </style>