网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

470 lines
26 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "biddingApi", "itemsApi"], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. timeArray: {
  9. d: '',
  10. h: '',
  11. m: '',
  12. s: '',
  13. },
  14. timer:null,
  15. setimer:null,
  16. outProjectInformationDetail:{}
  17. },
  18. };
  19. var tools = new Tools();
  20. module.init = function (page) {
  21. tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation,true);
  22. tools.doGet(webConfig, {}, module.webConfigInformation, true)
  23. var nowTime = new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"));
  24. $("#nowDateNYR").html(nowTime.getFullYear()+'.'+(nowTime.getMonth()+1)+'.'+nowTime.getDate())
  25. setInterval(function () {
  26. var nowTime = new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"));
  27. $("#nowDateSFM").html(nowTime.toLocaleTimeString());
  28. $("#nowTime").html('服务器时间:'+nowTime.getFullYear()+'.'+(nowTime.getMonth()+1)+'.'+nowTime.getDate()+' '+nowTime.toLocaleTimeString());
  29. },1000)
  30. tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation,true);
  31. if (getQueryVariable('type') == 'Y'){
  32. setInterval(function (){
  33. tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  34. tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation2,true);
  35. },5000)
  36. }
  37. };
  38. //获取地址栏参数
  39. function getQueryVariable(variable){
  40. var query = window.location.search.substring(1);
  41. var vars = query.split("&");
  42. for (var i=0;i<vars.length;i++) {
  43. var pair = vars[i].split("=");
  44. if(pair[0] == variable){return pair[1];}
  45. }
  46. return(false);
  47. }
  48. //获取地址栏参数
  49. rechSelect = function (){
  50. tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation,true);
  51. }
  52. //项目基本信息
  53. module.outProjectInformation = function (data) {
  54. if (data.code == 200) {
  55. var content = data.data;
  56. module.data.outProjectInformationDetail = content;
  57. // var outProjectInformationData = template('outProjectInformationData', module.data);
  58. // $("#outProjectInformationContent").html(outProjectInformationData);
  59. //挂牌价格字典
  60. tools.doGet(Dictionaries+'/price_unit', {}, (data)=>{
  61. if (data.code == 200) {
  62. var unit = eval(data.data).filter(function (e) { return e.dictValue == content.unit;})[0].dictLabel;
  63. module.data.outProjectInformationDetail.unit = unit;
  64. var outProjectInformationData = template('outProjectInformationData', module.data);
  65. $("#outProjectInformationContent").html(outProjectInformationData);
  66. var outProjectInformationData2 = template('outProjectInformationData2', module.data);
  67. $("#outProjectInformationContent2").html(outProjectInformationData2);
  68. }
  69. },true);
  70. //竞价方式字典
  71. tools.doGet(Dictionaries+'/bidding_type', {}, (data)=>{
  72. if (data.code == 200) {
  73. var biddingType = eval(data.data).filter(function (e) { return e.dictValue == content.biddingType;})[0].dictLabel;
  74. module.data.outProjectInformationDetail.biddingType = biddingType;
  75. var outProjectInformationData = template('outProjectInformationData', module.data);
  76. $("#outProjectInformationContent").html(outProjectInformationData);
  77. var outProjectInformationData2 = template('outProjectInformationData2', module.data);
  78. $("#outProjectInformationContent2").html(outProjectInformationData2);
  79. }
  80. },true);
  81. //期满处理字典
  82. tools.doGet(Dictionaries+'/bidding_direct', {}, (data)=>{
  83. if (data.code == 200) {
  84. var biddingDirect = eval(data.data).filter(function (e) { return e.dictValue == content.biddingDirect;})[0].dictLabel;
  85. module.data.outProjectInformationDetail.biddingDirect = biddingDirect;
  86. var outProjectInformationData = template('outProjectInformationData', module.data);
  87. $("#outProjectInformationContent").html(outProjectInformationData);
  88. var outProjectInformationData2 = template('outProjectInformationData2', module.data);
  89. $("#outProjectInformationContent2").html(outProjectInformationData2);
  90. }
  91. },true);
  92. //交易项目竞价记录
  93. tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  94. //倒计时
  95. module.data.timer = setInterval(function(){
  96. let signupStartTime = module.data.outProjectInformationDetail.signupStartTime;
  97. let signupStopTime = module.data.outProjectInformationDetail.signupStopTime;
  98. let biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime;
  99. let biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;//延时后结束时间
  100. let biddingStopSetime = module.data.outProjectInformationDetail.biddingStopSetime;//原始结束时间
  101. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  102. var difference = Date.parse(biddingStopTime)-nowTime;//延时后时间差
  103. var differenceSetime = Date.parse(biddingStopSetime)-nowTime;//原始时间差
  104. var centerTime = content.delayPeriod * 1000//延时周期
  105. var m,s;
  106. m = Math.floor(difference/1000/60%60);
  107. s = Math.floor(difference/1000%60);
  108. if(s%2 == 0&&centerTime!=0){
  109. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
  110. if (data.code == 200) {
  111. module.data.outProjectInformationDetail.biddingStopTime = data.data
  112. }
  113. },true);
  114. }
  115. if ( differenceSetime <= 0 && difference >= 0 && difference <= centerTime){
  116. module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime);
  117. if (s < 1 && m < 1){
  118. console.log("竞价结束22222222222")
  119. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){
  120. if (data.code == 200) {
  121. module.data.outProjectInformationDetail.biddingStopTime = data.data
  122. let timeNew = Date.parse(data.data) + 0 - nowTime;
  123. if (timeNew > 0) {
  124. module.data.outProjectInformationDetail.biddingStopTime = data.data;
  125. }else{
  126. $('#countDown').html('竞价结束')
  127. return;
  128. }
  129. }
  130. },true);
  131. }else if(s%2 == 0&&centerTime!=0){
  132. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
  133. if (data.code == 200) {
  134. module.data.outProjectInformationDetail.biddingStopTime = data.data
  135. }
  136. },true);
  137. }
  138. }else{
  139. module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime);
  140. }
  141. },1000);
  142. }
  143. }
  144. //项目基本信息
  145. module.outProjectInformation2 = function (data) {
  146. if (data.code == 200) {
  147. var content = data.data;
  148. $("#bmrs").html(content.bidderNum);
  149. $("#cjcs").html(content.bidPriceNum);
  150. }
  151. }
  152. //竞价记录
  153. module.biddinglistInformation = function (data) {
  154. if (data.code == 200) {
  155. //console.log(data)
  156. var content = data.rows;
  157. // for (var i = 0; i < content.length-1; i++) {
  158. // for (var j = 0; j < content.length - 1 - i; j++) {
  159. // // 相邻元素两两对比,元素交换,大的元素交换到后面
  160. // if (content[j].money < content[j + 1].money) {
  161. // var temp = content[j];
  162. // content[j] = content[j+1];
  163. // content[j+1] = temp;
  164. // }
  165. // }
  166. // }
  167. //console.log(content)
  168. module.data.biddinglistInformationDetail = content;
  169. var biddingInformationData = template('biddingInformationData', module.data);
  170. $("#biddingInformationContent").html(biddingInformationData);
  171. if (content.length > 0){
  172. $("#biddingPeople").html(content[0].memberId);
  173. $("#biddingMoney").html(content[0].money+module.data.outProjectInformationDetail.unit);
  174. }else{
  175. $("#biddingPeople").html('无');
  176. $("#biddingMoney").html('无');
  177. }
  178. }
  179. }
  180. module.dataCompare = function(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){
  181. var signupStartTime = signupStartTime;
  182. var signupStopTime = signupStopTime;
  183. var biddingStartTime = biddingStartTime;
  184. var biddingStopTime = biddingStopTime;
  185. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  186. var beginTimes=signupStartTime.substring(0,10).split('-');
  187. var endTimes=signupStopTime.substring(0,10).split('-');
  188. var biddingBeginTimes=biddingStartTime.substring(0,10).split('-');
  189. var biddingEndTimes=biddingStopTime.substring(0,10).split('-');
  190. signupStartTime=beginTimes[1]+'/'+beginTimes[2]+'/'+beginTimes[0]+' '+signupStartTime.substring(10,19);
  191. signupStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+signupStopTime.substring(10,19);
  192. biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19);
  193. biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19);
  194. //时间差
  195. var leftTime = Date.parse(biddingStopTime)-nowTime;
  196. //报名开始时间差
  197. var signupLeftTime = Date.parse(signupStartTime)-nowTime;
  198. //报名结束时间差
  199. var signDownLeftTime = Date.parse(signupStopTime)-nowTime;
  200. var centerTime = module.data.delayPeriod * 1000//延时周期
  201. //定义变量 d,h,m,s保存倒计时的时间
  202. var d,h,m,s;
  203. if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  204. //正在竞价
  205. module.data.biddingTimeType = 1;
  206. $('#d0').html(
  207. (
  208. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  209. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  210. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  211. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  212. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  213. )[0]
  214. );
  215. $('#d1').html(
  216. (
  217. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  218. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  219. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  220. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  221. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  222. )[1]
  223. );
  224. $('#d2').html(
  225. (
  226. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  227. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  228. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  229. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  230. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  231. )[2]
  232. );
  233. $('#h0').html(((Math.floor(leftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[0]);
  234. $('#h1').html(((Math.floor(leftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[1]);
  235. $('#m0').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  236. $('#m1').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  237. $('#s0').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  238. $('#s1').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  239. //tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  240. $('#countType').html('距竞价结束还有')
  241. }else if (nowTime>Date.parse(biddingStopTime)){
  242. //竞价结束
  243. $('#d0').html('0')
  244. $('#d1').html('0')
  245. $('#d2').html('0')
  246. $('#h0').html('0')
  247. $('#h1').html('0')
  248. $('#m0').html('0')
  249. $('#m1').html('0')
  250. $('#s0').html('0')
  251. $('#s1').html('0')
  252. $('#countType').html('竞价结束')
  253. module.data.biddingTimeType = 2;
  254. }else if (nowTime<Date.parse(biddingStartTime)){
  255. //竞价暂未开始
  256. $('#d0').html('0')
  257. $('#d1').html('0')
  258. $('#d2').html('0')
  259. $('#h0').html('0')
  260. $('#h1').html('0')
  261. $('#m0').html('0')
  262. $('#m1').html('0')
  263. $('#s0').html('0')
  264. $('#s1').html('0')
  265. $('#countType').html('暂未开始')
  266. module.data.biddingTimeType = 3;
  267. }
  268. if(Date.parse(signupStartTime)<nowTime&&nowTime<Date.parse(signupStopTime)){
  269. //正在报名
  270. module.data.signupTimeType = 1;
  271. $('#d0').html(((Math.floor(signDownLeftTime / 1000 / 60 / 60 / 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) : Math.floor(leftTime / 1000 / 60 / 60 / 24) + '')[0]);
  272. $('#d1').html(((Math.floor(signDownLeftTime / 1000 / 60 / 60 / 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) : Math.floor(leftTime / 1000 / 60 / 60 / 24) + '')[1]);
  273. $('#d2').html(((Math.floor(signDownLeftTime / 1000 / 60 / 60 / 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) : Math.floor(leftTime / 1000 / 60 / 60 / 24) + '')[2]);
  274. $('#h0').html(((Math.floor(signDownLeftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[0]);
  275. $('#h1').html(((Math.floor(signDownLeftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[1]);
  276. $('#m0').html(((Math.floor(signDownLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  277. $('#m1').html(((Math.floor(signDownLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  278. $('#s0').html(((Math.floor(signDownLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  279. $('#s1').html(((Math.floor(signDownLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  280. $('#countType').html('距报名结束还有')
  281. }else if (nowTime>Date.parse(signupStopTime)){
  282. //报名结束
  283. module.data.signupTimeType = 2;
  284. }else if (nowTime<Date.parse(signupStartTime)){
  285. //报名暂未开始
  286. module.data.signupTimeType = 3;
  287. $('#d0').html(((Math.floor(signupLeftTime / 1000 / 60 / 60 / 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) : Math.floor(leftTime / 1000 / 60 / 60 / 24) + '')[0]);
  288. $('#d1').html(((Math.floor(signupLeftTime / 1000 / 60 / 60 / 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) : Math.floor(leftTime / 1000 / 60 / 60 / 24) + '')[1]);
  289. $('#d2').html(((Math.floor(signupLeftTime / 1000 / 60 / 60 / 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) : Math.floor(leftTime / 1000 / 60 / 60 / 24) + '')[2]);
  290. $('#h0').html(((Math.floor(signupLeftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[0]);
  291. $('#h1').html(((Math.floor(signupLeftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[1]);
  292. $('#m0').html(((Math.floor(signupLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  293. $('#m1').html(((Math.floor(signupLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  294. $('#s0').html(((Math.floor(signupLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  295. $('#s1').html(((Math.floor(signupLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  296. $('#countType').html('距报名开始还有')
  297. }
  298. // if(module.data.outProjectInformationDetail.biddingType != '拍卖' && module.data.biddingTimeType != 2){
  299. // document.getElementById('biddingTable').style.display = 'none';
  300. // document.getElementById('biddingTitle').style.display = 'block';
  301. // }
  302. }
  303. module.setimeDataCompare = function(){
  304. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
  305. if (data.code == 200) {
  306. module.data.outProjectInformationDetail.biddingStopTime = data.data
  307. }
  308. },true);
  309. var biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime
  310. var biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;
  311. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  312. var biddingBeginTimes=biddingStartTime.substring(0,10).split('-');
  313. var biddingEndTimes=biddingStopTime.substring(0,10).split('-');
  314. biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19);
  315. biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19);
  316. //时间差
  317. var leftTime = Date.parse(biddingStopTime)-nowTime;
  318. //定义变量 d,h,m,s保存倒计时的时间
  319. var d,h,m,s;
  320. if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  321. //正在竞价
  322. module.data.biddingTimeType = 1;
  323. $('#d0').html(
  324. (
  325. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  326. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  327. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  328. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  329. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  330. )[0]
  331. );
  332. $('#d1').html(
  333. (
  334. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  335. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  336. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  337. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  338. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  339. )[1]
  340. );
  341. $('#d2').html(
  342. (
  343. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  344. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  345. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  346. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  347. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  348. )[2]
  349. );
  350. $('#h0').html(((Math.floor(leftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[0]);
  351. $('#h1').html(((Math.floor(leftTime / 1000 / 60 / 60 % 24) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 / 60 % 24) : Math.floor(leftTime / 1000 / 60 / 60 % 24) + '')[1]);
  352. $('#m0').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  353. $('#m1').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  354. $('#s0').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  355. $('#s1').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  356. let d,h,m,s;
  357. d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
  358. h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
  359. m = Math.floor(leftTime / 1000 / 60 % 60);
  360. s = Math.floor(leftTime / 1000 % 60);
  361. if (d<1&&h<1&&m<1&&s<1){
  362. console.log('竞价结束')
  363. clearInterval(module.data.setimer)
  364. }
  365. //tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  366. $('#countType').html('距竞价结束还有')
  367. }
  368. }
  369. //网站配置信息
  370. module.webConfigInformation = function (data) {
  371. if (data.code == 200) {
  372. var content = data.data;
  373. //console.log(content)
  374. //document.getElementById('time').innerHTML = '延时周期:'+content[8].configValue+content[8].remark+'<i class="wh">?</i>'
  375. module.data.timeConfig = content[8].configValue;
  376. module.data.titleConfig = content[9].configValue;
  377. module.data.importantTitle = content[7].configName+':'+ content[7].configValue.substr(3).substr(0,(content[7].configValue.substr(3).length-4));
  378. module.data.know = content[6].configValue;
  379. $("#know").html(content[6].configValue + '<span style="margin-left: 10px;"></span>' + content[6].configValue);
  380. }
  381. }
  382. module.biddingDirectDictionaries = function (data) {
  383. if (data.code == 200 && module.data.outProjectInformationDetail.biddingDirect!='') {
  384. var content = data.data;
  385. var biddingDirect = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingDirect;})[0].dictLabel;
  386. module.data.outProjectInformationDetail.biddingDirect = biddingDirect;
  387. }
  388. }
  389. module.unitDictionaries = function (data) {
  390. if (data.code == 200 && module.data.outProjectInformationDetail.unit!='') {
  391. var content = data.data;
  392. var unit = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.unit;})[0].dictLabel;
  393. module.data.outProjectInformationDetail.unit = unit;
  394. }
  395. }
  396. module.biddingTypeDictionaries = function (data) {
  397. if (data.code == 200 && module.data.outProjectInformationDetail.biddingType!='') {
  398. var content = data.data;
  399. console.log(eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingType;}))
  400. var biddingType = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingType;})[0].dictLabel;
  401. module.data.outProjectInformationDetail.biddingType = biddingType;
  402. }
  403. }
  404. return module;
  405. });