网站
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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