移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

1189 Zeilen
42 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. title="项目详情"
  5. left-arrow
  6. fixed
  7. placeholder
  8. @click-left="$router.back(-1)"
  9. />
  10. <van-tabs scrollspy sticky color="#007b76" >
  11. <van-tab title="竞拍信息" title-style="font-size:12px;">
  12. <!-- <van-swipe class="my-swipe" height="235" indicator-color="white" @change="onChange">-->
  13. <!-- <template v-if="detail.fileUrlList !== undefined &&detail.fileUrlList.length>0">-->
  14. <!-- <van-swipe-item v-for="(item,index) in detail.fileUrlList" :key="index"><van-image :src="item.fileUrl?'/api'+item.fileUrl:'../../static/images/zwtp.jpg'" height="235" /></van-swipe-item>-->
  15. <!-- </template>-->
  16. <!-- <template v-else>-->
  17. <!-- <van-swipe-item><van-image src="../../static/images/zwtp.jpg" height="235" /></van-swipe-item>-->
  18. <!-- </template>-->
  19. <!-- <template #indicator>-->
  20. <!-- <div class="custom-indicator">{{ current + 1 }}/{{ detail.fileUrlList !== undefined &&detail.fileUrlList.length>0 ? detail.fileUrlList.length:1 }}</div>-->
  21. <!-- </template>-->
  22. <!-- </van-swipe>-->
  23. <van-notice-bar color="#fff" background="#007E72" left-icon="clock-o">
  24. {{ process }}&nbsp&nbsp&nbsp&nbsp<span id="timeData"></span>
  25. <!-- <van-count-down ref="countDown" :time="time" format="DD 天 HH 时 mm 分 ss 秒" @change="timerChange" />-->
  26. </van-notice-bar>
  27. <div class="information">
  28. <van-row>
  29. <van-col span="24" class="title">【{{ detail.rollout }}】{{ detail.projectName }}</van-col>
  30. </van-row>
  31. <van-row>
  32. <van-col span="5">挂牌价</van-col>
  33. <van-col span="19" class="price"><span>{{detail.price}}</span> {{detail.unit}}</van-col>
  34. </van-row>
  35. <van-row>
  36. <van-col span="5">保证金</van-col>
  37. <van-col span="19" class="money"><span>{{ detail.deposit }}</span> 元</van-col>
  38. </van-row>
  39. </div>
  40. <div class="lead" v-if="detail.biddingType != '自由竞价' || biddingTimeType == 2">
  41. <van-row >
  42. <van-col span="2"><van-image src="../../static/images/icon/phone.png" style="vertical-align: text-top;" /></van-col>
  43. <template v-if="biddinglistInformation!=undefined&&biddinglistInformation.length>0">
  44. <van-col span="3">{{biddinglistInformation[0].memberId}}</van-col>
  45. <van-col span="6">{{biddinglistInformation[0].money}}元</van-col>
  46. <van-col span="4">领先</van-col>
  47. <van-col span="9">{{biddinglistInformation[0].createTime}}</van-col>
  48. </template>
  49. </van-row>
  50. </div>
  51. <div class="detail">
  52. <van-row>
  53. <van-col span="24"><span>报名开始时间:</span>{{ detail.signupStartTime }}</van-col>
  54. </van-row>
  55. <van-row>
  56. <van-col span="24"><span>报名截止时间:</span>{{ detail.signupStopTime }}</van-col>
  57. </van-row>
  58. <van-row>
  59. <van-col span="24"><span>竞价开始时间:</span>{{ detail.biddingStartTime }}</van-col>
  60. </van-row>
  61. <van-row>
  62. <van-col span="24"><span>竞价结束时间<span v-if="detail.delayPeriod!=0">(含延期)</span>:</span>{{ detail.biddingStopTime }}</van-col>
  63. </van-row>
  64. <van-row>
  65. <van-col span="24"><span>竞价方式:</span>{{ detail.biddingType }}</van-col>
  66. </van-row>
  67. <van-row>
  68. <van-col span="24"><span>竞价方向:</span>{{ detail.biddingDirect }}</van-col>
  69. </van-row>
  70. <van-row v-if="detail.ladderPrice&&detail.biddingType=='阶梯竞价'">
  71. <van-col span="24"><span>阶梯价(增减幅度):</span>¥{{ detail.ladderPrice }}</van-col>
  72. </van-row>
  73. <van-row v-if="detail.delayPeriod!=0">
  74. <van-col span="24"><span>延时周期:</span>{{detail.delayPeriod}}秒</van-col>
  75. </van-row>
  76. <van-row v-if="detail.delayPeriod!=0">
  77. <van-col span="24"><span>延时说明:</span>自由竞价期结束后,进入{{detail.delayPeriod}}秒延时竞价期;延时竞价期内但凡有出价,则继续延时竞价,直至无人出价!</van-col>
  78. </van-row>
  79. </div>
  80. </van-tab>
  81. <van-tab title="标的物介绍" title-style="font-size:12px;">
  82. <p class="delTitle">标的物介绍</p>
  83. <div class="introduce">
  84. <van-row>
  85. <van-col span="24" style="color:#333333;font-size: 0.4rem;text-align: center;font-weight: bold;">项目挂牌转出方简况及公告内容</van-col>
  86. </van-row>
  87. <van-row>
  88. <van-col span="24"><span>{{detail.projectNumber == '集体资产采购类' ? '建设方':'转出方'}}名称</span>{{ detail.outName }}</van-col>
  89. </van-row>
  90. <van-row>
  91. <van-col span="24"><span>住址</span>{{ detail.address }}</van-col>
  92. </van-row>
  93. <van-row>
  94. <van-col span="12"><span>经济类型</span>{{ detail.economicType }}</van-col>
  95. <van-col span="12"><span>统一社会信用代码</span>{{ detail.areaNum }}</van-col>
  96. </van-row>
  97. <van-row>
  98. <van-col span="12"><span>法人/负责人</span>{{ detail.legalPerson }}</van-col>
  99. <van-col span="12"><span>联系电话</span>{{ detail.phone }}</van-col>
  100. </van-row>
  101. <van-row>
  102. <van-col span="12"><span>项目类型</span>{{ detail.projectNumber }}</van-col>
  103. <van-col span="12"><span>农地性质</span>{{ detail.projectType }}</van-col>
  104. </van-row>
  105. <van-row>
  106. <van-col span="24"><span>转出项目名称</span>{{ detail.projectName }}</van-col>
  107. </van-row>
  108. <van-row>
  109. <van-col span="24"><span>坐落</span>{{ detail.locationName }}</van-col>
  110. </van-row>
  111. <!-- <van-row>-->
  112. <!-- <van-col span="14"><span>是否属再次转出</span>{{ detail.twoout == 'N'?"否":"是"}}</van-col>-->
  113. <!-- <van-col span="10"><span>前次转出方式</span>{{ detail.oneout}}</van-col>-->
  114. <!-- </van-row>-->
  115. <van-row>
  116. <van-col span="12"><span>拟转出方式</span>{{ detail.rollout }}</van-col>
  117. <van-col span="12"><span>拟转出面积/数量</span> {{detail.allCount}}{{detail.allCountUnit}} </van-col>
  118. </van-row>
  119. <van-row>
  120. <van-col span="24"><span>拟转出期限</span>{{detail.outStartTime}} 至 {{detail.outStopTime}}&nbsp&nbsp&nbsp&nbsp&nbsp共{{detail.outYearNum}}{{detail.outYearUnit}}</van-col>
  121. </van-row>
  122. <van-row>
  123. <van-col span="24"><span>涉及农户数</span>{{ detail.peasantNum }}</van-col>
  124. </van-row>
  125. <van-row>
  126. <van-col span="24"><span>支付方式</span>{{ detail.paymentType }}</van-col>
  127. </van-row>
  128. <van-row>
  129. <van-col span="24"><span>授权情况</span>{{ detail.authorization }}</van-col>
  130. </van-row>
  131. <van-row>
  132. <van-col span="24"><span>{{detail.projectNumber == '集体资产采购类' ? '工程内容':'拟流转土地用途'}}</span>{{ detail.contractPurpose }}</van-col>
  133. </van-row>
  134. <van-row>
  135. <van-col span="24"><span>{{detail.projectNumber == '集体资产采购类' ? '承包范围':'其它需要披露的事项'}}</span>{{ detail.cracksEvents }}</van-col>
  136. </van-row>
  137. <van-row>
  138. <van-col span="24"><span>受让方条件</span>{{ detail.condition }}</van-col>
  139. </van-row>
  140. <van-row>
  141. <van-col span="24" style="color:#007E72;">标的物信息</van-col>
  142. </van-row>
  143. <div class="project_info" v-for="(item,index) in detail.subjectList" :key="index">
  144. <van-row>
  145. <van-col span="8">{{ item.landName }}</van-col>
  146. <van-col span="8">{{ item.area }}{{item.areaUnit}}</van-col>
  147. <van-col span="8">{{ item.condition}}</van-col>
  148. </van-row>
  149. </div>
  150. </div>
  151. </van-tab>
  152. <van-tab title="标的物图片" title-style="font-size:12px;">
  153. <p class="delTitle">标的物图片</p>
  154. <template v-if="detail.fileUrlList !== undefined &&detail.fileUrlList.length>0">
  155. <van-image v-for="(item,index) in detail.fileUrlList" :key="index" :src="item.fileUrl?'/api'+item.fileUrl:'../../static/images/index/detailImg.png'" style="vertical-align: text-top;" />
  156. </template>
  157. <template v-else>
  158. <van-image src="../../static/images/index/detailImg.png" style="vertical-align: text-top;" />
  159. </template>
  160. </van-tab>
  161. <van-tab title="竞买须知" title-style="font-size:12px;">
  162. <p class="delTitle">竞买须知</p>
  163. <div class="notice" v-html="webConfig">
  164. </div>
  165. </van-tab>
  166. <van-tab title="竞价记录" title-style="font-size:12px;">
  167. <p class="delTitle">竞价记录</p>
  168. <div class="biddingList">
  169. <p v-if="detail.biddingType == '自由竞价' && biddingTimeType != 2">友情提示:自由竞价方式下,竞价过程中不显示竞价记录!</p>
  170. <table v-else width="100%" cellspacing="0">
  171. <tr>
  172. <td>出价人</td>
  173. <td>出价</td>
  174. <td>状态</td>
  175. <td>时间</td>
  176. </tr>
  177. <tr v-for="(item,index) in biddinglistInformation" :key="index">
  178. <td>{{ item.memberId }}</td>
  179. <td>{{ item.money}}</td>
  180. <template v-if="index==0">
  181. <td style="color:#C21F3A">领先</td>
  182. </template>
  183. <template v-else>
  184. <td></td>
  185. </template>
  186. <td>{{ item.loginTime }}</td>
  187. </tr>
  188. </table>
  189. </div>
  190. </van-tab>
  191. </van-tabs>
  192. <div style="height: 3rem;"></div>
  193. <div class="bottomBtn" v-if="bottomBtn">
  194. <van-row v-if="!showBtn">
  195. <!-- <van-col span="8" style="margin-top: 4px;" @click="showPopup">-->
  196. <!-- <van-image src="../../static/images/icon/clock.png" style="vertical-align: text-bottom;" />-->
  197. <!-- <p style="line-height: 0.2rem;color: #999999">提醒</p>-->
  198. <!-- </van-col>-->
  199. <van-col span="24">
  200. <van-button round color="#C21F3A" block :disabled="isSignup" @click="goSignUp">
  201. {{ btnMsg }}<br/>
  202. <span style="font-size: 10px">保证金¥{{detail.deposit}}</span>
  203. </van-button>
  204. </van-col>
  205. </van-row>
  206. <van-field v-if="showBtn&&detail.biddingType!='阶梯竞价'" v-model="price" type="number" input-align="center" placeholder="请输入出价金额" />
  207. <van-row v-if="showBtn" type="flex" justify="space-around">
  208. <van-col span="4" v-if="detail.ladderPrice&&detail.biddingType=='阶梯竞价'" style="text-align: center;line-height: 1rem">
  209. <van-button color="#e2e2e2" icon="minus" size="small" @click="sub"></van-button>
  210. </van-col>
  211. <van-col span="16">
  212. <div style="display: flex;">
  213. <van-button round color="#C21F3A" block @click="offer">
  214. <p>出价</p>
  215. <p v-if="detail.ladderPrice&&detail.biddingType=='阶梯竞价'">{{price}}元</p>
  216. </van-button>
  217. <van-button v-if="isFirst == 'Y'" round color="#C21F3A" block @click="offerFirst" style="margin-left: 10px;">
  218. <p>优先跟价</p>
  219. </van-button>
  220. </div>
  221. </van-col>
  222. <van-col span="4" v-if="detail.ladderPrice&&detail.biddingType=='阶梯竞价'" style="text-align: center;line-height: 1rem">
  223. <van-button color="#e2e2e2" icon="plus" size="small" @click="add"></van-button>
  224. </van-col>
  225. </van-row>
  226. </div>
  227. <van-popup v-model="show" class="popup" closeable>
  228. <van-image src="../../static/images/icon/success.png"/>
  229. <p class="popupTit">提醒设置成功</p>
  230. <p class="popupContent">系统将按要求提醒您竞拍</p>
  231. <van-button round color="#C21F3A" block class="iKnow">
  232. 我知道了
  233. </van-button>
  234. <p class="updatePopup">修改提醒方式</p>
  235. </van-popup>
  236. </div>
  237. </template>
  238. <script>
  239. import {
  240. biddingSubmit,
  241. getBiddingList, getBiddingStopTime,
  242. getMember,
  243. getOutProjectDetail,
  244. getSignup,
  245. getWebConfig,
  246. projectNewBidMoney
  247. } from "../../api/project";
  248. import {getInfo} from "../../api/login";
  249. import $ from "jquery";
  250. export default {
  251. name: "projectDetail",
  252. provide(){
  253. return{
  254. reload:this.reload
  255. }
  256. },
  257. data() {
  258. return {
  259. current: 0,
  260. show: false,
  261. id:this.$route.query.id,
  262. detail: {
  263. biddingType:'自由竞价'
  264. },
  265. webConfig:"",
  266. biddinglistInformation:[],
  267. rollout_type:[],
  268. process:"",
  269. tip:"",
  270. btnMsg:"",
  271. time:null,
  272. timeMsg:"",
  273. isSignup:true,
  274. showBtn:false,
  275. price:null,
  276. userAccount:"",
  277. userName:"",
  278. userId:"",
  279. timeConfig:'',
  280. biddinglistInformationLength:0,
  281. biddingTimeType:1,
  282. isFirst:'',
  283. timer:null,
  284. getSignupData:'',
  285. bottomBtn:false,
  286. delayPeriodNow:false,
  287. nowDate:0,
  288. biddingquery:{
  289. projectId:this.$route.query.id,
  290. pageSize:10,
  291. pageNum:1
  292. },
  293. timeData:'',
  294. timeCount:null
  295. };
  296. },
  297. computed: {
  298. getNowFormatDate:function(){
  299. let date = new Date();
  300. let seperator1 = "-";
  301. let seperator2 = ":";
  302. let month = date.getMonth() + 1;
  303. let day = date.getDate();
  304. let hours = date.getHours();
  305. let minutes = date.getMinutes();
  306. let seconds = date.getSeconds();
  307. if (month >= 1 && month <= 9) {
  308. month = "0" + month;
  309. }
  310. if (day >= 0 && day <= 9) {
  311. day = "0" + day;
  312. }
  313. if (hours >= 0 && hours <= 9) {
  314. hours = "0" + hours;
  315. }
  316. if (minutes >= 0 && minutes <= 9) {
  317. minutes = "0" + minutes;
  318. }
  319. if (seconds >= 0 && seconds <= 9) {
  320. seconds = "0" + seconds;
  321. }
  322. let currentdate = date.getFullYear() + seperator1 + month + seperator1 + day + " " + hours + seperator2 + minutes + seperator2 + seconds;
  323. //console.log(currentdate)
  324. return currentdate;
  325. }
  326. },
  327. created() {
  328. clearInterval(this.timer);
  329. this.reload();
  330. },
  331. methods: {
  332. goSignUp(){
  333. getInfo().then(response => {
  334. getMember(response.user.userId).then(resresponse => {
  335. let data= {
  336. projectId:this.id,
  337. memberId:resresponse.data.id,
  338. };
  339. var isSign;
  340. getSignup(data).then(r =>{
  341. if(r.data=="1"){
  342. isSign=true
  343. }
  344. })
  345. if (resresponse.data.auditStatus == 'Y'){
  346. if (isSign){
  347. this.$toast({
  348. icon: 'error', // 找到自己需要的图标
  349. message: '已报名,请耐心等待审核结果!',
  350. duration:"2000",
  351. onClose:function(){
  352. }
  353. })
  354. return;
  355. }
  356. this.$router.push(
  357. {
  358. path: 'signUp',
  359. query: {
  360. projectId: this.detail.id,
  361. deposit: this.detail.deposit,
  362. projectName: this.detail.projectName
  363. }
  364. }
  365. );
  366. }else{
  367. this.$toast({
  368. icon: 'error', // 找到自己需要的图标
  369. message: '交易中心审核注册信息后方可进行报名!',
  370. duration:"2000",
  371. onClose:function(){
  372. }
  373. })
  374. }
  375. })
  376. })
  377. },
  378. onChange(index) {
  379. this.current = index;
  380. },
  381. showPopup() {
  382. this.show = true;
  383. },
  384. reload(){
  385. //console.log("结束进入")
  386. getOutProjectDetail(this.id).then(response =>{
  387. this.detail=response.data
  388. this.getDicts("rollout_type").then(res =>{
  389. this.detail.rollout = this.selectDictLabel(res.data,response.data.rollout);
  390. if(this.detail.oneout==0){
  391. this.detail.oneout = "无"
  392. }else{
  393. this.detail.oneout = this.selectDictLabel(res.data,response.data.oneout);
  394. }
  395. })
  396. this.getDicts("project_type").then(res => {
  397. this.detail.projectNumber = this.selectDictLabel(res.data,response.data.projectNumber);
  398. });
  399. this.getDicts("sub_object_type").then(res => {
  400. // this.detail.projectType = this.selectDictLabel(res.data,response.data.projectType);
  401. });
  402. this.getDicts("economic_type").then(res => {
  403. this.detail.economicType = this.selectDictLabel(res.data,response.data.economicType);
  404. });
  405. this.getDicts("area_unit").then(res => {
  406. this.detail.allCountUnit = this.selectDictLabel(res.data,response.data.allCountUnit);
  407. });
  408. this.getDicts("bidding_type").then(res => {
  409. // debugger;
  410. this.detail.biddingType = this.selectDictLabel(res.data,response.data.biddingType);
  411. });
  412. this.getDicts("bidding_direct").then(res => {
  413. this.detail.biddingDirect = this.selectDictLabel(res.data,response.data.biddingDirect);
  414. });
  415. this.getDicts("price_unit").then(res => {
  416. this.detail.unit = this.selectDictLabel(res.data,response.data.unit);
  417. });
  418. this.getDicts("payment_type").then(res => {
  419. this.detail.paymentType = this.selectDictLabel(res.data,response.data.paymentType);
  420. });
  421. for(let i of this.detail.subjectList){
  422. this.getDicts("area_unit").then(res => {
  423. i.areaUnit = this.selectDictLabel(res.data,i.areaUnit);
  424. });
  425. }
  426. var that = this;
  427. this.timer = setInterval(function () {
  428. if(that.process == "竞价中"){
  429. getBiddingList(that.biddingquery).then(response =>{
  430. that.biddinglistInformation = response.rows
  431. if((response.rows.length != that.biddinglistInformationLength) && that.detail.ladderPrice){
  432. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  433. if(response.rows[0].money<=that.price) {
  434. that.price = parseInt(response.rows[0].money) - parseInt(that.detail.ladderPrice)
  435. }
  436. }else{
  437. if(response.rows[0].money>=that.price) {
  438. that.price = parseInt(response.rows[0].money) + parseInt(that.detail.ladderPrice)
  439. }
  440. }
  441. }
  442. that.biddinglistInformationLength = response.total
  443. });
  444. }
  445. },3000)
  446. getInfo().then(response => {
  447. this.userId=response.user.userId
  448. getMember(response.user.userId).then(res => {
  449. this.userAccount=res.data.phone
  450. this.userName=res.data.realname
  451. this.memberId=res.data.id
  452. let data= {
  453. projectId:this.id,
  454. memberId:res.data.id,
  455. depositStatus:'1'
  456. };
  457. getSignup(data).then(r =>{
  458. this.getSignupData = r.data;
  459. this.isFirst = r.signup.isFirst;
  460. this.getBidding();
  461. this.timeCount = setInterval(()=>{
  462. this.getTime()
  463. },1000)
  464. this.bottomBtn = true;
  465. })
  466. })
  467. })
  468. });
  469. getWebConfig().then(response =>{
  470. this.timeConfig = response.data[8].configValue;
  471. response.data.map(item =>{
  472. if(item.configKey=="cqjy.website.bidInfo"){
  473. this.webConfig = item.configValue
  474. }
  475. })
  476. });
  477. },
  478. getTime(){
  479. this.bottomBtn = true;
  480. let biddingStartTime = Date.parse(this.detail.biddingStartTime)+0
  481. let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
  482. let biddingStopSetime = Date.parse(this.detail.biddingStopSetime)+0
  483. let signupStartTime = Date.parse(this.detail.signupStartTime)+0
  484. let signupStopTime = Date.parse(this.detail.signupStopTime)+0
  485. let nowDate = Date.parse(this.format($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss"));
  486. let time = this.detail.delayPeriod * 1000;
  487. var difference = biddingStopTime-nowDate;//延时后时间差
  488. var differenceSetime = biddingStopSetime-nowDate;//延时后时间差
  489. let m = Math.floor(difference/1000/60%60);
  490. let s = Math.floor(difference/1000%60);
  491. if (differenceSetime <= 0 && difference >= 0 && difference <=time){
  492. console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  493. this.biddingTimeType = 1;
  494. this.process= "竞价中"
  495. this.tip=this.detail.biddingStopTime+"结束竞价"
  496. this.timeMsg="距竞价结束"
  497. if(this.getSignupData=="1"){
  498. this.isSignup=true
  499. this.btnMsg="立即竞价"
  500. this.showBtn=true
  501. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  502. }else{
  503. this.btnMsg="未报名"
  504. this.isSignup=true
  505. }
  506. $('#timeData').html(this.TimeInterval(biddingStopTime-nowDate));
  507. if (s < 2 && m < 1){
  508. console.log("竞价结束22222222222")
  509. getBiddingStopTime(this.id).then(response => {
  510. this.$set(this.detail,'biddingStopTime',response.data)
  511. let timeNew = Date.parse(response.data) + 0 - nowDate;
  512. if (timeNew > 0) {
  513. this.$set(this.detail,'biddingStopTime',response.data)
  514. this.getTime();
  515. } else {
  516. clearInterval(this.timeCount);
  517. this.process = "竞价结束"
  518. this.tip = this.detail.biddingStopTime + "结束竞价"
  519. this.btnMsg = "竞价结束"
  520. this.timeMsg = "竞价结束"
  521. this.time = 0
  522. this.isSignup = true
  523. this.showBtn = false
  524. this.biddingTimeType = 2;
  525. $('#timeData').html('');
  526. return;
  527. }
  528. });
  529. }else if (s%2 == 0&&time!=0){
  530. getBiddingStopTime(this.id).then(response =>{
  531. this.$set(this.detail,'biddingStopTime',response.data);
  532. });
  533. }
  534. }else{
  535. this.dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopSetime)
  536. }
  537. },
  538. dataCompare(signupStartTime,signupStopTime,biddingStartTime,biddingStopTime){
  539. let nowDate = Date.parse(this.format($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss"));
  540. if(signupStartTime>nowDate){
  541. //console.log('未开始')
  542. this.process= "报名未开始"
  543. this.tip=this.detail.signupStartTime+"开始报名"
  544. this.btnMsg="报名未开始"
  545. this.timeMsg="距报名开始"
  546. $('#timeData').html(this.TimeInterval(signupStartTime-nowDate))
  547. // this.timeData = ;
  548. this.isSignup=true
  549. }
  550. if(signupStopTime>nowDate&&signupStopTime>signupStartTime){
  551. //console.log('报名中')
  552. this.process= "报名中"
  553. this.isSignup=false
  554. this.tip=this.detail.signupStopTime+"报名截止"
  555. this.btnMsg="立即报名"
  556. this.timeMsg="距报名截止"
  557. // this.time = signupStopTime-nowDate
  558. $('#timeData').html(this.TimeInterval(signupStopTime-nowDate));
  559. // this.timeData = this.TimeInterval(signupStopTime-nowDate);
  560. if(this.getSignupData=="1"){
  561. this.isSignup=true
  562. this.btnMsg="已报名"
  563. }
  564. }
  565. if(biddingStartTime>nowDate&&nowDate>signupStopTime){
  566. //console.log('竞价未开始')
  567. this.biddingTimeType = 3;
  568. this.process= "竞价未开始"
  569. this.tip=this.detail.biddingStartTime+"开始竞价"
  570. this.timeMsg="距竞价开始"
  571. // this.time = biddingStartTime-nowDate
  572. $('#timeData').html(this.TimeInterval(biddingStartTime-nowDate));
  573. // this.timeData = this.TimeInterval(biddingStartTime-nowDate);
  574. this.isSignup=true;
  575. if(this.getSignupData=="1"){
  576. this.btnMsg="已报名"
  577. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  578. }else{
  579. this.btnMsg="未报名"
  580. }
  581. }
  582. if(biddingStopTime>nowDate&&nowDate>biddingStartTime){
  583. //console.log('竞价中')
  584. this.biddingTimeType = 1;
  585. this.process= "竞价中"
  586. this.tip=this.detail.biddingStopTime+"结束竞价"
  587. this.timeMsg="距竞价结束"
  588. // this.time = biddingStopTime-nowDate
  589. $('#timeData').html(this.TimeInterval(biddingStopTime-nowDate));
  590. // this.timeData = this.TimeInterval(biddingStopTime-nowDate);
  591. //console.log(this.timeData)
  592. if(this.getSignupData=="1"){
  593. this.isSignup=true
  594. this.btnMsg="立即竞价"
  595. this.showBtn=true
  596. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  597. }else{
  598. this.btnMsg="未报名"
  599. this.isSignup=true
  600. }
  601. }
  602. if(nowDate>biddingStopTime){
  603. //console.log('竞价结束')
  604. clearInterval(this.timeCount);
  605. this.process= "竞价结束"
  606. this.tip=this.detail.biddingStopTime+"结束竞价"
  607. this.btnMsg="竞价结束"
  608. this.timeMsg="竞价结束"
  609. this.time = 0
  610. this.isSignup = true
  611. this.showBtn=false
  612. this.biddingTimeType = 2;
  613. $('#timeData').html('');
  614. // this.timeData = ''
  615. }
  616. },
  617. getBidding(){
  618. var that = this;
  619. getBiddingList(that.biddingquery).then(response =>{
  620. that.biddinglistInformation = response.rows
  621. that.biddinglistInformationLength = response.total
  622. if (that.detail.biddingType == '阶梯竞价'){
  623. if (response.rows.length>0&&that.detail.ladderPrice){
  624. if (that.price == 0){return;}
  625. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  626. let money = that.price?that.price:response.rows[0].money
  627. if(response.rows[0].money<=money){
  628. that.price = parseFloat(response.rows[0].money - that.detail.ladderPrice).toFixed(2)
  629. }
  630. }else{
  631. console.log(response.rows[0].money>=that.price)
  632. let money = that.price?that.price:response.rows[0].money
  633. if(response.rows[0].money>=money){
  634. that.price = parseFloat(response.rows[0].money + that.detail.ladderPrice).toFixed(2)
  635. }
  636. }
  637. }else if (response.rows.length>0&&!that.detail.ladderPrice){
  638. if (that.price == 0){return;}
  639. that.price = response.rows[0].money
  640. }else{
  641. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  642. that.price = parseFloat(that.detail.price).toFixed(2)
  643. }else{
  644. that.price = parseFloat(that.detail.price).toFixed(2)
  645. }
  646. }
  647. }
  648. });
  649. },
  650. offerFirst(){
  651. let newMoney;
  652. projectNewBidMoney(this.id).then(response =>{
  653. if (response.data&&response.code==200){
  654. newMoney = response.data;
  655. }else{
  656. newMoney = this.detail.price;
  657. }
  658. let data= {
  659. projectId:this.id,
  660. memberId:this.memberId,
  661. userId:this.userId,
  662. userAccount:this.userAccount,
  663. userName:this.userName,
  664. money:parseFloat(newMoney),
  665. loginTime:Date.now($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"))
  666. };
  667. biddingSubmit(data).then(response =>{
  668. let _this = this
  669. if(response){
  670. this.$toast({
  671. icon: 'success', // 找到自己需要的图标
  672. message: '出价成功',
  673. duration:"1000",
  674. onClose:function(){
  675. clearInterval(this.timer);
  676. // _this.reload()
  677. _this.getBidding();
  678. if (_this.detail.delayPeriod != 0 && _this.delayPeriodNow){
  679. _this.time = null;
  680. }
  681. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  682. _this.price = null;
  683. }
  684. }
  685. })
  686. }
  687. })
  688. });
  689. },
  690. offer(){
  691. let newMoney;
  692. projectNewBidMoney(this.id).then(response =>{
  693. if (response.data&&response.code==200){
  694. newMoney = response.data;
  695. }else{
  696. newMoney = this.detail.price;
  697. }
  698. if (this.price==''||this.price==0||this.price<0||this.price == null){
  699. this.$toast({
  700. icon: 'fail', // 找到自己需要的图标
  701. message: '请输入出价金额',
  702. duration:"1000",
  703. onClose:function(){
  704. }
  705. })
  706. return;
  707. }
  708. if (this.detail.biddingDirect == '反向竞价'){
  709. // if (this.biddinglistInformation.length<1){
  710. if(this.detail.price<this.price){
  711. this.$toast({
  712. icon: 'fail', // 找到自己需要的图标
  713. message: '出价不能高于挂牌价格',
  714. duration:"1000",
  715. onClose:function(){
  716. }
  717. })
  718. return;
  719. }else{
  720. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  721. if (this.biddinglistInformation.length>1){
  722. //判断用户出价不能高于当前出价最低价格
  723. if(newMoney <= this.price){
  724. this.$toast({
  725. icon: 'fail', // 找到自己需要的图标
  726. message: '出价不能高于当前出价最低价格',
  727. duration:"1000",
  728. onClose:function(){
  729. }
  730. })
  731. return;
  732. }
  733. }
  734. }
  735. }
  736. }else{
  737. if(this.detail.price>this.price){
  738. this.$toast({
  739. icon: 'fail', // 找到自己需要的图标
  740. message: '出价不能低于挂牌价格',
  741. duration:"1000",
  742. onClose:function(){
  743. }
  744. })
  745. return;
  746. }else{
  747. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  748. if (this.biddinglistInformation.length>1){
  749. //判断用户出价不能高于当前出价最低价格
  750. //console.log(newMoney)
  751. //console.log(this.price)
  752. if(newMoney >= this.price){
  753. this.$toast({
  754. icon: 'fail', // 找到自己需要的图标
  755. message: '出价不能低于当前出价最高价格',
  756. duration:"1000",
  757. onClose:function(){
  758. }
  759. })
  760. return;
  761. }
  762. }
  763. }
  764. }
  765. }
  766. let data= {
  767. projectId:this.id,
  768. memberId:this.memberId,
  769. userId:this.userId,
  770. userAccount:this.userAccount,
  771. userName:this.userName,
  772. money:parseFloat(this.price),
  773. loginTime:Date.now($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"))
  774. };
  775. // console.log(Date.now($.ajax({async:false}).getResponseHeader("Date")))
  776. biddingSubmit(data).then(response =>{
  777. let _this = this
  778. if(response){
  779. // clearInterval(this.timer);
  780. this.$toast({
  781. icon: 'success', // 找到自己需要的图标
  782. message: '出价成功',
  783. duration:"1000",
  784. onClose:function(){
  785. clearInterval(this.timer);
  786. // _this.reload()
  787. _this.getBidding();
  788. if (_this.detail.delayPeriod != 0 && _this.delayPeriodNow){
  789. _this.time = null;
  790. }
  791. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  792. _this.price = null;
  793. }else{
  794. _this.price = _this.price-_this.detail.ladderPrice;
  795. }
  796. }
  797. })
  798. }
  799. })
  800. });
  801. },
  802. add(){
  803. if (this.detail.biddingDirect == '反向竞价'){
  804. if (this.biddinglistInformation.length<1){
  805. if(this.detail.price <= this.price){
  806. this.$toast({
  807. icon: 'fail', // 找到自己需要的图标
  808. message: '出价不能高于挂牌价格',
  809. duration:"1000",
  810. onClose:function(){
  811. }
  812. })
  813. return;
  814. }
  815. }else{
  816. if(this.biddinglistInformation[0].money <= (parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2)){
  817. this.$toast({
  818. icon: 'fail', // 找到自己需要的图标
  819. message: '出价不能高于当前出价最低价格',
  820. duration:"1000",
  821. onClose:function(){
  822. }
  823. })
  824. return;
  825. }
  826. }
  827. }else{
  828. if (this.biddinglistInformation.length<1){
  829. if(this.detail.price>this.price){
  830. this.$toast({
  831. icon: 'fail', // 找到自己需要的图标
  832. message: '出价不能低于挂牌价格',
  833. duration:"1000",
  834. onClose:function(){
  835. }
  836. })
  837. return;
  838. }
  839. }else{
  840. if(this.biddinglistInformation[0].money>this.price){
  841. this.$toast({
  842. icon: 'fail', // 找到自己需要的图标
  843. message: '出价不能低于当前出价最高价格',
  844. duration:"1000",
  845. onClose:function(){
  846. }
  847. })
  848. return;
  849. }
  850. }
  851. }
  852. //console.log(this.price == null)
  853. this.price == null?this.price = 0:this.price = this.price;
  854. this.detail.ladderPrice?this.price=(parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2):this.price += 1
  855. },
  856. sub(){
  857. if (this.detail.biddingDirect == '反向竞价'){
  858. if (this.biddinglistInformation.length<1){
  859. if(this.detail.price<this.price){
  860. this.$toast({
  861. icon: 'fail', // 找到自己需要的图标
  862. message: '出价不能高于挂牌价格',
  863. duration:"1000",
  864. onClose:function(){
  865. }
  866. })
  867. return;
  868. }
  869. }else{
  870. if(this.biddinglistInformation[0].money<this.price){
  871. this.$toast({
  872. icon: 'fail', // 找到自己需要的图标
  873. message: '出价不能高于当前出价最低价格',
  874. duration:"1000",
  875. onClose:function(){
  876. }
  877. })
  878. return;
  879. }
  880. }
  881. }else{
  882. if (this.biddinglistInformation.length<1){
  883. if(this.detail.price>=this.price){
  884. this.$toast({
  885. icon: 'fail', // 找到自己需要的图标
  886. message: '出价不能低于挂牌价格',
  887. duration:"1000",
  888. onClose:function(){
  889. }
  890. })
  891. return;
  892. }
  893. }else{
  894. if(this.biddinglistInformation[0].money >= (parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2)){
  895. this.$toast({
  896. icon: 'fail', // 找到自己需要的图标
  897. message: '出价不能低于当前出价最高价格',
  898. duration:"1000",
  899. onClose:function(){
  900. }
  901. })
  902. return;
  903. }
  904. }
  905. }
  906. this.price == null?this.price = 0:this.price = this.price;
  907. if (this.price == 0)return;
  908. this.detail.ladderPrice?this.price=(parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2):this.price -= 1
  909. // if(this.detail.ladderPrice){
  910. // if((this.price-this.detail.ladderPrice)>this.biddinglistInformation[0].money){
  911. // this.price-=this.detail.ladderPrice
  912. // }else{
  913. // this.$toast({
  914. // icon: 'error', // 找到自己需要的图标
  915. // message: '出价不能低于当前最高价',
  916. // duration:"1000",
  917. // })
  918. // }
  919. // }else{
  920. // if((this.price-1)>this.biddinglistInformation[0].money){
  921. // this.price-=1
  922. // }else{
  923. // this.$toast({
  924. // icon: 'error', // 找到自己需要的图标
  925. // message: '出价不能低于当前最高价',
  926. // duration:"1000",
  927. // })
  928. // }
  929. // }
  930. },
  931. timerChange(value){
  932. let d = value.days;
  933. let h = value.hours;
  934. let m = value.minutes;
  935. let s = value.seconds;
  936. let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
  937. let nowDate = Date.parse(this.format($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss"));
  938. let time = this.detail.delayPeriod * 1000;
  939. if (s < 1 && m < 1){
  940. console.log("竞价结束22222222222")
  941. getBiddingStopTime(this.id).then(response => {
  942. this.$set(this.detail,'biddingStopTime',response.data)
  943. let timeNew = Date.parse(response.data) + 0 - nowDate;
  944. if (timeNew > 0) {
  945. this.$set(this.detail,'biddingStopTime',response.data)
  946. this.getTime();
  947. } else {
  948. this.process = "竞价结束"
  949. this.tip = this.detail.biddingStopTime + "结束竞价"
  950. this.btnMsg = "竞价结束"
  951. this.timeMsg = "竞价结束"
  952. this.time = 0
  953. this.isSignup = true
  954. this.showBtn = false
  955. this.biddingTimeType = 2;
  956. return;
  957. }
  958. });
  959. }else if (s%2 == 0&&time!=0){
  960. //console.log('aaa')
  961. // console.log((biddingStopTime-nowDate))
  962. // console.log(time)
  963. // this.getTime();
  964. if ((biddingStopTime-nowDate)<=time){
  965. // console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  966. getBiddingStopTime(this.id).then(response =>{
  967. if(this.detail.biddingStopTime!=response.data){
  968. console.log('有人出价')
  969. this.time = null;
  970. }
  971. this.detail.biddingStopTime = response.data
  972. this.$set(this.detail,'biddingStopTime',response.data);
  973. this.delayPeriodNow = true;
  974. // this.time = Date.parse(response.data)+0-nowDate;
  975. });
  976. }
  977. }
  978. },
  979. TimeInterval(timestamp) {
  980. //时间戳转化为天时分秒
  981. // 总秒数
  982. var second = Math.floor(timestamp/ 1000);
  983. // 天数
  984. var day = Math.floor(second / 3600 / 24);
  985. // 小时
  986. var hr = Math.floor(second / 3600 % 24);
  987. // 分钟
  988. var min = Math.floor(second / 60 % 60);
  989. // 秒
  990. var sec = Math.floor(second % 60);
  991. return (day?day + "天":'0天') + (hr?hr+ "时":'0时') + ( min?min + "分":'0分') + sec + "秒";
  992. },
  993. },
  994. destroyed () {
  995. console.log('bbbbbbbbbb')
  996. clearInterval(this.timer);
  997. clearInterval(this.timeCount);
  998. },
  999. beforeDestory() {
  1000. clearInterval(this.timer)
  1001. clearInterval(this.timeCount);
  1002. },
  1003. //离开页面清除定时器失效问题
  1004. beforeRouteLeave(to, from, next) {
  1005. console.log("我离开了")
  1006. clearInterval(this.timer)
  1007. clearInterval(this.timeCount);
  1008. this.time = null;
  1009. next()
  1010. }
  1011. };
  1012. </script>
  1013. <style scoped lang="scss">
  1014. .app-container {
  1015. }
  1016. .van-count-down{
  1017. display: inline-block;
  1018. color: #fff;
  1019. }
  1020. .custom-indicator {
  1021. position: absolute;
  1022. right: 20px;
  1023. bottom: 20px;
  1024. padding: 0px 20px;
  1025. font-size: 12px;
  1026. /*rgba(0, 0, 0, 0.1)*/
  1027. background: rgba(0, 0, 0, 0.2);
  1028. color: #FFF;
  1029. border-radius: 20px;
  1030. line-height: 0.5rem;
  1031. }
  1032. .title{
  1033. font-size: 0.45rem;
  1034. margin-bottom: 10PX;
  1035. }
  1036. .my-swipe{
  1037. width: 100%;
  1038. }
  1039. .my-swipe .van-swipe-item .van-image{
  1040. width: 100%;
  1041. }
  1042. .information{
  1043. background-color: #FFF;
  1044. margin-top: 0.3rem;
  1045. padding: 0.4rem 0.5rem;
  1046. }
  1047. .van-row{
  1048. line-height: 0.7rem;
  1049. }
  1050. .price{
  1051. color: #C21F3A;
  1052. }
  1053. .price span{
  1054. font-size: 0.5rem;
  1055. font-weight: bold;
  1056. }
  1057. .money{
  1058. color: #C21F3A;
  1059. }
  1060. .money span{
  1061. font-size: 0.5rem;
  1062. font-weight: bold;
  1063. }
  1064. .van-count-down{
  1065. line-height: 0.7rem;
  1066. }
  1067. .lead{
  1068. background-color: #FFF;
  1069. margin-top: 0.3rem;
  1070. padding: 0.1rem 0.5rem;
  1071. color: #C21F3A;
  1072. }
  1073. .detail{
  1074. background-color: #FFF;
  1075. margin-top: 0.3rem;
  1076. padding: 0.2rem 0.5rem;
  1077. }
  1078. .detail span{
  1079. color: #8A8A8A;
  1080. }
  1081. .delTitle{
  1082. font-size: 0.4rem;
  1083. color: #007E72;
  1084. padding: 0.2rem 0.5rem;
  1085. }
  1086. .introduce{
  1087. padding: 0.2rem 0.5rem 0.5rem;
  1088. background-color: #FFF;
  1089. }
  1090. .introduce span{
  1091. color: #8A8A8A;
  1092. margin-right: 20px;
  1093. }
  1094. .project_info{
  1095. border: 1px solid #DCDCDC;
  1096. padding: 0px 20px;
  1097. margin-top: 10px;
  1098. border-radius: 10px;
  1099. }
  1100. .notice{
  1101. padding: 0.5rem;
  1102. background-color: #FFF;
  1103. }
  1104. .notice p{
  1105. line-height: 0.7rem;
  1106. }
  1107. .biddingList{
  1108. padding: 0.5rem;
  1109. background-color: #FFF;
  1110. margin-bottom: 0.4rem;
  1111. }
  1112. .biddingList table{
  1113. text-align: center;
  1114. }
  1115. .biddingList table td{
  1116. text-align: center;
  1117. padding: 10px 0px;
  1118. }
  1119. .biddingList table tr:first-child td{
  1120. background-color: #007E72;
  1121. color: #FFF;
  1122. }
  1123. .bottomBtn{
  1124. padding: 0.2rem 0.5rem;
  1125. background-color: #FFF;
  1126. position: fixed;
  1127. bottom: 0;
  1128. width: 100%;
  1129. }
  1130. .popup{
  1131. text-align: center;
  1132. padding: 0.5rem;
  1133. border-radius: 20px;
  1134. width: 70%;
  1135. padding-top: 1.5rem;
  1136. }
  1137. .popupTit{
  1138. color: #007E72;
  1139. font-size: 0.4rem;
  1140. line-height: 0.9rem;
  1141. }
  1142. .popupContent{
  1143. color: #666666;
  1144. }
  1145. .iKnow{
  1146. margin-top: 1rem;
  1147. }
  1148. .updatePopup{
  1149. color: #007E72;
  1150. margin-top: 0.5rem;
  1151. }
  1152. </style>