index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <div class="mine">
  3. <div class="banner">
  4. <div class="flex-col flex-ac">
  5. <div class="block_1">
  6. <img src="@/assets/logo.png" class="avatar" />
  7. </div>
  8. <div class="flex-col flex-ac">
  9. <span class="text_1">{{ userinfo.nickname }}</span>
  10. <div class="flex-row">
  11. <span class="text_2">{{ $t('lang35') }}{{ userinfo.addressEncrypt }}</span>
  12. <!-- <div class="text-wrapper_2"> -->
  13. <!-- <span>复制</span> -->
  14. <img src="@/assets/images/trade/copy.png" alt="" class="copys" @click="copy" :data-clipboard-text="this.userinfo.address" />
  15. <!-- </div> -->
  16. </div>
  17. <img src="@/assets/images/lang.png" alt="" class="lang" @click="reckoningClick('language')" />
  18. </div>
  19. </div>
  20. </div>
  21. <div class="content">
  22. <div class="balance_box">
  23. <div class="balance_li" @click="reckoningClick('assets')">
  24. <div class="left">
  25. <span class="amount">{{ $t('lang36') }}</span>
  26. </div>
  27. <div class="right">
  28. <!-- <img src="@/assets/images/usdt.png" class="icon1" /> -->
  29. <span>{{ $t('lang37') }}</span>
  30. </div>
  31. </div>
  32. <div class="balance_li" @click="reckoningClick('teaRights')">
  33. <div class="left">
  34. <span class="amount">{{ $t('lang218') }}</span>
  35. </div>
  36. <div class="right">
  37. <!-- <img src="@/assets/images/mine.png" class="icon2" /> -->
  38. <span>{{ $t('lang39') }}</span>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="list">
  43. <div @click="switchovers('myTeaFriends')" class="li">
  44. <div class="li_left">
  45. <div class="imgbox">
  46. <img src="@/assets/images/my.png" class="li_img" />
  47. </div>
  48. <span>{{ $t('lang40') }}</span>
  49. </div>
  50. <van-icon name="arrow" color="#aaaaaa" size="16" />
  51. </div>
  52. <div @click="switchovers('invite')" class="li">
  53. <div class="li_left">
  54. <div class="imgbox">
  55. <img src="@/assets/images/invite.png" class="li_img" />
  56. </div>
  57. <span>{{ $t('lang41') }}</span>
  58. </div>
  59. <van-icon name="arrow" color="#aaaaaa" size="16" />
  60. </div>
  61. <!-- <div @click="switchovers('share')" class="li">
  62. <div class="li_left">
  63. <div class="imgbox">
  64. <img src="@/assets/images/trade/detail.png" class="li_img" />
  65. </div>
  66. <span>{{ $t('lang205') }}</span>
  67. </div>
  68. <van-icon name="arrow" color="#aaaaaa" size="16" />
  69. </div> -->
  70. <div @click="switchovers('1')" class="li">
  71. <div class="li_left">
  72. <div class="imgbox">
  73. <img src="@/assets/images/trade/custom.png" class="li_img" />
  74. </div>
  75. <span>{{ $t('lang43') }}</span>
  76. </div>
  77. <van-icon name="arrow" color="#aaaaaa" size="16" />
  78. </div>
  79. <div @click="switchovers('setting')" class="li">
  80. <div class="li_left">
  81. <div class="imgbox">
  82. <img src="@/assets/images/set.png" class="li_img" />
  83. </div>
  84. <span>{{ $t('lang44') }}</span>
  85. </div>
  86. <van-icon name="arrow" color="#aaaaaa" size="16" />
  87. </div>
  88. </div>
  89. </div>
  90. <!-- 上级弹窗 -->
  91. <van-popup v-model="superiorShow" round style="width: 80%">
  92. <Superior :address="userinfo.parent_address" :level="userinfo.team_level_name" :parantId="userinfo.parent_id"></Superior>
  93. </van-popup>
  94. <BottomNavigation></BottomNavigation>
  95. </div>
  96. </template>
  97. <script>
  98. import Superior from './superiorPopup.vue';
  99. import { Notify } from 'vant';
  100. import { usApi, newsLetterApi, walletApi, homeApi } from '@/api/index';
  101. import { mapState } from 'vuex';
  102. import union from '../../api/union';
  103. import BottomNavigation from '@/components/BottomNavigation.vue';
  104. import Clipboard from 'clipboard';
  105. import Web3 from 'web3';
  106. export default {
  107. data() {
  108. return {
  109. show: false, //上级弹窗状态
  110. withdrawShow: false, //提现弹窗状态
  111. total: 0,
  112. team_level_name: '',
  113. userinfo: {
  114. address: undefined,
  115. nickname: undefined,
  116. avatar: undefined,
  117. team_level_id: undefined,
  118. seso_url: undefined,
  119. submit_limit: 0,
  120. },
  121. order_count: {
  122. pay: 0,
  123. sell: 0,
  124. success: 0,
  125. cancel: 0,
  126. },
  127. withdrawAmount: 0, // 提现金额
  128. feeObj: {
  129. usdt: 0,
  130. withdraw_fee_rate: 0,
  131. withdraw_min_amount: 0,
  132. },
  133. receiptAmount: 0, // 实际到账金额
  134. superiorShow: false, //上级弹窗
  135. };
  136. },
  137. created() {
  138. this.init();
  139. },
  140. mounted() {
  141. // this.init();
  142. },
  143. methods: {
  144. init() {
  145. if (this.account) {
  146. this.userinfo = JSON.parse(localStorage.getItem('userinfo'));
  147. this.userinfo.addressEncrypt = this.userinfo.address.substring(0, 5) + '****' + this.userinfo.address.substring(this.userinfo.address.length - 5, this.userinfo.address.length);
  148. this.getUserInfo();
  149. }
  150. },
  151. switchovers(router) {
  152. console.log(router);
  153. if (router == '') {
  154. // window.location.href = this.userinfo.seso_url;
  155. this.superiorShow = true;
  156. } else if (router == '1') {
  157. this.$toast(this.$t('lang2'));
  158. } else {
  159. this.$router.push({ name: router });
  160. }
  161. },
  162. reckoningClick(name) {
  163. this.$router.push({ name: name });
  164. },
  165. getUserInfo() {
  166. homeApi.getUserInfo({}).then(res => {
  167. if (res.code == 200) {
  168. this.userinfo = res.data;
  169. this.order_count = res.data.order_count;
  170. this.userinfo.addressEncrypt = this.userinfo.address.substring(0, 5) + '****' + this.userinfo.address.substring(this.userinfo.address.length - 5, this.userinfo.address.length);
  171. }
  172. });
  173. },
  174. copy() {
  175. if (this.userinfo.address) {
  176. var clipboard = new Clipboard('.copys');
  177. clipboard.on('success', e => {
  178. this.$toast(this.$t('lang45'));
  179. clipboard.destroy(); // 释放内存
  180. });
  181. clipboard.on('error', e => {
  182. this.$toast(this.$t('lang46'));
  183. clipboard.destroy(); // 释放内存
  184. });
  185. }
  186. },
  187. },
  188. computed: {
  189. ...mapState(['account']),
  190. },
  191. watch: {
  192. account() {
  193. this.init();
  194. },
  195. withdrawAmount(e) {
  196. // this.receiptAmount = 0;
  197. this.receiptAmount = Number(e) - Number(e) * Number(this.feeObj.withdraw_fee_rate);
  198. },
  199. },
  200. components: {
  201. Superior,
  202. BottomNavigation,
  203. },
  204. };
  205. </script>
  206. <style lang="less" scoped>
  207. .mine {
  208. min-height: 100vh;
  209. .banner {
  210. // display: flex;
  211. // justify-content: space-between;
  212. background: linear-gradient(to bottom right, #29b286, #dae9fd);
  213. padding: 30px 16px 60px;
  214. .block_1 {
  215. box-shadow: 0px 0px 29px 0px rgba(97, 142, 184, 0.19);
  216. // background-color: rgba(169, 191, 245, 1);
  217. border-radius: 50%;
  218. width: 68px;
  219. height: 68px;
  220. // border: 3px solid rgba(#b6b3b3, 1);
  221. margin-right: 14px;
  222. overflow: hidden;
  223. .avatar {
  224. width: 100%;
  225. height: 100%;
  226. background-color: #fff;
  227. }
  228. }
  229. .copys {
  230. width: 16px;
  231. height: 16px;
  232. margin-left: 4px;
  233. }
  234. .lang {
  235. width: 26px;
  236. position: absolute;
  237. right: 14px;
  238. top: 14px;
  239. }
  240. .grade {
  241. display: flex;
  242. align-items: center;
  243. font-size: 14px;
  244. color: #fff;
  245. .grade_img {
  246. display: block;
  247. width: 7px;
  248. height: 12px;
  249. }
  250. }
  251. .text_1 {
  252. color: rgba(6, 12, 80, 1);
  253. font-size: 16px;
  254. font-weight: normal;
  255. padding: 8px 0 6px;
  256. }
  257. .text_2 {
  258. color: rgba(#000, 0.6);
  259. font-size: 13px;
  260. }
  261. .text-wrapper_1 {
  262. font-size: 11px;
  263. line-height: 100%;
  264. padding: 5px 10px;
  265. background-color: rgba(246, 162, 15, 1);
  266. border-radius: 6px;
  267. margin: 6px;
  268. }
  269. .text-wrapper_2 {
  270. font-size: 11px;
  271. line-height: 100%;
  272. padding: 5px 10px;
  273. background-color: #7938cf;
  274. border-radius: 6px;
  275. margin: 6px;
  276. }
  277. }
  278. .flex-col {
  279. display: flex;
  280. flex-direction: column;
  281. }
  282. .flex-ac {
  283. align-items: center;
  284. justify-content: center;
  285. }
  286. .flex-row {
  287. display: flex;
  288. align-items: center;
  289. }
  290. .content {
  291. padding: 0 16px 100px;
  292. margin-top: -40px;
  293. color: #000;
  294. .balance_box {
  295. display: flex;
  296. align-items: center;
  297. justify-content: space-between;
  298. .balance_li {
  299. color: #fff;
  300. display: flex;
  301. flex-direction: column;
  302. width: 48%;
  303. font-size: 14px;
  304. padding: 14px;
  305. box-shadow: 4px 4px 15px 0px rgba(180, 212, 212, 0.29);
  306. border-radius: 6px;
  307. background: linear-gradient(to bottom right, #29b286, #30d5a0);
  308. .left {
  309. display: flex;
  310. flex-direction: column;
  311. }
  312. .icon1 {
  313. width: 16px;
  314. height: 16px;
  315. margin-right: 4px;
  316. }
  317. .icon2 {
  318. width: 16px;
  319. height: 14px;
  320. margin-right: 4px;
  321. }
  322. .right {
  323. display: flex;
  324. align-items: center;
  325. color: rgba(#fff, 0.6);
  326. font-size: 13px;
  327. margin-top: 6px;
  328. }
  329. .btn {
  330. color: #7938cf;
  331. font-size: 12px;
  332. padding: 4px 8px;
  333. border-radius: 3px;
  334. margin-left: 8px;
  335. background-color: rgba(48, 70, 212, 0.1);
  336. }
  337. .amount {
  338. font-size: 16px;
  339. }
  340. }
  341. .balance_li:last-child {
  342. background: linear-gradient(to bottom right, #14bcc6, #28d3de);
  343. }
  344. }
  345. .order {
  346. font-size: 13px;
  347. color: rgba(153, 153, 153, 1);
  348. border-radius: 16px;
  349. padding: 16px;
  350. box-shadow: 4px 4px 15px 0px rgba(180, 212, 212, 0.59);
  351. margin-top: 16px;
  352. background-color: rgba(255, 255, 255, 1);
  353. .top {
  354. display: flex;
  355. align-items: center;
  356. justify-content: space-between;
  357. padding-bottom: 16px;
  358. border-bottom: 1px solid rgba(232, 240, 247, 1);
  359. .order_text1 {
  360. font-size: 16px;
  361. color: rgba(0, 0, 0, 1);
  362. font-weight: 600;
  363. }
  364. .order_text2 {
  365. font-size: 12px;
  366. }
  367. }
  368. .bottom {
  369. padding-top: 16px;
  370. justify-content: space-between;
  371. .item {
  372. align-items: center;
  373. text-align: center;
  374. .num {
  375. color: rgba(#000, 0.75);
  376. font-size: 16px;
  377. font-weight: 650;
  378. padding-bottom: 4px;
  379. }
  380. }
  381. }
  382. }
  383. .list {
  384. margin-top: 16px;
  385. padding: 0 20px;
  386. border-radius: 10px;
  387. background-color: rgba(255, 255, 255, 1);
  388. .li {
  389. display: flex;
  390. align-items: center;
  391. justify-content: space-between;
  392. font-size: 14px;
  393. color: rgb(36, 36, 36);
  394. padding: 24px 0;
  395. // margin-bottom: 10px;
  396. border-top: 1px solid rgba(232, 240, 247, 1);
  397. // box-shadow: 4px 4px 15px 0px rgba(180, 212, 212, 0.29);
  398. .li_left {
  399. display: flex;
  400. align-items: center;
  401. .imgbox {
  402. width: 20px;
  403. height: 20px;
  404. margin-right: 12px;
  405. }
  406. .li_img {
  407. width: 20px;
  408. height: 20px;
  409. }
  410. }
  411. .right {
  412. width: 7px;
  413. height: 12px;
  414. }
  415. }
  416. }
  417. }
  418. .withdrawPopup {
  419. padding: 20px 30px;
  420. color: #666666;
  421. font-size: 14px;
  422. .title {
  423. display: flex;
  424. justify-content: center;
  425. padding-bottom: 20px;
  426. font-weight: bold;
  427. font-size: 16px;
  428. color: #000000;
  429. }
  430. .tip {
  431. font-size: 12px;
  432. display: flex;
  433. flex-direction: column;
  434. }
  435. .btn {
  436. color: #fff;
  437. padding: 16px 0;
  438. text-align: center;
  439. line-height: 50%;
  440. border-radius: 20px;
  441. margin-top: 18px;
  442. background-color: #7938cf;
  443. }
  444. .close—icon {
  445. position: absolute;
  446. bottom: -40px;
  447. left: 45%;
  448. }
  449. }
  450. }
  451. /deep/ .van-popup {
  452. overflow-y: visible;
  453. }
  454. /deep/ .van-field {
  455. background-color: #f2f9f9;
  456. border-radius: 8px;
  457. margin: 6px 0;
  458. }
  459. /deep/ .van-field__body {
  460. padding: 10px 10px;
  461. }
  462. </style>