generated from root/miduo_server
399 lines
18 KiB
HTML
399 lines
18 KiB
HTML
<!--_meta 作为公共模版分离出去-->
|
||
<!DOCTYPE HTML>
|
||
<html xmlns:th="http://www.thymeleaf.org">
|
||
<head>
|
||
<meta charset="utf-8"/>
|
||
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||
<meta name="viewport"
|
||
content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||
<link rel="Bookmark" href="../favicon.ico"/>
|
||
<link rel="Shortcut Icon" href="../favicon.ico"/>
|
||
<!--[if lt IE 9]>
|
||
<script type="text/javascript" src="../static/lib/html5shiv.js"></script>
|
||
<script type="text/javascript" src="../static/lib/respond.min.js"></script>
|
||
<![endif]-->
|
||
<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css"/>
|
||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css"/>
|
||
<link rel="stylesheet" type="text/css" href="../static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
|
||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin"/>
|
||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css"/>
|
||
|
||
<!-- 多选框 -->
|
||
<link href="../static/searchableSelect/css/jquery.searchableSelect.css" rel="stylesheet" type="text/css">
|
||
<link rel="stylesheet" type="text/css" href="https://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.css">
|
||
<link href="../static/bootstrap/css/bootstrap-select.css" rel="stylesheet">
|
||
<!--[if IE 6]>
|
||
<script type="text/javascript" src="../static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
|
||
<script>DD_belatedPNG.fix('*');</script>
|
||
<![endif]-->
|
||
<!--/meta 作为公共模版分离出去-->
|
||
|
||
<title>基本设置</title>
|
||
</head>
|
||
<body>
|
||
<nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页
|
||
<span class="c-gray en">></span>
|
||
GM管理
|
||
<span class="c-gray en">></span>
|
||
全服邮件
|
||
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
|
||
href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
|
||
</nav>
|
||
<div class="page-container">
|
||
<form class="form form-horizontal" id="form-article-add" action="http://60.1.1.212:9076/idip/manager" method="post">
|
||
<div id="tab-system" class="HuiTab">
|
||
<div class="tabBar cl">
|
||
<span>全服邮件</span>
|
||
</div>
|
||
<div class="tabCon">
|
||
<div class="row cl">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
<span class="c-red">*</span>
|
||
区服id:</label>
|
||
<div class="formControls col-xs-8 col-sm-9">
|
||
<!--多选服务器-->
|
||
<select name="serverId" class="selectpicker" id="serverId" multiple
|
||
data-live-search="true"
|
||
data-width="300px"
|
||
data-actions-box="true">
|
||
<!-- <select name="serverId" id="serverId" class="input-text"><!–下拉列表–>-->
|
||
<option th:each="server:${serverInfo}" th:value="${server.server_id}"
|
||
th:text="${server.server_id}+'-'+${server.name}"></option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="row cl">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
<span class="c-red">*</span>
|
||
邮件标题:</label>
|
||
<div class="formControls col-xs-8 col-sm-9">
|
||
<div>
|
||
中文<input type="text" name="mailTitle1" placeholder="" value="" class="input-text"/>
|
||
</div>
|
||
<div>
|
||
英文<input type="text" name="mailTitle2" placeholder="" value="" class="input-text"/>
|
||
</div>
|
||
<div>
|
||
越南文<input type="text" name="mailTitle3" placeholder="" value="" class="input-text"/>
|
||
</div>
|
||
<span class="MAILTITLE"></span>
|
||
</div>
|
||
</div>
|
||
<div class="row cl">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
<span class="c-red">*</span>
|
||
邮件正文:</label>
|
||
<div class="formControls col-xs-8 col-sm-9">
|
||
中文<textarea rows="5" cols="150" wrap="soft" name="mailContent1" style="width:100%;border:solid 1px #ddd"></textarea>
|
||
英文<textarea rows="5" cols="150" wrap="soft" name="mailContent2" style="width:100%;border:solid 1px #ddd"></textarea>
|
||
越南文<textarea rows="5" cols="150" wrap="soft" name="mailContent3" style="width:100%;border:solid 1px #ddd"></textarea>
|
||
<span class="MAILCONTENT"></span>
|
||
</div>
|
||
</div>
|
||
<div class="row cl">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
是否带附件:</label>
|
||
<div class="formControls col-xs-8 col-sm-9">
|
||
<select name="isAttach" class="input-text" id="isAttach" onclick="itemShow()">
|
||
<option value="1">有</option>
|
||
<option value="0" selected="selected">无</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="row cl" id="items" style="display: none">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
<span class="c-red">*</span>
|
||
附件:</label>
|
||
<div class="formControls col-xs-8 col-sm-9">
|
||
<div id="InputsWrapper">
|
||
<div th:each="i:${#numbers.sequence(1,20)}">
|
||
<div th:style="${i} ne 1?'display:none':''" th:id="item_+(${i})">
|
||
物品id:
|
||
<select name="itemId" style="width: 150px" th:id="itemId_+(${i})"><!--下拉列表-->
|
||
<option value="0" selected="selected">0.无物品</option>
|
||
<option th:each="item:${itemNameMap}" th:value="${item.key}"
|
||
th:text="${item.key}+.+${item.value}"></option>
|
||
</select>
|
||
<!--<input type="text" name="itemIds[]" id="itemId_1" style="width: 150px" />-->
|
||
物品数量:<input type="text" name="itemNum" th:id="itemNum_+(${i})" class="input_bg"/>
|
||
<a href="#" th:if="${i} ne 1" class="removeclass">×</a>
|
||
<a href="#" th:if="${i} eq 1" id="AddMoreFileBox" class="btn btn-info">+</a>
|
||
<span class="REWARD"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="row cl">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
<span class="c-red">*</span>
|
||
奖励发放时间:</label>
|
||
<div class="formControls col-xs-8 col-sm-9">
|
||
<input type="text"
|
||
onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'SendTime\')}' })"
|
||
id="SendTime" class="input-text Wdate" style="width:180px;" name="sendTime">
|
||
<span class="SENDTIME"></span>
|
||
</div>
|
||
</div>
|
||
<div class="row cl">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
<span class="c-red">*</span>
|
||
用户注册截止时间:</label>
|
||
<div class="formControls col-xs-8 col-sm-9">
|
||
<input type="text"
|
||
onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'PlayerRTime\')}' })"
|
||
id="PlayerRTime" class="input-text Wdate" style="width:180px;" name="playerRTime">
|
||
<span class="PLAYERRTIME"></span>
|
||
</div>
|
||
</div>
|
||
<div class="row cl">
|
||
<label class="form-label col-xs-4 col-sm-2">
|
||
<span class="c-red">*</span> 有效时间:</label>
|
||
<div class="formControls col-xs-8 col-sm-9" onclick="showInput()">
|
||
<input type="radio" name="effectTime" value="604800" checked="true"> <span>7天</span>
|
||
<input type="radio" style="margin-left: 30px;" name="effectTime" value="0"> <span>永久</span>
|
||
<input type="radio" style="margin-left: 30px;" name="effectTime" value="TheCustom"> <span>自定义</span>
|
||
<input type="text" style="display: none;width: 360px;line-height: 32px; margin-top: 13px;border: 1px solid #c6c6c6;" id="effectTime_input" placeholder=" 单位:天,0:永久" value="" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="row cl">
|
||
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
|
||
<button onClick="return sendSysMail();" class="btn btn-primary radius" type="button"><i
|
||
class="Hui-iconfont"></i> 发送全服邮件
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
|
||
<!--_footer 作为公共模版分离出去-->
|
||
<script type="text/javascript" src="../static/lib/jquery/1.9.1/jquery.min.js"></script>
|
||
<script type="text/javascript" src="../static/lib/layer/2.4/layer.js"></script>
|
||
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
|
||
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
|
||
|
||
<!--请在下方写此页面业务相关的脚本-->
|
||
<script type="text/javascript" src="../static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
|
||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
|
||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
|
||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
|
||
<!-- 多选框 -->
|
||
<script type="text/javascript" src="../static/searchableSelect/js/jquery.searchableSelect.js"></script>
|
||
<script src="../static/bootstrap/js/bootstrap-select.js"></script>
|
||
<!--<script src="../static/bootstrap/js/bootstrap.min.js"></script>-->
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
$('.skin-minimal input').iCheck({
|
||
checkboxClass: 'icheckbox-blue',
|
||
radioClass: 'iradio-blue',
|
||
increaseArea: '20%'
|
||
});
|
||
$("#tab-system").Huitab({
|
||
index: 0
|
||
});
|
||
// 模糊搜素
|
||
$('#InputsWrapper select').searchableSelect();
|
||
});
|
||
|
||
// 下拉框多选
|
||
init();
|
||
|
||
function init() {
|
||
initInfo();
|
||
}
|
||
|
||
// 物品栏是否显示
|
||
function itemShow() {
|
||
var isAttach = document.getElementById("isAttach").value;
|
||
if (isAttach === "0") {
|
||
$("#items").css("display", "none");
|
||
}
|
||
if (isAttach === "1") {
|
||
$("#items").css("display", "block");
|
||
}
|
||
}
|
||
|
||
// 自定义有效时间
|
||
function showInput() {
|
||
var effectTime = $("input[name='effectTime']:checked").val();
|
||
if (effectTime === "TheCustom") {
|
||
$("#effectTime_input").css("display","block");
|
||
} else {
|
||
$("#effectTime_input").css("display","none");
|
||
}
|
||
}
|
||
|
||
function initInfo() {
|
||
$(window).on('load', function () {
|
||
|
||
$('.selectpicker').selectpicker({
|
||
// 'selectedText': 'cat',
|
||
noneSelectedText: '请选择',
|
||
noneResultsText: '没有找到匹配的组织 {0}'
|
||
});
|
||
|
||
$('.selectpicker').selectpicker('refresh');
|
||
|
||
// 检测浏览器的方法由用户自行决定
|
||
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
|
||
$('.selectpicker').selectpicker('mobile');
|
||
}
|
||
});
|
||
}
|
||
|
||
$(document).ready(function () {
|
||
var MaxInputs = 20; //maximum input boxes allowed
|
||
var AddButton = $("#AddMoreFileBox"); //Add button ID
|
||
|
||
var item = "#item_";
|
||
var x = 2; //initlal text box count
|
||
|
||
$(AddButton).click(function (e) //on add input button click
|
||
{
|
||
console.log(x);
|
||
if (x <= MaxInputs) //max input box allowed
|
||
{
|
||
//add input box
|
||
$(item + x).css("display", "block");
|
||
x++;
|
||
return true;
|
||
}
|
||
return false;
|
||
});
|
||
|
||
$("body").on("click", ".removeclass", function (e) { //user click on remove text
|
||
if (x > 2) {
|
||
x--; //decrement textbox
|
||
$(item + x).css("display", "none"); //remove text box
|
||
}
|
||
return false;
|
||
});
|
||
});
|
||
|
||
function sendSysMail() {
|
||
//特殊字符验证
|
||
var reg = new RegExp("[|#]",'g');
|
||
var mailTitle1 = $("input[name='mailTitle1']").val();
|
||
var mailTitle2 = $("input[name='mailTitle2']").val();
|
||
var mailTitle3 = $("input[name='mailTitle3']").val();
|
||
|
||
var mailContent1 = $("textarea[name='mailContent1']").val();
|
||
var mailContent2 = $("textarea[name='mailContent2']").val();
|
||
var mailContent3 = $("textarea[name='mailContent3']").val();
|
||
|
||
if (reg.test(mailTitle1) || reg.test(mailTitle2) || reg.test(mailTitle3)){
|
||
alert("邮件标题不能含有特殊字符");
|
||
return false;
|
||
}
|
||
if (reg.test(mailContent1) || reg.test(mailContent2) || reg.test(mailContent3)){
|
||
alert("邮件正文不能有特殊字符");
|
||
return false;
|
||
}
|
||
|
||
var mailTitle = mailTitle1+"|"+mailTitle2+"|"+mailTitle3;
|
||
var mailContent = mailContent1+"|"+mailContent2+"|"+mailContent3;
|
||
|
||
var serverId = $("#serverId").val().toString();
|
||
|
||
var isAttach = document.getElementById("isAttach").value;
|
||
var sendTime = $("input[name='sendTime']").val();
|
||
var playerRTime = $("#PlayerRTime").val();
|
||
var effectTime = $("input[name='effectTime']:checked").val();
|
||
if (effectTime === "TheCustom"){
|
||
var seconds = document.getElementById("effectTime_input").value;
|
||
effectTime = seconds*24*60*60;
|
||
}
|
||
var version = new Date().getTime() / 1000;
|
||
var itemIds = [];
|
||
var itemNums =[];
|
||
if (isAttach === "1") {
|
||
$("select[name='itemId']").each(function () {
|
||
if($(this).val()!=='0'){
|
||
itemIds.push($(this).val());
|
||
}
|
||
});
|
||
$("input[name='itemNum']").each(function(){
|
||
if($(this).val()!=='') {
|
||
itemNums.push($(this).val());
|
||
}
|
||
});
|
||
}
|
||
if (serverId === '' || serverId == null) {
|
||
alert("服务器id不能为空!");
|
||
return false;
|
||
}
|
||
if (mailTitle == '' || mailTitle == null) {
|
||
alert("邮件标题不能为空!");
|
||
return false;
|
||
}
|
||
if (mailContent == '' || mailContent == null) {
|
||
alert("邮件内容不能为空!");
|
||
return false;
|
||
}
|
||
if (isAttach == "1") {
|
||
if (itemIds.length < 1) {
|
||
alert("带有附件状态,附件不能为空!");
|
||
return false;
|
||
}
|
||
}
|
||
|
||
if (sendTime === "" || sendTime < 0){
|
||
alert("奖励发送时间不能为空!");
|
||
return false;
|
||
}
|
||
|
||
if (playerRTime === "" || playerRTime < 0){
|
||
alert("用户注册时间不能为空!");
|
||
return false;
|
||
}
|
||
|
||
if (effectTime === "" || effectTime < 0){
|
||
alert("有效时间不能为空或小于0!");
|
||
return false;
|
||
}
|
||
|
||
$.ajax({
|
||
type: "POST",
|
||
data:
|
||
JSON.stringify({
|
||
"serverId": serverId,
|
||
"mailTitle": mailTitle,
|
||
"mailContent": mailContent,
|
||
"isAttach": isAttach,
|
||
"itemIds": itemIds,
|
||
"itemNums": itemNums,
|
||
"sendTime": sendTime,
|
||
"playerRTime": playerRTime,
|
||
"effectTime": effectTime,
|
||
"version": version,
|
||
"type": 1
|
||
})
|
||
,
|
||
url: "/sendSysMailWithBack",
|
||
dataType: "json",
|
||
contentType: 'application/json',
|
||
|
||
success: function (data) {
|
||
if (data == 0) {
|
||
layer.msg('发送全服邮件成功!', {icon: 6, time: 1000});
|
||
}
|
||
if (data == 1) {
|
||
layer.msg('发送全服邮件失败!', {icon: 6, time: 1000});
|
||
}
|
||
if (data === 2) {
|
||
layer.msg('发送邮件失败 道具不能为空!', {icon: 6, time: 1000});
|
||
}
|
||
}
|
||
}
|
||
)
|
||
}
|
||
</script>
|
||
<!--/请在上方写此页面业务相关的脚本-->
|
||
</body>
|
||
</html>
|