移动端
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ů.
 
 

1155 řádky
39 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. title="项目详情1"
  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{{timeData}}
  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}}秒内,任意方出价,距结束时间将延长{{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>转出方名称</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}}年</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. webConfig:"",
  264. biddinglistInformation:[],
  265. rollout_type:[],
  266. process:"",
  267. tip:"",
  268. btnMsg:"",
  269. time:null,
  270. timeMsg:"",
  271. isSignup:false,
  272. showBtn:false,
  273. price:null,
  274. userAccount:"",
  275. userName:"",
  276. userId:"",
  277. timeConfig:'',
  278. biddinglistInformationLength:0,
  279. biddingTimeType:2,
  280. isFirst:'',
  281. timer:null,
  282. getSignupData:'',
  283. bottomBtn:false,
  284. delayPeriodNow:false,
  285. nowDate:0,
  286. biddingquery:{
  287. projectId:this.$route.query.id,
  288. pageSize:10,
  289. pageNum:1
  290. },
  291. timeData:'',
  292. };
  293. },
  294. computed: {
  295. getNowFormatDate:function(){
  296. let date = new Date();
  297. let seperator1 = "-";
  298. let seperator2 = ":";
  299. let month = date.getMonth() + 1;
  300. let day = date.getDate();
  301. let hours = date.getHours();
  302. let minutes = date.getMinutes();
  303. let seconds = date.getSeconds();
  304. if (month >= 1 && month <= 9) {
  305. month = "0" + month;
  306. }
  307. if (day >= 0 && day <= 9) {
  308. day = "0" + day;
  309. }
  310. if (hours >= 0 && hours <= 9) {
  311. hours = "0" + hours;
  312. }
  313. if (minutes >= 0 && minutes <= 9) {
  314. minutes = "0" + minutes;
  315. }
  316. if (seconds >= 0 && seconds <= 9) {
  317. seconds = "0" + seconds;
  318. }
  319. let currentdate = date.getFullYear() + seperator1 + month + seperator1 + day + " " + hours + seperator2 + minutes + seperator2 + seconds;
  320. console.log(currentdate)
  321. return currentdate;
  322. }
  323. },
  324. created() {
  325. clearInterval(this.timer);
  326. this.reload();
  327. },
  328. methods: {
  329. goSignUp(){
  330. getInfo().then(response => {
  331. getMember(response.user.userId).then(resresponse => {
  332. let data= {
  333. projectId:this.id,
  334. memberId:resresponse.data.id,
  335. };
  336. var isSign;
  337. getSignup(data).then(r =>{
  338. if(r.data=="1"){
  339. isSign=true
  340. }
  341. })
  342. if (resresponse.data.auditStatus == 'Y'){
  343. if (isSign){
  344. this.$toast({
  345. icon: 'error', // 找到自己需要的图标
  346. message: '已报名,请耐心等待审核结果!',
  347. duration:"2000",
  348. onClose:function(){
  349. }
  350. })
  351. return;
  352. }
  353. this.$router.push(
  354. {
  355. path: 'signUp',
  356. query: {
  357. projectId: this.detail.id,
  358. deposit: this.detail.deposit,
  359. projectName: this.detail.projectName
  360. }
  361. }
  362. );
  363. }else{
  364. this.$toast({
  365. icon: 'error', // 找到自己需要的图标
  366. message: '交易中心审核注册信息后方可进行报名!',
  367. duration:"2000",
  368. onClose:function(){
  369. }
  370. })
  371. }
  372. })
  373. })
  374. },
  375. onChange(index) {
  376. this.current = index;
  377. },
  378. showPopup() {
  379. this.show = true;
  380. },
  381. reload(){
  382. console.log("结束进入")
  383. getOutProjectDetail(this.id).then(response =>{
  384. this.detail=response.data
  385. this.getDicts("rollout_type").then(res =>{
  386. this.detail.rollout = this.selectDictLabel(res.data,response.data.rollout);
  387. if(this.detail.oneout==0){
  388. this.detail.oneout = "无"
  389. }else{
  390. this.detail.oneout = this.selectDictLabel(res.data,response.data.oneout);
  391. }
  392. })
  393. this.getDicts("project_type").then(res => {
  394. this.detail.projectNumber = this.selectDictLabel(res.data,response.data.projectNumber);
  395. });
  396. this.getDicts("sub_object_type").then(res => {
  397. // this.detail.projectType = this.selectDictLabel(res.data,response.data.projectType);
  398. });
  399. this.getDicts("economic_type").then(res => {
  400. this.detail.economicType = this.selectDictLabel(res.data,response.data.economicType);
  401. });
  402. this.getDicts("area_unit").then(res => {
  403. this.detail.allCountUnit = this.selectDictLabel(res.data,response.data.allCountUnit);
  404. });
  405. this.getDicts("bidding_type").then(res => {
  406. // debugger;
  407. this.detail.biddingType = this.selectDictLabel(res.data,response.data.biddingType);
  408. });
  409. this.getDicts("bidding_direct").then(res => {
  410. this.detail.biddingDirect = this.selectDictLabel(res.data,response.data.biddingDirect);
  411. });
  412. this.getDicts("price_unit").then(res => {
  413. this.detail.unit = this.selectDictLabel(res.data,response.data.unit);
  414. });
  415. this.getDicts("payment_type").then(res => {
  416. this.detail.paymentType = this.selectDictLabel(res.data,response.data.paymentType);
  417. });
  418. for(let i of this.detail.subjectList){
  419. this.getDicts("area_unit").then(res => {
  420. i.areaUnit = this.selectDictLabel(res.data,i.areaUnit);
  421. });
  422. }
  423. var that = this;
  424. this.timer = setInterval(function () {
  425. if(that.process == "竞价中"){
  426. getBiddingList(that.biddingquery).then(response =>{
  427. that.biddinglistInformation = response.rows
  428. if((response.rows.length != that.biddinglistInformationLength) && that.detail.ladderPrice){
  429. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  430. that.price = parseInt(response.rows[0].money) - parseInt(that.detail.ladderPrice)
  431. }else{
  432. that.price = parseInt(response.rows[0].money) + parseInt(that.detail.ladderPrice)
  433. }
  434. }
  435. that.biddinglistInformationLength = response.total
  436. });
  437. }
  438. },3000)
  439. getInfo().then(response => {
  440. this.userId=response.user.userId
  441. getMember(response.user.userId).then(res => {
  442. this.userAccount=res.data.phone
  443. this.userName=res.data.realname
  444. this.memberId=res.data.id
  445. let data= {
  446. projectId:this.id,
  447. memberId:res.data.id,
  448. depositStatus:'1'
  449. };
  450. getSignup(data).then(r =>{
  451. this.getSignupData = r.data;
  452. this.isFirst = r.signup.isFirst;
  453. this.getBidding();
  454. this.timeCount = setInterval(()=>{
  455. this.getTime()
  456. },1000)
  457. this.bottomBtn = true;
  458. })
  459. })
  460. })
  461. });
  462. getWebConfig().then(response =>{
  463. this.timeConfig = response.data[8].configValue;
  464. response.data.map(item =>{
  465. if(item.configKey=="cqjy.website.bidInfo"){
  466. this.webConfig = item.configValue
  467. }
  468. })
  469. });
  470. },
  471. getTime(){
  472. this.bottomBtn = true;
  473. let biddingStartTime = Date.parse(this.detail.biddingStartTime)+0
  474. let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
  475. let signupStartTime = Date.parse(this.detail.signupStartTime)+0
  476. let signupStopTime = Date.parse(this.detail.signupStopTime)+0
  477. let nowDate = Date.parse(this.format($.ajax({async:false}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss"));
  478. let time = this.detail.delayPeriod * 1000;
  479. var difference = biddingStopTime-nowDate;
  480. let m = Math.floor(difference/1000/60%60);
  481. let s = Math.floor(difference/1000%60);
  482. if(signupStartTime>nowDate){
  483. console.log('未开始')
  484. this.process= "报名未开始"
  485. this.tip=this.detail.signupStartTime+"开始报名"
  486. this.btnMsg="立即报名"
  487. this.timeMsg="距报名开始"
  488. this.timeData = {
  489. days :signupStartTime-nowDate,
  490. hours :signupStartTime-nowDate,
  491. minutes :signupStartTime-nowDate,
  492. seconds :signupStartTime-nowDate,
  493. }
  494. this.isSignup=true
  495. }
  496. if(signupStopTime>nowDate&&signupStopTime>signupStartTime){
  497. console.log('报名中')
  498. this.process= "报名中"
  499. this.tip=this.detail.signupStopTime+"报名截止"
  500. this.btnMsg="立即报名"
  501. this.timeMsg="距报名截止"
  502. this.time = signupStopTime-nowDate
  503. if(this.getSignupData=="1"){
  504. this.isSignup=true
  505. this.btnMsg="已报名"
  506. }
  507. }
  508. if(biddingStartTime>nowDate&&nowDate>signupStopTime){
  509. console.log('竞价未开始')
  510. this.biddingTimeType = 3;
  511. this.process= "竞价未开始"
  512. this.tip=this.detail.biddingStartTime+"开始竞价"
  513. this.timeMsg="距竞价开始"
  514. this.time = biddingStartTime-nowDate
  515. if(this.getSignupData=="1"){
  516. this.isSignup=true;
  517. this.btnMsg="立即竞价"
  518. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  519. }else{
  520. this.btnMsg="未报名"
  521. }
  522. }
  523. if(biddingStopTime>nowDate&&nowDate>biddingStartTime){
  524. console.log('竞价中')
  525. this.biddingTimeType = 1;
  526. this.process= "竞价中"
  527. this.tip=this.detail.biddingStopTime+"结束竞价"
  528. this.timeMsg="距竞价结束"
  529. // this.time = biddingStopTime-nowDate
  530. this.timeData = this.TimeInterval(biddingStopTime-nowDate);
  531. console.log(this.timeData)
  532. if(this.getSignupData=="1"){
  533. this.isSignup=true
  534. this.btnMsg="立即竞价"
  535. this.showBtn=true
  536. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  537. }else{
  538. this.btnMsg="未报名"
  539. this.isSignup=true
  540. }
  541. }
  542. if(nowDate>biddingStopTime){
  543. console.log('竞价结束')
  544. this.process= "竞价结束"
  545. this.tip=this.detail.biddingStopTime+"结束竞价"
  546. this.btnMsg="竞价结束"
  547. this.timeMsg="竞价结束"
  548. this.time = 0
  549. this.isSignup = true
  550. this.showBtn=false
  551. this.biddingTimeType = 2;
  552. }
  553. // console.log(s+'---------------'+m)
  554. if (s < 1 && m < 1){
  555. console.log("竞价结束22222222222")
  556. getBiddingStopTime(this.id).then(response => {
  557. this.$set(this.detail,'biddingStopTime',response.data)
  558. let timeNew = Date.parse(response.data) + 0 - nowDate;
  559. if (timeNew > 0) {
  560. this.$set(this.detail,'biddingStopTime',response.data)
  561. this.getTime();
  562. } else {
  563. this.process = "竞价结束"
  564. this.tip = this.detail.biddingStopTime + "结束竞价"
  565. this.btnMsg = "竞价结束"
  566. this.timeMsg = "竞价结束"
  567. this.time = 0
  568. this.isSignup = true
  569. this.showBtn = false
  570. this.biddingTimeType = 2;
  571. return;
  572. }
  573. });
  574. }else if (s%2 == 0&&time!=0){
  575. console.log('aaa')
  576. // console.log((biddingStopTime-nowDate))
  577. // console.log(time)
  578. // this.getTime();
  579. if ((biddingStopTime-nowDate)<=time){
  580. // console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  581. getBiddingStopTime(this.id).then(response =>{
  582. if(this.detail.biddingStopTime!=response.data){
  583. console.log('有人出价')
  584. this.time = null;
  585. }
  586. this.detail.biddingStopTime = response.data
  587. this.$set(this.detail,'biddingStopTime',response.data);
  588. this.delayPeriodNow = true;
  589. // this.time = Date.parse(response.data)+0-nowDate;
  590. });
  591. }
  592. }
  593. },
  594. getBidding(){
  595. var that = this;
  596. getBiddingList(that.biddingquery).then(response =>{
  597. that.biddinglistInformation = response.rows
  598. that.biddinglistInformationLength = response.total
  599. if (that.detail.biddingType == '阶梯竞价'){
  600. if (response.rows.length>0&&that.detail.ladderPrice){
  601. if (that.price == 0){return;}
  602. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  603. that.price = parseFloat(response.rows[0].money - that.detail.ladderPrice).toFixed(2)
  604. }else{
  605. that.price = parseFloat(response.rows[0].money + that.detail.ladderPrice).toFixed(2)
  606. }
  607. }else if (response.rows.length>0&&!that.detail.ladderPrice){
  608. if (that.price == 0){return;}
  609. that.price = response.rows[0].money
  610. }
  611. else{
  612. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  613. that.price = parseFloat(that.detail.price).toFixed(2)
  614. }else{
  615. that.price = parseFloat(that.detail.price).toFixed(2)
  616. }
  617. }
  618. }
  619. });
  620. },
  621. offerFirst(){
  622. let newMoney;
  623. projectNewBidMoney(this.id).then(response =>{
  624. if (response.data&&response.code==200){
  625. newMoney = response.data;
  626. }else{
  627. newMoney = this.detail.price;
  628. }
  629. let data= {
  630. projectId:this.id,
  631. memberId:this.memberId,
  632. userId:this.userId,
  633. userAccount:this.userAccount,
  634. userName:this.userName,
  635. money:parseFloat(newMoney),
  636. };
  637. biddingSubmit(data).then(response =>{
  638. let _this = this
  639. if(response){
  640. this.$toast({
  641. icon: 'success', // 找到自己需要的图标
  642. message: '出价成功',
  643. duration:"1000",
  644. onClose:function(){
  645. clearInterval(this.timer);
  646. // _this.reload()
  647. _this.getBidding();
  648. if (_this.detail.delayPeriod != 0 && _this.delayPeriodNow){
  649. _this.time = null;
  650. }
  651. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  652. _this.price = null;
  653. }else{
  654. _this.price = _this.price-_this.detail.ladderPrice;
  655. }
  656. }
  657. })
  658. }
  659. })
  660. });
  661. },
  662. offer(){
  663. let newMoney;
  664. projectNewBidMoney(this.id).then(response =>{
  665. if (response.data&&response.code==200){
  666. newMoney = response.data;
  667. }else{
  668. newMoney = this.detail.price;
  669. }
  670. if (this.price==''||this.price==0||this.price<0||this.price == null){
  671. this.$toast({
  672. icon: 'fail', // 找到自己需要的图标
  673. message: '请输入出价金额',
  674. duration:"1000",
  675. onClose:function(){
  676. }
  677. })
  678. return;
  679. }
  680. if (this.detail.biddingDirect == '反向竞价'){
  681. // if (this.biddinglistInformation.length<1){
  682. if(this.detail.price<this.price){
  683. this.$toast({
  684. icon: 'fail', // 找到自己需要的图标
  685. message: '出价不能高于挂牌价格',
  686. duration:"1000",
  687. onClose:function(){
  688. }
  689. })
  690. return;
  691. }else{
  692. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  693. if (this.biddinglistInformation.length>1){
  694. //判断用户出价不能高于当前出价最低价格
  695. if(newMoney <= this.price){
  696. this.$toast({
  697. icon: 'fail', // 找到自己需要的图标
  698. message: '出价不能高于当前出价最低价格',
  699. duration:"1000",
  700. onClose:function(){
  701. }
  702. })
  703. return;
  704. }
  705. }
  706. }
  707. }
  708. }else{
  709. if(this.detail.price>this.price){
  710. this.$toast({
  711. icon: 'fail', // 找到自己需要的图标
  712. message: '出价不能低于挂牌价格',
  713. duration:"1000",
  714. onClose:function(){
  715. }
  716. })
  717. return;
  718. }else{
  719. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  720. if (this.biddinglistInformation.length>1){
  721. //判断用户出价不能高于当前出价最低价格
  722. console.log(newMoney)
  723. console.log(this.price)
  724. if(newMoney >= this.price){
  725. this.$toast({
  726. icon: 'fail', // 找到自己需要的图标
  727. message: '出价不能低于当前出价最高价格',
  728. duration:"1000",
  729. onClose:function(){
  730. }
  731. })
  732. return;
  733. }
  734. }
  735. }
  736. }
  737. }
  738. let data= {
  739. projectId:this.id,
  740. memberId:this.memberId,
  741. userId:this.userId,
  742. userAccount:this.userAccount,
  743. userName:this.userName,
  744. money:parseFloat(this.price),
  745. };
  746. console.log(data)
  747. biddingSubmit(data).then(response =>{
  748. let _this = this
  749. if(response){
  750. // clearInterval(this.timer);
  751. this.$toast({
  752. icon: 'success', // 找到自己需要的图标
  753. message: '出价成功',
  754. duration:"1000",
  755. onClose:function(){
  756. clearInterval(this.timer);
  757. // _this.reload()
  758. _this.getBidding();
  759. if (_this.detail.delayPeriod != 0 && _this.delayPeriodNow){
  760. _this.time = null;
  761. }
  762. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  763. _this.price = null;
  764. }else{
  765. _this.price = _this.price-_this.detail.ladderPrice;
  766. }
  767. }
  768. })
  769. }
  770. })
  771. });
  772. },
  773. add(){
  774. if (this.detail.biddingDirect == '反向竞价'){
  775. if (this.biddinglistInformation.length<1){
  776. if(this.detail.price <= this.price){
  777. this.$toast({
  778. icon: 'fail', // 找到自己需要的图标
  779. message: '出价不能高于挂牌价格',
  780. duration:"1000",
  781. onClose:function(){
  782. }
  783. })
  784. return;
  785. }
  786. }else{
  787. if(this.biddinglistInformation[0].money <= (parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2)){
  788. this.$toast({
  789. icon: 'fail', // 找到自己需要的图标
  790. message: '出价不能高于当前出价最低价格',
  791. duration:"1000",
  792. onClose:function(){
  793. }
  794. })
  795. return;
  796. }
  797. }
  798. }else{
  799. if (this.biddinglistInformation.length<1){
  800. if(this.detail.price>this.price){
  801. this.$toast({
  802. icon: 'fail', // 找到自己需要的图标
  803. message: '出价不能低于挂牌价格',
  804. duration:"1000",
  805. onClose:function(){
  806. }
  807. })
  808. return;
  809. }
  810. }else{
  811. if(this.biddinglistInformation[0].money>this.price){
  812. this.$toast({
  813. icon: 'fail', // 找到自己需要的图标
  814. message: '出价不能低于当前出价最高价格',
  815. duration:"1000",
  816. onClose:function(){
  817. }
  818. })
  819. return;
  820. }
  821. }
  822. }
  823. console.log(this.price == null)
  824. this.price == null?this.price = 0:this.price = this.price;
  825. this.detail.ladderPrice?this.price=(parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2):this.price += 1
  826. },
  827. sub(){
  828. if (this.detail.biddingDirect == '反向竞价'){
  829. if (this.biddinglistInformation.length<1){
  830. if(this.detail.price<this.price){
  831. this.$toast({
  832. icon: 'fail', // 找到自己需要的图标
  833. message: '出价不能高于挂牌价格',
  834. duration:"1000",
  835. onClose:function(){
  836. }
  837. })
  838. return;
  839. }
  840. }else{
  841. if(this.biddinglistInformation[0].money<this.price){
  842. this.$toast({
  843. icon: 'fail', // 找到自己需要的图标
  844. message: '出价不能高于当前出价最低价格',
  845. duration:"1000",
  846. onClose:function(){
  847. }
  848. })
  849. return;
  850. }
  851. }
  852. }else{
  853. if (this.biddinglistInformation.length<1){
  854. if(this.detail.price>=this.price){
  855. this.$toast({
  856. icon: 'fail', // 找到自己需要的图标
  857. message: '出价不能低于挂牌价格',
  858. duration:"1000",
  859. onClose:function(){
  860. }
  861. })
  862. return;
  863. }
  864. }else{
  865. if(this.biddinglistInformation[0].money >= (parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2)){
  866. this.$toast({
  867. icon: 'fail', // 找到自己需要的图标
  868. message: '出价不能低于当前出价最高价格',
  869. duration:"1000",
  870. onClose:function(){
  871. }
  872. })
  873. return;
  874. }
  875. }
  876. }
  877. this.price == null?this.price = 0:this.price = this.price;
  878. if (this.price == 0)return;
  879. this.detail.ladderPrice?this.price=(parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2):this.price -= 1
  880. // if(this.detail.ladderPrice){
  881. // if((this.price-this.detail.ladderPrice)>this.biddinglistInformation[0].money){
  882. // this.price-=this.detail.ladderPrice
  883. // }else{
  884. // this.$toast({
  885. // icon: 'error', // 找到自己需要的图标
  886. // message: '出价不能低于当前最高价',
  887. // duration:"1000",
  888. // })
  889. // }
  890. // }else{
  891. // if((this.price-1)>this.biddinglistInformation[0].money){
  892. // this.price-=1
  893. // }else{
  894. // this.$toast({
  895. // icon: 'error', // 找到自己需要的图标
  896. // message: '出价不能低于当前最高价',
  897. // duration:"1000",
  898. // })
  899. // }
  900. // }
  901. },
  902. timerChange(value){
  903. let d = value.days;
  904. let h = value.hours;
  905. let m = value.minutes;
  906. let s = value.seconds;
  907. let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
  908. let nowDate = Date.parse(this.format($.ajax({async:false}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss"));
  909. let time = this.detail.delayPeriod * 1000;
  910. if (s < 1 && m < 1){
  911. console.log("竞价结束22222222222")
  912. getBiddingStopTime(this.id).then(response => {
  913. this.$set(this.detail,'biddingStopTime',response.data)
  914. let timeNew = Date.parse(response.data) + 0 - nowDate;
  915. if (timeNew > 0) {
  916. this.$set(this.detail,'biddingStopTime',response.data)
  917. this.getTime();
  918. } else {
  919. this.process = "竞价结束"
  920. this.tip = this.detail.biddingStopTime + "结束竞价"
  921. this.btnMsg = "竞价结束"
  922. this.timeMsg = "竞价结束"
  923. this.time = 0
  924. this.isSignup = true
  925. this.showBtn = false
  926. this.biddingTimeType = 2;
  927. return;
  928. }
  929. });
  930. }else if (s%2 == 0&&time!=0){
  931. console.log('aaa')
  932. // console.log((biddingStopTime-nowDate))
  933. // console.log(time)
  934. // this.getTime();
  935. if ((biddingStopTime-nowDate)<=time){
  936. // console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  937. getBiddingStopTime(this.id).then(response =>{
  938. if(this.detail.biddingStopTime!=response.data){
  939. console.log('有人出价')
  940. this.time = null;
  941. }
  942. this.detail.biddingStopTime = response.data
  943. this.$set(this.detail,'biddingStopTime',response.data);
  944. this.delayPeriodNow = true;
  945. // this.time = Date.parse(response.data)+0-nowDate;
  946. });
  947. }
  948. }
  949. },
  950. TimeInterval(timestamp) {
  951. //时间戳转化为天时分秒
  952. // 总秒数
  953. var second = Math.floor(timestamp/ 1000);
  954. // 天数
  955. var day = Math.floor(second / 3600 / 24);
  956. // 小时
  957. var hr = Math.floor(second / 3600 % 24);
  958. // 分钟
  959. var min = Math.floor(second / 60 % 60);
  960. // 秒
  961. var sec = Math.floor(second % 60);
  962. return (day?day + "天":'0天') + (hr?hr+ "时":'时') + ( min?min + "分":'0分') + ( sec?sec + "秒":'0秒');
  963. },
  964. },
  965. destroyed () {
  966. console.log('bbbbbbbbbb')
  967. clearInterval(this.timer);
  968. },
  969. beforeDestory() {
  970. clearInterval(this.timer)
  971. },
  972. //离开页面清除定时器失效问题
  973. beforeRouteLeave(to, from, next) {
  974. console.log("我离开了")
  975. clearInterval(this.timer)
  976. this.time = null;
  977. next()
  978. }
  979. };
  980. </script>
  981. <style scoped lang="scss">
  982. .app-container {
  983. }
  984. .van-count-down{
  985. display: inline-block;
  986. color: #fff;
  987. }
  988. .custom-indicator {
  989. position: absolute;
  990. right: 20px;
  991. bottom: 20px;
  992. padding: 0px 20px;
  993. font-size: 12px;
  994. /*rgba(0, 0, 0, 0.1)*/
  995. background: rgba(0, 0, 0, 0.2);
  996. color: #FFF;
  997. border-radius: 20px;
  998. line-height: 0.5rem;
  999. }
  1000. .title{
  1001. font-size: 0.45rem;
  1002. margin-bottom: 10PX;
  1003. }
  1004. .my-swipe{
  1005. width: 100%;
  1006. }
  1007. .my-swipe .van-swipe-item .van-image{
  1008. width: 100%;
  1009. }
  1010. .information{
  1011. background-color: #FFF;
  1012. margin-top: 0.3rem;
  1013. padding: 0.4rem 0.5rem;
  1014. }
  1015. .van-row{
  1016. line-height: 0.7rem;
  1017. }
  1018. .price{
  1019. color: #C21F3A;
  1020. }
  1021. .price span{
  1022. font-size: 0.5rem;
  1023. font-weight: bold;
  1024. }
  1025. .money{
  1026. color: #C21F3A;
  1027. }
  1028. .money span{
  1029. font-size: 0.5rem;
  1030. font-weight: bold;
  1031. }
  1032. .van-count-down{
  1033. line-height: 0.7rem;
  1034. }
  1035. .lead{
  1036. background-color: #FFF;
  1037. margin-top: 0.3rem;
  1038. padding: 0.1rem 0.5rem;
  1039. color: #C21F3A;
  1040. }
  1041. .detail{
  1042. background-color: #FFF;
  1043. margin-top: 0.3rem;
  1044. padding: 0.2rem 0.5rem;
  1045. }
  1046. .detail span{
  1047. color: #8A8A8A;
  1048. }
  1049. .delTitle{
  1050. font-size: 0.4rem;
  1051. color: #007E72;
  1052. padding: 0.2rem 0.5rem;
  1053. }
  1054. .introduce{
  1055. padding: 0.2rem 0.5rem 0.5rem;
  1056. background-color: #FFF;
  1057. }
  1058. .introduce span{
  1059. color: #8A8A8A;
  1060. margin-right: 20px;
  1061. }
  1062. .project_info{
  1063. border: 1px solid #DCDCDC;
  1064. padding: 0px 20px;
  1065. margin-top: 10px;
  1066. border-radius: 10px;
  1067. }
  1068. .notice{
  1069. padding: 0.5rem;
  1070. background-color: #FFF;
  1071. }
  1072. .notice p{
  1073. line-height: 0.7rem;
  1074. }
  1075. .biddingList{
  1076. padding: 0.5rem;
  1077. background-color: #FFF;
  1078. margin-bottom: 0.4rem;
  1079. }
  1080. .biddingList table{
  1081. text-align: center;
  1082. }
  1083. .biddingList table td{
  1084. text-align: center;
  1085. padding: 10px 0px;
  1086. }
  1087. .biddingList table tr:first-child td{
  1088. background-color: #007E72;
  1089. color: #FFF;
  1090. }
  1091. .bottomBtn{
  1092. padding: 0.2rem 0.5rem;
  1093. background-color: #FFF;
  1094. position: fixed;
  1095. bottom: 0;
  1096. width: 100%;
  1097. }
  1098. .popup{
  1099. text-align: center;
  1100. padding: 0.5rem;
  1101. border-radius: 20px;
  1102. width: 70%;
  1103. padding-top: 1.5rem;
  1104. }
  1105. .popupTit{
  1106. color: #007E72;
  1107. font-size: 0.4rem;
  1108. line-height: 0.9rem;
  1109. }
  1110. .popupContent{
  1111. color: #666666;
  1112. }
  1113. .iKnow{
  1114. margin-top: 1rem;
  1115. }
  1116. .updatePopup{
  1117. color: #007E72;
  1118. margin-top: 0.5rem;
  1119. }
  1120. </style>