menu.vue 4.0 KB

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