网站
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

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