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/orders.html

158 lines
5.7 KiB
HTML

1 year ago
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<title>充值记录</title>
</head>
<body>
<div id="app">
<el-container>
<el-header style="text-align: center;">充值记录</el-header>
<el-main>
<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="real_name"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="card_no"
label="身份证号">
</el-table-column>
<el-table-column
prop="bank_card_no"
label="银行卡号">
</el-table-column>
<el-table-column
prop="mobile"
label="手机号">
</el-table-column>
<el-table-column
prop="amount"
label="充值金额">
</el-table-column>
<el-table-column
prop="payed_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">
</el-pagination>
</el-col>
</el-row>
</el-main>
</el-container>
<el-dialog title="登录" :visible.sync="loginVisible" width="30%">
<el-form :model="loginer" label-width="80px">
<el-form-item label="账号">
<el-input v-model="loginer.username" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="loginer.password" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="loginVisible = false">取 消</el-button>
<el-button type="primary" @click="login">确 定</el-button>
</div>
</el-dialog>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios@1.1.2/dist/axios.min.js"></script>
<script>
new Vue({
el: '#app',
data() {
return {
records: [],
total: 0,
pageSize: 20,
loginVisible: false,
loginer: {
username: '',
password: ''
}
}
},
created() {
if (!window.sessionStorage.getItem('token')) {
this.loginVisible = true;
return this.$message.error('请先登录');
}
this.searchList();
},
methods: {
searchList(page) {
let data = {
token: window.sessionStorage.getItem('token'),
page: page,
pageSize: this.pageSize
}
axios.post('/recharge/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;
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
console.log('submit!');
},
handleCurrentChange(val) {
this.searchList(val)
},
login() {
axios.post('/recharge/login', this.loginer)
.then( (response) => {
console.log(response);
let result = response.data
if (result.code != 1000) {
return this.$message.error(response.data.message);
}
window.sessionStorage.setItem('token', result.data.token)
this.loginVisible = false;
this.$message.success('登录成功');
this.searchList(1);
})
.catch((error) => {
this.$message.error('请求错误');
console.log(error);
});
}
}
})
</script>
</html>