menu.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 40rpx;">
  4. </view>
  5. <view class="user-wrap flex">
  6. <view class="user-name">
  7. {{userInfo.username}}
  8. </view>
  9. <view class="user-invit">
  10. 邀請碼:{{userInfo.invit}}
  11. </view>
  12. </view>
  13. <!-- <view class="user-list flex">
  14. <image src="../../static/icon/mu1.png" mode="" class="left-img"></image>
  15. <view class="">
  16. 語言
  17. </view>
  18. <image src="../../static/icon/back.png" mode="" class="right-img"></image>
  19. </view> -->
  20. <view class="user-list flex">
  21. <image src="../../static/icon/mu2.png" mode="" class="left-img"></image>
  22. <view class="">
  23. 幫助中心
  24. </view>
  25. <image src="../../static/icon/back.png" mode="" class="right-img"></image>
  26. </view>
  27. <view class="user-list flex">
  28. <image src="../../static/icon/mu3.png" mode="" class="left-img"></image>
  29. <view class="">
  30. 通知
  31. </view>
  32. <image src="../../static/icon/back.png" mode="" class="right-img"></image>
  33. </view>
  34. <view class="user-list flex">
  35. <image src="../../static/icon/mu4.png" mode="" class="left-img"></image>
  36. <view class="">
  37. 修改密碼
  38. </view>
  39. <image src="../../static/icon/back.png" mode="" class="right-img"></image>
  40. </view>
  41. <view class="user-list flex">
  42. <image src="../../static/icon/mu5.png" mode="" class="left-img"></image>
  43. <view class="">
  44. 提幣地址
  45. </view>
  46. <image src="../../static/icon/back.png" mode="" class="right-img"></image>
  47. </view>
  48. <view class="user-list flex">
  49. <image src="../../static/icon/mu6.png" mode="" class="left-img"></image>
  50. <view class="">
  51. 實名認證
  52. </view>
  53. <image src="../../static/icon/back.png" mode="" class="right-img"></image>
  54. </view>
  55. <view class="loginout" @click="cancel()">
  56. 退出
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. mapMutations,
  63. mapState
  64. } from 'vuex';
  65. import {
  66. getUser,
  67. loginout
  68. } from '@/api/login.js'
  69. export default {
  70. data() {
  71. return {
  72. }
  73. },
  74. computed: {
  75. ...mapState('user', ['userInfo'])
  76. },
  77. onLoad() {
  78. },
  79. onShow() {
  80. this.getUser()
  81. },
  82. onReachBottom() {
  83. },
  84. onReady() {
  85. },
  86. methods: {
  87. ...mapMutations('user', ['login', 'setUserInfo', 'logout']),
  88. getUser() {
  89. let obj = this
  90. getUser().then(res => {
  91. console.log(res)
  92. obj.setUserInfo(res.data)
  93. })
  94. },
  95. cancel() {
  96. // this.$refs.popup.open();
  97. let obj = this;
  98. uni.showModal({
  99. content: '确定要退出登录么',
  100. success: e => {
  101. if (e.confirm) {
  102. loginout().then(res => {
  103. obj.logout();
  104. uni.switchTab({
  105. url: '/pages/index/index'
  106. })
  107. })
  108. }
  109. }
  110. });
  111. },
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. page {
  117. background-color: #fff;
  118. height: 100%;
  119. }
  120. .user-wrap {
  121. width: 674rpx;
  122. height: 147rpx;
  123. margin: auto;
  124. background: #F9F9F9;
  125. border-radius: 10rpx;
  126. flex-direction: column;
  127. padding-left: 27rpx;
  128. justify-content: center;
  129. align-items: start;
  130. text-align: left;
  131. .user-name {
  132. font-size: 34rpx;
  133. font-weight: 500;
  134. color: #636572;
  135. }
  136. .user-invit {
  137. padding: 20rpx 0;
  138. font-size: 22rpx;
  139. font-weight: 500;
  140. color: #636572;
  141. }
  142. }
  143. .user-list {
  144. width: 691rpx;
  145. height: 104rpx;
  146. background: #FFFFFF;
  147. // box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06)
  148. border-radius: 28rpx;
  149. margin: 20rpx auto;
  150. // padding: 0 25rpx;
  151. .left-img {
  152. width: 50rpx;
  153. height: 50rpx;
  154. }
  155. view {
  156. padding-left: 20rpx;
  157. flex-grow: 1;
  158. font-size: 29rpx;
  159. font-weight: bold;
  160. color: #5D5D5D;
  161. }
  162. .right-img {
  163. width: 50rpx;
  164. height: 50rpx;
  165. }
  166. }
  167. .loginout {
  168. width: 675rpx;
  169. height: 70rpx;
  170. line-height: 70rpx;
  171. text-align: center;
  172. font-size: 26rpx;
  173. color: #000;
  174. background-color: #f4d03c;
  175. margin: 50rpx auto;
  176. border-radius: 20rpx;
  177. font-weight: bold;
  178. }
  179. </style>