网站
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

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