capital-switch.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="">
  3. <switchPopup ref="switchPopupRef" :availableMoney="getBiMoney(from_field)" :from_field="from_field"
  4. :to_field="to_field">
  5. <template #accounthint>
  6. <view class="hint-text">
  7. 温馨提示:无限模式仅盈利部分可划转至合
  8. 约账户中,最小划转金额为100USDT
  9. </view>
  10. </template>
  11. <template #accountbox>
  12. <view class="account-item">
  13. {{ getBiName(from_field) }}账户
  14. </view>
  15. <view class="account-link" >划转至</view>
  16. <view class="account-item">
  17. {{ getBiName(to_field) }}账户
  18. </view>
  19. </template>
  20. </switchPopup>
  21. </view>
  22. <!-- <uni-popup ref="popupRef">
  23. <view class="unopen-box">
  24. <text class="z-close iconfont" @click.stop="close">&#xe621;</text>
  25. <view class="unopen-title">
  26. <text>资金划转</text>
  27. </view>
  28. <view class="unopen-content">
  29. <view class="account-box">
  30. </view>
  31. <view class="capital-type">
  32. <text class="type-left">全部</text>
  33. <input class="type-input" type="number">
  34. <text class="type-rigth">USDT</text>
  35. </view>
  36. <view class="capital-nums">
  37. <text class="num-title">可划转金额:</text>
  38. <text class="num">{{ getBiMoney(from_field) }} USDT</text>
  39. </view>
  40. <view class="capital-btn" @click.stop="changeAccount">
  41. 确定
  42. </view>
  43. </view>
  44. </view>
  45. </uni-popup> -->
  46. </template>
  47. <script>
  48. import {
  49. mapGetters
  50. } from 'vuex'
  51. import {
  52. biName
  53. } from "../card.js"
  54. import {
  55. setChangeAccount
  56. } from "./../card.js"
  57. import switchPopup from "../switch.vue"
  58. // 合约 - 币币
  59. // 币币 - 合约 / 法币
  60. export default {
  61. name: "capitalSwitchModules",
  62. components: {
  63. switchPopup
  64. },
  65. data() {
  66. return {
  67. from_field: 'micro',
  68. to_field: 'lever'
  69. };
  70. },
  71. computed: {
  72. ...mapGetters([
  73. 'contractAccount',
  74. 'GiftMoneyAccount'
  75. ]),
  76. getBiName() {
  77. return function(key) {
  78. return biName[key]
  79. }
  80. },
  81. getBiMoney() {
  82. return function(key) {
  83. let nums = 0;
  84. switch (key) {
  85. case 'micro':
  86. nums = this.GiftMoneyAccount.usdt_totle
  87. break;
  88. case 'lever':
  89. nums = this.contractAccount.usdt_totle
  90. break;
  91. }
  92. console.log('contractAccount = ', this.contractAccount)
  93. return nums || 0
  94. }
  95. }
  96. },
  97. mounted() {
  98. // this.open()
  99. },
  100. methods: {
  101. // 切换币
  102. switchBiType() {
  103. const k = this.from_field;
  104. this.from_field = this.to_field;
  105. this.to_field = k;
  106. // this.from_field:'legal',
  107. // to_field:'change'
  108. },
  109. open() {
  110. this.$nextTick(() => {
  111. this.$refs.switchPopupRef.open();
  112. })
  113. },
  114. // changeAccount(){
  115. // let data = {
  116. // currency_id:'1',
  117. // number:100,
  118. // from_field:this.from_field,
  119. // to_field:this.to_field
  120. // }
  121. // setChangeAccount(data).then(res => {
  122. // }).catch(err => {
  123. // }).finally(() => {})
  124. // }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. @import "~./../switch.scss";
  130. .account-link{
  131. justify-content: center;
  132. font-size: 24rpx !important;
  133. }
  134. .account-item{
  135. font-size: 28rpx !important;
  136. }
  137. </style>