网站
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

1132 рядки
55 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. var nowTime = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  390. console.log(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")))
  391. var difference = Date.parse(biddingStopTime)-nowTime;
  392. // var centerTime = module.data.timeConfig * 60 * 1000
  393. var centerTime = content.delayPeriod * 1000
  394. if ( 0 <= difference&&difference <= centerTime){
  395. // console.log("竞价最后两分钟")
  396. //正在竞价
  397. var m,s;
  398. if(module.data.outProjectInformationDetail.biddingType == '自由竞价'){
  399. document.getElementById('biddingTable').style.display = 'none';
  400. document.getElementById('biddingTitle').style.display = 'block';
  401. document.getElementById('biddingTitle').innerHTML = '竞价进行中...';
  402. }
  403. // document.getElementById('swiperType').style.display = 'block';
  404. module.data.biddingTimeType = 1;
  405. m = Math.floor(difference/1000/60%60);
  406. s = Math.floor(difference/1000%60);
  407. $('#countType').html('竞价中')
  408. $('#countDown').html('<span>距竞价结束还有:0</span>天<span>0</span>时<span>'+m+'</span>分<span>'+s+'</span>秒')
  409. if(module.data.outProjectInformationDetail.biddingType != '自由竞价' && module.data.biddingTimeType != 2){
  410. document.getElementById('showNowMoney').style.display = 'table-row';
  411. var timName = document.getElementById('timeDown');
  412. if(timName) {
  413. document.getElementById('timeDown').style.display = 'inline-block';
  414. timName.innerHTML = t + '<b style="color: #666666">秒后自动刷新</b>';
  415. }
  416. t--;
  417. if (t < 0) {
  418. t = 3;
  419. tools.doGet(biddinglist, {projectId: getQueryVariable('id')}, module.biddinglistInformation, true);
  420. }
  421. }
  422. if(module.data.loginNow){ //判断是否登录(已登录)
  423. if(module.data.signup == 1){ //判断是否报名(已报名)
  424. if( module.data.biddingTimeType == 1 ){ //判断当前竞价状态(竞价中)
  425. document.getElementById('signYes').style.display = 'none';
  426. document.getElementById('signNo').style.display = 'none';
  427. document.getElementById('signBtn').style.display = 'none';
  428. document.getElementById('signBtn2').style.display = 'none';
  429. document.getElementById('noAction').style.display = 'none';
  430. document.getElementById('moneyText').style.display = 'table-row';
  431. document.getElementById('moneyBtn').style.display = 'flex';
  432. }else if( module.data.biddingTimeType == 3 ){ //判断当前竞价状态(竞价未开始)
  433. document.getElementById('moneyText').style.display = 'none';
  434. document.getElementById('moneyBtn').style.display = 'none';
  435. document.getElementById('signNo').style.display = 'none';
  436. document.getElementById('signBtn').style.display = 'none';
  437. document.getElementById('signBtn2').style.display = 'none';
  438. document.getElementById('noAction').style.display = 'none';
  439. document.getElementById('signYes').style.display = 'block';
  440. }else{ //判断当前竞价状态(竞价结束)
  441. $('.swiperInput').css('display','none');
  442. $('#timeDown').css('display','none');
  443. clearInterval(module.data.timeDown)
  444. }
  445. }else{ //判断是否报名(未报名)
  446. if( module.data.signupTimeType == 1 ){ //判断当前报名状态(正在报名)
  447. document.getElementById('moneyText').style.display = 'none';
  448. document.getElementById('moneyBtn').style.display = 'none';
  449. document.getElementById('signNo').style.display = 'none';
  450. document.getElementById('signBtn2').style.display = 'none';
  451. document.getElementById('noAction').style.display = 'none';
  452. document.getElementById('signYes').style.display = 'none';
  453. document.getElementById('signBtn').style.display = 'block';
  454. }else if( module.data.signupTimeType == 3 ){ //判断当前报名状态(报名未开始)
  455. document.getElementById('moneyText').style.display = 'none';
  456. document.getElementById('moneyBtn').style.display = 'none';
  457. document.getElementById('signBtn2').style.display = 'none';
  458. document.getElementById('signYes').style.display = 'none';
  459. document.getElementById('signBtn').style.display = 'none';
  460. document.getElementById('signNo').style.display = 'none';
  461. document.getElementById('noAction').style.display = 'block';
  462. }else{ //判断当前报名状态(报名结束)
  463. document.getElementById('moneyText').style.display = 'none';
  464. document.getElementById('moneyBtn').style.display = 'none';
  465. document.getElementById('signBtn2').style.display = 'none';
  466. document.getElementById('noAction').style.display = 'none';
  467. document.getElementById('signYes').style.display = 'none';
  468. document.getElementById('signBtn').style.display = 'none';
  469. document.getElementById('signNo').style.display = 'block';
  470. }
  471. }
  472. }else{ //判断是否登录(未登录)
  473. if( module.data.biddingTimeType == 2 ){//判断当前竞价状态(竞价结束)
  474. $('.swiperInput').css('display','none')
  475. }else{
  476. document.getElementById('signBtn2').style.display = 'block';
  477. }
  478. }
  479. console.log(s+'-------------'+m)
  480. if (s < 1 && m < 1){
  481. console.log("竞价结束22222222222")
  482. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){
  483. if (data.code == 200) {
  484. var nowDate = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  485. module.data.outProjectInformationDetail.biddingStopTime = data.data
  486. let timeNew = Date.parse(data.data) + 0 - nowDate;
  487. if (timeNew > 0) {
  488. module.data.outProjectInformationDetail.biddingStopTime = data.data;
  489. // module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,data.data);
  490. }else{
  491. $('#countType').html('')
  492. $('#countDown').html('竞价结束')
  493. // document.getElementById('swiperType').style.display = 'none';
  494. document.getElementById('biddingTable').style.display = 'table';
  495. document.getElementById('biddingTitle').style.display = 'none';
  496. module.data.biddingTimeType = 2;
  497. return;
  498. }
  499. }
  500. },true);
  501. }else if(s%2 == 0&&centerTime!=0){
  502. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, module.getBiddingStopTime,true);
  503. }
  504. }else{
  505. if (!signupStartTime){console.log('缺失报名开始时间');return;}
  506. if (!signupStopTime){console.log('缺失报名结束时间');return;}
  507. if (!biddingStartTime){console.log('缺失竞价开始时间');return;}
  508. if (!biddingStopTime){console.log('缺失竞价结束时间');return;}
  509. module.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime);
  510. }
  511. if(module.data.outProjectInformationDetail.biddingType == '自由竞价' && module.data.biddingTimeType != 2){
  512. document.getElementById('biddingTable').style.display = 'none';
  513. document.getElementById('biddingTitle').style.display = 'block';
  514. }
  515. },1000)
  516. //倒计时
  517. // module.data.timer2 = setInterval(function(){
  518. // //交易项目竞价记录
  519. // tools.doGet(biddinglist, {projectId:getQueryVariable('id')}, module.biddinglistInformationNew,true);
  520. //
  521. // },10000)
  522. if(module.data.loginNow){
  523. //判断是否报名
  524. tools.doGet(signup, {projectId:getQueryVariable('id'),depositStatus:'1',memberId:tools.getCookie('memberId')}, module.signup);
  525. tools.doGet(signup, {projectId:getQueryVariable('id'),memberId:tools.getCookie('memberId')}, module.signup2);
  526. }
  527. }
  528. }
  529. module.getBiddingStopTime = function(data){
  530. if (data.code == 200) {
  531. $('#stopTime').html(data.data)
  532. module.data.outProjectInformationDetail.biddingStopTime = data.data
  533. }
  534. }
  535. module.signup2 = function(data){
  536. if (data.code == 200) {
  537. module.data.signHistory = data.data
  538. }
  539. }
  540. //标的物图片
  541. module.showImgInformation = function (data) {
  542. if (data.code == 200) {
  543. var content = data.data;
  544. console.log(content)
  545. var contentList = [];
  546. for(var i = 0 ; i < content.length ; i++){
  547. contentList[i] = serverApi+content[i].fileUrl;
  548. }
  549. module.data.showImgInformationDetail = contentList;
  550. console.log(contentList)
  551. var showImgInformationData = template('showImgInformationData', module.data);
  552. $("#tabDetail2").html(showImgInformationData);
  553. }
  554. }
  555. //竞价记录
  556. module.biddinglistInformation = function (data) {
  557. if (data.code == 200) {
  558. var content = data.rows;
  559. if (content.length>0){
  560. console.log('abccba')
  561. $("#nowMoneyBlock").html('<span id="nowMoney">'+content[0].money+'</span> 元');
  562. }else{
  563. $("#nowMoneyBlock").html('暂无出价');
  564. }
  565. if(module.data.biddinglistInformationDetailLength == content.length){
  566. return;
  567. }
  568. console.log(module.data.outProjectInformationDetail.biddingDirect)
  569. console.log(module.data.outProjectInformationDetail.biddingType)
  570. setTimeout(function(){
  571. if(module.data.outProjectInformationDetail.biddingType == '阶梯竞价'||module.data.outProjectInformationDetail.biddingType == '2'){
  572. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'||module.data.outProjectInformationDetail.biddingDirect == '2'){
  573. if (content.length>0){
  574. let money = $('#money').val()?$('#money').val():content[0].money
  575. if(content[0].money<=money) {
  576. document.getElementById('money').value = parseFloat(parseFloat(content[0].money) - parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2);
  577. }
  578. }else{
  579. document.getElementById('money').value = parseFloat(parseFloat(module.data.outProjectInformationDetail.price)).toFixed(2);
  580. // + parseFloat(module.data.outProjectInformationDetail.ladderPrice)
  581. }
  582. }else{
  583. if (content.length>0){
  584. let money = $('#money').val()?$('#money').val():content[0].money
  585. if(content[0].money>=money){
  586. document.getElementById('money').value = parseFloat(parseFloat(content[0].money) + parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2);
  587. }
  588. }else{
  589. document.getElementById('money').value = parseFloat(parseFloat(module.data.outProjectInformationDetail.price)).toFixed(2);
  590. // + parseFloat(module.data.outProjectInformationDetail.ladderPrice)
  591. }
  592. }
  593. }
  594. },2000)
  595. module.data.biddinglistInformationDetail = content;
  596. module.data.biddinglistInformationDetailLength = content.length;
  597. var biddinglistInformationData = template('biddinglistInformationData', module.data);
  598. $("#tabDetail4").html(biddinglistInformationData);
  599. if (content.length>0){
  600. console.log('abccba')
  601. $("#nowMoneyBlock").html('<span id="nowMoney">'+content[0].money+'</span> 元');}
  602. }
  603. }
  604. //竞价记录
  605. module.biddinglistInformationNew = function (data) {
  606. if (data.code == 200) {
  607. var content = data.rows;
  608. console.log(module.data.biddinglistInformationDetail.length+'----------------------'+content.length)
  609. if (module.data.biddinglistInformationDetailLength<content.length){
  610. let time = new Date(Date.parse(new Date())+(2 * 60 * 1000));
  611. const Y = time.getFullYear()
  612. const M = time.getMonth() + 1 < 10 ? '0'+(time.getMonth()+1) : time.getMonth()+1
  613. const D = time.getDate()
  614. const H = time.getHours() // 小时
  615. const m = time.getMinutes() // 分钟
  616. const S = time.getSeconds() // 秒
  617. module.data.biddingStopTime = Y+'-'+M+'-'+D+' '+H+':'+m+':'+S;
  618. module.data.biddinglistInformationDetailLength = content.length;
  619. }
  620. }
  621. }
  622. //焦点图滚动
  623. module.swiperBanner = function (type) {
  624. console.log('aaaa')
  625. var viewSwiper = new Swiper('.view .swiper-container', {
  626. onSlideChangeStart: function() {
  627. updateNavPosition()
  628. }
  629. })
  630. $('.view .arrow-left,.preview .arrow-left').on('click', function(e) {
  631. console.log('abc')
  632. e.preventDefault()
  633. if (viewSwiper.activeIndex == 0) {
  634. viewSwiper.swipeTo(viewSwiper.slides.length - 1, 1000);
  635. return
  636. }
  637. viewSwiper.swipePrev()
  638. })
  639. $('.view .arrow-right,.preview .arrow-right').on('click', function(e) {
  640. console.log('abc')
  641. e.preventDefault()
  642. if (viewSwiper.activeIndex == viewSwiper.slides.length - 1) {
  643. viewSwiper.swipeTo(0, 1000);
  644. return
  645. }
  646. viewSwiper.swipeNext()
  647. })
  648. var previewSwiper = new Swiper('.preview .swiper-container', {
  649. visibilityFullFit: true,
  650. slidesPerView: 'auto',
  651. onlyExternal: true,
  652. onSlideClick: function() {
  653. viewSwiper.swipeTo(previewSwiper.clickedSlideIndex)
  654. }
  655. })
  656. function updateNavPosition() {
  657. $('.preview .active-nav').removeClass('active-nav')
  658. var activeNav = $('.preview .swiper-slide').eq(viewSwiper.activeIndex).addClass('active-nav')
  659. if (!activeNav.hasClass('swiper-slide-visible')) {
  660. if (activeNav.index() > previewSwiper.activeIndex) {
  661. var thumbsPerNav = Math.floor(previewSwiper.width / activeNav.width()) - 1
  662. previewSwiper.swipeTo(activeNav.index() - thumbsPerNav)
  663. } else {
  664. previewSwiper.swipeTo(activeNav.index())
  665. }
  666. }
  667. }
  668. }
  669. //切换
  670. tabClick = function(type){
  671. //标的物介绍
  672. for (var i = 0 ; i < 4 ; i++){
  673. document.getElementById('tabDetail'+(i+1)).style.display = 'none';
  674. document.getElementById('tab'+(i+1)).classList = '';
  675. }
  676. document.getElementById('tabDetail'+type).style.display = 'block';
  677. document.getElementById('tab'+type).classList = 'active';
  678. }
  679. //挂牌价格
  680. module.unitDictionaries = function (data) {
  681. if (data.code == 200) {
  682. var content = data.data;
  683. var unit = content[(module.data.outProjectInformationDetail.unit-1)].dictLabel;
  684. module.data.outProjectInformationDetail.unit = unit;
  685. var outProjectInformationData = template('outProjectInformationData', module.data);
  686. $("#outProjectInformationContent").html(outProjectInformationData);
  687. }
  688. }
  689. //出价
  690. module.biddingSubmitMethod = function (data2) {
  691. let newMoney;
  692. if (data2.data&&data2.code==200){
  693. console.log(data2)
  694. newMoney = data2.data;
  695. }else{
  696. newMoney = module.data.outProjectInformationDetail.price;
  697. }
  698. if ($('#money').val()<=0){
  699. tools.initError('请正常出价!');
  700. return;
  701. }
  702. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  703. //判断用户出价不能高于挂牌价
  704. if(module.data.outProjectInformationDetail.price<$('#money').val()){
  705. tools.initError('出价不能高于挂牌价');
  706. return;
  707. }else{
  708. //判断当前竞价方式
  709. if (module.data.outProjectInformationDetail.biddingType=='阶梯竞价' || module.data.outProjectInformationDetail.biddingType=='公开竞价'){
  710. //判断当前是否有人出价
  711. if (data2.data){
  712. //判断用户出价不能高于当前出价最低价格
  713. if(newMoney <= $('#money').val()){
  714. tools.initError('不能高于当前最低价格!');
  715. return;
  716. }
  717. }
  718. }
  719. }
  720. }else{
  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. }
  738. var data = {};
  739. var projectId = getQueryVariable('id');
  740. var memberId = tools.getCookie('memberId');
  741. var userId = tools.getCookie('userId');
  742. var userAccount = tools.getCookie('phone');
  743. var userName = tools.getCookie('userName');
  744. var money = parseFloat($('#money').val());
  745. var loginTime = Date.now($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"));
  746. data['projectId'] = projectId;
  747. data['memberId'] = memberId;
  748. data['userId'] = userId;
  749. data['userAccount'] = userAccount;
  750. data['userName'] = userName;
  751. data['money'] = money;
  752. data['loginTime'] = loginTime;
  753. tools.doPost(biddingSubmit, data, module.biddingSubmitOpen);
  754. }
  755. module.biddingSubmitOpen = function(){
  756. tools.doGet(getBiddingStopTime+getQueryVariable('id'), {}, function(data){
  757. if (data.code == 200) {
  758. var nowDate = Date.parse(new Date($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date")));
  759. module.data.outProjectInformationDetail.biddingStopTime = data.data
  760. let timeNew = Date.parse(data.data) + 0 - nowDate;
  761. if (timeNew > 0) {
  762. module.data.outProjectInformationDetail.biddingStopTime = data.data;
  763. module.dataCompare(
  764. module.data.outProjectInformationDetail.signupStartTime,
  765. module.data.outProjectInformationDetail.signupStopTime,
  766. module.data.outProjectInformationDetail.biddingStartTime,data.data);
  767. }else{
  768. $('#countType').html('')
  769. $('#countDown').html('竞价结束')
  770. // document.getElementById('swiperType').style.display = 'none';
  771. document.getElementById('biddingTable').style.display = 'table';
  772. document.getElementById('biddingTitle').style.display = 'none';
  773. module.data.biddingTimeType = 2;
  774. return;
  775. }
  776. }
  777. },true);
  778. tools.initError('出价成功');
  779. // $('#money').val(0)
  780. }
  781. //经济类型
  782. module.economicTypeDictionaries = function (data) {
  783. if (data.code == 200 && module.data.outProjectInformationDetail.economicType!='') {
  784. var content = data.data;
  785. if(content[(module.data.outProjectInformationDetail.economicType-1)] != undefined){
  786. var economicType = content[(module.data.outProjectInformationDetail.economicType-1)].dictLabel;
  787. module.data.outProjectInformationDetail.economicType = economicType;
  788. var outProjectInformationData = template('outProjectInformationData', module.data);
  789. $("#outProjectInformationContent").html(outProjectInformationData);
  790. }
  791. }
  792. }
  793. //项目类型
  794. module.projectNumberDictionaries = function (data) {
  795. if (data.code == 200 && module.data.outProjectInformationDetail.projectNumber!='') {
  796. var content = data.data;
  797. var projectNumber = content.filter(function (e) { return e.dictValue == module.data.outProjectInformationDetail.projectNumber; })[0].dictLabel;
  798. module.data.outProjectInformationDetail.projectNumber = projectNumber;
  799. var outProjectInformationData = template('outProjectInformationData', module.data);
  800. $("#outProjectInformationContent").html(outProjectInformationData);
  801. }
  802. }
  803. //农地性质
  804. module.projectTypeDictionaries = function (data) {
  805. if (data.code == 200 && module.data.outProjectInformationDetail.projectType!='') {
  806. var content = data.data;
  807. console.log(content)
  808. console.log((module.data.outProjectInformationDetail.projectType-1))
  809. var projectType = content[(module.data.outProjectInformationDetail.projectType-1)].dictLabel;
  810. module.data.outProjectInformationDetail.projectType = projectType;
  811. var outProjectInformationData = template('outProjectInformationData', module.data);
  812. $("#outProjectInformationContent").html(outProjectInformationData);
  813. }
  814. }
  815. //前次转出方式
  816. module.oneoutDictionaries = function (data) {
  817. if (data.code == 200 && module.data.outProjectInformationDetail.oneout!='') {
  818. var content = data.data;
  819. if(module.data.outProjectInformationDetail.oneout == 0){
  820. module.data.outProjectInformationDetail.oneout = '无';
  821. }else{
  822. var oneout = content[(module.data.outProjectInformationDetail.oneout-1)].dictLabel;
  823. module.data.outProjectInformationDetail.oneout = oneout;
  824. }
  825. var rollout = content[(module.data.outProjectInformationDetail.rollout-1)].dictLabel;
  826. module.data.outProjectInformationDetail.rollout = rollout;
  827. var outProjectInformationData = template('outProjectInformationData', module.data);
  828. $("#outProjectInformationContent").html(outProjectInformationData);
  829. }
  830. }
  831. //面积单位
  832. module.areaDictionaries = function (data) {
  833. if (data.code == 200 && module.data.outProjectInformationDetail.allCountUnit!='') {
  834. var content = data.data;
  835. var allCountUnit = content[(module.data.outProjectInformationDetail.allCountUnit-1)].dictLabel;
  836. module.data.outProjectInformationDetail.allCountUnit = allCountUnit;
  837. if(module.data.outProjectInformationDetail.subjectList.length>0){
  838. for(var i = 0 ; i < module.data.outProjectInformationDetail.subjectList.length ; i++){
  839. module.data.outProjectInformationDetail.subjectList[i].areaUnit = content[(module.data.outProjectInformationDetail.subjectList[i].areaUnit-1)].dictLabel;
  840. }
  841. }
  842. var outProjectInformationData = template('outProjectInformationData', module.data);
  843. $("#outProjectInformationContent").html(outProjectInformationData);
  844. }
  845. }
  846. //支付方式
  847. module.paymentTypeDictionaries = function (data) {
  848. if (data.code == 200 && module.data.outProjectInformationDetail.paymentType!='') {
  849. var content = data.data;
  850. var paymentType = content[(module.data.outProjectInformationDetail.paymentType-1)].dictLabel;
  851. module.data.outProjectInformationDetail.paymentType = paymentType;
  852. var outProjectInformationData = template('outProjectInformationData', module.data);
  853. $("#outProjectInformationContent").html(outProjectInformationData);
  854. }
  855. }
  856. //缴纳形式
  857. module.depositPaymentTypeDictionaries = function (data) {
  858. if (data.code == 200 && module.data.outProjectInformationDetail.depositPaymentType!='') {
  859. var content = data.data;
  860. var depositPaymentType = content[(module.data.outProjectInformationDetail.depositPaymentType-1)].dictLabel;
  861. module.data.outProjectInformationDetail.depositPaymentType = depositPaymentType;
  862. var outProjectInformationData = template('outProjectInformationData', module.data);
  863. $("#outProjectInformationContent").html(outProjectInformationData);
  864. }
  865. }
  866. //交易方式
  867. module.transactionDictionaries = function (data) {
  868. if (data.code == 200 && module.data.outProjectInformationDetail.dealType!='') {
  869. var content = data.data;
  870. var dealType = content[(module.data.outProjectInformationDetail.dealType-1)].dictLabel;
  871. module.data.outProjectInformationDetail.dealType = dealType;
  872. var outProjectInformationData = template('outProjectInformationData', module.data);
  873. $("#outProjectInformationContent").html(outProjectInformationData);
  874. }
  875. }
  876. //竞价方式
  877. module.biddingTypeDictionaries = function (data) {
  878. if (data.code == 200 && module.data.outProjectInformationDetail.biddingType!='') {
  879. var content = data.data;
  880. var biddingType = content[(module.data.outProjectInformationDetail.biddingType-1)].dictLabel;
  881. module.data.outProjectInformationDetail.biddingType = biddingType;
  882. var outProjectInformationData = template('outProjectInformationData', module.data);
  883. $("#outProjectInformationContent").html(outProjectInformationData);
  884. }
  885. }
  886. //系统是否
  887. module.expireTypeDictionaries = function (data) {
  888. if (data.code == 200 && module.data.outProjectInformationDetail.expire!='') {
  889. var content = data.data;
  890. var expire = content[(module.data.outProjectInformationDetail.expire-1)].dictLabel;
  891. module.data.outProjectInformationDetail.expire = expire;
  892. var outProjectInformationData = template('outProjectInformationData', module.data);
  893. $("#outProjectInformationContent").html(outProjectInformationData);
  894. }
  895. }
  896. //系统是否
  897. module.biddingDirectDictionaries = function (data) {
  898. if (data.code == 200 && module.data.outProjectInformationDetail.biddingDirect!='') {
  899. var content = data.data;
  900. var biddingDirect = content[(module.data.outProjectInformationDetail.biddingDirect-1)].dictLabel;
  901. module.data.outProjectInformationDetail.biddingDirect = biddingDirect;
  902. var outProjectInformationData = template('outProjectInformationData', module.data);
  903. $("#outProjectInformationContent").html(outProjectInformationData);
  904. }
  905. }
  906. changeProMoney = function(){
  907. tools.doGet(projectNewBidMoney+getQueryVariable('id'), {}, module.biddingSubmitMethod);
  908. }
  909. changeProMoneyFirst = function(){
  910. tools.doGet(projectNewBidMoney+getQueryVariable('id'), {}, module.biddingSubmitMethodFirst);
  911. }
  912. module.biddingSubmitMethodFirst = function (data) {
  913. if (data.code == 200) {
  914. let newMoney;
  915. if (data.data){
  916. newMoney = data.data;
  917. }else{
  918. newMoney = module.data.outProjectInformationDetail.price;
  919. }
  920. console.log(newMoney);
  921. var data = {};
  922. var projectId = getQueryVariable('id');
  923. var memberId = tools.getCookie('memberId');
  924. var userId = tools.getCookie('userId');
  925. var userAccount = tools.getCookie('phone');
  926. var userName = tools.getCookie('userName');
  927. var money = parseFloat(newMoney);
  928. // var loginTime = tools.getNowFormatDate();
  929. var loginTime = Date.now($.ajax({type:'HEAD',async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"));
  930. data['projectId'] = projectId;
  931. data['memberId'] = memberId;
  932. data['userId'] = userId;
  933. data['userAccount'] = userAccount;
  934. data['userName'] = userName;
  935. data['money'] = money;
  936. data['loginTime'] = loginTime;
  937. tools.doPost(biddingSubmit, data, module.biddingSubmitOpen);
  938. }
  939. }
  940. //向上加价
  941. upMoney = function(){
  942. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  943. if (module.data.biddinglistInformationDetail.length<1){
  944. if(module.data.outProjectInformationDetail.price <= $('#money').val()){
  945. tools.initError('出价不能高于挂牌价格');
  946. return;
  947. }
  948. }else{
  949. if(module.data.biddinglistInformationDetail[0].money <= (parseFloat($('#money').val())+parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)){
  950. tools.initError('出价不能高于当前出价最低价格');
  951. return;
  952. }
  953. }
  954. }else{
  955. if (module.data.biddinglistInformationDetail.length<1){
  956. if(module.data.outProjectInformationDetail.price>$('#money').val()){
  957. tools.initError('出价不能低于挂牌价格');
  958. return;
  959. }
  960. }else{
  961. if(module.data.biddinglistInformationDetail[0].money>=$('#money').val()){
  962. tools.initError('出价不能低于当前出价最高价格');
  963. return;
  964. }
  965. }
  966. }
  967. $('#money').val() == null||$('#money').val() == ''?$('#money').val(0):'';
  968. console.log($('#money').val())
  969. module.data.outProjectInformationDetail.ladderPrice?$('#money').val((parseFloat($('#money').val())+parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)):document.getElementById('money').value += 1
  970. }
  971. //向下降价
  972. downMoney = function(){
  973. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  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. }else{
  986. if (module.data.biddinglistInformationDetail.length<1){
  987. if(module.data.outProjectInformationDetail.price>=$('#money').val()){
  988. tools.initError('出价不能低于挂牌价格');
  989. return;
  990. }
  991. }else{
  992. if(module.data.biddinglistInformationDetail[0].money>=(parseFloat($('#money').val())-parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)){
  993. tools.initError('出价不能低于当前出价最高价格');
  994. return;
  995. }
  996. }
  997. }
  998. $('#money').val() == null?$('#money').val(0):'';
  999. if ($('#money').val() == 0)return;
  1000. module.data.outProjectInformationDetail.ladderPrice?$('#money').val((parseFloat($('#money').val())-parseFloat(module.data.outProjectInformationDetail.ladderPrice)).toFixed(2)):document.getElementById('money').value -= 1
  1001. }
  1002. moneyChange = function(){
  1003. if (module.data.outProjectInformationDetail.biddingDirect == '反向竞价'){
  1004. if(module.data.outProjectInformationDetail.price<$('#money').val()){
  1005. $('#money').val(module.data.outProjectInformationDetail.price-1);
  1006. }
  1007. }
  1008. }
  1009. //登陆跳转
  1010. goLogin = function(){
  1011. tools.initDialog('登陆提示', '登陆后可参与竞价,是否登录?', function () {
  1012. tools.skip('../login/login.html')
  1013. }, '登录', function () { }, "取消")
  1014. }
  1015. return module;
  1016. });