123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <template>
- <view class="content">
- <view class="" style="height: 50rpx;">
- </view>
- <view class="wrap">
- <view class="imgbox_1">
- 劃轉類型
- </view>
- <view class="flex">
- <view class="imgbox_noaction" :class="{'imgbox_action': current == 1}" @click="current = 1">
- 資金賬戶轉合約賬戶
- </view>
- <view class="imgbox_noaction" :class="{'imgbox_action': current == 2}" @click="current = 2">
- 合約帳戶甎資金賬戶
- </view>
- </view>
- <view class="flex" style="margin-top: 20rpx;">
- <view class="item-left">
- 資金賬戶
- </view>
- <view class="item-right">
- 可用餘額 {{userInfo.usdt}} USDT
- </view>
- </view>
- <view class="flex">
- <view class="item-left">
- 合約賬戶
- </view>
- <view class="item-right">
- 可用餘額 {{userInfo.money}} USDT
- </view>
- </view>
- <view class="sr-wrap flex">
- <input type="digit" placeholder="輸入劃轉數量" class="sr-inp" v-model="tbnum" />
- <view class="">
- USDT
- </view>
- </view>
- <view class="sub-btn" @click="transfer">
- 提交
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import {
- transfer,
- getUser
- } from '@/api/login.js'
- export default {
- data() {
- return {
- current: 1,
- tbnum: '',
- loaded: false
- }
- },
- onLoad() {
- console.log(this.userInfo)
- },
- computed: {
- ...mapState('user', ['userInfo'])
- },
- onShow() {
- getUser().then(re => {
- this.setUserInfo(re.data)
- })
- },
- onReachBottom() {
- },
- onReady() {
- },
- methods: {
- ...mapMutations('user', ['setUserInfo']),
- transfer() {
- let obj = this
- if(obj.loaded) {
- return
- }
- obj.loaded = true
- transfer({
- tbnum: obj.tbnum,
- type: obj.current
- }).then(res => {
-
- uni.showToast({
- title: '劃轉成功',
- duration: 2000,
- position: 'top'
- });
- getUser().then(re => {
- obj.loaded = false
- obj.setUserInfo(re.data)
- })
- }).catch(err => {
- obj.loaded = false
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .wrap {
- width: 640rpx;
- height: 610rpx;
- padding: 40rpx;
- background-color: #fff;
- margin: auto;
- border-radius: 20rpx;
- .imgbox_1 {
- height: 80rpx;
- line-height: 80rpx;
- font-size: 32rpx;
- }
- .imgbox_noaction {
- width: 280rpx;
- height: 70rpx;
- line-height: 70rpx;
- text-align: center;
- font-size: 24rpx;
- border: #ccc solid 1px;
- color: #ccc;
- border-radius: 20rpx;
- }
- .imgbox_action {
- color: #FCD535;
- border: #FCD535 solid 1px;
- }
- }
- .item-left {
- height: 60rpx;
- line-height: 60rpx;
- font-size: 32rpx;
- }
- .item-right {
- height: 60rpx;
- line-height: 60rpx;
- font-size: 24rpx;
- color: #707A8A;
- }
- .sr-wrap {
- width: 560rpx;
- height: 80rpx;
- background-color: #f5f5f5;
- border-radius: 20rpx;
- padding: 0 20rpx;
- .sr-inp {
- width: 352rpx;
- height: 60rpx;
- line-height: 60rpx;
- display: inline-block;
- }
- }
- .sub-btn {
- width: 560rpx;
- height: 80rpx;
- line-height: 80rpx;
- color: #000;
- text-align: center;
- font-size: 28rpx;
- background: linear-gradient(to left, #eeb80d, #ffe35b);
- margin-top: 30rpx;
- border-radius: 20rpx;
- }
- </style>
|