合同小程序前端代码仓库
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.

122 lines
2.3 KiB

2 weeks ago
  1. <template>
  2. <view class="container">
  3. <!-- 用户信息 -->
  4. <view class="user-info">
  5. <text class="username">李晓春</text>
  6. </view>
  7. <!-- 功能列表 -->
  8. <view class="menu">
  9. <view class="menu-item" >
  10. <image class="arrow" src="/static/arrow-right.png"></image>
  11. <text>关于我们</text>
  12. </view>
  13. <view class="menu-item" >
  14. <image class="arrow" src="/static/arrow-right.png"></image>
  15. <text>修改密码</text>
  16. </view>
  17. <view class="menu-item">
  18. <image class="arrow" src="/static/arrow-right.png"></image>
  19. <text>服务协议</text>
  20. </view>
  21. <view class="menu-item" >
  22. <image class="arrow" src="/static/arrow-right.png"></image>
  23. <text>隐私政策</text>
  24. </view>
  25. <view class="menu-item" @click="logout">
  26. <image class="arrow" src="/static/arrow-right.png"></image>
  27. <text>退出登录</text>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. methods: {
  35. logout() {
  36. uni.showModal({
  37. title: '提示',
  38. content: '确定要退出登录吗?',
  39. success: (res) => {
  40. if (res.confirm) {
  41. uni.showToast({
  42. title: '退出登录成功',
  43. icon: 'success',
  44. success: () => {
  45. // 这里可以添加退出登录的逻辑,例如清除用户登录状态
  46. setTimeout(() => {
  47. uni.navigateTo({ url: '/pages/index/index' });
  48. }, 1500);
  49. }
  50. });
  51. }
  52. }
  53. });
  54. }
  55. }
  56. };
  57. </script>
  58. <style>
  59. .container {
  60. display: flex;
  61. flex-direction: column;
  62. height: 300vh;
  63. background-color: #f5f5f5;
  64. }
  65. .user-info {
  66. padding: 20px;
  67. height: 200px;
  68. background-color: #007aff;
  69. color: #fff;
  70. text-align: center;
  71. }
  72. .username {
  73. font-size: 20px;
  74. font-weight: bold;
  75. margin: 0 auto;
  76. line-height: 200px;
  77. }
  78. .menu {
  79. flex: 1;
  80. padding: 20px;
  81. background-color: #fff;
  82. }
  83. .menu-item {
  84. display: flex;
  85. justify-content: space-between;
  86. align-items: center;
  87. padding: 15px 0;
  88. border-bottom: 1px solid #eee;
  89. }
  90. .menu-item text {
  91. font-size: 16px;
  92. }
  93. .arrow {
  94. width: 20px;
  95. height: 20px;
  96. }
  97. .footer {
  98. display: flex;
  99. justify-content: space-around;
  100. padding: 10px;
  101. background-color: #fff;
  102. border-top: 1px solid #ccc;
  103. }
  104. .nav-item {
  105. text-align: center;
  106. }
  107. .nav-item text {
  108. font-size: 14px;
  109. }
  110. </style>