menu.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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" @click="navto('/pages/user/respwd')">
  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" @click="navto('/pages/user/authrz')">
  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. navto(url) {
  89. uni.navigateTo({
  90. url,
  91. fail() {
  92. uni.switchTab({
  93. url
  94. })
  95. }
  96. })
  97. },
  98. getUser() {
  99. let obj = this
  100. getUser().then(res => {
  101. console.log(res)
  102. obj.setUserInfo(res.data)
  103. })
  104. },
  105. cancel() {
  106. // this.$refs.popup.open();
  107. let obj = this;
  108. uni.showModal({
  109. content: '确定要退出登录么',
  110. success: e => {
  111. if (e.confirm) {
  112. loginout().then(res => {
  113. obj.logout();
  114. uni.switchTab({
  115. url: '/pages/index/index'
  116. })
  117. })
  118. }
  119. }
  120. });
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. page {
  127. background-color: #fff;
  128. height: 100%;
  129. }
  130. .user-wrap {
  131. width: 674rpx;
  132. height: 147rpx;
  133. margin: auto;
  134. background: #F9F9F9;
  135. border-radius: 10rpx;
  136. flex-direction: column;
  137. padding-left: 27rpx;
  138. justify-content: center;
  139. align-items: start;
  140. text-align: left;
  141. .user-name {
  142. font-size: 34rpx;
  143. font-weight: 500;
  144. color: #636572;
  145. }
  146. .user-invit {
  147. padding: 20rpx 0;
  148. font-size: 22rpx;
  149. font-weight: 500;
  150. color: #636572;
  151. }
  152. }
  153. .user-list {
  154. width: 691rpx;
  155. height: 104rpx;
  156. background: #FFFFFF;
  157. // box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06)
  158. border-radius: 28rpx;
  159. margin: 20rpx auto;
  160. // padding: 0 25rpx;
  161. .left-img {
  162. width: 50rpx;
  163. height: 50rpx;
  164. }
  165. view {
  166. padding-left: 20rpx;
  167. flex-grow: 1;
  168. font-size: 29rpx;
  169. font-weight: bold;
  170. color: #5D5D5D;
  171. }
  172. .right-img {
  173. width: 50rpx;
  174. height: 50rpx;
  175. }
  176. }
  177. .loginout {
  178. width: 675rpx;
  179. height: 70rpx;
  180. line-height: 70rpx;
  181. text-align: center;
  182. font-size: 26rpx;
  183. color: #000;
  184. background-color: #f4d03c;
  185. margin: 50rpx auto;
  186. border-radius: 20rpx;
  187. font-weight: bold;
  188. }
  189. </style>