支付宝提现

This commit is contained in:
唐明明
2021-11-05 17:24:40 +08:00
parent 0717891b31
commit f8500192b3
11 changed files with 411 additions and 188 deletions

View File

@@ -32,6 +32,7 @@
uni.showModal({ uni.showModal({
title: "更新提示", title: "更新提示",
content: res.note || '版本更新信息', content: res.note || '版本更新信息',
confirmText: "更新",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
if (plus.os.name=="Android") { if (plus.os.name=="Android") {

View File

@@ -10,8 +10,8 @@ import router from '../router'
// 基础配置 // 基础配置
const config = { const config = {
apiUrl : 'https://oapi.lianshang.vip/api/', // 正式环境 // apiUrl : 'https://oapi.lianshang.vip/api/', // 正式环境
// apiUrl : 'http://api.ahxh.shangkelian.cn/api/', // 测试环境 apiUrl : 'http://api.ahxh.shangkelian.cn/api/', // 测试环境
apiUrls : 'https://storage.lianshang.vip/', // 图片路径(测试/正式) apiUrls : 'https://storage.lianshang.vip/', // 图片路径(测试/正式)
timeout : 60000 timeout : 60000
} }

View File

@@ -2,8 +2,8 @@
"name" : "链商星球", "name" : "链商星球",
"appid" : "__UNI__1F65101", "appid" : "__UNI__1F65101",
"description" : "安徽星煌,链商星球商家工具", "description" : "安徽星煌,链商星球商家工具",
"versionName" : "1.1.0", "versionName" : "1.1.1",
"versionCode" : 110, "versionCode" : 111,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@@ -153,7 +153,7 @@
"titleNView": { "titleNView": {
"backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)" "backgroundImage": "linear-gradient(to right, #7c52fc, #976dff)"
} }
} }
} }
}, },
{ {

View File

@@ -48,7 +48,7 @@
export default { export default {
data() { data() {
return { return {
phone : "18245180131", phone : "",
code : "", code : "",
parentId: "", parentId: "",
smsTime : 60, smsTime : 60,

View File

@@ -347,7 +347,6 @@
// 获取企业认证状态 // 获取企业认证状态
companyStatus(){ companyStatus(){
companyStatus().then(res=>{ companyStatus().then(res=>{
console.log(res)
this.companyCreateInfo = res this.companyCreateInfo = res
}) })
}, },

View File

@@ -759,7 +759,7 @@
.outTime{ .outTime{
padding: $padding 0 0; padding: $padding 0 0;
.outTime-down{ .outTime-down{
color: $text-price; color: $mian-color;
font-size: 32rpx; font-size: 32rpx;
} }
} }

View File

@@ -169,6 +169,11 @@
duration: 3000 duration: 3000
}) })
setTimeout(res => { setTimeout(res => {
console.log(this.$Route)
// if(this.$Route)
uni.setStorageSync('refresh',true) uni.setStorageSync('refresh',true)
uni.navigateBack({}) uni.navigateBack({})
}, 3000) }, 3000)

View File

@@ -5,54 +5,71 @@
<view class="propery-content"> <view class="propery-content">
<view class="currency">可提现额度</view> <view class="currency">可提现额度</view>
<view class="balance">{{ balance || '0.00' }}</view> <view class="balance">{{ balance || '0.00' }}</view>
<view class="frozen" @click="withdrawDetail">提现记录</view> <view class="frozen" @click="$Router.push({name: 'withdrawList'})">提现记录</view>
</view> </view>
</view> </view>
<!-- 提现渠道 -->
<view class="item-name"> <view class="extract-radio">
提现至银行卡 <radio-group @change="extractType = $event.detail.value">
<view class="right"> <view class="extract-item" v-for="(item, index) in types" :key="index">
<view class="cardName" v-if="bank_accounts === 0" @click="addBanks">添加银行卡</view> <label class="radio">
<view class="cardName" v-if='bank_accounts>0' @click="bankLists">{{bankInfo.name?bankInfo.name:'选择银行卡'}} <radio :value="item.type" color="#8b64fd" :checked="extractType === item.type" /><text>提现到{{item.name}}</text>
</label>
</view> </view>
<uni-icons type="arrowright" size="12" color="#fff" /> </radio-group>
</view>
</view> </view>
<!-- 提现金额 -->
<view class="withdrawing-content"> <view class="withdrawing-content">
<view class="item"> <view class="item">
<view style="flex: 1;"> <view style="flex: 1;">
<view class="inputTxt">提现金额</view> <view class="inputTxt">提现金额</view>
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number" <input class="input_num" v-model="withdraw_input" @input='inputNum' type="number" placeholder-style="color:#999;font-weight:normal; font-size:34rpx;" placeholder="请输入提现金额" :disabled="balance===0" />
placeholder-style="color:#999;font-weight:normal; font-size:34rpx;"
placeholder="请输入提现金额" :disabled="balance===0" />
</view> </view>
<view class="all" @click="all">全部提现</view> <view class="all" @click="all">全部提现</view>
</view> </view>
</view> </view>
<view class="total" v-if="total">≈ ¥{{total.toFixed(2)}} </view> <!-- 银行卡 -->
<view class="btn" @click="actions">提现至银行卡</view> <block v-if="extractType === '1'">
<view class="item-name">
<view class="cardName" v-if="bank_accounts === 0" @click="$Router.push({name: 'addBank'})">添加银行卡</view>
<view class="cardName" v-if='bank_accounts > 0' @click="$Router.push({name: 'bankList'})">{{bankInfo.name ? bankInfo.name:'选择银行卡'}}</view>
<uni-icons type="arrowright" size="16" color="#ddd" />
</view>
</block>
<!-- 支付宝 -->
<block v-if="extractType === '2'">
<view class="alipay-form">
<view class="alipay-inputs">
<label>支付宝账号</label>
<input type="text" v-model="alipayUser" placeholder="输入支付宝账号" />
</view>
<view class="alipay-inputs">
<label>支付宝姓名</label>
<input type="text" v-model="alipayName" placeholder="输入支付宝姓名" />
</view>
</view>
</block>
<!-- -->
<view class="btn" @click="actions">申请提现</view>
<view class="des">预计5- 10个工作日到账 手续费: {{tax === '0'?'免手续费':tax+'%'}}</view> <view class="des">预计5- 10个工作日到账 手续费: {{tax === '0'?'免手续费':tax+'%'}}</view>
</view> </view>
</template> </template>
<script> <script>
import { import { withdrawsIndexCreate, withdrawsIndex } from '@/apis/interfaces/withdraws';
withdrawsIndexCreate,
withdrawsIndex
} from '@/apis/interfaces/withdraws';
export default { export default {
data() { data() {
return { return {
balance: 0, // 钱包通证金额 types : [],
tax: 0, // 当前手续费 alipayUser : '', // 支付宝账号
cost: 1, // 每个通证的价格 alipayName : '', // 支付宝姓名
total: 0, // 约合人民币 balance : 0, // 钱包通证金额
card: '', // 银行卡号 tax : 0, // 当前手续费
withdraw_input: '', // 提现通证金额 withdraw_input: '', // 提现通证金额
bank_accounts: 0, extractType : '1', // 提现方式
bankInfo: {}, bank_accounts : 0,
certification:false,// 认证状态 bankInfo : {},
certification : false,// 认证状态
}; };
}, },
onLoad() { onLoad() {
@@ -68,13 +85,19 @@
// 提现基本信息 // 提现基本信息
getInfo() { getInfo() {
withdrawsIndexCreate().then(res => { withdrawsIndexCreate().then(res => {
this.balance = res.balance let typesArry = new Array
this.tax = res.tax for(let key in res.types){
this.cost = res.cost typesArry.push({
this.bank_accounts = res.bank_accounts.length type: key,
name: res.types[key]
})
}
this.types = typesArry
this.balance = res.balance
this.tax = res.tax
this.bank_accounts = res.bank_accounts.length
this.withdraw_input = Number(res.balance) this.withdraw_input = Number(res.balance)
this.total = Number(res.balance) * Number(res.cost) this.certification = res.certification
this.certification = res.certification
uni.setStorageSync('refresh', false) uni.setStorageSync('refresh', false)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
@@ -97,7 +120,6 @@
duration: 2000 duration: 2000
}); });
this.withdraw_input = 0 this.withdraw_input = 0
this.total = 0
} else { } else {
uni.showToast({ uni.showToast({
title: '最大值能超过' + this.balance + '', title: '最大值能超过' + this.balance + '',
@@ -105,7 +127,6 @@
duration: 2000 duration: 2000
}); });
this.withdraw_input = this.balance this.withdraw_input = this.balance
this.total = this.balance * this.cost
} }
} }
}, },
@@ -125,24 +146,7 @@
}, },
// 提现 // 提现
actions() { actions() {
let data = { // 提现前置条件
bank_account_id: this.bankInfo.bank_account_id,
amount: Number(this.withdraw_input)
}
if (data.bank_account_id === undefined || data.bank_account_id === null || data.bank_account_id === '') {
uni.showToast({
title: this.bank_accounts > 0 ? '请选择银行卡' : '请添加银行卡',
icon: 'none'
})
return;
}
if (data.amount === 0) {
uni.showToast({
title: '请输入通证金额',
icon: 'none'
})
return;
}
if (!this.certification) { if (!this.certification) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@@ -161,14 +165,62 @@
}) })
return return
} }
// 组织提现数据
let data = {
type : this.extractType,
amount : this.withdraw_input,
bank_account_id : this.bankInfo.bank_account_id,
name : this.alipayName,
identity : this.alipayUser
}
// 检查提现金额
if (Number(data.amount) <= 0) {
uni.showToast({
title: '提现金额不能为0或复数',
icon: 'none'
})
return;
}
// 检查银行卡信息
if(data.type === 1){
if (data.bank_account_id === undefined || data.bank_account_id === null || data.bank_account_id === '') {
uni.showToast({
title: this.bank_accounts > 0 ? '请选择银行卡' : '请添加银行卡',
icon: 'none'
})
return;
}
}
// 检查支付宝账号
if(data.type === 2){
if (data.name === '') {
uni.showToast({
title: '请输入支付宝账号',
icon: 'none'
})
return;
}
if (data.identity === '') {
uni.showToast({
title: '请输入支付宝姓名',
icon: 'none'
})
return;
}
}
uni.showModal({ uni.showModal({
title: '温馨提示', title : '温馨提示',
content:this.tax === '0'?'您是否确认提现交易将免手续费':'您是否确认提现将会扣除' + this.tax + '%手续费', content :this.tax === '0' ? '您是否确认提现交易将免手续费' : '您是否确认提现将会扣除' + this.tax + '%手续费',
confirmColor: '#7c52fc', confirmColor: '#7c52fc',
cancelColor: '#cacaca', cancelColor : '#cacaca',
cancelText: '我再想想', cancelText : '我再想想',
confirmText: '确认提现', confirmText : '确认提现',
success: (res) => { success : res => {
if (res.confirm) { if (res.confirm) {
uni.showLoading({ uni.showLoading({
title: '提交中' title: '提交中'
@@ -180,12 +232,11 @@
duration: 3000 duration: 3000
}) })
this.withdraw_input = '' this.withdraw_input = ''
this.total = '' this.total = ''
setTimeout(res => { this.alipayUser = ''
this.getInfo() this.alipayName = ''
uni.hideLoading()
uni.setStorageSync('refresh',true) this.getInfo()
}, 3000)
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
@@ -196,24 +247,6 @@
} }
}) })
},
// 添加银行卡
addBanks() {
this.$Router.push({
name: 'addBank'
})
},
// 选择银行卡
bankLists() {
this.$Router.push({
name: 'bankList'
})
},
// 提现记录
withdrawDetail() {
this.$Router.push({
name: 'withdrawList'
})
} }
} }
} }
@@ -296,40 +329,27 @@
} }
.item-name { .item-name {
text-align: center;
color: #303030; color: #303030;
font-weight: bold; margin-top: $margin;
margin-bottom: $margin; font-size: 32rpx;
font-size: 30rpx;
display: flex; display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
background-image: linear-gradient(to right, #aaaaff, #aaaaff); background: white;
color: #fff; padding: $padding/2 $padding;
margin: 30rpx; line-height: 90rpx;
padding: 30rpx; justify-content: space-between;
.cardName{
.right {
flex: 1; flex: 1;
display: flex; &.gray{
flex-direction: row; color: $text-gray;
align-items: center;
justify-content: space-between;
font-size: 34rpx;
.cardName {
flex: 1;
} }
} }
} }
.withdrawing-content { .withdrawing-content {
background-color: #fff; background-color: #fff;
padding: $padding $padding $padding $padding * 2; padding: $padding/2 $padding/2 $padding/2 $padding;
font-size: $title-size-m; font-size: $title-size-m;
/* 绑定银行卡 */ /* 绑定银行卡 */
.bank-card { .bank-card {
display: flex; display: flex;
@@ -339,8 +359,6 @@
box-sizing: border-box; box-sizing: border-box;
padding: 0 45rpx 0 35rpx; padding: 0 45rpx 0 35rpx;
} }
.item { .item {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@@ -348,17 +366,14 @@
justify-content: flex-start; justify-content: flex-start;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx 0; padding: 20rpx 0;
span:nth-child(1) { span:nth-child(1) {
color: #666; color: #666;
margin-right: 20rpx; margin-right: 20rpx;
} }
.inputTxt { .inputTxt {
color: #999; color: #999;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.input_num { .input_num {
font-size: 60rpx; font-size: 60rpx;
color: #3a3a3a; color: #3a3a3a;
@@ -400,7 +415,7 @@
border-radius: 10rpx; border-radius: 10rpx;
text-align: center; text-align: center;
padding: $padding * .9; padding: $padding * .9;
margin: $margin * 3 $margin *2 $margin $margin*2; margin: $margin;
font-size: $title-size; font-size: $title-size;
font-weight: bold; font-weight: bold;
} }
@@ -417,4 +432,62 @@
margin-left: 50rpx; margin-left: 50rpx;
font-size: 36rpx; font-size: 36rpx;
} }
// 选择类型
.extract-radio{
background: white;
margin-bottom: $margin;
.extract-item{
position: relative;
padding: $padding/2 $padding;
line-height: 80rpx;
font-size: 32rpx;
label{
display: block;
}
radio{
margin-right: $margin/2;
}
&::before{
position: absolute;
bottom: 0;
left: $margin;
right: 0;
content: " ";
height: 1rpx;
background: $border-color;
}
&:last-child::before{
display: none;
}
}
}
// 支付宝提现
.alipay-form{
background: white;
margin-top: $margin;
.alipay-inputs{
position: relative;
padding-left: 240rpx;
position: relative;
height: 90rpx;
label{
position: absolute;
left: 0;
top: 0;
line-height: 90rpx;
width: 240rpx;
padding: 0 $padding;
box-sizing: border-box;
}
input{
height: 90rpx;
width: 100%;
}
label,
input{
font-size: 32rpx;
}
}
}
</style> </style>

View File

@@ -4,14 +4,10 @@
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" /> <image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
<view class="propery-content"> <view class="propery-content">
<view class="currency">可提现额度 <view class="currency">可提现额度
<!-- <span>( {{ price || '0.00' }} CNY)</span> -->
</view> </view>
<view class="balance">{{ cash || '0.00' }}</view> <view class="balance">{{ cash || '0.00' }}</view>
<!-- <view class="frozen">{{ balance.frozen || '0.00' }} 冻结中</view> -->
<view class="balance-flex"> <view class="balance-flex">
<!-- <view class="balance-flex-item" @click="showAddress">区块链地址</view> --> <view class="balance-flex-item" @click="$Router.push({name: 'ExtractRed'})">申请提现</view>
<!-- <view class="balance-flex-item" @click="showPrivatekey('privatekey')">我的私钥</view> -->
<view class="balance-flex-item" @click="$Router.push({name: 'ExtractRed'})">提现至银行卡</view>
</view> </view>
</view> </view>
</view> </view>

File diff suppressed because one or more lines are too long