|
|
@@ -18,14 +18,14 @@
|
|
|
<view class="title">提现金额</view>
|
|
|
<view class="row">
|
|
|
<text class="tit">¥</text>
|
|
|
- <input class="input" type="number" v-model="withdrawal" :placeholder="'最低提现金额' + minPrice + '元'" placeholder-class="placeholder" />
|
|
|
+ <input class="input" type="number" v-model="withdrawal" :placeholder="'最低提现金额' + '50' + '元'" placeholder-class="placeholder" />
|
|
|
<view class="buttom" @click="withdrawal = money">全部提现</view>
|
|
|
</view>
|
|
|
<view class="tip" v-if="withdrawal > 0">
|
|
|
实际到账{{ realMoney }},剩余{{ integral }}转化为消费补贴券
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="list">
|
|
|
+ <view class="list" >
|
|
|
<radio-group @change="tabRadio">
|
|
|
<!-- <label>
|
|
|
<view class="box">
|
|
|
@@ -40,79 +40,43 @@
|
|
|
<view class="box">
|
|
|
<view class="icon iconfont iconzhifubao"></view>
|
|
|
<view class="title-box">
|
|
|
- <view class="title"><text>提现至支付宝</text></view>
|
|
|
+ <view class="title">
|
|
|
+ <text v-if="aliData.fullname != null">提现至支付宝</text>
|
|
|
+ <text v-else>请创建支付宝账号</text>
|
|
|
+ </view>
|
|
|
+ <view class="node">
|
|
|
+ <text v-if="aliData.fullname != null">真实姓名({{ aliData.fullname }})</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="right"><radio value="alipay" color="#5dbc7c" :checked="type == 'alipay'" /></view>
|
|
|
</view>
|
|
|
</label>
|
|
|
<label>
|
|
|
- <view class="box">
|
|
|
- <view class="icon iconfont"><image class="icon-img" src="/static/icon/i8.png" mode="aspectFit"></image></view>
|
|
|
- <view class="title-box">
|
|
|
- <view class="title"><text>提现至银行卡</text></view>
|
|
|
- </view>
|
|
|
- <view class="right"><radio value="bank" color="#5dbc7c" :checked="type == 'bank'" /></view>
|
|
|
- </view>
|
|
|
- </label>
|
|
|
- <!-- <label>
|
|
|
<view class="box">
|
|
|
<view class="icon iconfont"><image class="icon-img" src="/static/icon/i8.png" mode="aspectFit"></image></view>
|
|
|
<view class="title-box">
|
|
|
<view class="title">
|
|
|
- <text v-if="bankData.bankno">{{ bankData.bank + ' ' + bankData.bankno }}</text>
|
|
|
+ <text v-if="bankData.bankno != null">{{ bankData.bank + ' ' + bankData.bankno }}</text>
|
|
|
<text v-else>请创建银行账号</text>
|
|
|
</view>
|
|
|
<view class="node">
|
|
|
- <text v-if="bankData.fullname">真实姓名({{ bankData.fullname }})</text>
|
|
|
+ <text v-if="bankData.fullname != null">真实姓名({{ bankData.fullname}})</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="right"><radio value="bank" color="#5dbc7c" :checked="type == 'bank'" /></view>
|
|
|
</view>
|
|
|
- </label> -->
|
|
|
+ </label>
|
|
|
</radio-group>
|
|
|
</view>
|
|
|
- <view class="row b-b" v-if="type == 'weixin'">
|
|
|
- <text class="tit">微信号</text>
|
|
|
- <input class="input" type="text" v-model="wiexin" placeholder="请输入微信号" placeholder-class="placeholder" />
|
|
|
- </view>
|
|
|
- <view class="row b-b" v-if="type == 'weixin'">
|
|
|
- <text class="tit">真实姓名</text>
|
|
|
- <input class="input" type="text" v-model="wiexin_name" placeholder="请输入真实姓名" placeholder-class="placeholder" />
|
|
|
- </view>
|
|
|
- <view class="box-item1" v-if="type == 'weixin'">
|
|
|
- <view class="item-left">微信收款码:</view>
|
|
|
- <view class="item-right">
|
|
|
- <image :src="img_wei" mode="" class="upload-img" @click.stop="imgsubW" v-if="img_wei"></image>
|
|
|
- <image src="../../static/img/phone.png" class="upload-img" mode="" v-if="!img_wei" @click.stop="imgsubW"></image>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="row b-b" v-if="type == 'alipay'">
|
|
|
- <text class="tit">支付宝账号</text>
|
|
|
- <input class="input" type="text" v-model="alipay_code" placeholder="请输入支付宝账号" placeholder-class="placeholder" />
|
|
|
- </view>
|
|
|
- <view class="row b-b" v-if="type == 'alipay'">
|
|
|
- <text class="tit">支付宝姓名</text>
|
|
|
- <input class="input" type="text" v-model="alipay_name" placeholder="请输入支付宝姓名" placeholder-class="placeholder" />
|
|
|
- </view>
|
|
|
- <view class="row b-b" v-if="type == 'bank'">
|
|
|
- <text class="tit">银行卡号</text>
|
|
|
- <input class="input" type="text" v-model="bank_code" placeholder="请输入银行卡号" placeholder-class="placeholder" />
|
|
|
- </view>
|
|
|
- <view class="row b-b" v-if="type == 'bank'">
|
|
|
- <text class="tit">姓名</text>
|
|
|
- <input class="input" type="text" v-model="bank_people" placeholder="请输入银行卡姓名" placeholder-class="placeholder" />
|
|
|
- </view>
|
|
|
- <view class="row b-b" v-if="type == 'bank'">
|
|
|
- <text class="tit">所属银行</text>
|
|
|
- <input class="input" type="text" v-model="bank_name" placeholder="请输入所属银行" placeholder-class="placeholder" />
|
|
|
- </view>
|
|
|
<button class="add-btn up" @click="confirm">提交申请</button>
|
|
|
+ <button class="add-btn modified" @click="navTo('/pages/collection/collection')">账号管理</button>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
import { getMoneyStyle } from '@/utils/rocessor.js';
|
|
|
import { extractCash, extractBank } from '@/api/wallet.js';
|
|
|
import { uploads } from '@/api/user.js';
|
|
|
+import { mapState, mapMutations } from 'vuex';
|
|
|
import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue';
|
|
|
export default {
|
|
|
filters: {
|
|
|
@@ -128,19 +92,13 @@ export default {
|
|
|
freeze: '0.0', //冻结金额
|
|
|
withdrawal: '', //提现金额
|
|
|
minPrice: '', //最少提现金额
|
|
|
- wiexin: '',
|
|
|
- wiexin_name:'',//真实姓名
|
|
|
- alipay_name: '', //支付宝姓名
|
|
|
- alipay_code: '', //支付宝账号
|
|
|
- img: '' ,//支付宝收款码
|
|
|
- img_wei:'',//微信收款码
|
|
|
- bank_people:'',//银行卡姓名
|
|
|
- bank_code:'',//银行卡号
|
|
|
- bank_name:'',//银行姓名
|
|
|
+ aliData: {fullname:'',alino:''},
|
|
|
+ bankData: {fullname:'',bank:'',bankno:''},
|
|
|
exchange:'',//转化率
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
+ ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
|
|
|
realMoney(){
|
|
|
return (this.withdrawal * this.exchange).toFixed(2)
|
|
|
},
|
|
|
@@ -155,6 +113,20 @@ export default {
|
|
|
//加载提现信息
|
|
|
this.loadData();
|
|
|
},
|
|
|
+ onShow(options) {
|
|
|
+ // #ifdef H5
|
|
|
+ this.weichatBsrowser = uni.getStorageSync('weichatBrowser');
|
|
|
+ // #endif
|
|
|
+ //加载提现信息
|
|
|
+ this.loadData();
|
|
|
+ // 加载提款账号信息
|
|
|
+ this.aliData.fullname = this.userInfo.alipay_name;
|
|
|
+ console.log(this.aliData.fullname);
|
|
|
+ this.aliData.alino = this.userInfo.alipay_code
|
|
|
+ this.bankData.fullname = this.userInfo.bank_user_name;
|
|
|
+ this.bankData.bank = this.userInfo.bank_name;
|
|
|
+ this.bankData.bankno = this.userInfo.bank_code;
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 加载余额信息
|
|
|
async loadData() {
|
|
|
@@ -195,71 +167,39 @@ export default {
|
|
|
},
|
|
|
// 提交
|
|
|
confirm() {
|
|
|
- const obj = this;
|
|
|
- let data ={}
|
|
|
- this.withdrawal = 1 * this.withdrawal
|
|
|
- if(this.type == 'weixin'){
|
|
|
- data = {
|
|
|
- extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
|
|
|
- weixin: this.wiexin,
|
|
|
- img:this.img_wei,
|
|
|
- name:this.wiexin_name,
|
|
|
- money: this.withdrawal, //金额
|
|
|
- money_type: 1 //0佣金1余额
|
|
|
- };
|
|
|
+ console.log(this.withdrawal);
|
|
|
+ if(this.withdrawal === ''){
|
|
|
+ this.$api.msg("请填写需要提现的佣金")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.withdrawal == 0){
|
|
|
+ this.$api.msg("提现佣金不能为0")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.withdrawal < 50){
|
|
|
+ this.$api.msg("提现金额不能低于最小金额")
|
|
|
+ return
|
|
|
}
|
|
|
- if(this.type == 'alipay'){
|
|
|
- if(this.alipay_code == ''){
|
|
|
- obj.$api.msg('请输入支付宝账号')
|
|
|
- return
|
|
|
- }
|
|
|
- if(this.alipay_name == ''){
|
|
|
- obj.$api.msg('请输入支付宝姓名')
|
|
|
- return
|
|
|
- }
|
|
|
- data = {
|
|
|
- extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
|
|
|
- name:this.alipay_name,
|
|
|
- alipay_code:this.alipay_code,
|
|
|
- // img:this.img,
|
|
|
- money: this.withdrawal, //金额
|
|
|
- money_type: 1 //0佣金1余额
|
|
|
- };
|
|
|
+ let data = {
|
|
|
+ extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
|
|
|
+ money: this.withdrawal, //金额
|
|
|
+ money_type: "brokerage" //0佣金1余额
|
|
|
+ };
|
|
|
+ if (this.type == 'alipay') {
|
|
|
+ data.name = this.aliData.fullname;
|
|
|
+ data.alipay_code = this.aliData.alino;
|
|
|
}
|
|
|
- if(this.type == 'bank') {
|
|
|
- if(this.bank_code == ''){
|
|
|
- obj.$api.msg('请输入银行卡卡号')
|
|
|
- return
|
|
|
- }
|
|
|
- if(this.bank_people == ''){
|
|
|
- obj.$api.msg('请输入银行卡姓名')
|
|
|
- return
|
|
|
- }
|
|
|
- if(this.bank_name == ''){
|
|
|
- obj.$api.msg('请输入所属银行')
|
|
|
- return
|
|
|
- }
|
|
|
- data = {
|
|
|
- extract_type: this.type, //bank -银行卡 alipay-支付宝 weixin-微信
|
|
|
- name: this.bank_people,
|
|
|
- bankname: this.bank_name,
|
|
|
- cardnum: this.bank_code,
|
|
|
- // img:this.img,
|
|
|
- money: this.withdrawal, //金额
|
|
|
- money_type: 1 //0佣金1余额
|
|
|
- };
|
|
|
+ if (this.type == 'bank') {
|
|
|
+ data.name = this.bankData.fullname;
|
|
|
+ data.bankname = this.bankData.bank;
|
|
|
+ data.cardnum = this.bankData.bankno;
|
|
|
}
|
|
|
- console.log(data)
|
|
|
+
|
|
|
extractCash(data)
|
|
|
.then(e => {
|
|
|
- uni.showToast({
|
|
|
- title: '提交成功',
|
|
|
- duration: 2000,
|
|
|
- position: 'top'
|
|
|
- });
|
|
|
- this.withdrawal = '';
|
|
|
- this.wiexin = '';
|
|
|
- this.loadData();
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages/money/success?type=1'
|
|
|
+ })
|
|
|
})
|
|
|
.catch(e => {
|
|
|
console.log();
|