1.0-version

This commit is contained in:
Administrator
2019-04-11 15:54:34 +08:00
commit 0e902893ca
2222 changed files with 255689 additions and 0 deletions

5553
public/js/bootstrap/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

2036
public/js/bootstrap/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

33
public/js/config.js Normal file
View File

@@ -0,0 +1,33 @@
var message=new Array();
message[0]="操作成功";
message[1]="请正确填写登录账号";
message[2]="请正确填写登录密码";
message[3]="请正确填写验证码";
message[4]="请正确填写密码";
message[5]="两次密码不一致";
message[6]="必添项不得为空";
message[7]="输入项已被占用";
message[8]="当前没有数据";
message[9]="数据长度不符";
message[10]="确认要删除数据吗?";
message[11]="输入项格式不符";
message[12]="原始密码错误";
message[13]="用户名或密码错误";
message[14]="上传文件错误";
message[15]="该数据不存在";
message[16]="手机号被占用";
message[17]="请添加商品信息";
maxlen=10;
minlen=2;
codelen=13;
wait=300;
var statearr=new Array();
statearr[0]="申请";
statearr[1]="投放";
statearr[2]="退钱";
statearr[3]="结束";

485
public/js/func.js Normal file
View File

@@ -0,0 +1,485 @@
$(document).ready(function(){
});
/*
设置页面tip
oid:原始id属性
oclass:原始class属性
nclass:新加class属性
显示文字
*/
function setErrorTips(oid,nclass,txt)
{
$("#"+oid).addClass(nclass);
$("#"+oid).html(txt);
}
/*
清除页面tip
oclass:原始class属性
nclass:新加class属性
显示文字
*/
function clearErrorTips(oclass,nclass)
{
$("."+oclass).each(function(){
$("."+oclass).removeClass(nclass);
$("."+oclass).html("");
});
}
var code ;
function createCode(){
code = "";
var codeLength = 4;
var selectChar = new Array(1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f','g','h','j','k','l','m','n','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z');
for(var i=0;i<codeLength;i++) {
var charIndex = Math.floor(Math.random()*60);
code +=selectChar[charIndex];
}
if(code.length != codeLength){
createCode();
}
if ($("#myCanvas").length>0)
{
var c = document.getElementById("myCanvas");
c.value=code;
}
}
function validate () {
var inputCode = document.getElementById("J_codetext").value;
if(inputCode.length <= 0) {
//alert(message[3]);
return false;
}
else if(inputCode.toLowerCase() != code.toLowerCase() ) {
//alert(message[3]);
createCode();
document.getElementById("J_codetext").value = "";
return false;
}
return true;
}
window.onload=createCode;
var oldTime=null;
/*
确认提示
*/
function tip(txt,func)
{
layer.confirm(txt, {
btn: ['确定']
}, function(index){
layer.close(index);
if (func!=""&&func!=null)
{
func();
}
});
}
/*
向后台发送数据
*/
function sendClientMsg(url,msg,func)
{
var str='';
if (msg!=""&&msg!=null)
{
for(var i in msg)
{
str+='<input type="text" name="'+i+'" value="'+msg[i]+'" style="display:none">';
}
}
if (func!=""&&func!=null)
{
str+='<input type="text" name="clientCallBackFunc" value="'+func+'" style="display:none">';
}
if ($("#form_sendMsg").length==0)
{
//$("body").wrapInner('<form id="form_sendMsg" action="" method="post" target="ifm" enctype="multipart/form-data"></form>');
//$("body").append('<form id="form_sendMsg" action="" method="post" target="ifm" enctype="multipart/form-data"></form>');
$("#msg").wrap('<form id="form_sendMsg" action="" method="post" target="ifm" enctype="multipart/form-data"></form>');
$("#form_sendMsg").append('<div id="clientMsg">'+str+'</div>');
}else
{
$("#clientMsg").remove();
//$("body").append('<iframe id="ifm" style="display:none" name="ifm"></iframe>');
$("#form_sendMsg").append('<div id="clientMsg">'+str+'</div>');
}
if ($("#ifm").length==0)
{
$("body").append('<iframe id="ifm" style="display:none" name="ifm"></iframe>');
}
$("#form_sendMsg").attr("action",url);
$("#form_sendMsg").submit();
//$("#clientMsg").html("");
//$("#ifm").remove();
}
//通信
function ajaxData(_msgtype,_url,_data,_datatype,_func)
{
$.ajax({
type:_msgtype,
url:_url,
data:_data,
//dataType:'json',
dataType:_datatype,
async:false,
success:function(msg){
if (_func!=null)
{
_func(msg);
}
},
error:function(){
alert("错误");
return false;
}
});
}
/*
刷新当前页面
*/
function refresh(msg)
{
window.location.reload();//刷新当前页面.
}
function setLayerAlert(msg)
{
layer.alert(msg, {icon: 6});
}
/*
定时器
*/
function setTime(msg)
{
oldTime=new Date();
var ins=setTimeout(function(){
var newTime=new Date();
var time=newTime.getTime()/1000-oldTime.getTime()/1000;
if (time>=1)
{
msg();
oldTime=new Date();
}
setTimeout(arguments.callee,1000);
},1000);
return ins;
};
//生成从minNum到maxNum的随机数
function randomNum(minNum,maxNum){
switch(arguments.length){
case 1:
return parseInt(Math.random()*minNum+1,10);
break;
case 2:
return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
break;
default:
return 0;
break;
}
}
/*
设置全选
*/
function setAllCheck()
{
$('.checkall').unbind('click');
$(".checkall").click(function(){
$("input[name='id[]']").each(function(){
if (this.checked) {
this.checked = false;
}
else {
this.checked = true;
}
});
})
}
/*
获取选择的广告位
*/
function getCheckBox(name)
{
var _hash={};
$("input[name='"+name+"']").each(function(){
if (this.checked==true) {
var _id=this.value;
var num=$("[name=day_"+_id+"]").val();
var bol=checkNum(num);
if (bol==true)
{
num=parseInt(num);
}
else if (bol==false)
{
num=1;
}
_hash["vacancy_"+_id]=num;
}
});
return _hash;
}
/*
加载页面
*/
function loadPage(page,fun)
{
$("#con").html("");
$("#con").load(String(page), function() {
if (fun!=null)
{
fun();
}
});
}
//上一页
function previousPage(_url,_data,_func)
{
$('.previousPage').unbind('click');
$(".previousPage").click(function (e) {
var _num=parseInt($(".currentpage").html());
if (_num>1)
{
_num=_num-1;
_data['pagecurrent']=_num;
//ajaxData(_msgtype,_url,_data,_datatype,_func);
sendClientMsg(_url,_data,_func);
return false;
}
});
}
//下一页
function nextPage(_url,_data,_func)
{
$('.nextPage').unbind('click');
$(".nextPage").click(function (e) {
var _num=parseInt($(".currentpage").html());
var _totalpage=$(".totalpage").html();
if (_num<parseInt(_totalpage))
{
_num=_num+1;
_data['pagecurrent']=_num;
//ajaxData(_msgtype,_url,_data,_datatype,_func);
sendClientMsg(_url,_data,_func);
return false;
}
});
}
//自选页
function numPage(_url,_data,_func)
{
$('.page_num').unbind('click');
$(".page_num").click(function (e) {
var _num=parseInt($.trim($("[name=my_page]").val()));
if (_num!=""&&_num!=null)
{
var _totalpage=parseInt($(".totalpage").html());
if (_num>=1&&_num<=_totalpage)
{
_data['pagecurrent']=_num;
//ajaxData(_msgtype,_url,_data,_datatype,_func);
sendClientMsg(_url,_data,_func);
return false;
}
}
});
}
function checkInput(inputname)
{
var ins=$('[name="'+inputname+'"]');
var bool=false;
for(var i in ins)
{
if ($.trim(ins[i].value)!='')
{
bool=true;
}
}
return bool;
}
function checkCbLen(cbname)
{
return $("input[name='"+cbname+"']:checked").length;
}
function arrToStr(arr)
{
var str='';
for(var i in arr)
{
str+=arr[i]+'&nbsp;';
}
return str;
}
/*
二维数组转字符串
*/
function arrToString(arr,ico1,ico2)
{
for(j = 0,len=arr.length; j < len; j++)
{
var _str=arr[j].join(ico1);
arr[j]=_str;
}
return arr.join(ico2);
}
/*
判断手机号
*/
function checkPhone(num)
{
if(!(/^1[34578]\d{9}$/.test(num)))
{
return false;
}
return true;
}
/*
判断字符串是否为纯数字或纯字母
*/
function checkRate(num)
{
var bol=true;
//var tmp=false;
var reg=/^[a-zA-Z]+$/;
if(!isNaN(num))
{
return true;
//tmp=true;
/*if (reg.test(num)==false)
{
bol=false;
}*/
}else
{
//bol=false;
if (reg.test(num)==true)
{
return true;
}
}
return false;
//return reg.test(num);
}
/*
判断大于0的整数
*/
function checkNum(num)
{
//var reg=/^(([a-z]+[0-9]+)|([0-9]+[a-z]+))[a-z0-9]*$/i;
var reg = /^\+?[1-9]\d*$/;
return reg.test(num);
}
//关联数组长度
function getObjLength(obj)
{
var count=0;
for(var name in obj){
count++;
}
return count;
}
/*
设置主导航样式
*/
function setNav(allnav,nnav,nclass,oclass)
{
$(allnav).removeClass(oclass);
nnav.addClass(nclass);
}
/*
去掉所有空格
*/
function trimAll(str,is_global)
{
var result;
result = str.replace(/(^\s+)|(\s+$)/g,"");
if(is_global.toLowerCase()=="g")
{
result = result.replace(/\s/g,"");
}
return result;
}
function createSelect(selectname,arr)
{
$(selectname).empty();
var title='<option value="">请选择</option>';
var _str='';
for(var i in arr)
{
_str+='<option value="'+arr[i].id+'">'+arr[i].name+'</option>';
}
$(selectname).append(title+_str);
}
function createTitleSelect(selectname,arr,title)
{
$(selectname).empty();
var title='<option value="">'+title+'</option>';
var _str='';
for(var i in arr)
{
_str+='<option value="'+arr[i].id+'">'+arr[i].name+'</option>';
}
$(selectname).append(title+_str);
}
function createAdSelect(selectname,arr)
{
$(selectname).empty();
var title='<option value="">请选择</option>';
var _str='';
for(var i in arr)
{
_str+='<option value="'+arr[i].id+'">'+arr[i].number+'</option>';
}
$(selectname).append(title+_str);
}
function setSelect(idname,text){
$(idname+" option").each(function (){
if($(this).text()==text){
$(this).attr('selected',true);
}
});
}

11
public/js/index.html Normal file
View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

2
public/js/jquery-1.8.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
public/js/jquery-3.1.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18706
public/js/jquery-ui.js vendored Normal file

File diff suppressed because it is too large Load Diff

4
public/js/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

229
public/js/jquery.md5.js Normal file
View File

@@ -0,0 +1,229 @@
/**
* jQuery MD5 hash algorithm function
*
* <code>
* Calculate the md5 hash of a String
* String $.md5 ( String str )
* </code>
*
* Calculates the MD5 hash of str using the 禄 RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash.
* MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of data. The generated hash is also non-reversable. Data cannot be retrieved from the message digest, the digest uniquely identifies the data.
* MD5 was developed by Professor Ronald L. Rivest in 1994. Its 128 bit (16 byte) message digest makes it a faster implementation than SHA-1.
* This script is used to process a variable length message into a fixed-length output of 128 bits using the MD5 algorithm. It is fully compatible with UTF-8 encoding. It is very useful when u want to transfer encrypted passwords over the internet. If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag).
* This function orginally get from the WebToolkit and rewrite for using as the jQuery plugin.
*
* Example
* Code
* <code>
* $.md5("I'm Persian.");
* </code>
* Result
* <code>
* "b8c901d0f02223f9761016cfff9d68df"
* </code>
*
* @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com >
* @link http://www.semnanweb.com/jquery-plugin/md5.html
* @see http://www.webtoolkit.info/
* @license http://www.gnu.org/licenses/gpl.html [GNU General Public License]
* @param {jQuery} {md5:function(string))
* @return string
*/
(function($){
var rotateLeft = function(lValue, iShiftBits) {
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
}
var addUnsigned = function(lX, lY) {
var lX4, lY4, lX8, lY8, lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
lY4 = (lY & 0x40000000);
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
if (lX4 | lY4) {
if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
else return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
} else {
return (lResult ^ lX8 ^ lY8);
}
}
var F = function(x, y, z) {
return (x & y) | ((~ x) & z);
}
var G = function(x, y, z) {
return (x & z) | (y & (~ z));
}
var H = function(x, y, z) {
return (x ^ y ^ z);
}
var I = function(x, y, z) {
return (y ^ (x | (~ z)));
}
var FF = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var GG = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var HH = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var II = function(a, b, c, d, x, s, ac) {
a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac));
return addUnsigned(rotateLeft(a, s), b);
};
var convertToWordArray = function(string) {
var lWordCount;
var lMessageLength = string.length;
var lNumberOfWordsTempOne = lMessageLength + 8;
var lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - (lNumberOfWordsTempOne % 64)) / 64;
var lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16;
var lWordArray = Array(lNumberOfWords - 1);
var lBytePosition = 0;
var lByteCount = 0;
while (lByteCount < lMessageLength) {
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
lByteCount++;
}
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
return lWordArray;
};
var wordToHex = function(lValue) {
var WordToHexValue = "", WordToHexValueTemp = "", lByte, lCount;
for (lCount = 0; lCount <= 3; lCount++) {
lByte = (lValue >>> (lCount * 8)) & 255;
WordToHexValueTemp = "0" + lByte.toString(16);
WordToHexValue = WordToHexValue + WordToHexValueTemp.substr(WordToHexValueTemp.length - 2, 2);
}
return WordToHexValue;
};
var uTF8Encode = function(string) {
string = string.replace(/\x0d\x0a/g, "\x0a");
var output = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
output += String.fromCharCode(c);
} else if ((c > 127) && (c < 2048)) {
output += String.fromCharCode((c >> 6) | 192);
output += String.fromCharCode((c & 63) | 128);
} else {
output += String.fromCharCode((c >> 12) | 224);
output += String.fromCharCode(((c >> 6) & 63) | 128);
output += String.fromCharCode((c & 63) | 128);
}
}
return output;
};
$.extend({
md5: function(string) {
var x = Array();
var k, AA, BB, CC, DD, a, b, c, d;
var S11=7, S12=12, S13=17, S14=22;
var S21=5, S22=9 , S23=14, S24=20;
var S31=4, S32=11, S33=16, S34=23;
var S41=6, S42=10, S43=15, S44=21;
string = uTF8Encode(string);
x = convertToWordArray(string);
a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
for (k = 0; k < x.length; k += 16) {
AA = a; BB = b; CC = c; DD = d;
a = FF(a, b, c, d, x[k+0], S11, 0xD76AA478);
d = FF(d, a, b, c, x[k+1], S12, 0xE8C7B756);
c = FF(c, d, a, b, x[k+2], S13, 0x242070DB);
b = FF(b, c, d, a, x[k+3], S14, 0xC1BDCEEE);
a = FF(a, b, c, d, x[k+4], S11, 0xF57C0FAF);
d = FF(d, a, b, c, x[k+5], S12, 0x4787C62A);
c = FF(c, d, a, b, x[k+6], S13, 0xA8304613);
b = FF(b, c, d, a, x[k+7], S14, 0xFD469501);
a = FF(a, b, c, d, x[k+8], S11, 0x698098D8);
d = FF(d, a, b, c, x[k+9], S12, 0x8B44F7AF);
c = FF(c, d, a, b, x[k+10], S13, 0xFFFF5BB1);
b = FF(b, c, d, a, x[k+11], S14, 0x895CD7BE);
a = FF(a, b, c, d, x[k+12], S11, 0x6B901122);
d = FF(d, a, b, c, x[k+13], S12, 0xFD987193);
c = FF(c, d, a, b, x[k+14], S13, 0xA679438E);
b = FF(b, c, d, a, x[k+15], S14, 0x49B40821);
a = GG(a, b, c, d, x[k+1], S21, 0xF61E2562);
d = GG(d, a, b, c, x[k+6], S22, 0xC040B340);
c = GG(c, d, a, b, x[k+11], S23, 0x265E5A51);
b = GG(b, c, d, a, x[k+0], S24, 0xE9B6C7AA);
a = GG(a, b, c, d, x[k+5], S21, 0xD62F105D);
d = GG(d, a, b, c, x[k+10], S22, 0x2441453);
c = GG(c, d, a, b, x[k+15], S23, 0xD8A1E681);
b = GG(b, c, d, a, x[k+4], S24, 0xE7D3FBC8);
a = GG(a, b, c, d, x[k+9], S21, 0x21E1CDE6);
d = GG(d, a, b, c, x[k+14], S22, 0xC33707D6);
c = GG(c, d, a, b, x[k+3], S23, 0xF4D50D87);
b = GG(b, c, d, a, x[k+8], S24, 0x455A14ED);
a = GG(a, b, c, d, x[k+13], S21, 0xA9E3E905);
d = GG(d, a, b, c, x[k+2], S22, 0xFCEFA3F8);
c = GG(c, d, a, b, x[k+7], S23, 0x676F02D9);
b = GG(b, c, d, a, x[k+12], S24, 0x8D2A4C8A);
a = HH(a, b, c, d, x[k+5], S31, 0xFFFA3942);
d = HH(d, a, b, c, x[k+8], S32, 0x8771F681);
c = HH(c, d, a, b, x[k+11], S33, 0x6D9D6122);
b = HH(b, c, d, a, x[k+14], S34, 0xFDE5380C);
a = HH(a, b, c, d, x[k+1], S31, 0xA4BEEA44);
d = HH(d, a, b, c, x[k+4], S32, 0x4BDECFA9);
c = HH(c, d, a, b, x[k+7], S33, 0xF6BB4B60);
b = HH(b, c, d, a, x[k+10], S34, 0xBEBFBC70);
a = HH(a, b, c, d, x[k+13], S31, 0x289B7EC6);
d = HH(d, a, b, c, x[k+0], S32, 0xEAA127FA);
c = HH(c, d, a, b, x[k+3], S33, 0xD4EF3085);
b = HH(b, c, d, a, x[k+6], S34, 0x4881D05);
a = HH(a, b, c, d, x[k+9], S31, 0xD9D4D039);
d = HH(d, a, b, c, x[k+12], S32, 0xE6DB99E5);
c = HH(c, d, a, b, x[k+15], S33, 0x1FA27CF8);
b = HH(b, c, d, a, x[k+2], S34, 0xC4AC5665);
a = II(a, b, c, d, x[k+0], S41, 0xF4292244);
d = II(d, a, b, c, x[k+7], S42, 0x432AFF97);
c = II(c, d, a, b, x[k+14], S43, 0xAB9423A7);
b = II(b, c, d, a, x[k+5], S44, 0xFC93A039);
a = II(a, b, c, d, x[k+12], S41, 0x655B59C3);
d = II(d, a, b, c, x[k+3], S42, 0x8F0CCC92);
c = II(c, d, a, b, x[k+10], S43, 0xFFEFF47D);
b = II(b, c, d, a, x[k+1], S44, 0x85845DD1);
a = II(a, b, c, d, x[k+8], S41, 0x6FA87E4F);
d = II(d, a, b, c, x[k+15], S42, 0xFE2CE6E0);
c = II(c, d, a, b, x[k+6], S43, 0xA3014314);
b = II(b, c, d, a, x[k+13], S44, 0x4E0811A1);
a = II(a, b, c, d, x[k+4], S41, 0xF7537E82);
d = II(d, a, b, c, x[k+11], S42, 0xBD3AF235);
c = II(c, d, a, b, x[k+2], S43, 0x2AD7D2BB);
b = II(b, c, d, a, x[k+9], S44, 0xEB86D391);
a = addUnsigned(a, AA);
b = addUnsigned(b, BB);
c = addUnsigned(c, CC);
d = addUnsigned(d, DD);
}
var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
return tempValue.toLowerCase();
}
});
})(jQuery);

BIN
public/js/layer-v3.0.3.zip Normal file

Binary file not shown.

2
public/js/layer/layer.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

107
public/js/map.js Normal file
View File

@@ -0,0 +1,107 @@
var map, district, polygons = [], citycode;
var citySelect = document.getElementById('city');
var province=null;
var func=null;
var provincename="";
var cityname="";
function setDistrict()
{
$("#city").append('<option value="">请选择</option>');
//行政区划查询
var opts = {
subdistrict: 1, //返回下一级行政区
level: 'city',
showbiz:false //查询行政级别为 市
};
district = new AMap.DistrictSearch(opts);//注意:需要使用插件同步下发功能才能这样直接使用
district.search('中国', function(status, result) {
if(status=='complete'){
getData(result.districtList[0]);
}
});
}
function getData(data)
{
var subList = data.districtList;
province=subList;
var level = data.level;
//清空下一级别的下拉列表
if (level === 'province') {
nextLevel = 'city';
$("#city").empty();
}
if (subList) {
var contentSub =new Option('请选择');
for (var i = 0, l = subList.length; i < l; i++) {
var name = subList[i].name;
var levelSub = subList[i].level;
var cityCode = subList[i].citycode;
if(i==0){
document.querySelector('#' + levelSub).add(contentSub);
}
contentSub=new Option(name);
contentSub.setAttribute("value", levelSub);
contentSub.center = subList[i].center;
contentSub.adcode = subList[i].adcode;
document.querySelector('#' + levelSub).add(contentSub);
}
if (provincename!="")
{
$("#province option").each(function (){
if($(this).text()==provincename){
$(this).attr('selected',true);
var checkIndex=$("#province").get(0).selectedIndex;
var obj = document.getElementById("province");
provincename="";
search(obj.options[checkIndex]);
}
});
}
if (provincename==""&&cityname!="")
{
$("#city option").each(function (){
if($(this).text()==cityname){
cityname="";
$(this).attr('selected',true);
}
});
}
}
$("#province").change(function(){
var checkIndex=$("#province").get(0).selectedIndex;
search(this[checkIndex]);
});
}
function customProvince(_provincename,_cityname)
{
provincename=_provincename;
cityname=_cityname;
setDistrict();
}
function search(option)
{
//var option = obj[obj.options.selectedIndex];
var keyword = option.text; //关键字
var adcode = option.adcode;
district.setLevel(option.value); //行政区级别
district.setExtensions('all');
//行政区查询
//按照adcode进行查询可以保证数据返回的唯一性
district.search(adcode, function(status, result) {
if(status === 'complete'){
getData(result.districtList[0]);
}
});
}