移动端
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

1180 wiersze
41 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>{{ 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>{{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 signupStartTime = Date.parse(this.detail.signupStartTime)+0
  483. let signupStopTime = Date.parse(this.detail.signupStopTime)+0
  484. let nowDate = Date.parse(this.format($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss"));
  485. let time = this.detail.delayPeriod * 1000;
  486. var difference = biddingStopTime-nowDate;
  487. let m = Math.floor(difference/1000/60%60);
  488. let s = Math.floor(difference/1000%60);
  489. if(signupStartTime>nowDate){
  490. //console.log('未开始')
  491. this.process= "报名未开始"
  492. this.tip=this.detail.signupStartTime+"开始报名"
  493. this.btnMsg="报名未开始"
  494. this.timeMsg="距报名开始"
  495. $('#timeData').html(this.TimeInterval(signupStartTime-nowDate))
  496. // this.timeData = ;
  497. this.isSignup=true
  498. }
  499. if(signupStopTime>nowDate&&signupStopTime>signupStartTime){
  500. //console.log('报名中')
  501. this.process= "报名中"
  502. this.isSignup=false
  503. this.tip=this.detail.signupStopTime+"报名截止"
  504. this.btnMsg="立即报名"
  505. this.timeMsg="距报名截止"
  506. // this.time = signupStopTime-nowDate
  507. $('#timeData').html(this.TimeInterval(signupStopTime-nowDate));
  508. // this.timeData = this.TimeInterval(signupStopTime-nowDate);
  509. if(this.getSignupData=="1"){
  510. this.isSignup=true
  511. this.btnMsg="已报名"
  512. }
  513. }
  514. if(biddingStartTime>nowDate&&nowDate>signupStopTime){
  515. //console.log('竞价未开始')
  516. this.biddingTimeType = 3;
  517. this.process= "竞价未开始"
  518. this.tip=this.detail.biddingStartTime+"开始竞价"
  519. this.timeMsg="距竞价开始"
  520. // this.time = biddingStartTime-nowDate
  521. $('#timeData').html(this.TimeInterval(biddingStartTime-nowDate));
  522. // this.timeData = this.TimeInterval(biddingStartTime-nowDate);
  523. this.isSignup=true;
  524. if(this.getSignupData=="1"){
  525. this.btnMsg="已报名"
  526. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  527. }else{
  528. this.btnMsg="未报名"
  529. }
  530. }
  531. if(biddingStopTime>nowDate&&nowDate>biddingStartTime){
  532. //console.log('竞价中')
  533. this.biddingTimeType = 1;
  534. this.process= "竞价中"
  535. this.tip=this.detail.biddingStopTime+"结束竞价"
  536. this.timeMsg="距竞价结束"
  537. // this.time = biddingStopTime-nowDate
  538. $('#timeData').html(this.TimeInterval(biddingStopTime-nowDate));
  539. // this.timeData = this.TimeInterval(biddingStopTime-nowDate);
  540. //console.log(this.timeData)
  541. if(this.getSignupData=="1"){
  542. this.isSignup=true
  543. this.btnMsg="立即竞价"
  544. this.showBtn=true
  545. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  546. }else{
  547. this.btnMsg="未报名"
  548. this.isSignup=true
  549. }
  550. }
  551. if(nowDate>biddingStopTime){
  552. //console.log('竞价结束')
  553. clearInterval(this.timeCount);
  554. this.process= "竞价结束"
  555. this.tip=this.detail.biddingStopTime+"结束竞价"
  556. this.btnMsg="竞价结束"
  557. this.timeMsg="竞价结束"
  558. this.time = 0
  559. this.isSignup = true
  560. this.showBtn=false
  561. this.biddingTimeType = 2;
  562. $('#timeData').html('');
  563. // this.timeData = ''
  564. }
  565. // console.log(s+'---------------'+m)
  566. if (s < 1 && m < 1){
  567. console.log("竞价结束22222222222")
  568. getBiddingStopTime(this.id).then(response => {
  569. this.$set(this.detail,'biddingStopTime',response.data)
  570. let timeNew = Date.parse(response.data) + 0 - nowDate;
  571. if (timeNew > 0) {
  572. this.$set(this.detail,'biddingStopTime',response.data)
  573. this.getTime();
  574. } else {
  575. clearInterval(this.timeCount);
  576. this.process = "竞价结束"
  577. this.tip = this.detail.biddingStopTime + "结束竞价"
  578. this.btnMsg = "竞价结束"
  579. this.timeMsg = "竞价结束"
  580. this.time = 0
  581. this.isSignup = true
  582. this.showBtn = false
  583. this.biddingTimeType = 2;
  584. $('#timeData').html('');
  585. return;
  586. }
  587. });
  588. }else if (s%2 == 0&&time!=0){
  589. //console.log('aaa')
  590. // console.log((biddingStopTime-nowDate))
  591. // console.log(time)
  592. // this.getTime();
  593. if ((biddingStopTime-nowDate)<=time){
  594. // console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  595. getBiddingStopTime(this.id).then(response =>{
  596. if(this.detail.biddingStopTime!=response.data){
  597. console.log('有人出价')
  598. this.time = null;
  599. }
  600. // this.detail.biddingStopTime = response.data
  601. this.$set(this.detail,'biddingStopTime',response.data);
  602. // this.delayPeriodNow = true;
  603. // this.time = Date.parse(response.data)+0-nowDate;
  604. });
  605. }
  606. }
  607. },
  608. getBidding(){
  609. var that = this;
  610. getBiddingList(that.biddingquery).then(response =>{
  611. that.biddinglistInformation = response.rows
  612. that.biddinglistInformationLength = response.total
  613. if (that.detail.biddingType == '阶梯竞价'){
  614. if (response.rows.length>0&&that.detail.ladderPrice){
  615. if (that.price == 0){return;}
  616. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  617. let money = that.price?that.price:response.rows[0].money
  618. if(response.rows[0].money<=money){
  619. that.price = parseFloat(response.rows[0].money - that.detail.ladderPrice).toFixed(2)
  620. }
  621. }else{
  622. console.log(response.rows[0].money>=that.price)
  623. let money = that.price?that.price:response.rows[0].money
  624. if(response.rows[0].money>=money){
  625. that.price = parseFloat(response.rows[0].money + that.detail.ladderPrice).toFixed(2)
  626. }
  627. }
  628. }else if (response.rows.length>0&&!that.detail.ladderPrice){
  629. if (that.price == 0){return;}
  630. that.price = response.rows[0].money
  631. }else{
  632. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  633. that.price = parseFloat(that.detail.price).toFixed(2)
  634. }else{
  635. that.price = parseFloat(that.detail.price).toFixed(2)
  636. }
  637. }
  638. }
  639. });
  640. },
  641. offerFirst(){
  642. let newMoney;
  643. projectNewBidMoney(this.id).then(response =>{
  644. if (response.data&&response.code==200){
  645. newMoney = response.data;
  646. }else{
  647. newMoney = this.detail.price;
  648. }
  649. let data= {
  650. projectId:this.id,
  651. memberId:this.memberId,
  652. userId:this.userId,
  653. userAccount:this.userAccount,
  654. userName:this.userName,
  655. money:parseFloat(newMoney),
  656. loginTime:Date.now($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"))
  657. };
  658. biddingSubmit(data).then(response =>{
  659. let _this = this
  660. if(response){
  661. this.$toast({
  662. icon: 'success', // 找到自己需要的图标
  663. message: '出价成功',
  664. duration:"1000",
  665. onClose:function(){
  666. clearInterval(this.timer);
  667. // _this.reload()
  668. _this.getBidding();
  669. if (_this.detail.delayPeriod != 0 && _this.delayPeriodNow){
  670. _this.time = null;
  671. }
  672. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  673. _this.price = null;
  674. }
  675. }
  676. })
  677. }
  678. })
  679. });
  680. },
  681. offer(){
  682. let newMoney;
  683. projectNewBidMoney(this.id).then(response =>{
  684. if (response.data&&response.code==200){
  685. newMoney = response.data;
  686. }else{
  687. newMoney = this.detail.price;
  688. }
  689. if (this.price==''||this.price==0||this.price<0||this.price == null){
  690. this.$toast({
  691. icon: 'fail', // 找到自己需要的图标
  692. message: '请输入出价金额',
  693. duration:"1000",
  694. onClose:function(){
  695. }
  696. })
  697. return;
  698. }
  699. if (this.detail.biddingDirect == '反向竞价'){
  700. // if (this.biddinglistInformation.length<1){
  701. if(this.detail.price<this.price){
  702. this.$toast({
  703. icon: 'fail', // 找到自己需要的图标
  704. message: '出价不能高于挂牌价格',
  705. duration:"1000",
  706. onClose:function(){
  707. }
  708. })
  709. return;
  710. }else{
  711. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  712. if (this.biddinglistInformation.length>1){
  713. //判断用户出价不能高于当前出价最低价格
  714. if(newMoney <= this.price){
  715. this.$toast({
  716. icon: 'fail', // 找到自己需要的图标
  717. message: '出价不能高于当前出价最低价格',
  718. duration:"1000",
  719. onClose:function(){
  720. }
  721. })
  722. return;
  723. }
  724. }
  725. }
  726. }
  727. }else{
  728. if(this.detail.price>this.price){
  729. this.$toast({
  730. icon: 'fail', // 找到自己需要的图标
  731. message: '出价不能低于挂牌价格',
  732. duration:"1000",
  733. onClose:function(){
  734. }
  735. })
  736. return;
  737. }else{
  738. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  739. if (this.biddinglistInformation.length>1){
  740. //判断用户出价不能高于当前出价最低价格
  741. //console.log(newMoney)
  742. //console.log(this.price)
  743. if(newMoney >= this.price){
  744. this.$toast({
  745. icon: 'fail', // 找到自己需要的图标
  746. message: '出价不能低于当前出价最高价格',
  747. duration:"1000",
  748. onClose:function(){
  749. }
  750. })
  751. return;
  752. }
  753. }
  754. }
  755. }
  756. }
  757. let data= {
  758. projectId:this.id,
  759. memberId:this.memberId,
  760. userId:this.userId,
  761. userAccount:this.userAccount,
  762. userName:this.userName,
  763. money:parseFloat(this.price),
  764. loginTime:Date.now($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"))
  765. };
  766. // console.log(Date.now($.ajax({async:false}).getResponseHeader("Date")))
  767. biddingSubmit(data).then(response =>{
  768. let _this = this
  769. if(response){
  770. // clearInterval(this.timer);
  771. this.$toast({
  772. icon: 'success', // 找到自己需要的图标
  773. message: '出价成功',
  774. duration:"1000",
  775. onClose:function(){
  776. clearInterval(this.timer);
  777. // _this.reload()
  778. _this.getBidding();
  779. if (_this.detail.delayPeriod != 0 && _this.delayPeriodNow){
  780. _this.time = null;
  781. }
  782. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  783. _this.price = null;
  784. }else{
  785. _this.price = _this.price-_this.detail.ladderPrice;
  786. }
  787. }
  788. })
  789. }
  790. })
  791. });
  792. },
  793. add(){
  794. if (this.detail.biddingDirect == '反向竞价'){
  795. if (this.biddinglistInformation.length<1){
  796. if(this.detail.price <= this.price){
  797. this.$toast({
  798. icon: 'fail', // 找到自己需要的图标
  799. message: '出价不能高于挂牌价格',
  800. duration:"1000",
  801. onClose:function(){
  802. }
  803. })
  804. return;
  805. }
  806. }else{
  807. if(this.biddinglistInformation[0].money <= (parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2)){
  808. this.$toast({
  809. icon: 'fail', // 找到自己需要的图标
  810. message: '出价不能高于当前出价最低价格',
  811. duration:"1000",
  812. onClose:function(){
  813. }
  814. })
  815. return;
  816. }
  817. }
  818. }else{
  819. if (this.biddinglistInformation.length<1){
  820. if(this.detail.price>this.price){
  821. this.$toast({
  822. icon: 'fail', // 找到自己需要的图标
  823. message: '出价不能低于挂牌价格',
  824. duration:"1000",
  825. onClose:function(){
  826. }
  827. })
  828. return;
  829. }
  830. }else{
  831. if(this.biddinglistInformation[0].money>this.price){
  832. this.$toast({
  833. icon: 'fail', // 找到自己需要的图标
  834. message: '出价不能低于当前出价最高价格',
  835. duration:"1000",
  836. onClose:function(){
  837. }
  838. })
  839. return;
  840. }
  841. }
  842. }
  843. //console.log(this.price == null)
  844. this.price == null?this.price = 0:this.price = this.price;
  845. this.detail.ladderPrice?this.price=(parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2):this.price += 1
  846. },
  847. sub(){
  848. if (this.detail.biddingDirect == '反向竞价'){
  849. if (this.biddinglistInformation.length<1){
  850. if(this.detail.price<this.price){
  851. this.$toast({
  852. icon: 'fail', // 找到自己需要的图标
  853. message: '出价不能高于挂牌价格',
  854. duration:"1000",
  855. onClose:function(){
  856. }
  857. })
  858. return;
  859. }
  860. }else{
  861. if(this.biddinglistInformation[0].money<this.price){
  862. this.$toast({
  863. icon: 'fail', // 找到自己需要的图标
  864. message: '出价不能高于当前出价最低价格',
  865. duration:"1000",
  866. onClose:function(){
  867. }
  868. })
  869. return;
  870. }
  871. }
  872. }else{
  873. if (this.biddinglistInformation.length<1){
  874. if(this.detail.price>=this.price){
  875. this.$toast({
  876. icon: 'fail', // 找到自己需要的图标
  877. message: '出价不能低于挂牌价格',
  878. duration:"1000",
  879. onClose:function(){
  880. }
  881. })
  882. return;
  883. }
  884. }else{
  885. if(this.biddinglistInformation[0].money >= (parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2)){
  886. this.$toast({
  887. icon: 'fail', // 找到自己需要的图标
  888. message: '出价不能低于当前出价最高价格',
  889. duration:"1000",
  890. onClose:function(){
  891. }
  892. })
  893. return;
  894. }
  895. }
  896. }
  897. this.price == null?this.price = 0:this.price = this.price;
  898. if (this.price == 0)return;
  899. this.detail.ladderPrice?this.price=(parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2):this.price -= 1
  900. // if(this.detail.ladderPrice){
  901. // if((this.price-this.detail.ladderPrice)>this.biddinglistInformation[0].money){
  902. // this.price-=this.detail.ladderPrice
  903. // }else{
  904. // this.$toast({
  905. // icon: 'error', // 找到自己需要的图标
  906. // message: '出价不能低于当前最高价',
  907. // duration:"1000",
  908. // })
  909. // }
  910. // }else{
  911. // if((this.price-1)>this.biddinglistInformation[0].money){
  912. // this.price-=1
  913. // }else{
  914. // this.$toast({
  915. // icon: 'error', // 找到自己需要的图标
  916. // message: '出价不能低于当前最高价',
  917. // duration:"1000",
  918. // })
  919. // }
  920. // }
  921. },
  922. timerChange(value){
  923. let d = value.days;
  924. let h = value.hours;
  925. let m = value.minutes;
  926. let s = value.seconds;
  927. let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
  928. let nowDate = Date.parse(this.format($.ajax({async:false,data:{i: Date.parse(new Date())}}).getResponseHeader("Date"), "yyyy-MM-dd HH:mm:ss"));
  929. let time = this.detail.delayPeriod * 1000;
  930. if (s < 1 && m < 1){
  931. console.log("竞价结束22222222222")
  932. getBiddingStopTime(this.id).then(response => {
  933. this.$set(this.detail,'biddingStopTime',response.data)
  934. let timeNew = Date.parse(response.data) + 0 - nowDate;
  935. if (timeNew > 0) {
  936. this.$set(this.detail,'biddingStopTime',response.data)
  937. this.getTime();
  938. } else {
  939. this.process = "竞价结束"
  940. this.tip = this.detail.biddingStopTime + "结束竞价"
  941. this.btnMsg = "竞价结束"
  942. this.timeMsg = "竞价结束"
  943. this.time = 0
  944. this.isSignup = true
  945. this.showBtn = false
  946. this.biddingTimeType = 2;
  947. return;
  948. }
  949. });
  950. }else if (s%2 == 0&&time!=0){
  951. //console.log('aaa')
  952. // console.log((biddingStopTime-nowDate))
  953. // console.log(time)
  954. // this.getTime();
  955. if ((biddingStopTime-nowDate)<=time){
  956. // console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  957. getBiddingStopTime(this.id).then(response =>{
  958. if(this.detail.biddingStopTime!=response.data){
  959. console.log('有人出价')
  960. this.time = null;
  961. }
  962. this.detail.biddingStopTime = response.data
  963. this.$set(this.detail,'biddingStopTime',response.data);
  964. this.delayPeriodNow = true;
  965. // this.time = Date.parse(response.data)+0-nowDate;
  966. });
  967. }
  968. }
  969. },
  970. TimeInterval(timestamp) {
  971. //时间戳转化为天时分秒
  972. // 总秒数
  973. var second = Math.floor(timestamp/ 1000);
  974. // 天数
  975. var day = Math.floor(second / 3600 / 24);
  976. // 小时
  977. var hr = Math.floor(second / 3600 % 24);
  978. // 分钟
  979. var min = Math.floor(second / 60 % 60);
  980. // 秒
  981. var sec = Math.floor(second % 60);
  982. return (day?day + "天":'0天') + (hr?hr+ "时":'0时') + ( min?min + "分":'0分') + sec + "秒";
  983. },
  984. },
  985. destroyed () {
  986. console.log('bbbbbbbbbb')
  987. clearInterval(this.timer);
  988. clearInterval(this.timeCount);
  989. },
  990. beforeDestory() {
  991. clearInterval(this.timer)
  992. clearInterval(this.timeCount);
  993. },
  994. //离开页面清除定时器失效问题
  995. beforeRouteLeave(to, from, next) {
  996. console.log("我离开了")
  997. clearInterval(this.timer)
  998. clearInterval(this.timeCount);
  999. this.time = null;
  1000. next()
  1001. }
  1002. };
  1003. </script>
  1004. <style scoped lang="scss">
  1005. .app-container {
  1006. }
  1007. .van-count-down{
  1008. display: inline-block;
  1009. color: #fff;
  1010. }
  1011. .custom-indicator {
  1012. position: absolute;
  1013. right: 20px;
  1014. bottom: 20px;
  1015. padding: 0px 20px;
  1016. font-size: 12px;
  1017. /*rgba(0, 0, 0, 0.1)*/
  1018. background: rgba(0, 0, 0, 0.2);
  1019. color: #FFF;
  1020. border-radius: 20px;
  1021. line-height: 0.5rem;
  1022. }
  1023. .title{
  1024. font-size: 0.45rem;
  1025. margin-bottom: 10PX;
  1026. }
  1027. .my-swipe{
  1028. width: 100%;
  1029. }
  1030. .my-swipe .van-swipe-item .van-image{
  1031. width: 100%;
  1032. }
  1033. .information{
  1034. background-color: #FFF;
  1035. margin-top: 0.3rem;
  1036. padding: 0.4rem 0.5rem;
  1037. }
  1038. .van-row{
  1039. line-height: 0.7rem;
  1040. }
  1041. .price{
  1042. color: #C21F3A;
  1043. }
  1044. .price span{
  1045. font-size: 0.5rem;
  1046. font-weight: bold;
  1047. }
  1048. .money{
  1049. color: #C21F3A;
  1050. }
  1051. .money span{
  1052. font-size: 0.5rem;
  1053. font-weight: bold;
  1054. }
  1055. .van-count-down{
  1056. line-height: 0.7rem;
  1057. }
  1058. .lead{
  1059. background-color: #FFF;
  1060. margin-top: 0.3rem;
  1061. padding: 0.1rem 0.5rem;
  1062. color: #C21F3A;
  1063. }
  1064. .detail{
  1065. background-color: #FFF;
  1066. margin-top: 0.3rem;
  1067. padding: 0.2rem 0.5rem;
  1068. }
  1069. .detail span{
  1070. color: #8A8A8A;
  1071. }
  1072. .delTitle{
  1073. font-size: 0.4rem;
  1074. color: #007E72;
  1075. padding: 0.2rem 0.5rem;
  1076. }
  1077. .introduce{
  1078. padding: 0.2rem 0.5rem 0.5rem;
  1079. background-color: #FFF;
  1080. }
  1081. .introduce span{
  1082. color: #8A8A8A;
  1083. margin-right: 20px;
  1084. }
  1085. .project_info{
  1086. border: 1px solid #DCDCDC;
  1087. padding: 0px 20px;
  1088. margin-top: 10px;
  1089. border-radius: 10px;
  1090. }
  1091. .notice{
  1092. padding: 0.5rem;
  1093. background-color: #FFF;
  1094. }
  1095. .notice p{
  1096. line-height: 0.7rem;
  1097. }
  1098. .biddingList{
  1099. padding: 0.5rem;
  1100. background-color: #FFF;
  1101. margin-bottom: 0.4rem;
  1102. }
  1103. .biddingList table{
  1104. text-align: center;
  1105. }
  1106. .biddingList table td{
  1107. text-align: center;
  1108. padding: 10px 0px;
  1109. }
  1110. .biddingList table tr:first-child td{
  1111. background-color: #007E72;
  1112. color: #FFF;
  1113. }
  1114. .bottomBtn{
  1115. padding: 0.2rem 0.5rem;
  1116. background-color: #FFF;
  1117. position: fixed;
  1118. bottom: 0;
  1119. width: 100%;
  1120. }
  1121. .popup{
  1122. text-align: center;
  1123. padding: 0.5rem;
  1124. border-radius: 20px;
  1125. width: 70%;
  1126. padding-top: 1.5rem;
  1127. }
  1128. .popupTit{
  1129. color: #007E72;
  1130. font-size: 0.4rem;
  1131. line-height: 0.9rem;
  1132. }
  1133. .popupContent{
  1134. color: #666666;
  1135. }
  1136. .iKnow{
  1137. margin-top: 1rem;
  1138. }
  1139. .updatePopup{
  1140. color: #007E72;
  1141. margin-top: 0.5rem;
  1142. }
  1143. </style>