diff --git a/static/js/common/tools.js b/static/js/common/tools.js index 82e24c1..0dbd047 100644 --- a/static/js/common/tools.js +++ b/static/js/common/tools.js @@ -1,9 +1,10 @@ +var serverApi = '' define(['jquery', 'dialog'], function ($, dialog) { // 工具类 function Tool() { this.version = "1.0.0"; this.description = "这是一个工具类"; - this.serverApi = 'aaa'; + } var ajaxJsUrl = "/api"; @@ -346,7 +347,7 @@ define(['jquery', 'dialog'], function ($, dialog) { * getNowFormatDate 获取时间 * @param */ - getNowFormatDate:function () { + getNowFormatDate: function () { var date = new Date(); var seperator1 = "-"; var seperator2 = ":"; @@ -385,21 +386,21 @@ define(['jquery', 'dialog'], function ($, dialog) { * webConfigInformation 网站配置信息 * @param */ - webConfigInformation : function (data) { - console.log(data) + webConfigInformation: function (data) { + if (data.code == 200) { var content = data.data; $("#webConfigName").html(content[0].configValue); $("#webConfigRecord").html(content[1].configValue + content[2].configValue); - $("#webConfigAddress").html(content[0].configValue+' '+content[3].configValue); - this.serverApi = content[11].configValue; + $("#webConfigAddress").html(content[0].configValue + ' ' + content[3].configValue); + serverApi = content[11].configValue; } }, /** * webConfigInformation 网站配置信息 * @param */ - removeAllCookie : function () { + removeAllCookie: function () { var keys = document.cookie.match(/[^ =;]+(?==)/g) if (keys) { for (var i = keys.length; i--;) { diff --git a/static/js/project/listingItems/itemsList.js b/static/js/project/listingItems/itemsList.js index 41a954e..8c00a1d 100644 --- a/static/js/project/listingItems/itemsList.js +++ b/static/js/project/listingItems/itemsList.js @@ -1,20 +1,21 @@ /** * Created by Administrator on 2021/4/5. */ -define(['jquery', "template", "Tools", "itemsApi", "paging",'dateTime'], function ($, template, Tools ) { +define(['jquery', "template", "Tools", "itemsApi", "paging", 'dateTime'], function ($, template, Tools) { //数据存储 var module = { data: { //服务器地址 - serverApi:'http://219.148.186.198:8082/ruoyi-admin', + // serverApi: 'http://219.148.186.198:8082/ruoyi-admin', + serverApi: '', //标的物类型 - deptTypeList:[], + deptTypeList: [], //标的物所在地 - deptLocationList:[], + deptLocationList: [], //标的物二级所在地 - deptSecondLocationList:[], + deptSecondLocationList: [], //新闻列表 - itemsInformationList:'', + itemsInformationList: '', //页码 pageNum: 1, //页码集合 @@ -22,35 +23,35 @@ define(['jquery', "template", "Tools", "itemsApi", "paging",'dateTime'], functio //每页数量 pageSize: 20, //总页数 - pageCount:0, + pageCount: 0, //标的物集合长度 - deptSize:24, + deptSize: 24, //标的物选中项id - deptId:'', + deptId: '', //标的所在地选中 - secondDeptId:'', + secondDeptId: '', //标的物类型ID - projectNumber:'', + projectNumber: '', //项目状态 - projectShowStatus:'', + projectShowStatus: '', //报名开始时间 - signupStartTime:'', + signupStartTime: '', //报名结束时间 - signupStopTime:'', + signupStopTime: '', //竞价开始时间 - biddingStartTime:'', + biddingStartTime: '', //竞价结束时间 - biddingStopTime:'', - form:{ - deptId:'', - projectNumber:'', - projectShowStatus:'', - signupStartTime:'', - signupStopTime:'', - biddingStartTime:'', - biddingStopTime:'', - pageNum:1, - pageSize:1, + biddingStopTime: '', + form: { + deptId: '', + projectNumber: '', + projectShowStatus: '', + signupStartTime: '', + signupStopTime: '', + biddingStartTime: '', + biddingStopTime: '', + pageNum: 1, + pageSize: 1, } }, }; @@ -58,64 +59,60 @@ define(['jquery', "template", "Tools", "itemsApi", "paging",'dateTime'], functio module.init = function (page) { - if(getQueryVariable('projectCode') || getQueryVariable('projectName') || getQueryVariable('projectNumber')){ + if (getQueryVariable('projectCode') || getQueryVariable('projectName') || getQueryVariable('projectNumber')) { console.log('首页进入') tools.doGet(itemsList, { - deptId:100, - pageNum:module.data.pageNum, - pageSize:module.data.pageSize, - projectCode:getQueryVariable('projectCode'), - projectName:getQueryVariable('projectName'), - projectNumber:getQueryVariable('projectNumber') + deptId: 100, + pageNum: module.data.pageNum, + pageSize: module.data.pageSize, + projectCode: getQueryVariable('projectCode'), + projectName: getQueryVariable('projectName'), + projectNumber: getQueryVariable('projectNumber') }, module.itemList, true); - }else{ + } else { //新闻资讯 - tools.doGet(itemsList, {deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.itemList, true); + tools.doGet(itemsList, { deptId: 100, pageNum: module.data.pageNum, pageSize: module.data.pageSize }, module.itemList, true); } //标的物类型 - tools.doGet(webDeptType+"/project_type", {}, module.deptType, true); + tools.doGet(webDeptType + "/project_type", {}, module.deptType, true); //标的物所在地 - tools.doGet(webDept, {deptId:''}, module.deptLocation, true); + tools.doGet(webDept, { deptId: '' }, module.deptLocation, true); //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号) tools.getWebConfig(); - console.log(tools) - setTimeout(function () { - module.data.serverApi = tools.serverApi; - console.log(tools.serverApi) - },5000) + $("#signStartTimeStr").datetime({ - type:"date", - value:[2019,9,31], - success:function(res){ + type: "date", + value: [2019, 9, 31], + success: function (res) { console.log(res) } }) $("#signEndTimeStr").datetime({ - type:"date", - value:[2019,9,31], - success:function(res){ + type: "date", + value: [2019, 9, 31], + success: function (res) { console.log(res) } }) $("#auctionStartTimeStr").datetime({ - type:"date", - value:[2019,9,31], - success:function(res){ + type: "date", + value: [2019, 9, 31], + success: function (res) { console.log(res) } }) $("#endTimeStr").datetime({ - type:"date", - value:[2019,9,31], - success:function(res){ + type: "date", + value: [2019, 9, 31], + success: function (res) { console.log(res) } }) @@ -124,41 +121,46 @@ define(['jquery', "template", "Tools", "itemsApi", "paging",'dateTime'], functio }; //获取地址栏参数 - function getQueryVariable(variable){ + function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); - for (var i=0;i