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

172 lines
7.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/theme-chalk/index.min.css">
<title>我的账户</title>
</head>
<body>
<div id="app">
<el-container>
<el-main>
<el-row>
<el-col :span="24">
<el-descriptions title="用户信息">
<el-descriptions-item label="用户名">{{username}}</el-descriptions-item>
<el-descriptions-item label="手机号">{{userInfo.mobile}}</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-descriptions title="开户信息">
<el-descriptions-item label="用户名" v-if="userInfo.realname_flag==='Y'">{{userInfo.real_name}}</el-descriptions-item>
<el-descriptions-item label="用户名" v-else>--</el-descriptions-item>
<el-descriptions-item label="身份证号" v-if="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.set_pwd_flag==='Y'">**********</el-descriptions-item>
<el-descriptions-item label="支付密码" v-else>--</el-descriptions-item>
<el-descriptions-item label="手机号">{{userInfo.mobile}}</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-descriptions title="绑卡信息">
<el-descriptions-item label="开户行" v-if="userInfo.bind_card_flag==='Y'">{{bankCard.bank_name}}</el-descriptions-item>
<el-descriptions-item label="开户行" v-else>--</el-descriptions-item>
<el-descriptions-item label="开户姓名" v-if="userInfo.bind_card_flag==='Y'">{{bankCard.card_user_name}}</el-descriptions-item>
<el-descriptions-item label="开户姓名" v-else>--</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
</el-main>
</el-container>
</div>
</body>
<!-- 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>
<script>
new Vue({
el: '#app',
data() {
return {
activeName: 'register',
loginForm: {
username: '',
password: ''
},
registerForm: {
username: '',
password: '',
confirm_password: ''
},
username: '',
userInfo: {
realname_flag: '',
bind_card_flag: '',
mobile: '',
real_name: '',
certificate_no: '',
user_type: '',
apply_no: '',
is_platform_account: ''
},
bankCard: {
bank_name: '',
card_user_name: ''
}
}
},
created() {
if (!window.sessionStorage.getItem('token')) {
window.location.href = '/login.html'
return;
} else {
this.getUserInfo();
}
},
methods: {
getUserInfo() {
axios.post('/account/user-info', {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);
}
this.usernae = result.username;
this.userInfo = result.userInfo;
this.bankCard = result.bankCard;
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
bindCard() {
axios.post('/account/bind-card', this.bindConfirmForm)
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
this.bindConfirmVisible = false;
this.$message.success('支付成功');
this.$alert('请记住您的订单号:' + result.data.bizData.outOrderNo , '支付成功', {
confirmButtonText: '确定',
callback: action => {
}
});
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
transferPay() {
axios.post('/account/transfer-pay', this.payConfirmForm)
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
this.payConfirmVisible = false;
this.$message.success('支付成功');
this.$alert('请记住您的订单号:' + result.data.bizData.outOrderNo , '支付成功', {
confirmButtonText: '确定',
callback: action => {
}
});
})
.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;
}
}
})
</script>
</html>