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

206 lines
4.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="container">
  3. <!-- 用户信息 -->
  4. <view class="user-info">
  5. <view class="user-info-content">
  6. <image :src="avatar" ></image>
  7. <text class="username">{{nickName}}</text>
  8. </view>
  9. </view>
  10. <!-- 功能列表 -->
  11. <view class="menu">
  12. <view class="menu-item" @click="showModal">
  13. <view class="menu-item-left">
  14. <image class="arrow" src="/static/image/组 71696.png"></image>
  15. <text>关于我们</text>
  16. </view>
  17. <uni-icons type="right" class="menu-item-right"></uni-icons>
  18. </view>
  19. <view class="menu-item" >
  20. <view class="menu-item-left">
  21. <image class="arrow" src="/static/image/路径 6112.png"></image>
  22. <text>联系客服</text>
  23. </view>
  24. <uni-icons type="right" class="menu-item-right"></uni-icons>
  25. </view>
  26. <view class="menu-item" @click="logout">
  27. <view class="menu-item-left">
  28. <image class="arrow" src="/static/image/路径 6111.png"></image>
  29. <text>退出登录</text>
  30. </view>
  31. <uni-icons type="right" class="menu-item-right"></uni-icons>
  32. </view>
  33. </view>
  34. <mosowe-confirm-popup
  35. v-model="popupNoCancelShow"
  36. title="用户协议"
  37. confirmText
  38. cancelText
  39. >
  40. <text v-html="aboutUs"></text>
  41. <template v-slot:footer>
  42. <view class="mini_container">
  43. <button class="mini-btn" type="primary" size="mini" @click="closeModal">取消</button>
  44. <button class="mini-btn" type="primary" size="mini" @click="getConfirm">确认</button>
  45. </view>
  46. </template>
  47. </mosowe-confirm-popup>
  48. </view>
  49. </template>
  50. <script>
  51. import {logout,isToken} from '@/api.uts'
  52. export default {
  53. data() {
  54. return {
  55. avatar:'',
  56. nickName:'',
  57. aboutUs:'',
  58. popupNoCancelShow:false,
  59. }
  60. },
  61. mounted() {
  62. isToken();
  63. this.avatar = getApp().usrInfo.avatar;
  64. this.nickName = getApp().usrInfo.nickName;
  65. this.aboutUs = getApp().aboutUs;
  66. },
  67. methods: {
  68. showModal() {
  69. this.popupNoCancelShow = true ;
  70. },
  71. getConfirm(){
  72. this.popupNoCancelShow = false;
  73. },
  74. closeModal() {
  75. this.popupNoCancelShow = false ;
  76. },
  77. logout() {
  78. uni.showModal({
  79. title: '提示',
  80. content: '确定要退出登录吗?',
  81. success: (res) => {
  82. if (res.confirm) {
  83. logout().then((res)=>{
  84. if(res.success){
  85. uni.showToast({
  86. title: '退出登录成功',
  87. icon: 'success',
  88. success: () => {
  89. // 这里可以添加退出登录的逻辑,例如清除用户登录状态
  90. uni.clearStorageSync();
  91. setTimeout(() => {
  92. uni.navigateTo({ url: '/pages/index/login' });
  93. }, 1500);
  94. }
  95. });
  96. }
  97. })
  98. }
  99. }
  100. });
  101. }
  102. }
  103. };
  104. </script>
  105. <style>
  106. .container {
  107. display: flex;
  108. flex-direction: column;
  109. height: 100vh;
  110. background-color: #f5f5f5;
  111. }
  112. .user-info {
  113. padding: 1rem;
  114. height: 30%;
  115. background-color: #044f7a;
  116. color: #fff;
  117. display: flex;
  118. flex-direction: column;
  119. /* justify-content: space-between; */
  120. align-items: center;
  121. }
  122. .user-info-content{
  123. width: 40%;
  124. height: 70%;
  125. display: flex;
  126. align-items: center;
  127. margin-top: auto;
  128. }
  129. .user-info-content image{
  130. width: 70%;
  131. height: 70%;
  132. border-radius: 10%;
  133. }
  134. .user-info text{
  135. position: absolute;
  136. font-size: 1rem;
  137. bottom: 5%;
  138. }
  139. .menu {
  140. flex: 1;
  141. padding: 20px;
  142. background-color: #fff;
  143. }
  144. .menu-item {
  145. display: flex;
  146. flex-direction: row;
  147. justify-content: center;
  148. align-items: center;
  149. padding: 15px 0;
  150. border-bottom: 1px solid #eee;
  151. }
  152. .menu-item-left {
  153. display: flex;
  154. flex-direction: row;
  155. margin-right: auto;
  156. }
  157. .menu-item text {
  158. margin-left: 1rem;
  159. font-size: 16px;
  160. }
  161. .arrow {
  162. width: 20px;
  163. height: 20px;
  164. }
  165. .footer {
  166. display: flex;
  167. justify-content: space-around;
  168. padding: 10px;
  169. background-color: #fff;
  170. border-top: 1px solid #ccc;
  171. }
  172. .nav-item {
  173. text-align: center;
  174. }
  175. .nav-item text {
  176. font-size: 14px;
  177. }
  178. .mini_container{
  179. display: flex;
  180. flex-direction: row;
  181. align-items: center;
  182. }
  183. /* 按钮 */
  184. .mini-btn{
  185. width: 30%;
  186. margin-left: 15%;
  187. }
  188. </style>