庞东旭 2 місяці тому
джерело
коміт
c8d9219d16
15 змінених файлів з 2536 додано та 87 видалено
  1. +2
    -2
      sunVillage_info/index.html
  2. +100
    -0
      sunVillage_info/login.html
  3. +145
    -0
      sunVillage_info/operatingAssets.html
  4. +62
    -83
      sunVillage_info/static/css/login.css
  5. +131
    -0
      sunVillage_info/static/css/operatingAssets.css
  6. BIN
      sunVillage_info/static/images/login_icon_01.png
  7. BIN
      sunVillage_info/static/images/login_icon_02.png
  8. BIN
      sunVillage_info/static/images/login_icon_03.png
  9. +8
    -1
      sunVillage_info/static/js/api/index.js
  10. +1451
    -0
      sunVillage_info/static/js/api/user.js
  11. +5
    -0
      sunVillage_info/static/js/common/main.js
  12. +148
    -1
      sunVillage_info/static/js/common/tools.js
  13. +2
    -0
      sunVillage_info/static/js/lib/jsencrypt/jsencrypt.min.js
  14. +406
    -0
      sunVillage_info/static/js/project/login.js
  15. +76
    -0
      sunVillage_info/static/js/project/operatingAssets.js

+ 2
- 2
sunVillage_info/index.html Переглянути файл

@@ -35,7 +35,7 @@

<div class="new" style="justify-content: space-between;">

<div class="new_list">
<div class="new_list" onclick="window.open('incomeAndExpenditure.html')">
<div class="new_list_tit">
<p>收支明细公开</p>
<p>详情</p>
@@ -50,7 +50,7 @@
</div>
</div>

<div class="new_list">
<div class="new_list" onclick="window.open('operatingAssets.html')">
<div class="new_list_tit">
<p>经营性资产情况公开</p>
<p>详情</p>


+ 100
- 0
sunVillage_info/login.html Переглянути файл

@@ -0,0 +1,100 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN" xml:lang="zh-CN">

<head>
<meta charset="utf-8">
<title>用户登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" cxontent="" />
<link href="static/css/main.css" rel="stylesheet" type="text/css" />
<link href="static/css/index.css" rel="stylesheet" type="text/css" />
<link href="static/css/login.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="main" id="page">
<!--顶部Title -->
<!--LOGO search -->
<canvas id="canvas"></canvas>
<div class="header flex_dom flex_item_between flex_item_mid">
<div id="titContent">
<span id="tt">阳光三资公示公开</span>
<span>YANG GUANG SAN ZI GONG SHI GONG KAI</span>
</div>
<div class="flex_dom flex_item_between flex_item_mid">
<div class="header_nav">
<p>2025年7月14日 18:12:56</p>
<p>星期一</p>
</div>
</div>
</div>

<div class="registerBody" id="registerBody">
<div class="w-1200">
<div class="loginView">
<div class="titleTab">
<p id="loginBtn">用户登录</p>
<!-- <p id="phoneBtn" onclick="loginTab('phone')">快捷登录</p>-->
<div class="clear"></div>
</div>
<table id="loginTab" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<div>
<img src="static/images/login_icon_1.png" style="width: 20px;height: 20px;" alt="">
<input type="text" id="username" placeholder="请输入手机号"/>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div>
<img src="static/images/login_icon_2.png" style="width: 20px;height: 20px;" alt="">
<input type="password" id="password" placeholder="请输入密码"/>
</div>
</td>
</tr>
<tr>
<td>
<div>
<img src="static/images/login_icon_3.png" style="width: 20px;height: 20px;" alt="">
<input type="text" id="code" placeholder="请输入验证码"/>
</div>
</td>
<td><img id="graphicImg" alt=""/></td>
</tr>
</table>
<table id="phoneTab" style="display: none;">
<tr>
<td width="25%">手机号码</td>
<td colspan="2"><input type="text" placeholder="请输入手机号" id="mobile"/></td>
</tr>
<tr>
<td>图形验证</td>
<td><input type="text" placeholder="请输入验证码" id="mobileCode"/></td>
<td><img id="mobileGraphicImg" alt=""/></td>
</tr>
<tr>
<td>验<i style="margin-left: 0.5em;"></i>证<i style="margin-left: 0.5em;"></i>码</td>
<td width="40%"><input type="text" placeholder="请输入验证码" id="smsCode"/></td>
<td><input type="button" value="发送验证码" class="fsYzm" id="getSmsCode"/></td>
</tr>
</table>
<!-- <div class="remberPsw" id="remberPsw" style="display: block;">-->
<!-- <input type="checkbox"/>记住密码-->
<!-- </div>-->
<input type="button" value="登录" id="login-submit" class="loginBtn"/>
<!-- <input type="button" value="注册" onclick="window.location='register.html'" class="registerBtn"/>-->
</div>
</div>
</div>

<p id="zcdw">支持单位:中农融信(北京)科技股份有限公司</p>
</div>
</body>
<script src="static/js/common/require.js" data-main="static/js/common/main.js?t=101" id="require-page"
target-module="static/js/project/login.js" defer type="text/javascript"></script>
</html>

+ 145
- 0
sunVillage_info/operatingAssets.html Переглянути файл

@@ -0,0 +1,145 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN" xml:lang="zh-CN">

<head>
<meta charset="utf-8">
<title>农村资源信息港</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="incomeAndExpenditure" cxontent="" />
<link href="static/css/main.css" rel="stylesheet" type="text/css" />
<link href="static/css/index.css" rel="stylesheet" type="text/css" />
<link href="static/css/operatingAssets.css" rel="stylesheet" type="text/css" />
<link href="../static/css/dateTime.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="main" id="page">

<div class="header flex_dom flex_item_between flex_item_mid">
<div id="titContent">
<span id="tt">阳光三资公示公开</span>
<span>YANG GUANG SAN ZI GONG SHI GONG KAI</span>
</div>
<div class="wid25 flex_dom flex_item_between flex_item_mid">
<div class="header_nav">
<p>2025年7月14日 18:12:56</p>
<p>星期一</p>
</div>
<div class="user_box">
<p>用户名</p>
<img src="static/images/user_icon.png" alt="">
</div>
</div>
</div>

<div class="new_main" style="height: 65vh;">

<div class="new_flex">

<p class="tab_link">首页 > 公开 > 经营性资产情况公开</p>

<div class="search_main">
<p>查询年月</p>
<div style="position:relative;margin-right: 10px;">
<select class="data_input datas_input">
<option>自用</option>
<option>闲置</option>
</select>
</div>
<p class="search_btn">查询</p>
<p class="search_rest">重置</p>
</div>

<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>序号</td>
<td>资产名称</td>
<td>使用状态</td>
<td>原值</td>
<td>构建时间</td>
<td>数量</td>
<td>单位</td>
<td>承租人</td>
<td>合同金额</td>
</tr>
<tr>
<td>序号</td>
<td>资产名称</td>
<td>使用状态</td>
<td>原值</td>
<td>构建时间</td>
<td>数量</td>
<td>单位</td>
<td>承租人</td>
<td>合同金额</td>
</tr>
<tr>
<td>序号</td>
<td>资产名称</td>
<td>使用状态</td>
<td>原值</td>
<td>构建时间</td>
<td>数量</td>
<td>单位</td>
<td>承租人</td>
<td>合同金额</td>
</tr>
<tr>
<td>序号</td>
<td>资产名称</td>
<td>使用状态</td>
<td>原值</td>
<td>构建时间</td>
<td>数量</td>
<td>单位</td>
<td>承租人</td>
<td>合同金额</td>
</tr>
<tr>
<td>序号</td>
<td>资产名称</td>
<td>使用状态</td>
<td>原值</td>
<td>构建时间</td>
<td>数量</td>
<td>单位</td>
<td>承租人</td>
<td>合同金额</td>
</tr>
</table>

</div>


</div>


<div class="footer_main" >

<div class="footer">

<div class="footer_link_company">
<div>
<p id="phone">投诉电话:0631-12345678</p>
<p id="zcdw">支持单位:中农融信(北京)科技股份有限公司</p>
</div>
</div>

</div>

<div class="footer_link_filings">
<div class="footer_link_filings_left">
<p>手机扫码进入移动端</p>
<p>移动端操作更方便、快捷</p>
</div>
<img src="static/images/ewm.png" id="ewm" alt="">
</div>

</div>
</div>
</body>
<script src="./static/js/common/require.js" data-main="./static/js/common/main.js?t=101" id="require-page" target-module="./static/js/project/operatingAssets.js" defer type="text/javascript"></script>
</html>

+ 62
- 83
sunVillage_info/static/css/login.css Переглянути файл

@@ -1,47 +1,30 @@
input:-webkit-autofill,

input:-webkit-autofill:hover,

input:-webkit-autofill:focus,

input:-webkit-autofill:active {
-webkit-transition-delay: 111111s;

-webkit-transition: color 11111s ease-out, background-color 111111s ease-out;

}
.registerBody{
background: url("../images/login_bg.jpg");
width: 100%;
height: 100%;
background-size: 100% 100%;
text-align: center;
/*border-top: 2px solid var(--color);*/
}
.loginView_bg{
background: rgba(18,105,211,0.3);
text-align: center;
width: 440px;
margin: 0 auto;
padding: 50px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
border-radius: 8px;
height: 402px;

.header{
background: #ffffff;
padding: 0 10%;
width: 100%;
}

#page{
background: none;
}

#canvas{
display: none;
}

.loginView{
background: #FFFFFF;
text-align: center;
width: 420px;
margin: 0 auto;
padding: 50px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
border-radius: 8px;
height: 382px;
margin-top: 100px;
padding-bottom: 50px;
}

.loginView p{
@@ -54,7 +37,7 @@ input:-webkit-autofill:active {
}

.loginView table{
width: 100%;
width: 75%;
margin: 0 auto;
}

@@ -62,52 +45,42 @@ input:-webkit-autofill:active {
text-align: left;
}

.loginView table tr td:first-child{
}

.loginView table tr td{
padding-top: 20px;
position: relative;
}
.nameIcon{
width: 23px;
height: 23px;
display: block;
background: url('../images/login_01.png') no-repeat;
position: absolute;
bottom: 8px;
}
.passIcon{
width: 23px;
height: 23px;
display: block;
background: url('../images/login_02.png') no-repeat;
position: absolute;
bottom: 8px;
}
.codeIcon{
width: 23px;
height: 23px;
display: block;
background: url('../images/login_03.png') no-repeat;
position: absolute;
bottom: 8px;

.loginView table tr td div{
background: #f6f6f6;
display: flex;
align-items: center;
padding: 5px 15px;
border-radius: 50px;
}

.loginView table tr td input[type="text"],input[type="password"]{
height: 35px;
border-bottom: 1px solid #cfcfcf;
padding-left: 30px;
border: none;
padding-left: 5px;
width: 100%;
background: #f6f6f6;
}

.titleTab{
background: var(--color);
background: #ffffff;
}

.titleTab p{
float: left;
display: block;
line-height: 76px;
width: 50%;
width: 100%;
text-align: center;
color: #7fbdba;
color: #000000;
font-size: 24px;
font-weight: bold;
}

.titleTab p:hover{
@@ -119,10 +92,10 @@ input:-webkit-autofill:active {
}

.remberPsw{
width: 100%;
width: 72%;
margin: 0 auto;
text-align: left;
margin-top: 50px;
margin-top: 20px;
}

.remberPsw input[type="checkbox"]{
@@ -131,14 +104,14 @@ input:-webkit-autofill:active {
}

.loginBtn{
width: 100%;
width: 70%;
padding: 10px 0;
border: none;
background: #1269d3;
background: linear-gradient( 87deg, #187CF4 0%, #2538FE 100%);
color: #ffffff;
display: block;
margin: 0 auto;
margin-top: 20px;
margin-top: 30px;
cursor: pointer;
}

@@ -153,25 +126,31 @@ input:-webkit-autofill:active {
}

.fsYzm{
height: 35px;
height: 45px;
border: 1px solid #cfcfcf;
width: 100%;
}
#zcdw{
position: absolute;
bottom: 0;
text-align: center;
/* left: 50%; */
width: 100%;
color: #ffffff;
}
#graphicImg{
height: 45px;
border-radius: 50px;
}

.topLogo{
margin: 0 auto;
padding-top: 2%;
.logoSearch{
height: calc(100vh - 865px);
}

.topLogo p{
font-size: 60px;
font-weight: bold;
color: #1269d3;
.logoSearch .logoSearch-div{
top: 2vh;
}

.bottomInformation_login{
position: absolute;
bottom: 3%;
width: 100%;
color: #010101;
}
#userLogin{
padding: 0;
}

+ 131
- 0
sunVillage_info/static/css/operatingAssets.css Переглянути файл

@@ -0,0 +1,131 @@
.new_main{
width: 100%;
margin: 0 auto;
height: 65vh;
display: flex;
background: #ffffff;
align-items: center;
justify-content: center;
}
.new_flex{
width: 75%;
margin: 0 auto;
height: 65vh;
}
.new_main table{
border: 1px solid #eeeeee;
margin-top: 30px;
}
.new_main table tr td{
border: 1px solid #eeeeee;
text-align: center;
padding: 10px 0;
}
.new_main table tr:nth-child(1) td{
background: #F0F6FE;
}
.report-title {
font-size: 20px;
font-weight: bold;
text-align: center;
line-height: 24px;
margin-bottom: 2px;
position: relative;
}
.main-title {
margin-bottom: 5px;
padding: 0 10px;
height: 33px;
line-height: 33px;
color: #333;
font-size: 13px;
display: flex;
}
.main-title .company {
text-align: left;
display: inline-block;
width: 30%;
}
.main-title .nper {
display: inline-block;
width: 40%;
text-align: center;
}
.main-title .amountOf {
display: inline-block;
width: 30%;
text-align: right;
}

.balance-main {
background: #fff;
margin: 17px auto 0;
padding-bottom: 10px;
}
.tab_link{
margin: 20px 0;
}
.search_main{
display: flex;
background: #F7F8FA;
height: 80px;
align-items: center;
padding: 0 20px;
}
.data_input {
float: left;
width: 190px;
height: 26px;
background: #ffffff;
border: 1px solid #E5E5E5;
border-radius: 4px;
text-indent: 10px;
margin-left: 15px;
font-size: 14px;
}
.datas_input::-webkit-input-placeholder {
color: #999;
}

.datas_input:-moz-placeholder {
color: #999;
}

.datas_input:-ms-input-placeholder {
color: #999;
}
.input_data_icon {
position: absolute;
width: 18px;
right: 10px;
top: 4px;
}
.centerRight-list1-form input,
select {
background-color: transparent;
border: 1px solid #bfbfbf;
height: 26px;
padding-left: 5px;
width: 170px;
}
.search_btn{
background: linear-gradient( 91deg, #187CF4 0%, #2538FE 100%);
border-radius: 2px 2px 2px 2px;
width: 80px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
line-height: 1;
}
.search_rest{
background: #ffffff;
border-radius: 2px 2px 2px 2px;
width: 80px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
}

BIN
sunVillage_info/static/images/login_icon_01.png Переглянути файл

Перед Після
Ширина: 32  |  Висота: 32  |  Розмір: 927 B

BIN
sunVillage_info/static/images/login_icon_02.png Переглянути файл

Перед Після
Ширина: 32  |  Висота: 32  |  Розмір: 478 B

BIN
sunVillage_info/static/images/login_icon_03.png Переглянути файл

Перед Після
Ширина: 32  |  Висота: 32  |  Розмір: 1.1 KiB

+ 8
- 1
sunVillage_info/static/js/api/index.js Переглянути файл

@@ -1,7 +1,7 @@
/*--------------
* 获取用户、登录、注册相关
-----------------*/
var captchaImage_get = '/captchaImage'; //图形验证码接口
var captchaImage_get = '/gkyzm'; //图形验证码接口
var login_post = '/login'; //用户登录接口
var getInfo_get = '/getInfo' //获取用户信息
/*
@@ -39,6 +39,13 @@ var newsDetail = '/open/house/web/get/' //查询新闻详情
*/
var assetList = '/open/asset/list' //查询资产列表


/*
@purl /transaction/website/config
@param
*/
var webConfig = '/transaction/website/config'//查询网站配置信息

/*
@purl /open/asset/get
*/


+ 1451
- 0
sunVillage_info/static/js/api/user.js
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 5
- 0
sunVillage_info/static/js/common/main.js Переглянути файл

@@ -29,6 +29,7 @@ requirejs.config({
ajaxUploadImage:'lib/ajaxUpload/ajaxupload',//上传图片
kindeditor:'lib/kindeditor/kindeditor-all',
zhCN:'lib/kindeditor/lang/zh-CN',
jsencrypt:'lib/jsencrypt/jsencrypt.min'//加密解密
},
shim: {
bootstrap: {
@@ -61,6 +62,10 @@ requirejs.config({
deps: ['jquery'],
exports: 'ajaxUploadImage'
},
jsencrypt: {
deps: ['jquery'],
exports: 'jsencrypt'
}
}
});



+ 148
- 1
sunVillage_info/static/js/common/tools.js Переглянути файл

@@ -2,7 +2,8 @@ var serverApi = '';
var friendsLinksList = [];
var themeColor = '';
var logo = '';
define(['jquery', 'dialog'], function ($, dialog) {
var lastTime = 0.00;
define(['jquery', 'dialog','jsencrypt'], function ($, dialog,JSEncrypt) {
// 工具类
function Tool() {
this.version = "1.0.0";
@@ -59,6 +60,47 @@ define(['jquery', 'dialog'], function ($, dialog) {
}
});
},
doPostSign: function (url, data, cb, Bearer) {
var _this = this;
// data.deptId = 100 ;
// console.log(data)
var headAttribute = '';
if (Bearer && Bearer == true || _this.getCookie('Admin-Token') == '') {
headAttribute = function (xhr) {
xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8');
}
} else {
headAttribute = function (xhr) {
xhr.setRequestHeader("Content-Type", 'application/json;charset=utf-8');
xhr.setRequestHeader('Authorization', 'Bearer ' + _this.getCookie('Admin-Token'))
}
}
$.ajax({
url: ajaxJsUrl + url + '?=' + Math.random(),
type: 'POST',
data: data,
dataType: 'json',
contentType: false,
processData: false, // jQuery不要去处理发送的数据
success: function (data) {
var code = data.code;
var msg = data.msg;
if (code === 401) {
_this.removeAllCookie();
_this.initDialog('系统提示', '登录状态已过期,您可以继续留在该页面,或者重新登录', function () {
_this.skip('/view/login/login.html')
}, '重新登录', function () { }, "取消")
} else if (code === 500) {
_this.initError(msg)
cb(data);
} else if (code != 200) {
_this.initError(msg)
} else {
cb(data);
}
}
});
},
/**
* ajax post
* @param url (String)
@@ -426,6 +468,38 @@ define(['jquery', 'dialog'], function ($, dialog) {
console.log(currentdate)
return currentdate;
},
/**
* getNowFormatDateNew 获取时间
* @param
*/
getNowFormatDateNew: function (data) {
var date = data;
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var day = date.getDate();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (day >= 0 && day <= 9) {
day = "0" + day;
}
if (hours >= 0 && hours <= 9) {
hours = "0" + hours;
}
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + day + " " + hours + seperator2 + minutes + seperator2 + seconds;
console.log(currentdate)
return currentdate;
},
/**
* getWebConfig 网站配置信息
* @param
@@ -461,6 +535,8 @@ define(['jquery', 'dialog'], function ($, dialog) {
$("#webConfigAddress").html(content[0].configValue + '<span style="margin-left: 10px;"></span>' + content[3].configValue);
serverApi = content[11].configValue;

lastTime = parseFloat(content[8].configValue);

}
},
/**
@@ -476,6 +552,77 @@ define(['jquery', 'dialog'], function ($, dialog) {
location.reload();
}
},
/**
* encrypt 加密
* @param
*/
encrypt: function (txt) {
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' +
'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
const encryptor = new JSEncrypt()
encryptor.setPublicKey(publicKey) // 设置公钥
return encryptor.encrypt(txt) // 对数据进行加密
},
/**
* encrypt 解密
* @param
*/
decrypt: function (txt) {
const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' +
'7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' +
'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' +
'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' +
'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' +
'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' +
'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' +
'UP8iWi1Qw0Y='
const encryptor = new JSEncrypt()
encryptor.setPrivateKey(privateKey) // 设置私钥
return encryptor.decrypt(txt) // 对数据进行解密
},

format: function (time, format) {
var t = new Date(time);
var tf = function (i) { return (i < 10 ? '0' : '') + i };
return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) {
switch (a) {
case 'yyyy':
return tf(t.getFullYear());
break;
case 'MM':
return tf(t.getMonth() + 1);
break;
case 'mm':
return tf(t.getMinutes());
break;
case 'dd':
return tf(t.getDate());
break;
case 'HH':
return tf(t.getHours());
break;
case 'ss':
return tf(t.getSeconds());
break;
}
})
},

/**
* 计算出相差天数
* @param secondSub
*/
formatTotalDateSub: function (secondSub) {
var days = Math.floor(secondSub / (24 * 3600)); // 计算出小时数
var leave1 = secondSub % (24*3600) ; // 计算天数后剩余的毫秒数
var hours = Math.floor(leave1 / 3600); // 计算相差分钟数
var leave2 = leave1 % (3600); // 计算小时数后剩余的毫秒数
var minutes = Math.floor(leave2 / 60); // 计算相差秒数
var leave3 = leave2 % 60; // 计算分钟数后剩余的毫秒数
var seconds = Math.round(leave3);
return days + "天" + hours + "时" + minutes + "分" + seconds + '秒';
}

});
return Tool;
});

+ 2
- 0
sunVillage_info/static/js/lib/jsencrypt/jsencrypt.min.js
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 406
- 0
sunVillage_info/static/js/project/login.js Переглянути файл

@@ -0,0 +1,406 @@

/**
* Created by admin on 2021/4/5.
*
*/
define(['jquery', "Tools","user"], function ($, Tools) {
//数据存储
var module = {
uuid: '', //验证码uuid
computeTime:60,
timer:null,
loginType:'login'
};
//自定义公共方法
var tools = new Tools();

// 可调参数
var BACKGROUND_COLOR = "#4A97F4"; // 背景颜色
var POINT_NUM = 100; // 星星数目
var POINT_COLOR = "rgba(255,255,255,0.7)"; // 点的颜色
var LINE_LENGTH = 10000; // 点之间连线长度(的平方)

// 创建背景画布
var cvs = document.createElement("canvas");
cvs.width = window.innerWidth;
cvs.height = window.innerHeight;
cvs.style.cssText = "\
position:fixed;\
top:0px;\
left:0px;\
z-index:-1;\
opacity:1.0;\
";
document.body.appendChild(cvs);

var ctx = cvs.getContext("2d");

var startTime = new Date().getTime();

//默认进入页面加载方法
module.init = function (page) {
//点击登录
$('#login-submit').on('click', module.login)
//点击图形验证码
$('#graphicImg').on('click', module.verificationCode)
//点击图形验证码
$('#mobileGraphicImg').on('click', module.verificationCode1)
//点击发送验证码
$('#getSmsCode').on('click', module.getSmsCode)
//图形验证码加载
module.verificationCode()
//背景高度
module.register()
//网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
tools.getWebConfig();
document.onkeydown = function (event) {
var e = event || window.event;
if (e && e.keyCode == 13) { //回车键的键值为13
$("#login-submit").click(); //调用登录按钮的登录事件
}
};
initPoints(POINT_NUM);
drawFrame();
};

//随机数函数
function randomInt(min, max) {
return Math.floor((max - min + 1) * Math.random() + min);
}

function randomFloat(min, max) {
return (max - min) * Math.random() + min;
}

//构造点类
function Point() {
this.x = randomFloat(0, cvs.width);
this.y = randomFloat(0, cvs.height);

var speed = randomFloat(0.3, 1.4);
var angle = randomFloat(0, 2 * Math.PI);

this.dx = Math.sin(angle) * speed;
this.dy = Math.cos(angle) * speed;

this.r = 1.2;

this.color = POINT_COLOR;
}

Point.prototype.move = function () {
this.x += this.dx;
if (this.x < 0) {
this.x = 0;
this.dx = -this.dx;
} else if (this.x > cvs.width) {
this.x = cvs.width;
this.dx = -this.dx;
}
this.y += this.dy;
if (this.y < 0) {
this.y = 0;
this.dy = -this.dy;
} else if (this.y > cvs.height) {
this.y = cvs.height;
this.dy = -this.dy;
}
}

Point.prototype.draw = function () {
ctx.fillStyle = this.color;
ctx.beginPath();
ctx.arc(this.x, this.y, this.r, 0, Math.PI * 2);
ctx.closePath();
ctx.fill();
}

var points = [];

function initPoints(num) {
for (var i = 0; i < num; ++i) {
points.push(new Point());
}
}

var p0 = new Point(); //鼠标
p0.dx = p0.dy = 0;
var degree = 2.5;
document.onmousemove = function (ev) {
p0.x = ev.clientX;
p0.y = ev.clientY;
}
document.onmousedown = function (ev) {
degree = 5.0;
p0.x = ev.clientX;
p0.y = ev.clientY;
}
document.onmouseup = function (ev) {
degree = 2.5;
p0.x = ev.clientX;
p0.y = ev.clientY;
}
window.onmouseout = function () {
p0.x = null;
p0.y = null;
}

function drawLine(p1, p2, deg) {
var dx = p1.x - p2.x;
var dy = p1.y - p2.y;
var dis2 = dx * dx + dy * dy;
if (dis2 < 2 * LINE_LENGTH) {
if (dis2 > LINE_LENGTH) {
if (p1 === p0) {
p2.x += dx * 0.03;
p2.y += dy * 0.03;
} else return;
}
var t = (1.05 - dis2 / LINE_LENGTH) * 0.2 * deg;
ctx.strokeStyle = "rgba(255,255,255," + t + ")";
ctx.beginPath();
ctx.lineWidth = 1.5;
ctx.moveTo(p1.x, p1.y);
ctx.lineTo(p2.x, p2.y);
ctx.closePath();
ctx.stroke();
}
return;
}

//绘制每一帧
function drawFrame() {
cvs.width = window.innerWidth;
cvs.height = window.innerHeight;
ctx.fillStyle = BACKGROUND_COLOR;
ctx.fillRect(0, 0, cvs.width, cvs.height);

var arr = (p0.x == null ? points : [p0].concat(points));
for (var i = 0; i < arr.length; ++i) {
for (var j = i + 1; j < arr.length; ++j) {
drawLine(arr[i], arr[j], 1.0);
}
arr[i].draw();
arr[i].move();
}

window.requestAnimationFrame(drawFrame);
}

module.getSmsCode = function () {
var mobile = $('#mobile').val();

tools.doPost(getSmsCode, {mobile:mobile,code:$('#mobileCode').val(),uuid:module.uuid}, module.getSmsCodeAjax, true)
}

module.getSmsCodeAjax = function (data) {
module.uuid = data.uuid;
module.computeTime = 60;
module.timer = setInterval(() => {
module.computeTime--;
document.getElementById('getSmsCode').value = module.computeTime;
if (module.computeTime <= 0) {
clearInterval(module.timer);
document.getElementById('getSmsCode').value = '发送验证码';
}
}, 1000);
}

//底部友情链接
module.bottomFriendsLinks = function (data) {
if (data.code == 200) {
var content = data.data;
console.log(content)
module.data.friendsLinksList = content;
var friendsLinksData = template('friendsLinksData', module.data);
$("#friendsLinksContent").html(friendsLinksData);
}
}
/*-----------------------------自定义方法-------------------------------------*/
//登录方式切换
loginTab = function(type){
document.getElementById('loginTab').style.display = 'none'
document.getElementById('remberPsw').style.display = 'none'
document.getElementById('phoneTab').style.display = 'none'
document.getElementById(type+'Tab').style.display = 'block'
module.loginType = type;

if (type == 'phone'){
//图形验证码加载
module.verificationCode1()
}

if (type == 'login'){
//图形验证码加载
module.verificationCode()
document.getElementById('remberPsw').style.display = 'block'
}

$('#loginBtn').attr('class','')
$('#phoneBtn').attr('class','')
$('#'+type+'Btn').attr('class','active')
}
//背景高度
module.register = function(){
document.getElementById('registerBody').style.height = (document.body.offsetHeight - 112) +'px';
}
//图形验证码
module.verificationCode = function () {
tools.doGet(captchaImage_get, {}, module.verificationAjax, true)
}
module.verificationAjax = function (data) {
if (data.code == 200) {
$('#graphicImg').attr('src', 'data:image/gif;base64,' + data.img)
module.uuid = data.uuid;
}
}

//图形验证码
module.verificationCode1 = function () {
tools.doGet(captchaImage_get, {}, module.verificationAjax1, true)
}
module.verificationAjax1 = function (data) {
if (data.code == 200) {
$('#mobileGraphicImg').attr('src', 'data:image/gif;base64,' + data.img)
module.uuid = data.uuid;
}
}
//用户登录
module.login = function () {
if (module.check()) {
var data = {};

var usernameVal = tools.encrypt($('#username').val());
var passwordVal = tools.encrypt($('#password').val());
var codeVal = $('#code').val();

var mobile = $('#mobile').val();
var mobileCode = $('#mobileCode').val();
var smsCode = $('#smsCode').val();

data['uuid'] = module.uuid;

if(module.loginType == 'login'){
data['username'] = usernameVal;
data['password'] = passwordVal;
data['code'] = codeVal;
tools.doPost(login_post, data, module.loginData, true)
}

if(module.loginType == 'phone'){
data['mobile'] = mobile;
data['smsCode'] = smsCode;
data['code'] = mobileCode;
tools.doPost(login_sms_post, data, module.loginData, true)
}
}
};
//手动验证表单
module.check = function () {
var usernameVal = $('#username').val();
var passwordVal = $('#password').val();
var codeVal = $('#code').val();

var mobile = $('#mobile').val();
var mobileCode = $('#mobileCode').val();
var smsCode = $('#smsCode').val();

var type = module.loginType;

if (type == 'login'){
/* 手机号 */
if (usernameVal == '') {
$('#username')[0].focus()
tools.initTips('请输入用户名', 'right', $('#username')[0], 2000)
return false;
}
/* 密码 */
if (passwordVal == '') {
$('#password')[0].focus()
tools.initTips('请输入密码', 'right', $('#password')[0], 2000)
return false;
} else if (parseInt(passwordVal.length) < 6 || parseInt(passwordVal.length) > 18) {
$('#password')[0].focus()
tools.initTips('请输入正确格式密码', 'right', $('#password')[0], 2000)
return false;
}
/*图形验证码*/
if (module.uuid == '' || codeVal == '') {
$('#code')[0].focus()
tools.initTips('请输入图形验证码', 'right', $('#code')[0], 2000)
return false;
}
}
if (type == 'phone'){
/* 手机号 */
if (mobile == '') {
$('#mobile')[0].focus()
tools.initTips('请输入手机号码', 'right', $('#mobile')[0], 2000)
return false;
}
/*图形验证码*/
if (module.uuid == '' || mobileCode == '') {
$('#mobileCode')[0].focus()
tools.initTips('请输入图形验证码', 'right', $('#mobileCode')[0], 2000)
return false;
}
/* 密码 */
if (smsCode == '') {
$('#smsCode')[0].focus()
tools.initTips('请输入验证码', 'right', $('#smsCode')[0], 2000)
return false;
}
}


return true;
}
//登录校验
module.loginData = function (data) {
console.log(data)
if (data.code == 500) {

if (module.loginType == 'login'){
module.verificationCode()
}
if (module.loginType == 'phone'){
module.verificationCode1()
}

} else {
tools.setCookie('Admin-Token', data.token, 24 * 60 * 60)
//用户资料
tools.doGet(userData, {}, module.userData);
//tools.skip('/')
}
}
//个人中心用户信息
module.userData = function(data){
if (data.code == 200) {
var content = data.user;
console.log(content)
tools.setCookie('userId', content.userId, 24 * 60 * 60);
tools.doGet(userMember + '/' + content.userId, {}, module.userMember);//memberType 1个人 2单位
}
}

//个人中心用户资料
module.userMember = function(data){
if (data.code == 200) {
var content = data.data;
tools.setCookie('userName', content.realname, 24 * 60 * 60);
tools.setCookie('memberId', content.id, 24 * 60 * 60);
tools.setCookie('idCardNum',content.idCardNum,24 * 60 * 60)
tools.setCookie('phone',content.phone,24 * 60 * 60)
tools.setCookie('address',content.address,24 * 60 * 60)
tools.setCookie('bankAddress',content.bankAddress,24 * 60 * 60)
tools.setCookie('bankCardName',content.bankCardName,24 * 60 * 60)
tools.setCookie('bankCardNum',content.bankCardNum,24 * 60 * 60)
tools.setCookie('accountType',content.accountType,24 * 60 * 60)
tools.setCookie('payeePaymentLines',content.payeePaymentLines,24 * 60 * 60)
tools.setCookie('bankType',content.bankType,24 * 60 * 60)
tools.skip('/sunVillage_info/index.html')
}
}
return module;
});

+ 76
- 0
sunVillage_info/static/js/project/operatingAssets.js Переглянути файл

@@ -0,0 +1,76 @@
/**
* Created by Administrator on 2021/4/5.
*/
define(['jquery', "template", "Tools", 'swiper', 'dateTime'], function ($, template, Tools, swiper) {
//数据存储
var module = {
data: {
//服务器地址
serverApi:'',
//焦点图数据
focusList: [],
communicateList: [],
newImgList:[]
},
};
var tools = new Tools();

module.init = function (page) {
tools.doGet(webList, { configKey: 'web.open' }, module.webList , true);

$("#signStartTimeStr").datetime({
type: "date",
value: [new Date().getFullYear(),new Date().getMonth()+1,new Date().getDate()],
success: function (res) {
//console.log(res)
}
})
};

module.newsList = function (data) {
if (data.code == 200) {
var content = data.rows;
module.data.newList = content;
var newListData = template('newListData', module.data);
$("#newListContent").html(newListData);

var newImgList = [];
content.map(rr=>{
if (rr.infoImg!=null&&rr.infoImg!=""){
newImgList.push(rr.infoImg);
}
})
module.data.newImgList = newImgList;
var newListDataImg = template('newListDataImg', module.data);
$("#bannerFocusNextContent").html(newListDataImg);
}
}

module.webList = function (data) {
if (data.code == 200) {
var content = data.rows;

content.map(rr=>{
if (rr.configKey == 'web.open.technique'){
$("#zcdw").html(rr.configValue);
}
if (rr.configKey == "web.open.phone"){
$("#phone").html(rr.configValue);
}
if (rr.configKey == "web.open.qrcode"){
$('#ewm').attr('src', rr.configValue);
}
if (rr.configKey == "web.open.title"){
$("#tt").html(rr.configValue);
}
})

}
}

searchChange = function () {
tools.doGet(newsList, {pageNum:1,pageSize:8,infoName:$("#searchInput").val()}, module.newsList , true);
}

return module;
});

Завантаження…
Відмінити
Зберегти