网站
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

biddingBigDataDetail.js 26 KiB

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