|
|
@ -1,17 +1,20 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="cash-withdrawal"> |
|
|
|
<view class="cash-withdrawal"> |
|
|
|
<view class="nav acea-row"> |
|
|
|
<!-- <view class="nav acea-row"> |
|
|
|
<view |
|
|
|
<view v-for="(item, navListIndex) in navList" class="item font-color-red" @click="swichNav(navListIndex, item)" |
|
|
|
v-for="(item, navListIndex) in navList" |
|
|
|
:key="navListIndex"> |
|
|
|
class="item font-color-red" |
|
|
|
|
|
|
|
@click="swichNav(navListIndex, item)" |
|
|
|
|
|
|
|
:key="navListIndex" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<view class="line bg-color-red" :class="currentTab === navListIndex ? 'on' : ''"></view> |
|
|
|
<view class="line bg-color-red" :class="currentTab === navListIndex ? 'on' : ''"></view> |
|
|
|
<view class="iconfont" :class="item.icon + ' ' + (currentTab === navListIndex ? 'on' : '')"></view> |
|
|
|
<view class="iconfont" :class="item.icon + ' ' + (currentTab === navListIndex ? 'on' : '')"></view> |
|
|
|
<view>{{ item.name }}</view> |
|
|
|
<view>{{ item.name }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="pos-order-list"> |
|
|
|
|
|
|
|
<view class="nav acea-row row-around row-middle"> |
|
|
|
|
|
|
|
<view v-for="(item, navListIndex) in navList" class="item" :class="currentTab === navListIndex ? 'on' : ''" |
|
|
|
|
|
|
|
@click="swichNav(navListIndex, item)" :key="navListIndex">{{item.name}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</div> |
|
|
|
<view class="wrapper"> |
|
|
|
<view class="wrapper"> |
|
|
|
<view :hidden="currentTab !== 0" class="list"> |
|
|
|
<view :hidden="currentTab !== 0" class="list"> |
|
|
|
<view class="item acea-row row-between-wrapper"> |
|
|
|
<view class="item acea-row row-between-wrapper"> |
|
|
@ -55,19 +58,33 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { getBank, postCashInfo } from "@/api/user"; |
|
|
|
import { |
|
|
|
import { required } from "@/utils/validate"; |
|
|
|
getBank, |
|
|
|
import { validatorDefaultCatch } from "@/utils/dialog"; |
|
|
|
postCashInfo |
|
|
|
|
|
|
|
} from "@/api/user"; |
|
|
|
|
|
|
|
import { |
|
|
|
|
|
|
|
required |
|
|
|
|
|
|
|
} from "@/utils/validate"; |
|
|
|
|
|
|
|
import { |
|
|
|
|
|
|
|
validatorDefaultCatch |
|
|
|
|
|
|
|
} from "@/utils/dialog"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "UserCash", |
|
|
|
name: "UserCash", |
|
|
|
components: {}, |
|
|
|
components: {}, |
|
|
|
props: {}, |
|
|
|
props: {}, |
|
|
|
data: function() { |
|
|
|
data: function () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
navList: [ |
|
|
|
navList: [{ |
|
|
|
{ name: "微信", type: "weixin", icon: "icon-weixin2" }, |
|
|
|
name: "微信", |
|
|
|
{ name: "支付宝", type: "alipay", icon: "icon-icon34" } |
|
|
|
type: "weixin", |
|
|
|
|
|
|
|
icon: "icon-weixin2" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name: "支付宝", |
|
|
|
|
|
|
|
type: "alipay", |
|
|
|
|
|
|
|
icon: "icon-icon34" |
|
|
|
|
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
post: { |
|
|
|
post: { |
|
|
|
extract_type: "weixin", |
|
|
|
extract_type: "weixin", |
|
|
@ -84,16 +101,16 @@ export default { |
|
|
|
commissionCount: 0 |
|
|
|
commissionCount: 0 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted: function() { |
|
|
|
mounted: function () { |
|
|
|
this.getBank(); |
|
|
|
this.getBank(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
swichNav: function(index, item) { |
|
|
|
swichNav: function (index, item) { |
|
|
|
console.log(item); |
|
|
|
console.log(item); |
|
|
|
this.currentTab = index; |
|
|
|
this.currentTab = index; |
|
|
|
this.post.extract_type = item.type; |
|
|
|
this.post.extract_type = item.type; |
|
|
|
}, |
|
|
|
}, |
|
|
|
getBank: function() { |
|
|
|
getBank: function () { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
getBank().then( |
|
|
|
getBank().then( |
|
|
|
res => { |
|
|
|
res => { |
|
|
@ -101,9 +118,9 @@ export default { |
|
|
|
that.minPrice = res.data.minPrice; |
|
|
|
that.minPrice = res.data.minPrice; |
|
|
|
that.commissionCount = res.data.commissionCount; |
|
|
|
that.commissionCount = res.data.commissionCount; |
|
|
|
}, |
|
|
|
}, |
|
|
|
function(err) { |
|
|
|
function (err) { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: err.msg || err.response.data.msg|| err.response.data.message, |
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
icon: "none", |
|
|
|
icon: "none", |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}); |
|
|
|
}); |
|
|
@ -122,10 +139,22 @@ export default { |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
parseFloat(money) > parseFloat(that.commissionCount) || |
|
|
|
parseFloat(money) > parseFloat(that.commissionCount) || |
|
|
|
parseFloat(that.commissionCount) == 0 |
|
|
|
parseFloat(that.commissionCount) == 0 |
|
|
|
) |
|
|
|
) { |
|
|
|
return that.$dialog.message("余额不足"); |
|
|
|
uni.showToast({ |
|
|
|
if (parseFloat(money) < parseFloat(that.minPrice)) |
|
|
|
title: "余额不足", |
|
|
|
return that.$dialog.message("最低提现金额" + that.minPrice); |
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (parseFloat(money) < parseFloat(that.minPrice)) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: "最低提现金额" + that.minPrice, |
|
|
|
|
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
//console.log(that.post.extract_type) |
|
|
|
//console.log(that.post.extract_type) |
|
|
|
switch (that.post.extract_type) { |
|
|
|
switch (that.post.extract_type) { |
|
|
|
case "alipay": |
|
|
|
case "alipay": |
|
|
@ -158,7 +187,11 @@ export default { |
|
|
|
name: [required(required.message("支付宝用户名"))], |
|
|
|
name: [required(required.message("支付宝用户名"))], |
|
|
|
alipay_code: [required(required.message("支付宝账号"))], |
|
|
|
alipay_code: [required(required.message("支付宝账号"))], |
|
|
|
money: [required(required.message("提现金额"))] |
|
|
|
money: [required(required.message("提现金额"))] |
|
|
|
}).validate({ name, alipay_code, money }); |
|
|
|
}).validate({ |
|
|
|
|
|
|
|
name, |
|
|
|
|
|
|
|
alipay_code, |
|
|
|
|
|
|
|
money |
|
|
|
|
|
|
|
}); |
|
|
|
let save = { |
|
|
|
let save = { |
|
|
|
extractType: that.post.extract_type, |
|
|
|
extractType: that.post.extract_type, |
|
|
|
alipayCode: alipay_code, |
|
|
|
alipayCode: alipay_code, |
|
|
@ -175,7 +208,10 @@ export default { |
|
|
|
await this.$validator({ |
|
|
|
await this.$validator({ |
|
|
|
weixin: [required(required.message("提现微信号"))], |
|
|
|
weixin: [required(required.message("提现微信号"))], |
|
|
|
money: [required(required.message("提现金额"))] |
|
|
|
money: [required(required.message("提现金额"))] |
|
|
|
}).validate({ weixin, money }); |
|
|
|
}).validate({ |
|
|
|
|
|
|
|
weixin, |
|
|
|
|
|
|
|
money |
|
|
|
|
|
|
|
}); |
|
|
|
let save = { |
|
|
|
let save = { |
|
|
|
extractType: that.post.extract_type, |
|
|
|
extractType: that.post.extract_type, |
|
|
|
weixin: weixin, |
|
|
|
weixin: weixin, |
|
|
@ -188,7 +224,7 @@ export default { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
save: function(info) { |
|
|
|
save: function (info) { |
|
|
|
postCashInfo(info).then( |
|
|
|
postCashInfo(info).then( |
|
|
|
res => { |
|
|
|
res => { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -196,11 +232,13 @@ export default { |
|
|
|
icon: "none", |
|
|
|
icon: "none", |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.router.push({ path: "/user/audit" }); |
|
|
|
this.router.push({ |
|
|
|
|
|
|
|
path: "/user/audit" |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
err => { |
|
|
|
err => { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: err.msg || err.response.data.msg|| err.response.data.message, |
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
icon: "none", |
|
|
|
icon: "none", |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}); |
|
|
|
}); |
|
|
@ -208,5 +246,10 @@ export default { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="less"> |
|
|
|
|
|
|
|
.cash-withdrawal .pos-order-list .nav .item.on { |
|
|
|
|
|
|
|
color: #eb3729 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|