menu.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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: this.$t('popup.qrtcdl'),
  89. confirmText: this.$t('popup.qr'),
  90. cancelText: this.$t('popup.qx'),
  91. success: e => {
  92. if (e.confirm) {
  93. loginout().then(res => {
  94. obj.logout();
  95. uni.switchTab({
  96. url: '/pages/index/index'
  97. });
  98. });
  99. }
  100. }
  101. });
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="scss">
  107. page {
  108. background-color: #fff;
  109. height: 100%;
  110. }
  111. .user-wrap {
  112. width: 674rpx;
  113. height: 147rpx;
  114. margin: auto;
  115. background: #f9f9f9;
  116. border-radius: 10rpx;
  117. flex-direction: column;
  118. padding-left: 27rpx;
  119. justify-content: center;
  120. align-items: start;
  121. text-align: left;
  122. .user-name {
  123. font-size: 34rpx;
  124. font-weight: 500;
  125. color: #636572;
  126. }
  127. .user-invit {
  128. padding: 20rpx 0;
  129. font-size: 22rpx;
  130. font-weight: 500;
  131. color: #636572;
  132. }
  133. }
  134. .user-list {
  135. width: 691rpx;
  136. height: 104rpx;
  137. background: #ffffff;
  138. // box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06)
  139. border-radius: 28rpx;
  140. margin: 20rpx auto;
  141. // padding: 0 25rpx;
  142. .left-img {
  143. width: 50rpx;
  144. height: 50rpx;
  145. }
  146. view {
  147. padding-left: 20rpx;
  148. flex-grow: 1;
  149. font-size: 29rpx;
  150. font-weight: bold;
  151. color: #5d5d5d;
  152. }
  153. .right-img {
  154. width: 50rpx;
  155. height: 50rpx;
  156. }
  157. }
  158. .loginout {
  159. width: 675rpx;
  160. height: 70rpx;
  161. line-height: 70rpx;
  162. text-align: center;
  163. font-size: 26rpx;
  164. color: #000;
  165. background-color: #f4d03c;
  166. margin: 50rpx auto;
  167. border-radius: 20rpx;
  168. font-weight: bold;
  169. }
  170. </style>