网站
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

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