123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <template>
- <view class="container">
- <view class="listBox">
- <view class="titleTetx">收款地址</view>
- <view class="flex listTpl">
- <input type="number" class="inputBox" v-model="address" placeholder="请输入收款地址" />
- </view>
- </view>
- <view class="listBox" style="padding-top: 0rpx;">
- <view class="titleTetx">转账数量</view>
- <view class="listTpl flex">
- <input type="number" class="inputBox" v-model="number" placeholder="请输入转账金额" />
- <view class="listAll" @click="number=dataMoney.money">全部</view>
- </view>
- <view class="flex tipBox">
- <view class="tip1">可用余额{{dataMoney.money||0}}USDT</view>
- </view>
- </view>
- <view class="submission">
- <button class="golden" type="golden" hover-class="none" @click="submission">确认转账</button>
- </view>
- </view>
- </template>
- <script>
- import {
- trade
- } from '@/api/game.js';
- import {
- qianBao
- } from '@/api/wallet.js';
- export default {
- data() {
- return {
- address: '',
- number: '',
- dataMoney:{},
- };
- },
- onLoad() {
- this.qianBao();
- },
- methods: {
- qianBao(){
- const taht = this;
- qianBao({}).then(
- (res) => {
- taht.dataMoney = res.data.back.USDT.money
- taht.dataMoney.money = +taht.dataMoney.money;
- }
- ).catch(
- (res) => {
-
- }
- )
- },
- submission() {
- const that = this;
- uni.showModal({
- title: '请输入支付密码',
- editable:true,
- success: res => {
- if(res.confirm){
- trade({
- type: "USDT",
- num: that.number,
- to_user_address: that.address,
- trade_psw: res.content,
- }).then((res) => {
- uni.showToast({
- title: res.msg,
- duration: 1500,
- });
- that.number = ''
- that.qianBao();
- }
- ).catch(
- (res) => {
-
- }
- )
- }
- },
- fail: () => {},
- complete: () => {}
- });
-
- }
- }
- };
- </script>
- <style lang="scss">
- .container {
- padding: 25rpx 25rpx;
- }
- .listBox {
- padding: 46rpx 25rpx;
- background: #1F2A4A;
- border-radius: 10rpx;
- .titleTetx {
- font-weight: bold;
- font-size: 24rpx;
- color: #FFFFFF;
- padding-bottom: 25rpx;
- }
- .tipBox {
- padding-top: 15rpx;
- font-size: 24rpx;
- .tip1 {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- color: #0C5AFA;
- line-height: 45rpx;
- }
- }
- }
- .listTpl {
- border-bottom: 1rpx solid #6A7288;
- padding-bottom: 25rpx;
- .inputBox {
- font-size: 35rpx;
- color: #FFFFFF;
- }
- .listTip {}
- .listAll {
- padding-left: 30rpx;
- font-size: 30rpx;
- color: #0C5AFA;
- }
- }
- .input-placeholder {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- color: #666666;
- }
- .submission {
- padding: 80rpx 25rpx;
- padding-bottom: 25rpx;
- .golden {
- background: #0C5AFA;
- color: #ffffff;
- }
- }
- </style>
|