网站
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

477 řádky
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. 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. module.data.outProjectInformationDetail.projectShowStatus = '竞价结束';
  127. var biddingInformationData = template('biddingInformationData', module.data);
  128. $("#biddingInformationContent").html(biddingInformationData);
  129. return;
  130. }
  131. }
  132. },true);
  133. }else if(s%2 == 0&&centerTime!=0){
  134. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
  135. if (data.code == 200) {
  136. module.data.outProjectInformationDetail.biddingStopTime = data.data
  137. }
  138. },true);
  139. }
  140. }else{
  141. module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime);
  142. }
  143. },1000);
  144. }
  145. }
  146. //项目基本信息
  147. module.outProjectInformation2 = function (data) {
  148. if (data.code == 200) {
  149. var content = data.data;
  150. $("#bmrs").html(content.bidderNum);
  151. $("#cjcs").html(content.bidPriceNum);
  152. }
  153. }
  154. //竞价记录
  155. module.biddinglistInformation = function (data) {
  156. if (data.code == 200) {
  157. //console.log(data)
  158. var content = data.rows;
  159. // for (var i = 0; i < content.length-1; i++) {
  160. // for (var j = 0; j < content.length - 1 - i; j++) {
  161. // // 相邻元素两两对比,元素交换,大的元素交换到后面
  162. // if (content[j].money < content[j + 1].money) {
  163. // var temp = content[j];
  164. // content[j] = content[j+1];
  165. // content[j+1] = temp;
  166. // }
  167. // }
  168. // }
  169. //console.log(content)
  170. module.data.biddinglistInformationDetail = content;
  171. var biddingInformationData = template('biddingInformationData', module.data);
  172. $("#biddingInformationContent").html(biddingInformationData);
  173. if (content.length > 0){
  174. if((module.data.outProjectInformationDetail.biddingType=='自由竞价'||module.data.outProjectInformationDetail.biddingType=='1')&&module.data.outProjectInformationDetail.projectShowStatus=='正在竞价'){
  175. $("#biddingMoney").html('*');
  176. $("#biddingPeople").html('*');
  177. }else{
  178. $("#biddingMoney").html(content[0].money+module.data.outProjectInformationDetail.unit);
  179. $("#biddingPeople").html(content[0].memberId);
  180. }
  181. }else{
  182. $("#biddingPeople").html('无');
  183. $("#biddingMoney").html('无');
  184. }
  185. }
  186. }
  187. module.dataCompare = function(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){
  188. var signupStartTime = signupStartTime;
  189. var signupStopTime = signupStopTime;
  190. var biddingStartTime = biddingStartTime;
  191. var biddingStopTime = biddingStopTime;
  192. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  193. var beginTimes=signupStartTime.substring(0,10).split('-');
  194. var endTimes=signupStopTime.substring(0,10).split('-');
  195. var biddingBeginTimes=biddingStartTime.substring(0,10).split('-');
  196. var biddingEndTimes=biddingStopTime.substring(0,10).split('-');
  197. signupStartTime=beginTimes[1]+'/'+beginTimes[2]+'/'+beginTimes[0]+' '+signupStartTime.substring(10,19);
  198. signupStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+signupStopTime.substring(10,19);
  199. biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19);
  200. biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19);
  201. //时间差
  202. var leftTime = Date.parse(biddingStopTime)-nowTime;
  203. //报名开始时间差
  204. var signupLeftTime = Date.parse(signupStartTime)-nowTime;
  205. //报名结束时间差
  206. var signDownLeftTime = Date.parse(signupStopTime)-nowTime;
  207. var centerTime = module.data.delayPeriod * 1000//延时周期
  208. //定义变量 d,h,m,s保存倒计时的时间
  209. var d,h,m,s;
  210. if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  211. //正在竞价
  212. module.data.biddingTimeType = 1;
  213. $('#d0').html(
  214. (
  215. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  216. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  217. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  218. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  219. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  220. )[0]
  221. );
  222. $('#d1').html(
  223. (
  224. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  225. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  226. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  227. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  228. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  229. )[1]
  230. );
  231. $('#d2').html(
  232. (
  233. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  234. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  235. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  236. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  237. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  238. )[2]
  239. );
  240. $('#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]);
  241. $('#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]);
  242. $('#m0').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  243. $('#m1').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  244. $('#s0').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  245. $('#s1').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  246. //tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  247. $('#countType').html('距竞价结束还有')
  248. }else if (nowTime>Date.parse(biddingStopTime)){
  249. //竞价结束
  250. $('#d0').html('0')
  251. $('#d1').html('0')
  252. $('#d2').html('0')
  253. $('#h0').html('0')
  254. $('#h1').html('0')
  255. $('#m0').html('0')
  256. $('#m1').html('0')
  257. $('#s0').html('0')
  258. $('#s1').html('0')
  259. $('#countType').html('竞价结束')
  260. module.data.biddingTimeType = 2;
  261. }else if (nowTime<Date.parse(biddingStartTime)){
  262. //竞价暂未开始
  263. $('#d0').html('0')
  264. $('#d1').html('0')
  265. $('#d2').html('0')
  266. $('#h0').html('0')
  267. $('#h1').html('0')
  268. $('#m0').html('0')
  269. $('#m1').html('0')
  270. $('#s0').html('0')
  271. $('#s1').html('0')
  272. $('#countType').html('暂未开始')
  273. module.data.biddingTimeType = 3;
  274. }
  275. if(Date.parse(signupStartTime)<nowTime&&nowTime<Date.parse(signupStopTime)){
  276. //正在报名
  277. module.data.signupTimeType = 1;
  278. $('#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]);
  279. $('#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]);
  280. $('#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]);
  281. $('#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]);
  282. $('#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]);
  283. $('#m0').html(((Math.floor(signDownLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  284. $('#m1').html(((Math.floor(signDownLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  285. $('#s0').html(((Math.floor(signDownLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  286. $('#s1').html(((Math.floor(signDownLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  287. $('#countType').html('距报名结束还有')
  288. }else if (nowTime>Date.parse(signupStopTime)){
  289. //报名结束
  290. module.data.signupTimeType = 2;
  291. }else if (nowTime<Date.parse(signupStartTime)){
  292. //报名暂未开始
  293. module.data.signupTimeType = 3;
  294. $('#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]);
  295. $('#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]);
  296. $('#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]);
  297. $('#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]);
  298. $('#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]);
  299. $('#m0').html(((Math.floor(signupLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  300. $('#m1').html(((Math.floor(signupLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  301. $('#s0').html(((Math.floor(signupLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  302. $('#s1').html(((Math.floor(signupLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  303. $('#countType').html('距报名开始还有')
  304. }
  305. // if(module.data.outProjectInformationDetail.biddingType != '拍卖' && module.data.biddingTimeType != 2){
  306. // document.getElementById('biddingTable').style.display = 'none';
  307. // document.getElementById('biddingTitle').style.display = 'block';
  308. // }
  309. }
  310. module.setimeDataCompare = function(){
  311. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
  312. if (data.code == 200) {
  313. module.data.outProjectInformationDetail.biddingStopTime = data.data
  314. }
  315. },true);
  316. var biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime
  317. var biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;
  318. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  319. var biddingBeginTimes=biddingStartTime.substring(0,10).split('-');
  320. var biddingEndTimes=biddingStopTime.substring(0,10).split('-');
  321. biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19);
  322. biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19);
  323. //时间差
  324. var leftTime = Date.parse(biddingStopTime)-nowTime;
  325. //定义变量 d,h,m,s保存倒计时的时间
  326. var d,h,m,s;
  327. if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  328. //正在竞价
  329. module.data.biddingTimeType = 1;
  330. $('#d0').html(
  331. (
  332. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  333. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  334. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  335. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  336. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  337. )[0]
  338. );
  339. $('#d1').html(
  340. (
  341. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  342. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  343. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  344. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  345. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  346. )[1]
  347. );
  348. $('#d2').html(
  349. (
  350. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  351. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  352. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  353. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  354. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  355. )[2]
  356. );
  357. $('#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]);
  358. $('#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]);
  359. $('#m0').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  360. $('#m1').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  361. $('#s0').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  362. $('#s1').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  363. let d,h,m,s;
  364. d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
  365. h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
  366. m = Math.floor(leftTime / 1000 / 60 % 60);
  367. s = Math.floor(leftTime / 1000 % 60);
  368. if (d<1&&h<1&&m<1&&s<1){
  369. console.log('竞价结束')
  370. clearInterval(module.data.setimer)
  371. }
  372. //tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  373. $('#countType').html('距竞价结束还有')
  374. }
  375. }
  376. //网站配置信息
  377. module.webConfigInformation = function (data) {
  378. if (data.code == 200) {
  379. var content = data.data;
  380. //console.log(content)
  381. //document.getElementById('time').innerHTML = '延时周期:'+content[8].configValue+content[8].remark+'<i class="wh">?</i>'
  382. module.data.timeConfig = content[8].configValue;
  383. module.data.titleConfig = content[9].configValue;
  384. module.data.importantTitle = content[7].configName+':'+ content[7].configValue.substr(3).substr(0,(content[7].configValue.substr(3).length-4));
  385. module.data.know = content[6].configValue;
  386. $("#know").html(content[6].configValue + '<span style="margin-left: 10px;"></span>' + content[6].configValue);
  387. }
  388. }
  389. module.biddingDirectDictionaries = function (data) {
  390. if (data.code == 200 && module.data.outProjectInformationDetail.biddingDirect!='') {
  391. var content = data.data;
  392. var biddingDirect = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingDirect;})[0].dictLabel;
  393. module.data.outProjectInformationDetail.biddingDirect = biddingDirect;
  394. }
  395. }
  396. module.unitDictionaries = function (data) {
  397. if (data.code == 200 && module.data.outProjectInformationDetail.unit!='') {
  398. var content = data.data;
  399. var unit = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.unit;})[0].dictLabel;
  400. module.data.outProjectInformationDetail.unit = unit;
  401. }
  402. }
  403. module.biddingTypeDictionaries = function (data) {
  404. if (data.code == 200 && module.data.outProjectInformationDetail.biddingType!='') {
  405. var content = data.data;
  406. console.log(eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingType;}))
  407. var biddingType = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingType;})[0].dictLabel;
  408. module.data.outProjectInformationDetail.biddingType = biddingType;
  409. }
  410. }
  411. return module;
  412. });