You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/public/account.html

464 lines
22 KiB
HTML

11 months ago
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
11 months ago
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/theme-chalk/index.min.css">
11 months ago
<title>我的账户</title>
</head>
<body>
<div id="app">
<el-container>
<el-main>
11 months ago
<el-tabs v-model="activeName" @tab-click="handleClick">
11 months ago
<el-tab-pane label="账户信息" name="user">
<el-row>
<el-col :span="24">
<el-descriptions title="用户信息">
<el-descriptions-item label="用户名">{{username}} <el-button type="primary" @click="logout" size="mini" round>退出登录</el-button></el-descriptions-item>
11 months ago
<el-descriptions-item label="登录密码"><el-button type="primary" @click="updatePasswordVisible = true" size="mini" round>修改</el-button></el-descriptions-item>
11 months ago
</el-descriptions>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-descriptions title="开户信息">
<el-descriptions-item label="用户名" v-if="userInfo != null && userInfo.realname_flag==='Y'">{{userInfo.real_name}}</el-descriptions-item>
<el-descriptions-item label="用户名" v-else><el-button type="primary" @click="openAccount" size="mini" round>开户</el-button></el-descriptions-item>
<el-descriptions-item label="身份证号" v-if="userInfo != null && userInfo.realname_flag==='Y'">{{userInfo.certificate_no}}</el-descriptions-item>
<el-descriptions-item label="身份证号" v-else>--</el-descriptions-item>
<el-descriptions-item label="支付密码" v-if="userInfo != null && userInfo.set_pwd_flag==='Y'">********** <el-button type="primary" @click="resetPayPassword" size="mini" round>修改</el-button></el-descriptions-item>
<el-descriptions-item label="支付密码" v-else><el-button type="primary" @click="setPayPassword" size="mini" round>设置</el-button></el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-descriptions title="绑卡信息">
11 months ago
<el-descriptions-item label="开户行" v-if="bankCard != null && userInfo.bind_card_flag!=='N'">{{bankCard.bank_name}} <el-button type="primary" @click="unbindCard" size="mini" round>解绑</el-button></el-descriptions-item>
11 months ago
<el-descriptions-item label="开户行" v-else><el-button type="primary" @click="bindCard" size="mini" round>绑卡</el-button></el-descriptions-item>
11 months ago
<el-descriptions-item label="开户姓名" v-if="bankCard != null && userInfo.bind_card_flag!=='N'">{{bankCard.card_user_name}}</el-descriptions-item>
11 months ago
<el-descriptions-item label="开户姓名" v-else>--</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="充值" name="recharge">
<div>
11 months ago
<el-form ref="payForm" :model="payForm" label-width="80px">
11 months ago
<el-form-item label="金额">
11 months ago
<el-input v-model="payForm.amount"></el-input>
11 months ago
</el-form-item>
<el-form-item>
<el-button type="primary" @click="transferPay">充值</el-button>
</el-form-item>
</el-form>
</div>
<div>
<h2>充值流程</h2>
<p>1. 输入金额,点击充值按钮</p>
11 months ago
<p>2. 按弹窗提示转账</p>
11 months ago
</div>
</el-tab-pane>
11 months ago
<el-tab-pane label="充值记录" name="orders">
<div>
<el-row>
<el-form :inline="true" :model="search">
<el-form-item label="">
<el-input v-model="search.outOrderNo" placeholder="商户订单号" clearable></el-input>
</el-form-item>
<el-form-item label="">
<el-input v-model="search.mobile" placeholder="手机尾号(后四位)" clearable></el-input>
</el-form-item>
<el-form-item label="">
<el-input v-model="search.bankCardNo" placeholder="银行卡(后四位)" clearable></el-input>
</el-form-item>
<el-form-item label="">
<el-input v-model="search.cardUserName" placeholder="名字(不加姓)" clearable></el-input>
</el-form-item>
<el-form-item label="">
<el-date-picker
v-model="search.timeRange"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="支付开始日期"
end-placeholder="支付结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="">
<el-select v-model="search.status" placeholder="支付状态" clearable>
<el-option label="转账成功,入账成功" value="FINISH"></el-option>
<el-option label="转账成功,待入账" value="SUCCESS"></el-option>
<el-option label="转账成功,入账失败" value="CONFIRM_FAILED"></el-option>
<el-option label="转账失败" value="FAILED"></el-option>
<el-option label="待转账" value="PROCESS"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="query">查询</el-button>
</el-form-item>
<el-form-item>
<div style="line-height: 20px; margin-left: 20px; display: inline-block; margin-top: 10px; font-size: 14px;">充值金额:{{ amount }}</div>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col :span="24">
<el-table
:data="records"
style="width: 100%">
<el-table-column
prop="out_order_no"
label="订单号"
width="180">
</el-table-column>
<el-table-column
prop="card_user_name"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="certificate_no"
label="身份证号">
</el-table-column>
<el-table-column
prop="last_card_no"
label="银行卡号(后四位)">
</el-table-column>
<el-table-column
prop="bank_mobile"
label="手机号(后四位)">
</el-table-column>
<el-table-column
prop="amount"
label="充值金额">
</el-table-column>
<el-table-column
prop="created_at"
label="充值时间">
</el-table-column>
<el-table-column
prop="status_text"
label="状态">
</el-table-column>
</el-table>
<el-pagination
background
layout="prev, pager, next"
@current-change="handleCurrentChange"
:page-size="pageSize"
:total="total"
style="margin-top: 10px">
</el-pagination>
</el-col>
</el-row>
</div>
</el-tab-pane>
11 months ago
</el-tabs>
11 months ago
</el-main>
</el-container>
11 months ago
<el-dialog title="转账信息" :visible.sync="payInfoVisible" width="50%">
11 months ago
<div>
<h3>您可通过网银或手机银行app向专属打款账户进行转账其中</h3>
<p><el-tag type="success">订单号:{{outOrderNo}}</el-tag></p>
<p><el-tag type="success">户名:宝付网络科技(上海)有限公司</el-tag></p>
<p><el-tag type="success">银行:支付机构备付金集中存管账户</p>
<p><el-tag type="success">开户城市:上海</el-tag></p>
<p><el-tag type="success">开户网点:宝付网络-备付金账户</el-tag></p>
<p><el-tag type="success">行号991290000793</el-tag></p>
<p><el-tag type="success">专属打款账户:{{acsNo}}</el-tag></p>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="payInfoVisible = false">确 定</el-button>
</div>
</el-dialog>
11 months ago
<el-dialog title="修改登录密码" :visible.sync="updatePasswordVisible" width="40%">
<div>
<el-form ref="updatePasswordForm" :model="updatePasswordForm" label-width="80px">
<el-form-item label="原密码">
<el-input show-password v-model="updatePasswordForm.oldPassword"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input show-password v-model="updatePasswordForm.password"></el-input>
</el-form-item>
<el-form-item label="确认密码">
<el-input show-password v-model="updatePasswordForm.confirm_password"></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="updatePasswordVisible = false">取 消</el-button>
<el-button type="primary" @click="updatePassword">确 定</el-button>
</div>
</el-dialog>
11 months ago
</div>
</body>
11 months ago
<!-- import Vue before Element -->
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.9/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/index.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/1.5.0/axios.min.js"></script>
11 months ago
<script>
new Vue({
el: '#app',
data() {
return {
11 months ago
activeName: 'user',
11 months ago
updatePasswordVisible: false,
11 months ago
username: '',
11 months ago
payForm: {
amount: 0
},
11 months ago
userInfo: {
realname_flag: '',
bind_card_flag: '',
mobile: '',
real_name: '',
certificate_no: '',
user_type: '',
apply_no: '',
is_platform_account: ''
},
11 months ago
updatePasswordForm: {
oldPassword: '',
password: '',
confirm_password: ''
},
11 months ago
bankCard: {
11 months ago
id: 0,
11 months ago
bank_name: '',
card_user_name: ''
11 months ago
},
acsNo: '',
outOrderNo: '',
11 months ago
payInfoVisible: false,
search: {
mobile: '',
cardNo: '',
bankCardNo: '',
orderNo: '',
outOrderNo: '',
cardUserName: '',
timeRange: null,
status: undefined
},
records: [],
total: 0,
amount: 0,
pageSize: 20
11 months ago
}
},
created() {
if (!window.sessionStorage.getItem('token')) {
11 months ago
window.location.href = '/login.html'
11 months ago
return;
11 months ago
} else {
this.getUserInfo();
11 months ago
}
},
methods: {
11 months ago
logout() {
11 months ago
window.sessionStorage.removeItem('token');
11 months ago
window.location.href = '/login.html';
},
11 months ago
getUserInfo() {
axios.post('/account/user-info', {token: window.sessionStorage.getItem('token')})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
11 months ago
this.$message.error(response.data.message);
11 months ago
window.sessionStorage.removeItem('token');
window.location.href = '/login.html';
11 months ago
return;
11 months ago
}
11 months ago
this.username = result.data.username;
this.userInfo = result.data.userInfo;
this.bankCard = result.data.bankCard;
11 months ago
console.log('result', result);
console.log('username', this.username);
11 months ago
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
11 months ago
openAccount() {
11 months ago
axios.post('/account/open-account', {token: window.sessionStorage.getItem('token')})
11 months ago
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
window.open(result.data.url)
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
11 months ago
updatePassword() {
11 months ago
if (this.updatePasswordForm.confirm_password != this.updatePasswordForm.password) {
11 months ago
this.$message.error('密码和确认密码不一致');
return;
}
axios.post('/account/update-password', {token: window.sessionStorage.getItem('token'), oldPassword: this.updatePasswordForm.oldPassword, password: this.updatePasswordForm.password})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
this.$message.success('修改成功');
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
11 months ago
resetPayPassword() {
axios.post('/account/reset-pay-password', {token: window.sessionStorage.getItem('token')})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
window.open(result.data.url)
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
setPayPassword() {
axios.post('/account/set-pay-password', {token: window.sessionStorage.getItem('token')})
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
window.open(result.data.url)
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
11 months ago
bindCard() {
11 months ago
axios.post('/account/bind-card', {token: window.sessionStorage.getItem('token')})
11 months ago
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
11 months ago
window.open(result.data.url)
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
unbindCard() {
11 months ago
axios.post('/account/unbind-card', {token: window.sessionStorage.getItem('token'), id: this.bankCard.id})
11 months ago
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
11 months ago
if (result.data.result) {
this.$message.success('解绑成功');
window.location.href = window.location.href;
} else {
return this.$message.error('解绑失败');
}
11 months ago
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
transferPay() {
11 months ago
axios.post('/account/transfer-pay', {token: window.sessionStorage.getItem('token'), amount: this.payForm.amount})
11 months ago
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
11 months ago
this.acsNo = result.data.acsNo;
this.outOrderNo = result.data.outOrderNo;
this.payInfoVisible = true;
11 months ago
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
getQueryParam(name) {
var query = window.location.search.substring(1);
console.log(query)
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
console.log(pair[0], name)
if(pair[0] == name) {
return pair[1];
}
}
return undefined;
11 months ago
},
searchList(page) {
let data = {...this.search}
data.token = window.sessionStorage.getItem('token');
data.page = page;
data.pageSize = this.pageSize;
axios.post('/account/get-orders', data)
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
if (result.code == 2005) {
this.loginVisible = true;
}
return this.$message.error(response.data.message);
}
this.records = result.data.records;
this.total = result.data.total;
this.amount = result.data.amount;
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
query() {
this.searchList(1)
},
handleCurrentChange(val) {
this.searchList(val)
},
handleClick(tab, event) {
11 months ago
console.log(tab)
11 months ago
if (tab.name === 'orders') {
11 months ago
this.searchList(1)
}
11 months ago
}
}
})
</script>
</html>