5 Star 1 Fork 1

烟雨平生 / 跨境电商借卖平台前端

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bvo-gmcwallerAccount.html 16.12 KB
一键复制 编辑 原始数据 按行查看 历史
烟雨平生 提交于 2019-08-10 10:29 . admin
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Responsive Admin Dashboard Template">
<meta name="keywords" content="admin,dashboard">
<meta name="author" content="skcats">
<!-- The above 6 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!-- Title -->
<title>我的钱包</title>
<!-- Styles -->
<link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="assets/plugins/icomoon/style.css" rel="stylesheet">
<link href="assets/plugins/uniform/css/default.css" rel="stylesheet" />
<link href="assets/plugins/switchery/switchery.min.css" rel="stylesheet" />
<link href="css/bootstrap-table.min.css" rel="stylesheet" />
<!-- Theme Styles -->
<link href="assets/css/ecaps.min.css" rel="stylesheet">
<link href="assets/css/custom.css" rel="stylesheet">
</head>
<body>
<!-- Page Inner -->
<div class="page-inner" style="height: -webkit-fill-available;">
<div class="page-title">
<h3 class="breadcrumb-header">我的钱包</h3>
</div>
<div id="main-wrapper">
<!--提现金额模态框
模态框ID:cashMachineModify
提现金额ID:cash
密码ID:password
确认按钮ID:cashMachine
-->
<div class="modal fade" id="cashMachineModify" tabindex="-1" role="dialog" aria-labelledby="modifyModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close btn-cancel" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">提现</h4>
</div>
<div class="modal-body">
<form action="" role="form">
<div class="form-group">
<input type="text" id="cash" class="form-control" placeholder="提现金额:" required>
</div>
<div class="form-group">
<input type="password" id="password" class="form-control" placeholder="密码:" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">取消</button>
<button type="submit" id="cashMachine" class="btn btn-primary">确认</button>
</div>
</div>
</div>
</div>
<!--充值模态框
模态框ID:rechargeModify
提现金额ID:rechargeCash
密码ID:rechargePassword
确认按钮ID:recharge
-->
<div class="modal fade" id="rechargeModify" tabindex="-1" role="dialog" aria-labelledby="modifyModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close btn-cancel" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">充值</h4>
</div>
<div class="modal-body">
<form action="" role="form">
<div class="form-group">
<input type="text" id="rechargeCash" class="form-control" placeholder="充值金额:" required>
</div>
<div class="form-group">
<input type="password" id="rechargePassword" class="form-control" placeholder="密码:" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">取消</button>
<button type="submit" id="recharge" class="btn btn-primary">确认</button>
</div>
</div>
</div>
</div>
<!--更改密码模态框
模态框ID:passwordChangeModify
旧密码ID:oldPassword
新密码ID:newPassword
确认密码ID:comfirmPassword
确认更改按钮ID:changePassword
-->
<div class="modal fade" id="passwordChangeModify" tabindex="-1" role="dialog" aria-labelledby="modifyModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close btn-cancel" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">更改密码</h4>
</div>
<div class="modal-body">
<form action="" role="form">
<div class="form-group">
<input type="password" id="oldPassword" class="form-control" placeholder="输入旧密码:" required>
</div>
<div class="form-group">
<input type="password" id="newPassword" class="form-control" placeholder="输入新密码:" required>
</div>
<div class="form-group">
<input type="password" id="comfirmPassword" class="form-control" placeholder="再次输入新密码:" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">取消</button>
<button type="submit" id="changePassword" class="btn btn-primary">确认更改</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-white">
<div class="panel-body">
<div class="table-responsive">
<table id="example" class="display table" style="width: 100%; cellspacing: 0;" data-show-jumpto="true">
<thead>
<tr>
<th>账户</th>
<th>余额</th>
<th>操作</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="panel-footer">
<div class="btn-group">
<button class="btn btn-success m-b-sm" id="accountList">
<i class='fa fa-tasks'></i> 交易进度
</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-warning m-b-sm" data-toggle="modal" data-target="#passwordChangeModify">
<i class="fa fa-key"></i> 更改密码
</button>
</div>
</div>
</div>
</div>
</div>
</div><!-- Main Wrapper -->
<div class="page-footer">
</div>
</div><!-- /Page Inner -->
<!-- Javascripts -->
<script src="assets/plugins/jquery/jquery-3.1.0.min.js"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="assets/plugins/uniform/js/jquery.uniform.standalone.js"></script>
<script src="js/bootstrap-table.min.js"></script>
<script src="js/bootstrap-table-zh-CN.min.js" type="text/javascript" charset="utf-8"></script>
<script src="assets/plugins/switchery/switchery.min.js"></script>
<script src="assets/js/ecaps.min.js"></script>
<script type="text/javascript">
//获取url中"?"符后的字串
function GetRequest() {
var url = location.search;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
}
}
return theRequest;
}
var request = GetRequest();
console.log("URL中传入数据:");
console.log(request);
//表格元素类
function param(account, balance) {
this.account = account;
this.balance = balance;
}
//渲染表格
var $table = $('#example');
$(window).resize(function() {
$table.bootstrapTable('resetView');
});
//加载界面,获取用户钱包数据
var arr = [];
$(function() {
'use strict';
console.log('user_id:');
console.log(localStorage.getItem('user_id'));
$.ajax({
url: "http://localhost:88/wallet/query?user_id="+localStorage.getItem('user_id'),
method: 'GET',
headers: {
"content-type": "application/json",
"GMC-ACCESS-TOKEN": localStorage.getItem('token')
},
processData: false,
success: function(data, status) {
console.log('钱包余额返回数据:');
if (data) {
console.log(data);
arr[0] = data;
init(arr);
} else{
alert('该账户还没注册钱包!3秒后前往钱包注册页面!');
setTimeout(function(){
window.location.href = 'bvo-wallerAccountRegister.html';
},3000)
}
},
error: function(err) {
console.log(err);
}
});
/* $.get("http://localhost:88/wallet/query?user_id="+localStorage.getItem('user_id'), function(data, status) {
console.log('钱包余额返回数据:');
if (data) {
console.log(data);
arr[0] = data;
init(arr);
} else{
alert('该账户还没注册钱包!3秒后前往钱包注册页面!');
setTimeout(function(){
window.location.href = 'bvo-wallerAccountRegister.html';
},3000)
}
}); */
});
//页面初始化
function init(row) {
$table.bootstrapTable({
data: row,
cache: false,
striped: true,
dataType: "json",
dataField: "data",
pagination: true,
showPaginationSwitch: false,
pageSize: 10,
pageNumber: 1,
sortable: true,
sortOrder: "asc",
pageList: [2, 5, 10],
search: false,
sidePagination: 'client',
silent: true,
toolbarAlign: 'right',
columns: [{
field: 'account_name',
align: 'center',
}, {
field: 'balance',
align: 'center',
}, {
field: 'op',
align: 'center',
valign: 'center',
events: window.operateEvents,
formatter: function(value, row, index) {
var html = [
"<button type='button' class='btn btn-danger btn-xs' style='margin-right:5px;' data-toggle='modal' data-target='#rechargeModify'><i class='fa fa-money'></i> 充值</button>",
"<button type='button' class='btn btn-primary btn-xs' style='margin-right:5px;' data-toggle='modal' data-target='#cashMachineModify'><i class='fa fa-money'></i> 提现</button>",
];
return html.join('');
}
}, ],
onLoadSuccess: function(res) {
},
onLoadError: function(statusCode) {
return "error"
},
formatLoadingMessage: function() {
return "";
},
formatNoMatches: function() {
return "";
}
});
}
//获取当前时间
function now() {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
var time = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
return time;
}
//提现点击事件
$("#cashMachine").click(function() {
var formdata = {
account_name: arr[0].account_name,
password: $("#rechargePassword").val(),
transaction_money: $("#rechargeCash").val(),
transaction_state: 1,
transaction_time: now(),
transaction_type: 1,
user_id: localStorage.getItem('user_id')
};
console.log(formdata);
$.ajax({
url: "http://localhost:88/daw/add",
method: 'POST',
headers: {
"content-type": "application/json",
"GMC-ACCESS-TOKEN": localStorage.getItem('token')
},
data:formdata,
processData: false,
success: function(data, status) {
console.log('提现返回数据:');
console.log(data);
console.log('时间:');
console.log(now());
if (data.success) {
alert("提现申请已发起。");
$('#cashMachineModify').modal('hide');
} else {
alert("fail");
}
},
error: function(err) {
console.log(err);
}
});
/* $.post("http://localhost:88/daw/add", {
account_name: arr[0].account_name,
password: $("#password").val(),
transaction_money: $("#cash").val(),
transaction_state: 1,
// transaction_time: now(),
transaction_type: 2,
user_id: localStorage.getItem('user_id')
}, function(data, status) {
console.log('提现返回数据:');
console.log(data);
console.log('时间:');
console.log(now());
if (data.success) {
alert("提现申请已发起。");
$('#cashMachineModify').modal('hide');
} else {
alert("fail");
}
}); */
});
//充值点击事件
$("#recharge").click(function() {
var formdata = {
account_name: arr[0].account_name,
password: $("#rechargePassword").val(),
transaction_money: $("#rechargeCash").val(),
transaction_state: 1,
transaction_time: now(),
transaction_type: 1,
user_id: localStorage.getItem('user_id')
};
$.ajax({
url: "http://localhost:88/daw/add?account_name="+arr[0].account_name+
"&password="+$("#rechargePassword").val()+"&transaction_money="+$("#rechargeCash").val()
+"&transaction_state=1&transaction_time="+now()+"&transaction_type=1&user_id="+localStorage.getItem('user_id'),
method: 'POST',
headers: {
"content-type": "application/json",
"GMC-ACCESS-TOKEN": localStorage.getItem('token')
},
//data:formdata,
processData: false,
success: function(data, status) {
console.log('充值返回数据:');
console.log(data);
console.log('时间:');
console.log(now());
if (data.success) {
alert("充值申请已发起。");
$('#rechargeModify').modal('hide');
} else {
alert("fail");
}
},
error: function(err) {
console.log(err);
}
});
/* $.post("http://localhost:88/daw/add", {
account_name: arr[0].account_name,
password: $("#rechargePassword").val(),
transaction_money: $("#rechargeCash").val(),
transaction_state: 1,
transaction_time: now(),
transaction_type: 1,
user_id: localStorage.getItem('user_id')
}, function(data, status) {
console.log('充值返回数据:');
console.log(data);
console.log('时间:');
console.log(now());
if (data.success) {
alert("充值申请已发起。");
$('#rechargeModify').modal('hide');
} else {
alert("fail");
}
}); */
});
//交易进度点击事件
$("#accountList").click(function() {
window.location.href = 'http://localhost:88/bvo-gmcwallerAccountList.html?account=' + arr[0].account_name;
});
//更改密码点击事件
$("#changePassword").click(function() {
var formdata = {
newPassword: $("#newPassword").val(),
oldPassword: $("#oldPassword").val(),
user_id: localStorage.getItem('user_id')
};
if ($("#newPassword").val() == $("#comfirmPassword").val()) {
$.ajax({
url: "http://localhost:88/wallet/modifypassword?newPassword="+$("#newPassword").val()+"&oldPassword="+$("#oldPassword").val()+"&user_id="+localStorage.getItem('user_id'),
method: 'POST',
headers: {
"content-type": "application/json",
"GMC-ACCESS-TOKEN": localStorage.getItem('token')
},
//data:formdata,
processData: false,
success: function(data, status) {
console.log('data:');
console.log(data);
console.log('status:');
console.log(status);
if(data['success']){
alert('密码已修改!');
$('#passwordChangeModify').modal('hide');
}else{
alert('fail');
}
},
error: function(err) {
console.log(err);
}
});
/* $.post("http://localhost:88/wallet/modifypassword", {
newPassword: $("#newPassword").val(),
oldPassword: $("#oldPassword").val(),
user_id: localStorage.getItem('user_id')
}, function(data, status) {
console.log('data:');
console.log(data);
console.log('status:');
console.log(status);
if(data['success']){
alert('密码已修改!');
$('#passwordChangeModify').modal('hide');
}else{
alert('fail');
}
}); */
}else{
alert("两次密码输入不一致!");
}
});
</script>
</body>
</html>
HTML/CSS
1
https://gitee.com/LGlogo/gmcbrand.git
git@gitee.com:LGlogo/gmcbrand.git
LGlogo
gmcbrand
跨境电商借卖平台前端
develop

搜索帮助