网站
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

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