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

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>
<el-row>
<el-col :span="24">
<el-descriptions title="用户信息">
11 months ago
<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>
11 months ago
</el-descriptions>
</el-col>
</el-row>
</el-main>
</el-container>
</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 {
activeName: 'register',
loginForm: {
username: '',
password: ''
},
registerForm: {
username: '',
password: '',
confirm_password: ''
11 months ago
},
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: ''
11 months ago
}
}
},
created() {
if (!window.sessionStorage.getItem('token')) {
window.location.href = '/login.html'
return;
11 months ago
} else {
this.getUserInfo();
11 months ago
}
},
methods: {
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) {
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!');
},
11 months ago
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>