Commit 572f010b by kun

pc账户

parent 7a19ff3a
<template>
<div class="container">
<el-form ref="form" :model="form" label-width="150px" style="background-color: #fff;padding-bottom: 40px;">
<div class="container" id="container">
<el-form v-if="dataSource.type == 0" ref="form" :model="form" label-width="150px" style="background-color: #fff;padding-bottom: 40px;">
<div style="background-color: #eefaff">
<div style="font-size: 14px;font-weight: bold;margin-bottom: 10px;padding-top: 40px;text-align: center">账户余额提现</div>
<el-form-item label="出款账户:">
<div style="text-align: left">网商银行(23456***253)</div>
<div style="text-align: left" v-if="dataSource.subAccountNo">{{ '网商银行(****'+dataSource.subAccountNo.substring(dataSource.subAccountNo.length-4,dataSource.subAccountNo.length)+')' }}</div>
</el-form-item>
<el-form-item label="收款账户:">
<div style="text-align: left">西安小多软件科技有限公司</div>
<div style="text-align: left">中国建设银行(**** **** **** 5566)</div>
<div style="text-align: left">{{dataSource.name}}</div>
<div style="text-align: left">{{ dataSource.resource.bank_name+'(****'+dataSource.resource.bank_account_no.substring(dataSource.resource.bank_account_no.length-4,dataSource.resource.bank_account_no.length)+')' }}</div>
</el-form-item>
<el-form-item label="提现金额:">
<div style="text-align: left"><span style="color: #ff6625;">10</span><span style="color: #ff6625;">(+0.0元 服务费)</span></div>
<div style="text-align: left"><span style="color: #ff6625;">{{ dataSource.money }}</span><span style="color: #ff6625;">(+0.0元 服务费)</span></div>
</el-form-item>
<el-form-item label="到账时间:">
<div style="color: #ff6625;text-align: left">预计24小时内到账,请留意到账提醒</div>
......@@ -22,48 +22,48 @@
<div class="code-input-main">
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode0"
class="code-input-main-item code-input-main-item0"
v-model="one1.phoneCode0"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode1"
class="code-input-main-item code-input-main-item0"
v-model="one1.phoneCode1"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode2"
class="code-input-main-item code-input-main-item0"
v-model="one1.phoneCode2"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode3"
class="code-input-main-item code-input-main-item0"
v-model="one1.phoneCode3"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode4"
class="code-input-main-item code-input-main-item0"
v-model="one1.phoneCode4"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode5"
class="code-input-main-item code-input-main-item0"
v-model="one1.phoneCode5"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
......@@ -82,26 +82,26 @@
</el-form-item>
</el-form>
<el-form ref="form" :model="form" label-width="150px" style="background-color: #fff;padding-bottom: 40px;">
<el-form v-if="dataSource.type == 1" ref="form" :model="form" label-width="150px" style="background-color: #fff;padding-bottom: 40px;">
<div style="background-color: #eefaff">
<div style="font-size: 14px;font-weight: bold;margin-bottom: 10px;padding-top: 40px;text-align: center">银行卡绑定</div>
<el-form-item label="银行账户类型:">
<div style="text-align: left">对公银行账户</div>
</el-form-item>
<el-form-item label="银行开户名:">
<div style="text-align: left">西安小多软件科技有限公司</div>
<div style="text-align: left">{{ dataSource.account_name }}</div>
</el-form-item>
<el-form-item label="银行账号:">
<div style="text-align: left">86******************598</div>
<div style="text-align: left">{{ dataSource.bank_account_no }}</div>
</el-form-item>
<el-form-item label="开户银行:">
<div style="text-align: left">长安银行</div>
<div style="text-align: left">{{ dataSource.bank_name }}</div>
</el-form-item>
<el-form-item label="开户银行所在地区:">
<div style="text-align: left">陕西省西安市</div>
<div style="text-align: left">{{ dataSource.province + dataSource.city }}</div>
</el-form-item>
<el-form-item label="开户银行支行:">
<div style="text-align: left">陕西省西安市二环南路支行</div>
<div style="text-align: left">{{dataSource.bank_branch}}</div>
</el-form-item>
<el-divider></el-divider>
</div>
......@@ -109,48 +109,48 @@
<div class="code-input-main">
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode0"
class="code-input-main-item code-input-main-item1"
v-model="two.phoneCode0"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode1"
class="code-input-main-item code-input-main-item1"
v-model="two.phoneCode1"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode2"
class="code-input-main-item code-input-main-item1"
v-model="two.phoneCode2"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode3"
class="code-input-main-item code-input-main-item1"
v-model="two.phoneCode3"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode4"
class="code-input-main-item code-input-main-item1"
v-model="two.phoneCode4"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode5"
class="code-input-main-item code-input-main-item1"
v-model="two.phoneCode5"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
......@@ -163,81 +163,81 @@
</el-form-item>
<el-form-item>
<div style="text-align: left">
<el-button type="primary" @click="onSubmit">确认提现</el-button>
<el-button type="primary" @click="onSubmit">确认</el-button>
<el-button type="text" style="margin-left: 40px" @click="goUpdate">返回修改</el-button>
</div>
</el-form-item>
</el-form>
<el-form ref="form" :model="form" label-width="150px" style="background-color: #fff;padding-bottom: 40px;">
<el-form v-if="dataSource.type == 2" ref="form" :model="form" label-width="150px" style="background-color: #fff;padding-bottom: 40px;">
<div style="background-color: #eefaff">
<div style="font-size: 14px;font-weight: bold;margin-bottom: 10px;padding-top: 40px;text-align: center">银行卡解绑</div>
<el-form-item label="银行账户类型:">
<div style="text-align: left">对公银行账户</div>
<div style="text-align: left">{{ dataSource.data.status== 'B'?'对公银行账户':'对私银行账户' }}</div>
</el-form-item>
<el-form-item label="银行开户名:">
<div style="text-align: left">西安小多软件科技有限公司</div>
<div style="text-align: left">{{dataSource.data.name}}</div>
</el-form-item>
<el-form-item label="银行账号:">
<div style="text-align: left">86******************598</div>
<div style="text-align: left">{{ dataSource.data.account }}</div>
</el-form-item>
<el-form-item label="开户银行:">
<div style="text-align: left">长安银行</div>
<div style="text-align: left">{{ dataSource.data.region }}</div>
</el-form-item>
<el-form-item label="开户银行所在地区:">
<div style="text-align: left">陕西省西安市</div>
</el-form-item>
<el-form-item label="开户银行支行:">
<div style="text-align: left">陕西省西安市二环南路支行</div>
<div style="text-align: left">{{ dataSource.data.city }}</div>
</el-form-item>
<!-- <el-form-item label="开户银行支行:">-->
<!-- <div style="text-align: left">陕西省西安市二环南路支行</div>-->
<!-- </el-form-item>-->
<el-divider></el-divider>
</div>
<el-form-item label="资金密码:">
<div class="code-input-main">
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode0"
class="code-input-main-item code-input-main-item2"
v-model="tress.phoneCode0"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode1"
class="code-input-main-item code-input-main-item2"
v-model="tress.phoneCode1"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode2"
class="code-input-main-item code-input-main-item2"
v-model="tress.phoneCode2"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode3"
class="code-input-main-item code-input-main-item2"
v-model="tress.phoneCode3"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode4"
class="code-input-main-item code-input-main-item2"
v-model="tress.phoneCode4"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
type="password"/>
<input
pattern="\d*"
class="code-input-main-item"
v-model="phoneCode5"
class="code-input-main-item code-input-main-item2"
v-model="tress.phoneCode5"
oninput="value=value.length>1?value.substr(0,1):value;"
maxlength="1"
onkeyup="value=value.replace(/[^\d]/g,'')"
......@@ -250,7 +250,7 @@
</el-form-item>
<el-form-item>
<div style="text-align: left">
<el-button type="primary" @click="onSubmit">确认提现</el-button>
<el-button type="primary" @click="onSubmit">确认</el-button>
<el-button type="text" style="margin-left: 40px" @click="goUpdate">返回修改</el-button>
</div>
</el-form-item>
......@@ -259,6 +259,18 @@
</template>
<script>
import {
getBusinessIndo,
update,
activationNewPaw,
cloneAccountplatform,
unBindingBank,
cardBindingBank,
alipayBindingS,
asynNotifyM,
} from "@/port/pc_index";
import { isEmpty, format } from "@/lib/js/common";
export default {
name: 'withdrawal',
data() {
......@@ -275,26 +287,135 @@ export default {
},
input: '',
isModalVisible: true, // 是否展示获取验证码弹窗
phoneCode: "", // 验证码6位
phoneCode0: "", // 输入框1的值
phoneCode1: "", // 输入框2的值
phoneCode2: "", // 输入框3的值
phoneCode3: "", // 输入框4的值
phoneCode4: "", // 输入框5的值
phoneCode5: "", // 输入框6的值
one1:{
phoneCode: "", // 验证码6位
phoneCode0: "", // 输入框1的值
phoneCode1: "", // 输入框2的值
phoneCode2: "", // 输入框3的值
phoneCode3: "", // 输入框4的值
phoneCode4: "", // 输入框5的值
phoneCode5: "", // 输入框6的值
},
two:{
phoneCode: "", // 验证码6位
phoneCode0: "", // 输入框1的值
phoneCode1: "", // 输入框2的值
phoneCode2: "", // 输入框3的值
phoneCode3: "", // 输入框4的值
phoneCode4: "", // 输入框5的值
phoneCode5: "", // 输入框6的值
},
tress:{
phoneCode: "", // 验证码6位
phoneCode0: "", // 输入框1的值
phoneCode1: "", // 输入框2的值
phoneCode2: "", // 输入框3的值
phoneCode3: "", // 输入框4的值
phoneCode4: "", // 输入框5的值
phoneCode5: "", // 输入框6的值
},
telephone: "1333***8912", // 手机号
type: '0',
token: '',
dataSource: {resource:{bank_account_no:''},data:{}}
}
},
watch:{
dataSource: {
deep: true,
handler: function (newV, oldV) {
console.log('watch中:', newV)
}
}
},
mounted() {
this.goNextInput('.code-input-main-item');// 实现输入框自动聚焦
let _that = this;
window.addEventListener('message',function(event){
_that.getInfoDetail(event.data.data)
})
},
methods: {
onSubmit() {
this.$router.push('/withdrawalRecord')
if(this.dataSource.type == "0"){
let str = format(new Date().getTime(), "yyyyMMddhhmmss");
let json = {
account_type: "BASIC",
amount: this.dataSource.money,
bank_id: this.dataSource.resource.bank_id,
notify_url:
"http://account.xoado.com/payment/v1/mag/" +
this.dataSource.platformId +
"/asynNotify.htm",
outer_inst_order_no: str,
outer_trade_no: str,
password: this.one1.phoneCode,
platform_id: this.dataSource.platformId,
uid: this.dataSource.uid,
account_id: this.dataSource.id,
memo:"提现到"+this.dataSource.resource.bank_name+"("+this.dataSource.resource.bank_account_no.replace(/^(\d{4})\d+(\d{4})$/, "尾号$2")+")"
};
asynNotifyM(json).then((res) => {
console.log(JSON.stringify(res));
if (!!res && !!res.data && res.status == 200) {
this.$router.push('/withdrawalRecord')
}else {
this.$message.error(res.msg)
}
})
}else if(this.dataSource.type == "1"){
let json = this.dataSource
json.password = this.two.phoneCode;
cardBindingBank(json).then(res=>{
if(res.status == 200){
this.$message.success('绑卡成功')
window.parent.postMessage({data:false},'*');
}else {
this.$message.error(res.msg)
}
})
}else if(this.dataSource.type == "2"){
let json = this.dataSource
json.password = this.tress.phoneCode;
unBindingBank(json).then(res=>{
if(res.status == 200){
this.$message.success('解绑成功')
window.parent.postMessage({data:false},'*');
}else {
this.$message.error(res.msg)
}
})
}
},
closeBackground() { // 关闭验证码弹窗
this.isModalVisible = false
},
getInfoDetail(val){
if(val){
getBusinessIndo(val).then((res) => {
if (!!res && !!res.data && res.status == 200) {
this.dataSource = res.data;
if(res.data.type == "0"){
this.$nextTick(()=>{
this.goNextInput('.code-input-main-item0');// 实现输入框自动聚焦
})
}else if(res.data.type == "1"){
this.$nextTick(()=> {
this.goNextInput('.code-input-main-item1');// 实现输入框自动聚焦
})
}else if(res.data.type == "2"){
this.$nextTick(()=> {
this.goNextInput('.code-input-main-item2');// 实现输入框自动聚焦
})
}
} else {
this.$router.push({ path: "/m_404" });
}
});
}
},
goNextInput(el) { // 实现输入框自动聚焦
var that = this;
var txts = document.querySelectorAll(el);// 获取所有input对象
......@@ -344,7 +465,13 @@ export default {
if (next > txts.length - 1) // 如果是最后一个input时执行事件
{
that.phoneCode = "";
that.phoneCode = that.phoneCode0 + that.phoneCode1 + that.phoneCode2 + that.phoneCode3 + that.phoneCode4 + that.phoneCode5;
if(that.dataSource.type == "0"){
that.one1.phoneCode = that.one1.phoneCode0 + that.one1.phoneCode1 + that.one1.phoneCode2 + that.one1.phoneCode3 + that.one1.phoneCode4 + that.one1.phoneCode5;
}else if(that.dataSource.type == "1"){
that.two.phoneCode = that.two.phoneCode0 + that.two.phoneCode1 + that.two.phoneCode2 + that.two.phoneCode3 + that.two.phoneCode4 + that.two.phoneCode5;
}else if(that.dataSource.type == "2"){
that.tress.phoneCode = that.tress.phoneCode0 + that.tress.phoneCode1 + that.tress.phoneCode2 + that.tress.phoneCode3 + that.tress.phoneCode4 + that.tress.phoneCode5;
}
// that.CheckSmsCode(); // 验证验证码是否正确
return;
}
......@@ -356,14 +483,15 @@ export default {
}
},
goUpdate() {
this.$router.back();
window.parent.postMessage({data:false},'*');
}
}
}
</script>
<style scoped >
.container {
margin: 0 20%;
/*margin: 0 20%;*/
width: 100%;
height: 100%;
}
</style>
......
......@@ -30,10 +30,10 @@
},
methods: {
rollOut(){
this.$router.go('-1');
window.parent.postMessage({data:false},'*');
},
goBackAccount(){
this.$router.push('account-information');
window.parent.postMessage({data:false},'*');
}
}
}
......
import { get ,post} from '@/request/http'
import globalAPI from '@/request/globalAPI'
//查询信息
export function getBusinessIndo(token, data = {}) {
const url = globalAPI.BASE_URL+'auth/support/' + token;
return get(url, data)
}
//修改密码
export function update(data = {}) {
const url = globalAPI.BUSINESS_URL+'payment/v1/password/update';
return post(url, data)
}
//新增密码
export function activationNewPaw(data = {}) {
const url = globalAPI.BUSINESS_URL+'payment/v1/password/activation';
return post(url, data)
}
//开通结算账户
export function cloneAccountplatform(data = {}) {
const url = globalAPI.BUSINESS_URL+'http://account.xoado.com/payment/v1/xoado/cloneAccount';
return post(url, data)
}
//解绑银行卡
export function unBindingBank(data = {}) {
const url = globalAPI.BUSINESS_URL+'payment/v1/manage/unBinding';
return post(url, data)
}
//绑定银行卡
export function cardBindingBank(data) {
const url = globalAPI.BUSINESS_URL+'payment/v1/manage/cardBinding';
return post(url, data)
}
//提现
export function asynNotifyM(data = {}) {
const url = globalAPI.BUSINESS_URL+'payment/v1/xoado/withdraw';
return post(url, data)
}
var BASE_URL = "http://core.xoado.com/";
var BUSINESS_URL="http://account.xoado.com/";
var BUSINESS_URL="https://account.xoado.com/";
export default {
BASE_URL,
BUSINESS_URL
......
......@@ -67,22 +67,33 @@ var router = new VueRouter({
routes: routes
});
router.beforeEach((to, from, next) => {
// var platform = oneValues("platform");
// console.log(platform)
// if (!isEmpty(oneValues("platform"))) {
// if (platform == "driver") {
// if (to.path === '/') {
// console.log(oneValues("token")+"__________________")
// return next({
// path: '/m_index', query: {
// token: oneValues("token")
// }
// });
// } else {
// return next();
// }
// }
// }
var platform = oneValues("platform");
console.log(platform)
if (!isEmpty(oneValues("platform"))) {
if (platform == "driver") {
if (to.path === '/') {
console.log(oneValues("token")+"__________________")
return next({
path: '/m_index', query: {
token: oneValues("token")
}
});
} else {
return next();
}
}else {
if (to.path === '/') {
console.log(oneValues("token")+"__________________")
return next({
path: '/pc_index', query: {
token: oneValues("token")
}
});
} else {
return next();
}
}
}
next()
});
export default router;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment