menu.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. confirmText: '確認',
  111. success: e => {
  112. if (e.confirm) {
  113. loginout().then(res => {
  114. obj.logout();
  115. uni.switchTab({
  116. url: '/pages/index/index'
  117. })
  118. })
  119. }
  120. }
  121. });
  122. },
  123. }
  124. }
  125. </script>
  126. <style lang="scss">
  127. page {
  128. background-color: #fff;
  129. height: 100%;
  130. }
  131. .user-wrap {
  132. width: 674rpx;
  133. height: 147rpx;
  134. margin: auto;
  135. background: #F9F9F9;
  136. border-radius: 10rpx;
  137. flex-direction: column;
  138. padding-left: 27rpx;
  139. justify-content: center;
  140. align-items: start;
  141. text-align: left;
  142. .user-name {
  143. font-size: 34rpx;
  144. font-weight: 500;
  145. color: #636572;
  146. }
  147. .user-invit {
  148. padding: 20rpx 0;
  149. font-size: 22rpx;
  150. font-weight: 500;
  151. color: #636572;
  152. }
  153. }
  154. .user-list {
  155. width: 691rpx;
  156. height: 104rpx;
  157. background: #FFFFFF;
  158. // box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06)
  159. border-radius: 28rpx;
  160. margin: 20rpx auto;
  161. // padding: 0 25rpx;
  162. .left-img {
  163. width: 50rpx;
  164. height: 50rpx;
  165. }
  166. view {
  167. padding-left: 20rpx;
  168. flex-grow: 1;
  169. font-size: 29rpx;
  170. font-weight: bold;
  171. color: #5D5D5D;
  172. }
  173. .right-img {
  174. width: 50rpx;
  175. height: 50rpx;
  176. }
  177. }
  178. .loginout {
  179. width: 675rpx;
  180. height: 70rpx;
  181. line-height: 70rpx;
  182. text-align: center;
  183. font-size: 26rpx;
  184. color: #000;
  185. background-color: #f4d03c;
  186. margin: 50rpx auto;
  187. border-radius: 20rpx;
  188. font-weight: bold;
  189. }
  190. </style>