网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1152 line
57 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", 'swiper', 'itemsApi', 'swiper'], function ($, template, Tools ,Swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //焦点图数据
  9. focusListTop: [],
  10. showImgInformationDetail:'',
  11. loginNow:'',
  12. isFirst:'',
  13. timer:null,
  14. timer2:null,
  15. biddinglistInformationDetailLength:-1,
  16. biddingTimeType:0,
  17. biddinglistInformationDetail:[],
  18. timeConfig:0.00
  19. },
  20. };
  21. var tools = new Tools();
  22. module.init = function (page) {
  23. //获取焦点图信息
  24. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  25. //底部友情链接
  26. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  27. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  28. tools.getWebConfig();
  29. module.data.loginNow = tools.getCookie('Admin-Token');
  30. //浏览次数
  31. tools.doGet(outProject, {id:getQueryVariable('id')}, module.projectNum,true);
  32. setTimeout(function(){//项目基本信息
  33. tools.doGet(outProject + '/id/'+getQueryVariable('id'), {}, module.outProjectInformation,true);
  34. },100)
  35. //焦点图
  36. setTimeout(function () {
  37. module.swiperBanner();
  38. },5000)
  39. setTimeout(function(){//项目基本信息
  40. tools.doGet(showImg + '/'+getQueryVariable('id'), {}, module.showImgInformation,true);
  41. },100)
  42. tools.doGet(webConfig, {}, module.webConfigInformation, true)
  43. };
  44. //焦点图数据
  45. module.focusNewsTop = function (data) {
  46. if (data.code == 200) {
  47. let focusArray = [];
  48. if(data.data.length<1){
  49. focusArray.push({
  50. picUrl:'../../../static/images/banner1.png'
  51. },{
  52. picUrl:'../../../static/images/banner2.png'
  53. },{
  54. picUrl:'../../../static/images/banner3.png'
  55. })
  56. }else{
  57. data.data.forEach(res=>{
  58. focusArray.push({
  59. picUrl:'/api'+res.picUrl
  60. })
  61. })
  62. }
  63. module.data.focusListTop = focusArray;
  64. var bannerFocusDataTop = template('bannerFocusDataTop', module.data);
  65. $("#bannerFocusTopContent").html(bannerFocusDataTop);
  66. new Swiper('#bannerFocusWrapTop', {
  67. paginationClickable: true,
  68. autoplay : 4000,
  69. loop:true
  70. })
  71. }
  72. }
  73. //获取地址栏参数
  74. function getQueryVariable(variable){
  75. var query = window.location.search.substring(1);
  76. var vars = query.split("&");
  77. for (var i=0;i<vars.length;i++) {
  78. var pair = vars[i].split("=");
  79. if(pair[0] == variable){return pair[1];}
  80. }
  81. return(false);
  82. }
  83. //网站配置信息
  84. module.webConfigInformation = function (data) {
  85. if (data.code == 200) {
  86. var content = data.data;
  87. //console.log(content)
  88. //document.getElementById('time').innerHTML = '延时周期:'+content[8].configValue+content[8].remark+'<i class="wh">?</i>'
  89. module.data.timeConfig = parseFloat(content[8].configValue);
  90. module.data.titleConfig = content[9].configValue;
  91. module.data.importantTitle = content[7].configName+':'+ content[7].configValue.substr(3).substr(0,(content[7].configValue.substr(3).length-4));
  92. module.data.know = content[6].configValue;
  93. $("#know").html(content[6].configValue);
  94. // + '<span style="margin-left: 10px;"></span>' + content[6].configValue
  95. }
  96. }
  97. //底部友情链接
  98. module.bottomFriendsLinks = function (data) {
  99. if (data.code == 200) {
  100. var content = data.data;
  101. //console.log(content)
  102. module.data.friendsLinksList = content;
  103. var friendsLinksData = template('friendsLinksData', module.data);
  104. $("#friendsLinksContent").html(friendsLinksData);
  105. }
  106. }
  107. var t = 3;
  108. module.dataCompare = function(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){
  109. //console.log('aaaaaaaaaaa')
  110. var signupStartTime = signupStartTime;
  111. var signupStopTime = signupStopTime;
  112. var biddingStartTime = biddingStartTime;
  113. var biddingStopTime = biddingStopTime;
  114. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  115. // console.log(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")))
  116. var beginTimes=signupStartTime.substring(0,10).split('-');
  117. var endTimes=signupStopTime.substring(0,10).split('-');
  118. var biddingBeginTimes=biddingStartTime.substring(0,10).split('-');
  119. var biddingEndTimes=biddingStopTime.substring(0,10).split('-');
  120. signupStartTime=beginTimes[1]+'/'+beginTimes[2]+'/'+beginTimes[0]+' '+signupStartTime.substring(10,19);
  121. signupStopTime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+' '+signupStopTime.substring(10,19);
  122. biddingStartTime=biddingBeginTimes[1]+'/'+biddingBeginTimes[2]+'/'+biddingBeginTimes[0]+' '+biddingStartTime.substring(10,19);
  123. biddingStopTime=biddingEndTimes[1]+'/'+biddingEndTimes[2]+'/'+biddingEndTimes[0]+' '+biddingStopTime.substring(10,19);
  124. //时间差
  125. var leftTime = Date.parse(biddingStopTime)-nowTime;
  126. //报名开始时间差
  127. var signupLeftTime = Date.parse(signupStartTime)-nowTime;
  128. //报名结束时间差
  129. var signDownLeftTime = Date.parse(signupStopTime)-nowTime;
  130. //定义变量 d,h,m,s保存倒计时的时间
  131. var d,h,m,s;
  132. if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  133. //正在竞价
  134. // console.log('正在竞价')
  135. module.data.biddingTimeType = 1;
  136. module.data.outProjectInformationDetail.projectShowStatus = '正在竞价';
  137. // if(module.data.outProjectInformationDetail.biddingType == '自由竞价'){
  138. // document.getElementById('biddingTable').style.display = 'none';
  139. // document.getElementById('biddingTitle').style.display = 'block';
  140. // document.getElementById('biddingTitle').innerHTML = '竞价进行中...';
  141. // }
  142. // document.getElementById('swiperType').style.display = 'block';
  143. d = Math.floor(leftTime/1000/60/60/24);
  144. h = Math.floor(leftTime/1000/60/60%24);
  145. m = Math.floor(leftTime/1000/60%60);
  146. s = Math.floor(leftTime/1000%60);
  147. // console.log('<span>距竞价结束还有:'+d+'</span>天<span>'+h+'</span>时<span>'+m+'</span>分<span>'+s+'</span>秒')
  148. $('#countType').html('竞价中')
  149. $('#countDown').html('<span>距竞价结束还有:'+d+'</span>天<span>'+h+'</span>时<span>'+m+'</span>分<span>'+s+'</span>秒')
  150. document.getElementById('biddingTitle').innerHTML = '自由竞价方式下,项目成交前不显示竞价记录!';
  151. if(module.data.outProjectInformationDetail.biddingType != '自由竞价' && module.data.biddingTimeType != 2){
  152. document.getElementById('showNowMoney').style.display = 'table-row';
  153. var timName = document.getElementById('timeDown');
  154. if(timName) {
  155. document.getElementById('timeDown').style.display = 'inline-block';
  156. timName.innerHTML = t + '<b style="color: #666666">秒后自动刷新</b>';
  157. }
  158. t--;
  159. if (t < 0) {
  160. t = 3;
  161. tools.doGet(biddinglist, {projectId: getQueryVariable('id')}, module.biddinglistInformation, true);
  162. }
  163. }
  164. }else if (nowTime>Date.parse(biddingStopTime)){
  165. //竞价结束
  166. $('#countType').html('')
  167. $('#countDown').html('竞价结束')
  168. module.data.outProjectInformationDetail.projectShowStatus = '等待成交';
  169. // document.getElementById('swiperType').style.display = 'none';
  170. // document.getElementById('biddingTable').style.display = 'table';
  171. // document.getElementById('biddingTitle').style.display = 'none';
  172. module.data.biddingTimeType = 2;
  173. }else if (nowTime<Date.parse(biddingStartTime)){
  174. leftTime = Date.parse(biddingStartTime)-nowTime;
  175. module.data.outProjectInformationDetail.projectShowStatus = '等待竞价';
  176. d = Math.floor(leftTime/1000/60/60/24);
  177. h = Math.floor(leftTime/1000/60/60%24);
  178. m = Math.floor(leftTime/1000/60%60);
  179. s = Math.floor(leftTime/1000%60);
  180. $('#countType').html('未开始')
  181. $('#countDown').html('<span>距竞价开始还有:'+d+'</span>天<span>'+h+'</span>时<span>'+m+'</span>分<span>'+s+'</span>秒')
  182. //竞价暂未开始
  183. document.getElementById('biddingTitle').innerHTML = '竞价暂未开始...';
  184. module.data.biddingTimeType = 3;
  185. }
  186. if(Date.parse(signupStartTime)<nowTime&&nowTime<Date.parse(signupStopTime)){
  187. //正在报名
  188. module.data.signupTimeType = 1;
  189. // document.getElementById('swiperType').style.display = 'block';
  190. d = Math.floor(signDownLeftTime/1000/60/60/24);
  191. h = Math.floor(signDownLeftTime/1000/60/60%24);
  192. m = Math.floor(signDownLeftTime/1000/60%60);
  193. s = Math.floor(signDownLeftTime/1000%60);
  194. $('#countType').html('报名中')
  195. $('#countDown').html('<span>距报名结束还有:'+d+'</span>天<span>'+h+'</span>时<span>'+m+'</span>分<span>'+s+'</span>秒')
  196. }else if (nowTime>Date.parse(signupStopTime)){
  197. //报名结束
  198. module.data.signupTimeType = 2;
  199. }else if (nowTime<Date.parse(signupStartTime)){
  200. //报名暂未开始
  201. module.data.signupTimeType = 3;
  202. d = Math.floor(signupLeftTime/1000/60/60/24);
  203. h = Math.floor(signupLeftTime/1000/60/60%24);
  204. m = Math.floor(signupLeftTime/1000/60%60);
  205. s = Math.floor(signupLeftTime/1000%60);
  206. $('#countType').html('未开始')
  207. $('#countDown').html('<span>距报名开始还有:'+d+'</span>天<span>'+h+'</span>时<span>'+m+'</span>分<span>'+s+'</span>秒')
  208. }
  209. //moneyText:出价输入框
  210. //moneyBtn:出价按钮
  211. //signYes:已报名显示文字
  212. //signNo:未报名显示文字
  213. //signBtn:已登录但未报名跳转报名按钮
  214. //signBtn2:未登录跳转登录按钮
  215. //noAction:未开始显示文字
  216. if(module.data.loginNow){ //判断是否登录(已登录)
  217. if(module.data.signup == 1){ //判断是否报名(已报名)
  218. if( module.data.biddingTimeType == 1 ){ //判断当前竞价状态(竞价中)
  219. document.getElementById('signYes').style.display = 'none';
  220. document.getElementById('signNo').style.display = 'none';
  221. document.getElementById('signBtn').style.display = 'none';
  222. document.getElementById('signBtn2').style.display = 'none';
  223. document.getElementById('noAction').style.display = 'none';
  224. document.getElementById('moneyText').style.display = 'table-row';
  225. document.getElementById('moneyBtn').style.display = 'flex';
  226. }else if( module.data.biddingTimeType == 3 ){ //判断当前竞价状态(竞价未开始)
  227. document.getElementById('moneyText').style.display = 'none';
  228. document.getElementById('moneyBtn').style.display = 'none';
  229. document.getElementById('signNo').style.display = 'none';
  230. document.getElementById('signBtn').style.display = 'none';
  231. document.getElementById('signBtn2').style.display = 'none';
  232. document.getElementById('noAction').style.display = 'none';
  233. document.getElementById('signYes').style.display = 'block';
  234. }else{ //判断当前竞价状态(竞价结束)
  235. $('.swiperInput').css('display','none');
  236. $('#timeDown').css('display','none');
  237. clearInterval(module.data.timeDown)
  238. }
  239. }else{ //判断是否报名(未报名)
  240. if( module.data.signupTimeType == 1 ){ //判断当前报名状态(正在报名)
  241. document.getElementById('moneyText').style.display = 'none';
  242. document.getElementById('moneyBtn').style.display = 'none';
  243. document.getElementById('signNo').style.display = 'none';
  244. document.getElementById('signBtn2').style.display = 'none';
  245. document.getElementById('noAction').style.display = 'none';
  246. document.getElementById('signYes').style.display = 'none';
  247. document.getElementById('signBtn').style.display = 'block';
  248. }else if( module.data.signupTimeType == 3 ){ //判断当前报名状态(报名未开始)
  249. document.getElementById('moneyText').style.display = 'none';
  250. document.getElementById('moneyBtn').style.display = 'none';
  251. document.getElementById('signBtn2').style.display = 'none';
  252. document.getElementById('signYes').style.display = 'none';
  253. document.getElementById('signBtn').style.display = 'none';
  254. document.getElementById('signNo').style.display = 'none';
  255. document.getElementById('noAction').style.display = 'block';
  256. }else{ //判断当前报名状态(报名结束)
  257. document.getElementById('moneyText').style.display = 'none';
  258. document.getElementById('moneyBtn').style.display = 'none';
  259. document.getElementById('signBtn2').style.display = 'none';
  260. document.getElementById('noAction').style.display = 'none';
  261. document.getElementById('signYes').style.display = 'none';
  262. document.getElementById('signBtn').style.display = 'none';
  263. document.getElementById('signNo').style.display = 'block';
  264. }
  265. }
  266. }else{ //判断是否登录(未登录)
  267. if( module.data.biddingTimeType == 2 ){//判断当前竞价状态(竞价结束)
  268. $('.swiperInput').css('display','none')
  269. }else{
  270. document.getElementById('signBtn2').style.display = 'block';
  271. }
  272. }
  273. // if(module.data.outProjectInformationDetail.biddingType != '自由竞价' && module.data.biddingTimeType != 2){
  274. // document.getElementById('biddingTable').style.display = 'table';
  275. // document.getElementById('biddingTitle').style.display = 'none';
  276. // }
  277. }
  278. module.projectNum = function(data){
  279. console.log(data)
  280. }
  281. module.signup = function(data){
  282. console.log(data)
  283. module.data.signup = data.data;
  284. module.data.isFirst = data.signup.isFirst;
  285. var outProjectInformationData = template('outProjectInformationData', module.data);
  286. $("#outProjectInformationContent").html(outProjectInformationData);
  287. }
  288. goBond = function(){
  289. var nowTime = Date.parse(new Date());
  290. var signupStopTime = Date.parse(module.data.outProjectInformationDetail.signupStopTime)
  291. if (nowTime>signupStopTime){
  292. tools.initError('报名已结束!');
  293. return;
  294. }
  295. if (module.data.signHistory == 1){
  296. tools.initError('已报名,请耐心等待审核结果!');
  297. return;
  298. }
  299. tools.doGet(userData, {}, module.userData);
  300. }
  301. module.userData = function(data){
  302. if (data.code == 200) {
  303. var content = data.user;
  304. //console.log(content)
  305. module.data.userId = content.userId;
  306. tools.doGet(userMember + '/' + content.userId, {}, module.userMember);//memberType 1个人 2单位
  307. }
  308. }
  309. module.userMember = function(data){
  310. if (data.code == 200) {
  311. var content = data.data;
  312. if (content.auditStatus == 'Y'){
  313. tools.skip('bond.html?id='+getQueryVariable('id'))
  314. }else{
  315. tools.initError("交易中心审核注册信息后方可进行报名!");
  316. }
  317. }
  318. }
  319. //项目基本信息
  320. module.outProjectInformation = function (data) {
  321. if (data.code == 200) {
  322. var content = data.data;
  323. module.data.biddingStopTime = content.biddingStopTime;
  324. for(var i = 0 ; i < content.fileUrlList.length ; i++){
  325. content.fileUrlList[i].fileUrl = serverApi+content.fileUrlList[i].fileUrl;
  326. }
  327. module.data.outProjectInformationDetail = content;
  328. setTimeout(function(){
  329. var outProjectInformationData = template('outProjectInformationData', module.data);
  330. $("#outProjectInformationContent").html(outProjectInformationData);
  331. // var timName = document.getElementById('timeDown');
  332. // if(timName){
  333. // var t = 3;
  334. //
  335. // module.data.timeDown = setInterval(function(){
  336. // // console.log($('#countType').html())
  337. // // if ($('#countType').html()!='竞价中'){
  338. // // clearInterval(module.data.timeDown)
  339. // // document.getElementById('timeDown').style.display = 'none';
  340. // // return;
  341. // // }
  342. // timName.innerHTML = t+'<b style="color: #666666">秒后自动刷新</b>';
  343. // t--;
  344. // document.getElementById('timeDown').style.display = 'inline-block';
  345. // if(t<0){
  346. // t = 3;
  347. // let biddingStartTime = content.biddingStartTime;
  348. // let biddingStopTime = content.biddingStopTime;
  349. // var nowTime = Date.parse(new Date());
  350. // if(Date.parse(biddingStartTime)<nowTime&&nowTime<Date.parse(biddingStopTime)){
  351. // //正在竞价
  352. // //交易项目竞价记录
  353. // tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  354. // }
  355. // }
  356. // }, 1000)
  357. // }
  358. },2000)
  359. $("#know").html(module.data.know);
  360. //挂牌价格字典
  361. tools.doGet(Dictionaries+'/price_unit', {}, module.unitDictionaries,true);
  362. //经济类型字典
  363. tools.doGet(Dictionaries+'/economic_type', {}, module.economicTypeDictionaries,true);
  364. //项目类型字典
  365. tools.doGet(Dictionaries+'/project_type', {}, module.projectNumberDictionaries,true);
  366. //农地性质字典
  367. // tools.doGet(Dictionaries+'/sub_object_type', {}, module.projectTypeDictionaries,true);
  368. //前次转出方式
  369. tools.doGet(Dictionaries+'/rollout_type', {}, module.oneoutDictionaries,true);
  370. //面积单位字典
  371. tools.doGet(Dictionaries+'/area_unit', {}, module.areaDictionaries,true);
  372. //支付方式字典
  373. tools.doGet(Dictionaries+'/payment_type', {}, module.paymentTypeDictionaries,true);
  374. //缴纳形式字典
  375. tools.doGet(Dictionaries+'/deposit_payment_type', {}, module.depositPaymentTypeDictionaries,true);
  376. //交易方式字典
  377. tools.doGet(Dictionaries+'/deal_type', {}, module.transactionDictionaries,true);
  378. //竞价方式字典
  379. tools.doGet(Dictionaries+'/bidding_type', {}, module.biddingTypeDictionaries,true);
  380. //期满处理字典
  381. tools.doGet(Dictionaries+'/expire_type', {}, module.expireTypeDictionaries,true);
  382. //期满处理字典
  383. tools.doGet(Dictionaries+'/bidding_direct', {}, module.biddingDirectDictionaries,true);
  384. //交易项目竞价记录
  385. tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformation,true);
  386. //倒计时
  387. module.data.timer = setInterval(function(){
  388. // '2023-05-17 14:56:00'
  389. let signupStartTime = module.data.outProjectInformationDetail.signupStartTime;
  390. let signupStopTime = module.data.outProjectInformationDetail.signupStopTime;
  391. let biddingStartTime = module.data.outProjectInformationDetail.biddingStartTime;
  392. let biddingStopTime = module.data.outProjectInformationDetail.biddingStopTime;//延时后结束时间
  393. let biddingStopSetime = module.data.outProjectInformationDetail.biddingStopSetime;//原始结束时间
  394. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  395. var difference = Date.parse(biddingStopTime)-nowTime;//延时后时间差
  396. var differenceSetime = Date.parse(biddingStopSetime)-nowTime;//原始时间差
  397. // var centerTime = module.data.timeConfig * 60 * 1000
  398. var centerTime = content.delayPeriod * 1000//延时周期
  399. var m,s;
  400. m = Math.floor(difference/1000/60%60);
  401. s = Math.floor(difference/1000%60);
  402. if(s%2 == 0&&centerTime!=0){
  403. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, module.getBiddingStopTime,true);
  404. }
  405. if ( differenceSetime <= 0 && difference >= 0 && difference <= centerTime){
  406. console.log("竞价最后两分钟")
  407. //正在竞价
  408. // if(module.data.outProjectInformationDetail.biddingType == '自由竞价'){
  409. // document.getElementById('biddingTable').style.display = 'none';
  410. // document.getElementById('biddingTitle').style.display = 'block';
  411. // document.getElementById('biddingTitle').innerHTML = '竞价进行中...';
  412. // }
  413. // document.getElementById('swiperType').style.display = 'block';
  414. module.data.biddingTimeType = 1;
  415. $('#countType').html('竞价中')
  416. $('#countDown').html('<span>距竞价结束还有:0</span>天<span>0</span>时<span>'+m+'</span>分<span>'+s+'</span>秒')
  417. if(module.data.outProjectInformationDetail.biddingType != '自由竞价' && module.data.biddingTimeType != 2){
  418. document.getElementById('showNowMoney').style.display = 'table-row';
  419. var timName = document.getElementById('timeDown');
  420. if(timName) {
  421. document.getElementById('timeDown').style.display = 'inline-block';
  422. timName.innerHTML = t + '<b style="color: #666666">秒后自动刷新</b>';
  423. }
  424. t--;
  425. if (t < 0) {
  426. t = 3;
  427. tools.doGet(biddinglist, {projectId: getQueryVariable('id')}, module.biddinglistInformation, true);
  428. }
  429. }
  430. if(module.data.loginNow){ //判断是否登录(已登录)
  431. if(module.data.signup == 1){ //判断是否报名(已报名)
  432. if( module.data.biddingTimeType == 1 ){ //判断当前竞价状态(竞价中)
  433. document.getElementById('signYes').style.display = 'none';
  434. document.getElementById('signNo').style.display = 'none';
  435. document.getElementById('signBtn').style.display = 'none';
  436. document.getElementById('signBtn2').style.display = 'none';
  437. document.getElementById('noAction').style.display = 'none';
  438. document.getElementById('moneyText').style.display = 'table-row';
  439. document.getElementById('moneyBtn').style.display = 'flex';
  440. $('.swiperInput').css('display','block')
  441. }else if( module.data.biddingTimeType == 3 ){ //判断当前竞价状态(竞价未开始)
  442. document.getElementById('moneyText').style.display = 'none';
  443. document.getElementById('moneyBtn').style.display = 'none';
  444. document.getElementById('signNo').style.display = 'none';
  445. document.getElementById('signBtn').style.display = 'none';
  446. document.getElementById('signBtn2').style.display = 'none';
  447. document.getElementById('noAction').style.display = 'none';
  448. document.getElementById('signYes').style.display = 'block';
  449. }else{ //判断当前竞价状态(竞价结束)
  450. $('.swiperInput').css('display','none');
  451. $('#timeDown').css('display','none');
  452. clearInterval(module.data.timeDown)
  453. }
  454. }else{ //判断是否报名(未报名)
  455. if( module.data.signupTimeType == 1 ){ //判断当前报名状态(正在报名)
  456. document.getElementById('moneyText').style.display = 'none';
  457. document.getElementById('moneyBtn').style.display = 'none';
  458. document.getElementById('signNo').style.display = 'none';
  459. document.getElementById('signBtn2').style.display = 'none';
  460. document.getElementById('noAction').style.display = 'none';
  461. document.getElementById('signYes').style.display = 'none';
  462. document.getElementById('signBtn').style.display = 'block';
  463. }else if( module.data.signupTimeType == 3 ){ //判断当前报名状态(报名未开始)
  464. document.getElementById('moneyText').style.display = 'none';
  465. document.getElementById('moneyBtn').style.display = 'none';
  466. document.getElementById('signBtn2').style.display = 'none';
  467. document.getElementById('signYes').style.display = 'none';
  468. document.getElementById('signBtn').style.display = 'none';
  469. document.getElementById('signNo').style.display = 'none';
  470. document.getElementById('noAction').style.display = 'block';
  471. }else{ //判断当前报名状态(报名结束)
  472. document.getElementById('moneyText').style.display = 'none';
  473. document.getElementById('moneyBtn').style.display = 'none';
  474. document.getElementById('signBtn2').style.display = 'none';
  475. document.getElementById('noAction').style.display = 'none';
  476. document.getElementById('signYes').style.display = 'none';
  477. document.getElementById('signBtn').style.display = 'none';
  478. document.getElementById('signNo').style.display = 'block';
  479. }
  480. }
  481. }else{ //判断是否登录(未登录)
  482. if( module.data.biddingTimeType == 2 ){//判断当前竞价状态(竞价结束)
  483. $('.swiperInput').css('display','none')
  484. }else{
  485. document.getElementById('signBtn2').style.display = 'block';
  486. }
  487. }
  488. //console.log(s+'-------------'+m)
  489. if (s < 1 && m < 1){
  490. console.log("竞价结束22222222222")
  491. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){
  492. if (data.code == 200) {
  493. var nowDate = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  494. module.data.outProjectInformationDetail.biddingStopTime = data.data
  495. let timeNew = Date.parse(data.data) + 0 - nowDate;
  496. if (timeNew > 0) {
  497. module.data.outProjectInformationDetail.biddingStopTime = data.data;
  498. $('.swiperInput').css('display','block')
  499. // module.data.biddingTimeType = 1;
  500. }else{
  501. $('#countType').html('')
  502. $('#countDown').html('竞价结束')
  503. $('#timeDown').css('display','none');
  504. $('.swiperInput').css('display','none');
  505. // document.getElementById('swiperType').style.display = 'none';
  506. // document.getElementById('biddingTable').style.display = 'table';
  507. // document.getElementById('biddingTitle').style.display = 'none';
  508. module.data.biddingTimeType = 2;
  509. module.data.outProjectInformationDetail.projectShowStatus = '竞价结束';
  510. var biddinglistInformationData = template('biddinglistInformationData', module.data);
  511. $("#tabDetail4").html(biddinglistInformationData);
  512. return;
  513. return;
  514. }
  515. }
  516. },true);
  517. }else if(s%2 == 0&&centerTime!=0){
  518. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, module.getBiddingStopTime,true);
  519. }
  520. }else{
  521. if (!signupStartTime){console.log('缺失报名开始时间');return;}
  522. if (!signupStopTime){console.log('缺失报名结束时间');return;}
  523. if (!biddingStartTime){console.log('缺失竞价开始时间');return;}
  524. if (!biddingStopTime){console.log('缺失竞价结束时间');return;}
  525. module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime);
  526. }
  527. // if(module.data.outProjectInformationDetail.biddingType == '自由竞价' && module.data.biddingTimeType != 2){
  528. // document.getElementById('biddingTable').style.display = 'none';
  529. // document.getElementById('biddingTitle').style.display = 'block';
  530. // }
  531. },1000)
  532. //倒计时
  533. // module.data.timer2 = setInterval(function(){
  534. // //交易项目竞价记录
  535. // tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformationNew,true);
  536. //
  537. // },10000)
  538. if(module.data.loginNow){
  539. //判断是否报名
  540. tools.doGet(signup, {projectId:getQueryVariable('id'),depositStatus:'1',memberId:tools.getCookie('memberId')}, module.signup);
  541. tools.doGet(signup, {projectId:getQueryVariable('id'),memberId:tools.getCookie('memberId')}, module.signup2);
  542. }
  543. }
  544. }
  545. module.getBiddingStopTime = function(data){
  546. if (data.code == 200) {
  547. // $('#stopTime').html(data.data)
  548. module.data.outProjectInformationDetail.biddingStopTime = data.data
  549. }
  550. }
  551. module.signup2 = function(data){
  552. if (data.code == 200) {
  553. module.data.signHistory = data.data
  554. }
  555. }
  556. //标的物图片
  557. module.showImgInformation = function (data) {
  558. if (data.code == 200) {
  559. var content = data.data;
  560. console.log(content)
  561. var contentList = [];
  562. for(var i = 0 ; i < content.length ; i++){
  563. contentList[i] = serverApi+content[i].fileUrl;
  564. }
  565. module.data.showImgInformationDetail = contentList;
  566. console.log(contentList)
  567. var showImgInformationData = template('showImgInformationData', module.data);
  568. $("#tabDetail2").html(showImgInformationData);
  569. }
  570. }
  571. //竞价记录
  572. module.biddinglistInformation = function (data) {
  573. if (data.code == 200) {
  574. var content = data.rows;
  575. if (content.length>0){
  576. //console.log('abccba')
  577. $("#nowMoneyBlock").html('<span id="nowMoney">'+content[0].money+'</span>'+module.data.outProjectInformationDetail.unit);
  578. }else{
  579. $("#nowMoneyBlock").html('暂无出价');
  580. }
  581. if(module.data.biddinglistInformationDetailLength == content.length){
  582. return;
  583. }
  584. //console.log(module.data.outProjectInformationDetail.biddingDirect)
  585. //console.log(module.data.outProjectInformationDetail.biddingType)
  586. setTimeout(function(){
  587. if(module.data.outProjectInformationDetail.biddingType == '阶梯竞价'||module.data.outProjectInformationDetail.biddingType == '2'){
  588. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'||module.data.outProjectInformationDetail.biddingDirect == '2'){
  589. if (content.length>0){
  590. let money = $('#money').val()?$('#money').val():content[0].money
  591. if(content[0].money<=money) {
  592. document.getElementById('money').value = parseFloat(parseFloat(content[0].money) - parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2);
  593. }
  594. }else{
  595. document.getElementById('money').value = parseFloat(parseFloat(module.data.outProjectInformationDetail.price)).toFixed(2);
  596. // + parseFloat(module.data.outProjectInformationDetail.ladderPrice)
  597. }
  598. }else{
  599. if (content.length>0){
  600. let money = $('#money').val()?$('#money').val():content[0].money
  601. if(content[0].money>=money){
  602. document.getElementById('money').value = parseFloat(parseFloat(content[0].money) + parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2);
  603. }
  604. }else{
  605. document.getElementById('money').value = parseFloat(parseFloat(module.data.outProjectInformationDetail.price)).toFixed(2);
  606. // + parseFloat(module.data.outProjectInformationDetail.ladderPrice)
  607. }
  608. }
  609. }
  610. },2000)
  611. module.data.biddinglistInformationDetail = content;
  612. module.data.biddinglistInformationDetailLength = content.length;
  613. var biddinglistInformationData = template('biddinglistInformationData', module.data);
  614. $("#tabDetail4").html(biddinglistInformationData);
  615. $('#unit').html('出价价格【'+module.data.outProjectInformationDetail.unit+'】')
  616. if (content.length>0){
  617. //console.log('abccba')
  618. $("#nowMoneyBlock").html('<span id="nowMoney">'+content[0].money+'</span> 元');}
  619. }
  620. }
  621. //竞价记录
  622. module.biddinglistInformationNew = function (data) {
  623. if (data.code == 200) {
  624. var content = data.rows;
  625. //console.log(module.data.biddinglistInformationDetail.length+'----------------------'+content.length)
  626. if (module.data.biddinglistInformationDetailLength<content.length){
  627. let time = new Date(Date.parse(new Date())+(2 * 60 * 1000));
  628. const Y = time.getFullYear()
  629. const M = time.getMonth() + 1 < 10 ? '0'+(time.getMonth()+1) : time.getMonth()+1
  630. const D = time.getDate()
  631. const H = time.getHours() // 小时
  632. const m = time.getMinutes() // 分钟
  633. const S = time.getSeconds() // 秒
  634. module.data.biddingStopTime = Y+'-'+M+'-'+D+' '+H+':'+m+':'+S;
  635. module.data.biddinglistInformationDetailLength = content.length;
  636. }
  637. }
  638. }
  639. //焦点图滚动
  640. module.swiperBanner = function (type) {
  641. //console.log('aaaa')
  642. var viewSwiper = new Swiper('.view .swiper-container', {
  643. onSlideChangeStart: function() {
  644. updateNavPosition()
  645. }
  646. })
  647. $('.view .arrow-left,.preview .arrow-left').on('click', function(e) {
  648. //console.log('abc')
  649. e.preventDefault()
  650. if (viewSwiper.activeIndex == 0) {
  651. viewSwiper.swipeTo(viewSwiper.slides.length - 1, 1000);
  652. return
  653. }
  654. viewSwiper.swipePrev()
  655. })
  656. $('.view .arrow-right,.preview .arrow-right').on('click', function(e) {
  657. //console.log('abc')
  658. e.preventDefault()
  659. if (viewSwiper.activeIndex == viewSwiper.slides.length - 1) {
  660. viewSwiper.swipeTo(0, 1000);
  661. return
  662. }
  663. viewSwiper.swipeNext()
  664. })
  665. var previewSwiper = new Swiper('.preview .swiper-container', {
  666. visibilityFullFit: true,
  667. slidesPerView: 'auto',
  668. onlyExternal: true,
  669. onSlideClick: function() {
  670. viewSwiper.swipeTo(previewSwiper.clickedSlideIndex)
  671. }
  672. })
  673. function updateNavPosition() {
  674. $('.preview .active-nav').removeClass('active-nav')
  675. var activeNav = $('.preview .swiper-slide').eq(viewSwiper.activeIndex).addClass('active-nav')
  676. if (!activeNav.hasClass('swiper-slide-visible')) {
  677. if (activeNav.index() > previewSwiper.activeIndex) {
  678. var thumbsPerNav = Math.floor(previewSwiper.width / activeNav.width()) - 1
  679. previewSwiper.swipeTo(activeNav.index() - thumbsPerNav)
  680. } else {
  681. previewSwiper.swipeTo(activeNav.index())
  682. }
  683. }
  684. }
  685. }
  686. //切换
  687. tabClick = function(type){
  688. //标的物介绍
  689. for (var i = 0 ; i < 4 ; i++){
  690. document.getElementById('tabDetail'+(i+1)).style.display = 'none';
  691. document.getElementById('tab'+(i+1)).classList = '';
  692. }
  693. document.getElementById('tabDetail'+type).style.display = 'block';
  694. document.getElementById('tab'+type).classList = 'active';
  695. }
  696. //挂牌价格
  697. module.unitDictionaries = function (data) {
  698. if (data.code == 200) {
  699. var content = data.data;
  700. var unit = content[(module.data.outProjectInformationDetail.unit-1)].dictLabel;
  701. module.data.outProjectInformationDetail.unit = unit;
  702. var outProjectInformationData = template('outProjectInformationData', module.data);
  703. $("#outProjectInformationContent").html(outProjectInformationData);
  704. }
  705. }
  706. //出价
  707. module.biddingSubmitMethod = function (data2) {
  708. let newMoney;
  709. if (data2.data&&data2.code==200){
  710. //console.log(data2)
  711. newMoney = data2.data;
  712. }else{
  713. newMoney = module.data.outProjectInformationDetail.price;
  714. }
  715. if ($('#money').val()<=0){
  716. tools.initError('请正常出价!');
  717. return;
  718. }
  719. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  720. //判断用户出价不能高于挂牌价
  721. if(module.data.outProjectInformationDetail.price<$('#money').val()){
  722. tools.initError('出价不能高于挂牌价');
  723. return;
  724. }else{
  725. //判断当前竞价方式
  726. if (module.data.outProjectInformationDetail.biddingType=='阶梯竞价' || module.data.outProjectInformationDetail.biddingType=='公开竞价'){
  727. //判断当前是否有人出价
  728. if (data2.data){
  729. //判断用户出价不能高于当前出价最低价格
  730. if(newMoney <= $('#money').val()){
  731. tools.initError('不能高于当前最低价格!');
  732. return;
  733. }
  734. }
  735. }
  736. }
  737. }else{
  738. if(module.data.outProjectInformationDetail.price>$('#money').val()){
  739. tools.initError('出价不能低于挂牌价');
  740. return;
  741. }else{
  742. //判断当前竞价方式
  743. if (module.data.outProjectInformationDetail.biddingType=='阶梯竞价' || module.data.outProjectInformationDetail.biddingType=='公开竞价'){
  744. //判断当前是否有人出价
  745. if (data2.data){
  746. //判断用户出价不能低于当前出价最高价格
  747. if(newMoney >= $('#money').val()){
  748. tools.initError('不能低于当前最高价格!');
  749. return;
  750. }
  751. }
  752. }
  753. }
  754. }
  755. var data = {};
  756. var projectId = getQueryVariable('id');
  757. var memberId = tools.getCookie('memberId');
  758. var userId = tools.getCookie('userId');
  759. var userAccount = tools.getCookie('phone');
  760. var userName = tools.getCookie('userName');
  761. var money = parseFloat($('#money').val());
  762. var loginTime = Date.now($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"));
  763. data['projectId'] = projectId;
  764. data['memberId'] = memberId;
  765. data['userId'] = userId;
  766. data['userAccount'] = userAccount;
  767. data['userName'] = userName;
  768. data['money'] = money;
  769. data['loginTime'] = loginTime;
  770. tools.doPost(biddingSubmit, data, module.biddingSubmitOpen);
  771. }
  772. module.biddingSubmitOpen = function(data1){
  773. if (data1.code == 200) {
  774. tools.initError('出价成功');
  775. }
  776. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){
  777. if (data.code == 200) {
  778. var nowDate = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  779. module.data.outProjectInformationDetail.biddingStopTime = data.data
  780. let timeNew = Date.parse(data.data) + 0 - nowDate;
  781. if (timeNew > 0) {
  782. module.data.outProjectInformationDetail.biddingStopTime = data.data;
  783. // module.dataCompare(
  784. // module.data.outProjectInformationDetail.signupStartTime,
  785. // module.data.outProjectInformationDetail.signupStopTime,
  786. // module.data.outProjectInformationDetail.biddingStartTime,data.data);
  787. }else{
  788. $('#countType').html('')
  789. $('#countDown').html('竞价结束')
  790. // document.getElementById('swiperType').style.display = 'none';
  791. // document.getElementById('biddingTable').style.display = 'table';
  792. // document.getElementById('biddingTitle').style.display = 'none';
  793. module.data.biddingTimeType = 2;
  794. return;
  795. }
  796. }
  797. },true);
  798. // $('#money').val(0)
  799. }
  800. //经济类型
  801. module.economicTypeDictionaries = function (data) {
  802. if (data.code == 200 && module.data.outProjectInformationDetail.economicType!='') {
  803. var content = data.data;
  804. if(content[(module.data.outProjectInformationDetail.economicType-1)] != undefined){
  805. var economicType = content[(module.data.outProjectInformationDetail.economicType-1)].dictLabel;
  806. module.data.outProjectInformationDetail.economicType = economicType;
  807. var outProjectInformationData = template('outProjectInformationData', module.data);
  808. $("#outProjectInformationContent").html(outProjectInformationData);
  809. }
  810. }
  811. }
  812. //项目类型
  813. module.projectNumberDictionaries = function (data) {
  814. if (data.code == 200 && module.data.outProjectInformationDetail.projectNumber!='') {
  815. var content = data.data;
  816. var projectNumber = content.filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.projectNumber; })[0].dictLabel;
  817. module.data.outProjectInformationDetail.projectNumber = projectNumber;
  818. var outProjectInformationData = template('outProjectInformationData', module.data);
  819. $("#outProjectInformationContent").html(outProjectInformationData);
  820. }
  821. }
  822. //农地性质
  823. module.projectTypeDictionaries = function (data) {
  824. if (data.code == 200 && module.data.outProjectInformationDetail.projectType!='') {
  825. var content = data.data;
  826. //console.log(content)
  827. //console.log((module.data.outProjectInformationDetail.projectType-1))
  828. var projectType = content[(module.data.outProjectInformationDetail.projectType-1)].dictLabel;
  829. module.data.outProjectInformationDetail.projectType = projectType;
  830. var outProjectInformationData = template('outProjectInformationData', module.data);
  831. $("#outProjectInformationContent").html(outProjectInformationData);
  832. }
  833. }
  834. //前次转出方式
  835. module.oneoutDictionaries = function (data) {
  836. if (data.code == 200 && module.data.outProjectInformationDetail.oneout!='') {
  837. var content = data.data;
  838. if(module.data.outProjectInformationDetail.oneout == 0){
  839. module.data.outProjectInformationDetail.oneout = '无';
  840. }else{
  841. var oneout = content[(module.data.outProjectInformationDetail.oneout-1)].dictLabel;
  842. module.data.outProjectInformationDetail.oneout = oneout;
  843. }
  844. var rollout = content[(module.data.outProjectInformationDetail.rollout-1)].dictLabel;
  845. module.data.outProjectInformationDetail.rollout = rollout;
  846. var outProjectInformationData = template('outProjectInformationData', module.data);
  847. $("#outProjectInformationContent").html(outProjectInformationData);
  848. }
  849. }
  850. //面积单位
  851. module.areaDictionaries = function (data) {
  852. if (data.code == 200 && module.data.outProjectInformationDetail.allCountUnit!='') {
  853. var content = data.data;
  854. var allCountUnit = content[(module.data.outProjectInformationDetail.allCountUnit-1)].dictLabel;
  855. module.data.outProjectInformationDetail.allCountUnit = allCountUnit;
  856. if(module.data.outProjectInformationDetail.subjectList.length>0){
  857. for(var i = 0 ; i < module.data.outProjectInformationDetail.subjectList.length ; i++){
  858. module.data.outProjectInformationDetail.subjectList[i].areaUnit = content[(module.data.outProjectInformationDetail.subjectList[i].areaUnit-1)].dictLabel;
  859. }
  860. }
  861. var outProjectInformationData = template('outProjectInformationData', module.data);
  862. $("#outProjectInformationContent").html(outProjectInformationData);
  863. }
  864. }
  865. //支付方式
  866. module.paymentTypeDictionaries = function (data) {
  867. if (data.code == 200 && module.data.outProjectInformationDetail.paymentType!='') {
  868. var content = data.data;
  869. var paymentType = content[(module.data.outProjectInformationDetail.paymentType-1)].dictLabel;
  870. module.data.outProjectInformationDetail.paymentType = paymentType;
  871. var outProjectInformationData = template('outProjectInformationData', module.data);
  872. $("#outProjectInformationContent").html(outProjectInformationData);
  873. }
  874. }
  875. //缴纳形式
  876. module.depositPaymentTypeDictionaries = function (data) {
  877. if (data.code == 200 && module.data.outProjectInformationDetail.depositPaymentType!='') {
  878. var content = data.data;
  879. var depositPaymentType = content[(module.data.outProjectInformationDetail.depositPaymentType-1)].dictLabel;
  880. module.data.outProjectInformationDetail.depositPaymentType = depositPaymentType;
  881. var outProjectInformationData = template('outProjectInformationData', module.data);
  882. $("#outProjectInformationContent").html(outProjectInformationData);
  883. }
  884. }
  885. //交易方式
  886. module.transactionDictionaries = function (data) {
  887. if (data.code == 200 && module.data.outProjectInformationDetail.dealType!='') {
  888. var content = data.data;
  889. var dealType = content[(module.data.outProjectInformationDetail.dealType-1)].dictLabel;
  890. module.data.outProjectInformationDetail.dealType = dealType;
  891. var outProjectInformationData = template('outProjectInformationData', module.data);
  892. $("#outProjectInformationContent").html(outProjectInformationData);
  893. }
  894. }
  895. //竞价方式
  896. module.biddingTypeDictionaries = function (data) {
  897. if (data.code == 200 && module.data.outProjectInformationDetail.biddingType!='') {
  898. var content = data.data;
  899. var biddingType = content[(module.data.outProjectInformationDetail.biddingType-1)].dictLabel;
  900. module.data.outProjectInformationDetail.biddingType = biddingType;
  901. var outProjectInformationData = template('outProjectInformationData', module.data);
  902. $("#outProjectInformationContent").html(outProjectInformationData);
  903. }
  904. }
  905. //系统是否
  906. module.expireTypeDictionaries = function (data) {
  907. if (data.code == 200 && module.data.outProjectInformationDetail.expire!='') {
  908. var content = data.data;
  909. var expire = content[(module.data.outProjectInformationDetail.expire-1)].dictLabel;
  910. module.data.outProjectInformationDetail.expire = expire;
  911. var outProjectInformationData = template('outProjectInformationData', module.data);
  912. $("#outProjectInformationContent").html(outProjectInformationData);
  913. }
  914. }
  915. //系统是否
  916. module.biddingDirectDictionaries = function (data) {
  917. if (data.code == 200 && module.data.outProjectInformationDetail.biddingDirect!='') {
  918. var content = data.data;
  919. var biddingDirect = content[(module.data.outProjectInformationDetail.biddingDirect-1)].dictLabel;
  920. module.data.outProjectInformationDetail.biddingDirect = biddingDirect;
  921. var outProjectInformationData = template('outProjectInformationData', module.data);
  922. $("#outProjectInformationContent").html(outProjectInformationData);
  923. }
  924. }
  925. changeProMoney = function(){
  926. tools.doGet(projectNewBidMoney+getQueryVariable('id'), {}, module.biddingSubmitMethod);
  927. }
  928. changeProMoneyFirst = function(){
  929. tools.doGet(projectNewBidMoney+getQueryVariable('id'), {}, module.biddingSubmitMethodFirst);
  930. }
  931. module.biddingSubmitMethodFirst = function (data) {
  932. if (data.code == 200) {
  933. let newMoney;
  934. if (data.data){
  935. newMoney = data.data;
  936. }else{
  937. newMoney = module.data.outProjectInformationDetail.price;
  938. }
  939. //console.log(newMoney);
  940. var data = {};
  941. var projectId = getQueryVariable('id');
  942. var memberId = tools.getCookie('memberId');
  943. var userId = tools.getCookie('userId');
  944. var userAccount = tools.getCookie('phone');
  945. var userName = tools.getCookie('userName');
  946. var money = parseFloat(newMoney);
  947. // var loginTime = tools.getNowFormatDate();
  948. var loginTime = Date.now($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"));
  949. data['projectId'] = projectId;
  950. data['memberId'] = memberId;
  951. data['userId'] = userId;
  952. data['userAccount'] = userAccount;
  953. data['userName'] = userName;
  954. data['money'] = money;
  955. data['loginTime'] = loginTime;
  956. tools.doPost(biddingSubmit, data, module.biddingSubmitOpen);
  957. }
  958. }
  959. //向上加价
  960. upMoney = function(){
  961. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  962. if (module.data.biddinglistInformationDetail.length<1){
  963. if(module.data.outProjectInformationDetail.price <= $('#money').val()){
  964. tools.initError('出价不能高于挂牌价格');
  965. return;
  966. }
  967. }else{
  968. if(module.data.biddinglistInformationDetail[0].money <= (parseFloat($('#money').val())+parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)){
  969. tools.initError('出价不能高于当前出价最低价格');
  970. return;
  971. }
  972. }
  973. }else{
  974. if (module.data.biddinglistInformationDetail.length<1){
  975. if(module.data.outProjectInformationDetail.price>$('#money').val()){
  976. tools.initError('出价不能低于挂牌价格');
  977. return;
  978. }
  979. }else{
  980. if(module.data.biddinglistInformationDetail[0].money>=$('#money').val()){
  981. tools.initError('出价不能低于当前出价最高价格');
  982. return;
  983. }
  984. }
  985. }
  986. $('#money').val() == null||$('#money').val() == ''?$('#money').val(0):'';
  987. //console.log($('#money').val())
  988. module.data.outProjectInformationDetail.ladderPrice?$('#money').val((parseFloat($('#money').val())+parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)):document.getElementById('money').value += 1
  989. }
  990. //向下降价
  991. downMoney = function(){
  992. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  993. if (module.data.biddinglistInformationDetail.length<1){
  994. if(module.data.outProjectInformationDetail.price<$('#money').val()){
  995. tools.initError('出价不能高于挂牌价格');
  996. return;
  997. }
  998. }else{
  999. if(module.data.biddinglistInformationDetail[0].money<$('#money').val()){
  1000. tools.initError('出价不能高于当前出价最低价格');
  1001. return;
  1002. }
  1003. }
  1004. }else{
  1005. if (module.data.biddinglistInformationDetail.length<1){
  1006. if(module.data.outProjectInformationDetail.price>=$('#money').val()){
  1007. tools.initError('出价不能低于挂牌价格');
  1008. return;
  1009. }
  1010. }else{
  1011. if(module.data.biddinglistInformationDetail[0].money>=(parseFloat($('#money').val())-parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)){
  1012. tools.initError('出价不能低于当前出价最高价格');
  1013. return;
  1014. }
  1015. }
  1016. }
  1017. $('#money').val() == null?$('#money').val(0):'';
  1018. if ($('#money').val() == 0)return;
  1019. module.data.outProjectInformationDetail.ladderPrice?$('#money').val((parseFloat($('#money').val())-parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)):document.getElementById('money').value -= 1
  1020. }
  1021. moneyChange = function(){
  1022. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  1023. if(module.data.outProjectInformationDetail.price<$('#money').val()){
  1024. $('#money').val(module.data.outProjectInformationDetail.price-1);
  1025. }
  1026. }
  1027. }
  1028. //登陆跳转
  1029. goLogin = function(){
  1030. tools.initDialog('登陆提示', '登陆后可参与竞价,是否登录?', function () {
  1031. tools.skip('../login/login.html')
  1032. }, '登录', function () { }, "取消")
  1033. }
  1034. return module;
  1035. });