<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<meta name="viewport" content="width=device-width, viewport-fit=cover, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<title>福利发放</title>
|
<link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
|
<script>
|
window.onresize = function () {
|
document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
|
};
|
window.onresize();
|
</script>
|
<script src="js/jquery.min.js"></script>
|
<script src="layui/layui.js"></script>
|
<style>
|
body{
|
background: #FFF;
|
}
|
.container{
|
display: flex;
|
align-items: center;
|
flex-direction: column;
|
}
|
.edit{
|
border-radius: 0.2rem;
|
width: 80%;
|
margin-top: 0.6rem;
|
}
|
.money {
|
border-radius: 0.1rem;
|
width: 80%;
|
margin-top: 0.4rem;
|
display: none;
|
}
|
|
.btn{
|
background-color: #FF2B4B;
|
border-radius: 0.1rem;
|
width: 80%;
|
margin-top: 0.4rem;
|
font-size: 0.25rem;
|
}
|
|
</style>
|
</head>
|
<body>
|
|
<div class="container">
|
<img src="img/icon.png" style="width: 40%;margin-top: 1rem;"/>
|
|
<textarea class="layui-textarea edit" placeholder="长按粘贴口令"></textarea>
|
|
<input class="layui-input money" placeholder="请输入付款金额" />
|
|
<button class="layui-btn btn" >提交</button>
|
|
</div>
|
|
<!-- 新增底部菜单 -->
|
<div class="footer-menu">
|
<a href="/index3.html" class="menu-item">
|
<img src="../img/command_fill.png" alt="口令" class="menu-icon">
|
<span>口令</span>
|
</a>
|
<a href="/credit/index.html" class="menu-item active">
|
<img src="../img/credit.png" alt="积分" class="menu-icon">
|
<span>积分</span>
|
</a>
|
</div>
|
|
<style>
|
/* 新增样式:底部菜单 */
|
.footer-menu {
|
position: fixed;
|
bottom: 0;
|
left: 0;
|
width: 100%;
|
display: flex;
|
justify-content: space-around;
|
background-color: #fff;
|
border-top: 1px solid #eee;
|
padding: 0.5rem 0;
|
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
|
}
|
|
.menu-item {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
text-decoration: none;
|
color: #666;
|
font-size: 0.24rem;
|
}
|
|
.menu-item.active {
|
color: #000;
|
}
|
|
.menu-icon {
|
width: 0.4rem;
|
height: 0.4rem;
|
margin-bottom: 0.1rem;
|
}
|
</style>
|
|
<script>
|
$(function(){
|
function getQueryString(name) {
|
console.log(window.location.search)
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var r = window.location.search.substr(1).match(reg);
|
if (r != null)
|
return unescape(decodeURI(r[2]));
|
return null;
|
}
|
var state = getQueryString("state");
|
var msg = getQueryString("msg");
|
var a=getQueryString("a");
|
if(state=="SUCCESS"){
|
layer.msg("提交成功");
|
}else if(state =="FAIL"){
|
if(msg!=null&&msg!=undefined&&msg!=""){
|
layer.msg(msg);
|
}else {
|
layer.msg("提交失败");
|
}
|
}
|
|
$(".btn").click(function(){
|
var text = $(".edit").val();
|
var money = $(".money").val();
|
if (text.length <= 0) {
|
layer.msg("请输入口令");
|
return;
|
}
|
|
if(a==null||a==undefined||a.length<=0){
|
layer.msg("非渠道链接");
|
return;
|
}
|
|
// const moneyRegex = /^\d+(\.\d{1,2})?$/;
|
// if (!moneyRegex.test(money)) {
|
// layer.msg("付款金额输入错误");
|
// return;
|
// }
|
var index = layer.load();
|
// 上传口令
|
$.post("/webapi/submitKeyV4",{"key":text,"money": money},function(response){
|
layer.close(index);
|
if(response.code==0){
|
layer.msg("提交成功");
|
$(".edit").val("");
|
window.location.href ="result.html?id="+response.data.id;
|
} else if(response.code==1001){
|
window.location.replace(response.data.link);
|
}else{
|
layer.msg(response.msg);
|
}
|
},'json').fail(function(jqXHR, textStatus, errorThrown){
|
layer.close(index);
|
layer.msg("网络请求失败");
|
});
|
});
|
|
|
});
|
|
</script>
|
|
|
</body>
|
</html>
|