|
@@ -5,9 +5,9 @@
|
|
|
<view class="one_1">
|
|
|
<text>¥</text><text>{{money}}</text>
|
|
|
</view>
|
|
|
- <!-- <view class="one_2" @tap="toCash">
|
|
|
+ <view class="one_2" @tap="toCash">
|
|
|
<button type="default" size="mini">提现</button>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="two">
|
|
|
<tabs :tabs="tabs" @tabsChange="tabsChange">
|
|
@@ -21,7 +21,7 @@
|
|
|
<view class="time">{{item.time}}</view>
|
|
|
</view>
|
|
|
<view class="other_2">
|
|
|
- <view class="money">{{item.money}}</view>
|
|
|
+ <view class="money"><text>{{item.source=='-2'||item.source=='-1'?'-':'+'}}</text> {{item.money}}</view>
|
|
|
<text class="iconfont icon-jiantouyou"></text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -31,7 +31,7 @@
|
|
|
<view class="time">{{item.apply_time}}</view>
|
|
|
</view>
|
|
|
<view class="other_2">
|
|
|
- <view class="money">{{item.money}}</view>
|
|
|
+ <view class="money">-{{item.money}}</view>
|
|
|
<text class="iconfont icon-jiantouyou"></text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -48,13 +48,19 @@
|
|
|
<uni-popup ref="popup" background-color="#fff" type="bottom">
|
|
|
<view class="popup">
|
|
|
<uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
|
|
|
- <uni-forms-item label="姓名" name="name">
|
|
|
- <uni-easyinput disabled v-model="form.name" placeholder="请输入姓名" />
|
|
|
+ <uni-forms-item label="真实姓名" name="card_name">
|
|
|
+ <uni-easyinput v-model="form.card_name" placeholder="请输入真实姓名" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="所属银行" name="card_bank">
|
|
|
+ <uni-easyinput v-model="form.card_bank" placeholder="请输入所属银行" />
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="银行卡号" name="card">
|
|
|
+ <uni-easyinput v-model="form.card" placeholder="请输入银行卡号" />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="提现金额" name="money">
|
|
|
<uni-easyinput type="digit" v-model="form.money" @input="toMoney" placeholder="请输入提现金额" />
|
|
|
<view class="money">
|
|
|
- 可提现金额为{{moneyInfo.payTotal||0}},<text @tap="toAll">全部提现</text>
|
|
|
+ 可提现金额为{{canGet||0}}(收货{{config.reward_day}}天以后才可提现),<text @tap="toAll">全部提现</text>
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="提现理由" name="apply_reason">
|
|
@@ -96,10 +102,28 @@
|
|
|
]
|
|
|
},
|
|
|
// 提现金额
|
|
|
- moneyInfo: {},
|
|
|
+ canGet: 0,
|
|
|
// 提现
|
|
|
form: {},
|
|
|
rules: {
|
|
|
+ card_name: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请输入真实姓名',
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ card_bank: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请输入所属银行',
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ card: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请输入银行卡号',
|
|
|
+ }]
|
|
|
+ },
|
|
|
money: {
|
|
|
rules: [{
|
|
|
required: true,
|
|
@@ -196,7 +220,10 @@
|
|
|
let arr = await that.$api(`/cashBack/computedTotal`, 'GET', {
|
|
|
customer: user._id
|
|
|
})
|
|
|
- if (arr.errcode == '0') that.$set(that, `money`, arr.data);
|
|
|
+ if (arr.errcode == '0'){
|
|
|
+ that.$set(that, `money`, arr.data.total);
|
|
|
+ that.$set(that, `canGet`, arr.data.canGet);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 查询其他信息
|
|
@@ -254,14 +281,13 @@
|
|
|
// 提现
|
|
|
toCash() {
|
|
|
const that = this;
|
|
|
- let user = that.user;
|
|
|
- that.$set(that.form, `name`, user.name)
|
|
|
+ that.$set(that, `form`, {})
|
|
|
that.$refs.popup.open()
|
|
|
},
|
|
|
// 提现金额
|
|
|
toMoney(value) {
|
|
|
const that = this;
|
|
|
- let money = that.moneyInfo.payTotal;
|
|
|
+ let money = that.canGet;
|
|
|
if (parseFloat(value) > parseFloat(money)) {
|
|
|
uni.showToast({
|
|
|
title: '输入金额不能超过可提现金额',
|
|
@@ -272,36 +298,43 @@
|
|
|
// 全部提现
|
|
|
toAll() {
|
|
|
const that = this;
|
|
|
- that.$set(that.form, `money`, that.moneyInfo.payTotal)
|
|
|
+ that.$set(that.form, `money`, that.canGet)
|
|
|
},
|
|
|
// 提交保存
|
|
|
async onSubmit(ref) {
|
|
|
const that = this;
|
|
|
- let money = that.moneyInfo.payTotal;
|
|
|
+ let money = that.canGet;
|
|
|
that.$refs[ref].validate().then(async params => {
|
|
|
- if (parseFloat(params.money) > parseFloat(money)) {
|
|
|
- uni.showToast({
|
|
|
- title: '输入金额不能超过可提现金额',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- } else {
|
|
|
- params.customer = that.user._id;
|
|
|
- params.apply_time = moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
- const arr = await that.$api(`/cashOut`, 'POST', params);
|
|
|
- if (arr.errcode == '0') {
|
|
|
+ if(parseFloat(params.money)>0){
|
|
|
+ if (parseFloat(params.money) > parseFloat(money)) {
|
|
|
uni.showToast({
|
|
|
- title: `提现申请成功`,
|
|
|
- icon: 'success',
|
|
|
- });
|
|
|
- that.$refs.popup.close();
|
|
|
- that.clearPage();
|
|
|
- that.search()
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: arr.errmsg,
|
|
|
- icon: 'none',
|
|
|
+ title: '输入金额不能超过可提现金额',
|
|
|
+ icon: 'none'
|
|
|
})
|
|
|
+ } else {
|
|
|
+ params.customer = that.user._id;
|
|
|
+ params.apply_time = moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ const arr = await that.$api(`/cashOut`, 'POST', params);
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ uni.showToast({
|
|
|
+ title: `提现申请成功`,
|
|
|
+ icon: 'success',
|
|
|
+ });
|
|
|
+ that.$refs.popup.close();
|
|
|
+ that.clearPage();
|
|
|
+ that.search()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: arr.errmsg,
|
|
|
+ icon: 'none',
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: '输入金额不能为0',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|