网站
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.

biddingBigDataDetail.js 25 KiB

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