移动端
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

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