dengrui/pagesB/immediateWithdrawal/immediateWithdrawal.vue

102 lines
4.0 KiB
Vue
Raw Normal View History

2021-08-26 01:49:06 +00:00
<template>
<view class="">
<!-- 使用标题栏 -->
<status-nav :statusBackw="true" :whereCome="whereCome*1" :statusTitle="true" :title-val="'立即提现'" :tabcolor="'#ffffff'"></status-nav>
<view class=" bacb" :style="{paddingTop:statusHNH+'px'}">
<view class="fon32 margin40 padding-x40">
<view>可提现余额<text>{{allPrice}}</text></view>
<view class="margin-sx40">可提现</view>
<view class="fon28 bold padding-x30 disac" style="">
<view class="margin-s10"></view><input :maxlength="maxLength" @input="priceInput" class="margin-z10" style="font-size: 38rpx;" type="number" v-model="inputPrice" placeholder="请输入要提现的金额" placeholder-style="color:#cccccc;"/>
</view>
<view class="borbot" style="margin-top: -10rpx;"></view>
<!-- <view class="fon24 color9 margin-sx20">提现需要扣除<text>{{cost}}</text>%的手续费实际到账金额<text class="cloor16">{{dangPrice}}</text></view> -->
<view class="padding-sx20">
<button @tap="submitT" :disabled="disabled" class="comebtn">立即提现</button>
</view>
</view>
</view>
<!-- 弹框 -->
<successpopu :isShow="isShow" :isSuccess="isSuccess" :title="title" :content="content" @change="changepopu"></successpopu>
</view>
</template>
<script>
import successpopu from '@/components/successpopu.vue';
export default {
components:{
successpopu
},
data() {
return {
whereCome:0,
allPrice:'',
inputPrice:'',
cost:5,
dangPrice:'0.00',
disabled:true,
isShow:false,
isSuccess:true,
title:'',
content:'',
maxLength:10,
ttype:'',//是否为分红提现、直卖提现
statusHNH:uni.getStorageSync('statusHNH')
}
},
onShow() {
this.$toolAll.tools.guoq()
},
onLoad(options) {
this.whereCome = options.index
this.allPrice = options.price
this.ttype = options.type
},
methods: {
submitT(){//立即提现事件
if(uni.getStorageSync('sm').name=='' || uni.getStorageSync('sm').phone){
this.$toolAll.tools.showToast('请前往个人资料完善信息')
} else if(this.inputPrice==0){
uni.showToast({
title:'请正确输入提现金额',
icon:'none'
})
} else {
this.disabled = true
this.$requst.post('user/withdraw-apply',{withdraw_money:this.inputPrice,type:this.ttype}).then(res=>{
// console.log('提现成功返回信息',res);
if(res.code==0){
this.isShow = true
this.isSuccess = true
this.title = '提现已申请'
this.content = '提现申请已经提交成功,请耐心等待。'
} else {
this.$toolAll.tools.showToast(res.msg)
}
},error=>{
})
}
},
changepopu(){//关闭弹框事件
this.isShow = false
},
priceInput(e){//实时输入事件input事件
let val = e.target.value
let ya =this
let jieg = this.$toolAll.tools.checkPrice(val,ya.allPrice)
ya.maxLength = jieg.len;
ya.inputPrice = jieg.val
ya.dangPrice = ya.inputPrice - (ya.inputPrice * ya.cost / 100).toFixed(2)
let str = ya.dangPrice.toString();//转换成字符串
let result = str.split('.')//变成数组
result.length == 1 ? ya.dangPrice = ya.dangPrice+'.00' : ''
ya.inputPrice.length == 0 ? ya.disabled = true : ya.disabled = false
}
}
}
</script>
<style>
</style>