网站
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

484 lines
27 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. 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=='正在竞价'||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. if((module.data.outProjectInformationDetail.biddingType=='自由竞价'||module.data.outProjectInformationDetail.biddingType=='1')&&(module.data.outProjectInformationDetail.projectShowStatus=='正在竞价'||module.data.outProjectInformationDetail.projectShowStatus=='等待竞价')){
  183. $("#biddingMoney").html('*');
  184. $("#biddingPeople").html('*');
  185. }else{
  186. $("#biddingPeople").html('无');
  187. $("#biddingMoney").html('无');
  188. }
  189. }
  190. }
  191. }
  192. module.dataCompare = function(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){
  193. var signupStartTime = signupStartTime;
  194. var signupStopTime = signupStopTime;
  195. var biddingStartTime = biddingStartTime;
  196. var biddingStopTime = biddingStopTime;
  197. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  198. var beginTimes=signupStartTime.substring(0,10).split('-');
  199. var endTimes=signupStopTime.substring(0,10).split('-');
  200. var biddingBeginTimes=biddingStartTime.substring(0,10).split('-');
  201. var biddingEndTimes=biddingStopTime.substring(0,10).split('-');
  202. signupStartTime=beginTimes[1]+'/'+beginTimes[2]+'/'+beginTimes[0]+' '+signupStartTime.substring(10,19);
  203. signupStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+signupStopTime.substring(10,19);
  204. biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19);
  205. biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19);
  206. //时间差
  207. var leftTime = Date.parse(biddingStopTime)-nowTime;
  208. //报名开始时间差
  209. var signupLeftTime = Date.parse(signupStartTime)-nowTime;
  210. //报名结束时间差
  211. var signDownLeftTime = Date.parse(signupStopTime)-nowTime;
  212. var centerTime = module.data.delayPeriod * 1000//延时周期
  213. //定义变量 d,h,m,s保存倒计时的时间
  214. var d,h,m,s;
  215. if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  216. //正在竞价
  217. module.data.biddingTimeType = 1;
  218. module.data.outProjectInformationDetail.projectShowStatus = '正在竞价';
  219. $('#d0').html(
  220. (
  221. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  222. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  223. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  224. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  225. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  226. )[0]
  227. );
  228. $('#d1').html(
  229. (
  230. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  231. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  232. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  233. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  234. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  235. )[1]
  236. );
  237. $('#d2').html(
  238. (
  239. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  240. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  241. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  242. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  243. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  244. )[2]
  245. );
  246. $('#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]);
  247. $('#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]);
  248. $('#m0').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  249. $('#m1').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  250. $('#s0').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  251. $('#s1').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  252. //tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  253. $('#countType').html('距竞价结束还有')
  254. }else if (nowTime>Date.parse(biddingStopTime)){
  255. module.data.outProjectInformationDetail.projectShowStatus = '等待成交';
  256. //竞价结束
  257. $('#d0').html('0')
  258. $('#d1').html('0')
  259. $('#d2').html('0')
  260. $('#h0').html('0')
  261. $('#h1').html('0')
  262. $('#m0').html('0')
  263. $('#m1').html('0')
  264. $('#s0').html('0')
  265. $('#s1').html('0')
  266. $('#countType').html('竞价结束')
  267. module.data.biddingTimeType = 2;
  268. }else if (nowTime<Date.parse(biddingStartTime)){
  269. module.data.outProjectInformationDetail.projectShowStatus = '等待竞价';
  270. //竞价暂未开始
  271. $('#d0').html('0')
  272. $('#d1').html('0')
  273. $('#d2').html('0')
  274. $('#h0').html('0')
  275. $('#h1').html('0')
  276. $('#m0').html('0')
  277. $('#m1').html('0')
  278. $('#s0').html('0')
  279. $('#s1').html('0')
  280. $('#countType').html('暂未开始')
  281. module.data.biddingTimeType = 3;
  282. }
  283. if(Date.parse(signupStartTime)<nowTime&&nowTime<Date.parse(signupStopTime)){
  284. //正在报名
  285. module.data.signupTimeType = 1;
  286. $('#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]);
  287. $('#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]);
  288. $('#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]);
  289. $('#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]);
  290. $('#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]);
  291. $('#m0').html(((Math.floor(signDownLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  292. $('#m1').html(((Math.floor(signDownLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  293. $('#s0').html(((Math.floor(signDownLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  294. $('#s1').html(((Math.floor(signDownLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  295. $('#countType').html('距报名结束还有')
  296. }else if (nowTime>Date.parse(signupStopTime)){
  297. //报名结束
  298. module.data.signupTimeType = 2;
  299. }else if (nowTime<Date.parse(signupStartTime)){
  300. //报名暂未开始
  301. module.data.signupTimeType = 3;
  302. $('#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]);
  303. $('#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]);
  304. $('#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]);
  305. $('#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]);
  306. $('#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]);
  307. $('#m0').html(((Math.floor(signupLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  308. $('#m1').html(((Math.floor(signupLeftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  309. $('#s0').html(((Math.floor(signupLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  310. $('#s1').html(((Math.floor(signupLeftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  311. $('#countType').html('距报名开始还有')
  312. }
  313. // if(module.data.outProjectInformationDetail.biddingType != '拍卖' && module.data.biddingTimeType != 2){
  314. // document.getElementById('biddingTable').style.display = 'none';
  315. // document.getElementById('biddingTitle').style.display = 'block';
  316. // }
  317. }
  318. module.setimeDataCompare = function(){
  319. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, (data)=>{
  320. if (data.code == 200) {
  321. module.data.outProjectInformationDetail.biddingStopTime = data.data
  322. }
  323. },true);
  324. var biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime
  325. var biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;
  326. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  327. var biddingBeginTimes=biddingStartTime.substring(0,10).split('-');
  328. var biddingEndTimes=biddingStopTime.substring(0,10).split('-');
  329. biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19);
  330. biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19);
  331. //时间差
  332. var leftTime = Date.parse(biddingStopTime)-nowTime;
  333. //定义变量 d,h,m,s保存倒计时的时间
  334. var d,h,m,s;
  335. if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  336. //正在竞价
  337. module.data.biddingTimeType = 1;
  338. $('#d0').html(
  339. (
  340. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  341. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  342. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  343. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  344. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  345. )[0]
  346. );
  347. $('#d1').html(
  348. (
  349. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  350. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  351. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  352. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  353. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  354. )[1]
  355. );
  356. $('#d2').html(
  357. (
  358. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 2 ?
  359. '00' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  360. (Math.floor(leftTime / 1000 / 60 / 60 / 24) + '').length < 3 ?
  361. '0' + Math.floor(leftTime / 1000 / 60 / 60 / 24) :
  362. Math.floor(leftTime / 1000 / 60 / 60 / 24) + ''
  363. )[2]
  364. );
  365. $('#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]);
  366. $('#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]);
  367. $('#m0').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[0]);
  368. $('#m1').html(((Math.floor(leftTime / 1000 / 60 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 / 60 % 60) : Math.floor(leftTime / 1000 / 60 % 60) + '')[1]);
  369. $('#s0').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[0]);
  370. $('#s1').html(((Math.floor(leftTime / 1000 % 60) + '').length < 2 ? '0' + Math.floor(leftTime / 1000 % 60) : Math.floor(leftTime / 1000 % 60) + '')[1]);
  371. let d,h,m,s;
  372. d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
  373. h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
  374. m = Math.floor(leftTime / 1000 / 60 % 60);
  375. s = Math.floor(leftTime / 1000 % 60);
  376. if (d<1&&h<1&&m<1&&s<1){
  377. console.log('竞价结束')
  378. clearInterval(module.data.setimer)
  379. }
  380. //tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  381. $('#countType').html('距竞价结束还有')
  382. }
  383. }
  384. //网站配置信息
  385. module.webConfigInformation = function (data) {
  386. if (data.code == 200) {
  387. var content = data.data;
  388. //console.log(content)
  389. //document.getElementById('time').innerHTML = '延时周期:'+content[8].configValue+content[8].remark+'<i class="wh">?</i>'
  390. module.data.timeConfig = content[8].configValue;
  391. module.data.titleConfig = content[9].configValue;
  392. module.data.importantTitle = content[7].configName+':'+ content[7].configValue.substr(3).substr(0,(content[7].configValue.substr(3).length-4));
  393. module.data.know = content[6].configValue;
  394. $("#know").html(content[6].configValue + '<span style="margin-left: 10px;"></span>' + content[6].configValue);
  395. }
  396. }
  397. module.biddingDirectDictionaries = function (data) {
  398. if (data.code == 200 && module.data.outProjectInformationDetail.biddingDirect!='') {
  399. var content = data.data;
  400. var biddingDirect = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingDirect;})[0].dictLabel;
  401. module.data.outProjectInformationDetail.biddingDirect = biddingDirect;
  402. }
  403. }
  404. module.unitDictionaries = function (data) {
  405. if (data.code == 200 && module.data.outProjectInformationDetail.unit!='') {
  406. var content = data.data;
  407. var unit = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.unit;})[0].dictLabel;
  408. module.data.outProjectInformationDetail.unit = unit;
  409. }
  410. }
  411. module.biddingTypeDictionaries = function (data) {
  412. if (data.code == 200 && module.data.outProjectInformationDetail.biddingType!='') {
  413. var content = data.data;
  414. console.log(eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingType;}))
  415. var biddingType = eval(content).filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.biddingType;})[0].dictLabel;
  416. module.data.outProjectInformationDetail.biddingType = biddingType;
  417. }
  418. }
  419. return module;
  420. });