移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

1014 righe
34 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{{tip}}
  25. </van-notice-bar>
  26. <div class="information">
  27. <van-row>
  28. <van-col span="24" class="title">【{{ detail.rollout }}】{{ detail.projectName }}</van-col>
  29. </van-row>
  30. <van-row>
  31. <van-col span="5">{{ process }}</van-col>
  32. <van-col span="19"><van-count-down :time="time" format="DD 天 HH 时 mm 分 ss 秒" @change="timerChange" /></van-col>
  33. </van-row>
  34. <van-row>
  35. <van-col span="5">挂牌价</van-col>
  36. <van-col span="19" class="price"><span>{{detail.price}}</span> {{detail.unit}}</van-col>
  37. </van-row>
  38. <van-row>
  39. <van-col span="5">保证金</van-col>
  40. <van-col span="19" class="money"><span>{{ detail.deposit }}</span> 元</van-col>
  41. </van-row>
  42. </div>
  43. <div class="lead" v-if="detail.biddingType != '自由竞价' || biddingTimeType == 2">
  44. <van-row >
  45. <van-col span="2"><van-image src="../../static/images/icon/phone.png" style="vertical-align: text-top;" /></van-col>
  46. <template v-if="biddinglistInformation!=undefined&&biddinglistInformation.length>0">
  47. <van-col span="3">{{biddinglistInformation[0].memberId}}</van-col>
  48. <van-col span="6">{{biddinglistInformation[0].money}}元</van-col>
  49. <van-col span="4">领先</van-col>
  50. <van-col span="9">{{biddinglistInformation[0].createTime}}</van-col>
  51. </template>
  52. </van-row>
  53. </div>
  54. <div class="detail">
  55. <van-row>
  56. <van-col span="24"><span>报名开始时间:</span>{{ detail.signupStartTime }}</van-col>
  57. </van-row>
  58. <van-row>
  59. <van-col span="24"><span>报名截止时间:</span>{{ detail.signupStopTime }}</van-col>
  60. </van-row>
  61. <van-row>
  62. <van-col span="24"><span>竞价开始时间:</span>{{ detail.biddingStartTime }}</van-col>
  63. </van-row>
  64. <van-row>
  65. <van-col span="24"><span>竞价截止时间:</span>{{ detail.biddingStopTime }}</van-col>
  66. </van-row>
  67. <van-row>
  68. <van-col span="24"><span>竞价方式:</span>{{ detail.biddingType }}</van-col>
  69. </van-row>
  70. <van-row>
  71. <van-col span="24"><span>竞价方向:</span>{{ detail.biddingDirect }}</van-col>
  72. </van-row>
  73. <van-row v-if="detail.ladderPrice&&detail.biddingType=='阶梯竞价'">
  74. <van-col span="24"><span>阶梯价(增减幅度):</span>¥{{ detail.ladderPrice }}</van-col>
  75. </van-row>
  76. <van-row>
  77. <van-col span="24"><span>延时周期:</span>{{timeConfig}}分钟</van-col>
  78. </van-row>
  79. <van-row>
  80. <van-col span="24"><span>延时周期说明:</span>竞价的最后{{timeConfig}}分钟内,任意方出价,距结束时间将延长{{timeConfig}}分钟,直至无人出价为止</van-col>
  81. </van-row>
  82. </div>
  83. </van-tab>
  84. <van-tab title="标的物介绍" title-style="font-size:12px;">
  85. <p class="delTitle">标的物介绍</p>
  86. <div class="introduce">
  87. <van-row>
  88. <van-col span="24" style="color:#333333;font-size: 0.4rem;text-align: center;font-weight: bold;">项目挂牌转出方简况及公告内容</van-col>
  89. </van-row>
  90. <van-row>
  91. <van-col span="24"><span>转出方名称</span>{{ detail.outName }}</van-col>
  92. </van-row>
  93. <van-row>
  94. <van-col span="24"><span>住址</span>{{ detail.address }}</van-col>
  95. </van-row>
  96. <van-row>
  97. <van-col span="12"><span>经济类型</span>{{ detail.economicType }}</van-col>
  98. <van-col span="12"><span>统一社会信用代码</span>{{ detail.areaNum }}</van-col>
  99. </van-row>
  100. <van-row>
  101. <van-col span="12"><span>法人/负责人</span>{{ detail.legalPerson }}</van-col>
  102. <van-col span="12"><span>联系电话</span>{{ detail.phone }}</van-col>
  103. </van-row>
  104. <van-row>
  105. <van-col span="12"><span>项目类型</span>{{ detail.projectNumber }}</van-col>
  106. <van-col span="12"><span>农地性质</span>{{ detail.projectType }}</van-col>
  107. </van-row>
  108. <van-row>
  109. <van-col span="24"><span>转出项目名称</span>{{ detail.projectName }}</van-col>
  110. </van-row>
  111. <van-row>
  112. <van-col span="24"><span>坐落</span>{{ detail.locationName }}</van-col>
  113. </van-row>
  114. <!-- <van-row>-->
  115. <!-- <van-col span="14"><span>是否属再次转出</span>{{ detail.twoout == 'N'?"否":"是"}}</van-col>-->
  116. <!-- <van-col span="10"><span>前次转出方式</span>{{ detail.oneout}}</van-col>-->
  117. <!-- </van-row>-->
  118. <van-row>
  119. <van-col span="12"><span>拟转出方式</span>{{ detail.rollout }}</van-col>
  120. <van-col span="12"><span>拟转出面积/数量</span> {{detail.allCount}}{{detail.allCountUnit}} </van-col>
  121. </van-row>
  122. <van-row>
  123. <van-col span="24"><span>拟转出期限</span>{{detail.outStartTime}} 至 {{detail.outStopTime}}&nbsp&nbsp&nbsp&nbsp&nbsp共{{detail.outYearNum}}年</van-col>
  124. </van-row>
  125. <van-row>
  126. <van-col span="24"><span>涉及农户数</span>{{ detail.peasantNum }}</van-col>
  127. </van-row>
  128. <van-row>
  129. <van-col span="24"><span>支付方式</span>{{ detail.paymentType }}</van-col>
  130. </van-row>
  131. <van-row>
  132. <van-col span="24"><span>授权情况</span>{{ detail.authorization }}</van-col>
  133. </van-row>
  134. <van-row>
  135. <van-col span="24"><span>拟流转用途</span>{{ detail.contractPurpose }}</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="">
  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,
  242. getMember,
  243. getOutProjectDetail,
  244. getSignup,
  245. getWebConfig,
  246. projectNewBidMoney
  247. } from "../../api/project";
  248. import {getInfo} from "../../api/login";
  249. export default {
  250. name: "projectDetail",
  251. provide(){
  252. return{
  253. reload:this.reload
  254. }
  255. },
  256. data() {
  257. return {
  258. current: 0,
  259. show: false,
  260. id:this.$route.query.id,
  261. detail: {},
  262. webConfig:"",
  263. biddinglistInformation:[],
  264. rollout_type:[],
  265. process:"",
  266. tip:"",
  267. btnMsg:"",
  268. time:1000000000000000000,
  269. timeMsg:"",
  270. isSignup:false,
  271. showBtn:false,
  272. price:null,
  273. userAccount:"",
  274. userName:"",
  275. userId:"",
  276. timeConfig:'',
  277. biddinglistInformationLength:0,
  278. biddingTimeType:0,
  279. isFirst:'',
  280. timer:null
  281. };
  282. },
  283. computed: {
  284. getNowFormatDate:function(){
  285. let date = new Date();
  286. let seperator1 = "-";
  287. let seperator2 = ":";
  288. let month = date.getMonth() + 1;
  289. let day = date.getDate();
  290. let hours = date.getHours();
  291. let minutes = date.getMinutes();
  292. let seconds = date.getSeconds();
  293. if (month >= 1 && month <= 9) {
  294. month = "0" + month;
  295. }
  296. if (day >= 0 && day <= 9) {
  297. day = "0" + day;
  298. }
  299. if (hours >= 0 && hours <= 9) {
  300. hours = "0" + hours;
  301. }
  302. if (minutes >= 0 && minutes <= 9) {
  303. minutes = "0" + minutes;
  304. }
  305. if (seconds >= 0 && seconds <= 9) {
  306. seconds = "0" + seconds;
  307. }
  308. let currentdate = date.getFullYear() + seperator1 + month + seperator1 + day + " " + hours + seperator2 + minutes + seperator2 + seconds;
  309. console.log(currentdate)
  310. return currentdate;
  311. }
  312. },
  313. created() {
  314. this.reload();
  315. },
  316. methods: {
  317. goSignUp(){
  318. getInfo().then(response => {
  319. getMember(response.user.userId).then(response => {
  320. if (response.data.auditStatus == 'Y'){
  321. this.$router.push(
  322. {
  323. path: 'signUp',
  324. query: {
  325. projectId: this.detail.id,
  326. deposit: this.detail.deposit,
  327. projectName: this.detail.projectName
  328. }
  329. }
  330. );
  331. }else{
  332. this.$toast({
  333. icon: 'error', // 找到自己需要的图标
  334. message: '交易中心审核注册信息后方可进行报名!',
  335. duration:"2000",
  336. onClose:function(){
  337. }
  338. })
  339. }
  340. })
  341. })
  342. },
  343. onChange(index) {
  344. this.current = index;
  345. },
  346. showPopup() {
  347. this.show = true;
  348. },
  349. reload(){
  350. console.log("结束进入")
  351. getOutProjectDetail(this.id).then(response =>{
  352. this.detail=response.data
  353. this.getDicts("rollout_type").then(res =>{
  354. this.detail.rollout = this.selectDictLabel(res.data,response.data.rollout);
  355. if(this.detail.oneout==0){
  356. this.detail.oneout = "无"
  357. }else{
  358. this.detail.oneout = this.selectDictLabel(res.data,response.data.oneout);
  359. }
  360. })
  361. this.getDicts("project_type").then(res => {
  362. this.detail.projectNumber = this.selectDictLabel(res.data,response.data.projectNumber);
  363. });
  364. this.getDicts("sub_object_type").then(res => {
  365. this.detail.projectType = this.selectDictLabel(res.data,response.data.projectType);
  366. });
  367. this.getDicts("economic_type").then(res => {
  368. this.detail.economicType = this.selectDictLabel(res.data,response.data.economicType);
  369. });
  370. this.getDicts("area_unit").then(res => {
  371. this.detail.allCountUnit = this.selectDictLabel(res.data,response.data.allCountUnit);
  372. });
  373. this.getDicts("bidding_type").then(res => {
  374. this.detail.biddingType = this.selectDictLabel(res.data,response.data.biddingType);
  375. });
  376. this.getDicts("bidding_direct").then(res => {
  377. this.detail.biddingDirect = this.selectDictLabel(res.data,response.data.biddingDirect);
  378. });
  379. this.getDicts("price_unit").then(res => {
  380. this.detail.unit = this.selectDictLabel(res.data,response.data.unit);
  381. });
  382. this.getDicts("payment_type").then(res => {
  383. this.detail.paymentType = this.selectDictLabel(res.data,response.data.paymentType);
  384. });
  385. for(let i of this.detail.subjectList){
  386. this.getDicts("area_unit").then(res => {
  387. i.areaUnit = this.selectDictLabel(res.data,i.areaUnit);
  388. });
  389. }
  390. var that = this;
  391. getBiddingList(that.id).then(response =>{
  392. that.biddinglistInformation = response.rows
  393. that.biddinglistInformationLength = response.total
  394. if (that.detail.biddingType == '阶梯竞价'){
  395. if (response.rows.length>0&&that.detail.ladderPrice){
  396. if (that.price == 0){return;}
  397. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  398. that.price = parseFloat(response.rows[0].money - that.detail.ladderPrice).toFixed(2)
  399. }else{
  400. that.price = parseFloat(response.rows[0].money + that.detail.ladderPrice).toFixed(2)
  401. }
  402. }else if (response.rows.length>0&&!that.detail.ladderPrice){
  403. if (that.price == 0){return;}
  404. that.price = response.rows[0].money
  405. }else{
  406. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  407. that.price = parseFloat(that.detail.price - that.detail.ladderPrice).toFixed(2)
  408. }else{
  409. that.price = parseFloat(that.detail.price + that.detail.ladderPrice).toFixed(2)
  410. }
  411. }
  412. }
  413. });
  414. let biddingStartTime = Date.parse(this.detail.biddingStartTime)+0
  415. let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
  416. let signupStartTime = Date.parse(this.detail.signupStartTime)+0
  417. let signupStopTime = Date.parse(this.detail.signupStopTime)+0
  418. let nowDate = Date.parse(new Date());
  419. if(signupStartTime>nowDate){
  420. console.log('未开始')
  421. this.process= "报名未开始"
  422. this.tip=this.detail.signupStartTime+"开始报名"
  423. this.btnMsg="立即报名"
  424. this.timeMsg="距报名开始"
  425. this.time = signupStartTime-nowDate
  426. this.isSignup=true
  427. }
  428. if(signupStopTime>nowDate&&signupStopTime>signupStartTime){
  429. console.log('报名中')
  430. this.process= "报名中"
  431. this.tip=this.detail.signupStopTime+"报名截止"
  432. this.btnMsg="立即报名"
  433. this.timeMsg="距报名截止"
  434. this.time = signupStopTime-nowDate
  435. getInfo().then(response => {
  436. let _this = this
  437. getMember(response.user.userId).then(res => {
  438. console.log(res)
  439. let data= {
  440. projectId:this.id,
  441. memberId:res.data.id,
  442. depositStatus:'1'
  443. };
  444. getSignup(data).then(r =>{
  445. if(r.data=="1"){
  446. _this.isSignup=true
  447. this.btnMsg="已报名"
  448. }
  449. })
  450. })
  451. })
  452. }
  453. if(biddingStartTime>nowDate&&nowDate>signupStopTime){
  454. console.log('竞价未开始')
  455. this.biddingTimeType = 3;
  456. this.process= "竞价未开始"
  457. this.tip=this.detail.biddingStartTime+"开始竞价"
  458. this.timeMsg="距竞价开始"
  459. this.time = biddingStartTime-nowDate
  460. getInfo().then(response => {
  461. let _this = this
  462. getMember(response.user.userId).then(res => {
  463. let data= {
  464. projectId:this.id,
  465. memberId:res.data.id,
  466. depositStatus:'1'
  467. };
  468. getSignup(data).then(r =>{
  469. if(r.data=="1"){
  470. _this.isSignup=true;
  471. this.btnMsg="立即竞价"
  472. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  473. }else{
  474. this.btnMsg="未报名"
  475. }
  476. })
  477. })
  478. })
  479. }
  480. if(biddingStopTime>nowDate&&nowDate>biddingStartTime){
  481. console.log('竞价中')
  482. this.biddingTimeType = 1;
  483. this.process= "竞价中"
  484. this.tip=this.detail.biddingStopTime+"结束竞价"
  485. this.timeMsg="距竞价结束"
  486. this.time = biddingStopTime-nowDate
  487. getInfo().then(response => {
  488. let _this = this
  489. this.userId=response.user.userId
  490. getMember(response.user.userId).then(res => {
  491. this.userAccount=res.data.phone
  492. this.userName=res.data.realname
  493. this.memberId=res.data.id
  494. let data= {
  495. projectId:this.id,
  496. memberId:res.data.id,
  497. depositStatus:'1'
  498. };
  499. getSignup(data).then(r =>{
  500. if(r.data=="1"){
  501. _this.isSignup=true
  502. this.btnMsg="立即竞价"
  503. this.showBtn=true
  504. _this.isFirst = r.signup.isFirst;
  505. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  506. }else{
  507. this.btnMsg="未报名"
  508. _this.isSignup=true
  509. }
  510. })
  511. })
  512. })
  513. this.timer = setInterval(function () {
  514. getBiddingList(that.id).then(response =>{
  515. that.biddinglistInformation = response.rows
  516. if((response.rows.length != that.biddinglistInformationLength) && that.detail.ladderPrice){
  517. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  518. that.price = parseInt(response.rows[0].money) - parseInt(that.detail.ladderPrice)
  519. }else{
  520. that.price = parseInt(response.rows[0].money) + parseInt(that.detail.ladderPrice)
  521. }
  522. }
  523. that.biddinglistInformationLength = response.total
  524. });
  525. },10000)
  526. }
  527. if(nowDate>biddingStopTime){
  528. console.log('竞价结束')
  529. this.process= "竞价结束"
  530. this.tip=this.detail.biddingStopTime+"结束竞价"
  531. this.btnMsg="竞价结束"
  532. this.timeMsg="竞价结束"
  533. this.time = 0
  534. this.isSignup = true
  535. this.showBtn=false
  536. this.biddingTimeType = 2;
  537. }
  538. });
  539. getWebConfig().then(response =>{
  540. this.timeConfig = response.data[8].configValue;
  541. response.data.map(item =>{
  542. if(item.configKey=="cqjy.website.bidInfo"){
  543. this.webConfig = item.configValue
  544. }
  545. })
  546. });
  547. },
  548. offerFirst(){
  549. let newMoney;
  550. projectNewBidMoney(this.id).then(response =>{
  551. if (response.data&&response.code==200){
  552. newMoney = response.data;
  553. }else{
  554. newMoney = this.detail.price;
  555. }
  556. let data= {
  557. projectId:this.id,
  558. memberId:this.memberId,
  559. userId:this.userId,
  560. userAccount:this.userAccount,
  561. userName:this.userName,
  562. money:parseFloat(newMoney),
  563. };
  564. biddingSubmit(data).then(response =>{
  565. let _this = this
  566. if(response){
  567. this.$toast({
  568. icon: 'success', // 找到自己需要的图标
  569. message: '出价成功',
  570. duration:"1000",
  571. onClose:function(){
  572. _this.reload()
  573. }
  574. })
  575. }
  576. })
  577. });
  578. },
  579. offer(){
  580. let newMoney;
  581. projectNewBidMoney(this.id).then(response =>{
  582. if (response.data&&response.code==200){
  583. newMoney = response.data;
  584. }else{
  585. newMoney = this.detail.price;
  586. }
  587. if (this.price==''||this.price==0||this.price<0||this.price == null){
  588. this.$toast({
  589. icon: 'fail', // 找到自己需要的图标
  590. message: '请输入出价金额',
  591. duration:"1000",
  592. onClose:function(){
  593. }
  594. })
  595. return;
  596. }
  597. if (this.detail.biddingDirect == '反向竞价'){
  598. // if (this.biddinglistInformation.length<1){
  599. if(this.detail.price<this.price){
  600. this.$toast({
  601. icon: 'fail', // 找到自己需要的图标
  602. message: '出价不能高于挂牌价格',
  603. duration:"1000",
  604. onClose:function(){
  605. }
  606. })
  607. return;
  608. }else{
  609. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  610. if (this.biddinglistInformation.length>1){
  611. //判断用户出价不能高于当前出价最低价格
  612. if(newMoney <= this.price){
  613. this.$toast({
  614. icon: 'fail', // 找到自己需要的图标
  615. message: '出价不能高于当前出价最低价格',
  616. duration:"1000",
  617. onClose:function(){
  618. }
  619. })
  620. return;
  621. }
  622. }
  623. }
  624. }
  625. }else{
  626. if(this.detail.price>this.price){
  627. this.$toast({
  628. icon: 'fail', // 找到自己需要的图标
  629. message: '出价不能低于挂牌价格',
  630. duration:"1000",
  631. onClose:function(){
  632. }
  633. })
  634. return;
  635. }else{
  636. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  637. if (this.biddinglistInformation.length>1){
  638. //判断用户出价不能高于当前出价最低价格
  639. console.log(newMoney)
  640. console.log(this.price)
  641. if(newMoney >= this.price){
  642. this.$toast({
  643. icon: 'fail', // 找到自己需要的图标
  644. message: '出价不能低于当前出价最高价格',
  645. duration:"1000",
  646. onClose:function(){
  647. }
  648. })
  649. return;
  650. }
  651. }
  652. }
  653. }
  654. }
  655. let data= {
  656. projectId:this.id,
  657. memberId:this.memberId,
  658. userId:this.userId,
  659. userAccount:this.userAccount,
  660. userName:this.userName,
  661. money:parseFloat(this.price),
  662. };
  663. console.log(data)
  664. biddingSubmit(data).then(response =>{
  665. let _this = this
  666. if(response){
  667. this.$toast({
  668. icon: 'success', // 找到自己需要的图标
  669. message: '出价成功',
  670. duration:"1000",
  671. onClose:function(){
  672. clearInterval(this.timer);
  673. _this.reload()
  674. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  675. _this.price = null;
  676. }else{
  677. _this.price = _this.price-_this.detail.ladderPrice;
  678. }
  679. }
  680. })
  681. }
  682. })
  683. });
  684. },
  685. add(){
  686. if (this.detail.biddingDirect == '反向竞价'){
  687. if (this.biddinglistInformation.length<1){
  688. if(this.detail.price <= this.price){
  689. this.$toast({
  690. icon: 'fail', // 找到自己需要的图标
  691. message: '出价不能高于挂牌价格',
  692. duration:"1000",
  693. onClose:function(){
  694. }
  695. })
  696. return;
  697. }
  698. }else{
  699. if(this.biddinglistInformation[0].money <= (parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2)){
  700. this.$toast({
  701. icon: 'fail', // 找到自己需要的图标
  702. message: '出价不能高于当前出价最低价格',
  703. duration:"1000",
  704. onClose:function(){
  705. }
  706. })
  707. return;
  708. }
  709. }
  710. }else{
  711. if (this.biddinglistInformation.length<1){
  712. if(this.detail.price>this.price){
  713. this.$toast({
  714. icon: 'fail', // 找到自己需要的图标
  715. message: '出价不能低于挂牌价格',
  716. duration:"1000",
  717. onClose:function(){
  718. }
  719. })
  720. return;
  721. }
  722. }else{
  723. if(this.biddinglistInformation[0].money>this.price){
  724. this.$toast({
  725. icon: 'fail', // 找到自己需要的图标
  726. message: '出价不能低于当前出价最高价格',
  727. duration:"1000",
  728. onClose:function(){
  729. }
  730. })
  731. return;
  732. }
  733. }
  734. }
  735. console.log(this.price == null)
  736. this.price == null?this.price = 0:this.price = this.price;
  737. this.detail.ladderPrice?this.price=(parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2):this.price += 1
  738. },
  739. sub(){
  740. if (this.detail.biddingDirect == '反向竞价'){
  741. if (this.biddinglistInformation.length<1){
  742. if(this.detail.price<this.price){
  743. this.$toast({
  744. icon: 'fail', // 找到自己需要的图标
  745. message: '出价不能高于挂牌价格',
  746. duration:"1000",
  747. onClose:function(){
  748. }
  749. })
  750. return;
  751. }
  752. }else{
  753. if(this.biddinglistInformation[0].money<this.price){
  754. this.$toast({
  755. icon: 'fail', // 找到自己需要的图标
  756. message: '出价不能高于当前出价最低价格',
  757. duration:"1000",
  758. onClose:function(){
  759. }
  760. })
  761. return;
  762. }
  763. }
  764. }else{
  765. if (this.biddinglistInformation.length<1){
  766. if(this.detail.price>=this.price){
  767. this.$toast({
  768. icon: 'fail', // 找到自己需要的图标
  769. message: '出价不能低于挂牌价格',
  770. duration:"1000",
  771. onClose:function(){
  772. }
  773. })
  774. return;
  775. }
  776. }else{
  777. if(this.biddinglistInformation[0].money >= (parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2)){
  778. this.$toast({
  779. icon: 'fail', // 找到自己需要的图标
  780. message: '出价不能低于当前出价最高价格',
  781. duration:"1000",
  782. onClose:function(){
  783. }
  784. })
  785. return;
  786. }
  787. }
  788. }
  789. this.price == null?this.price = 0:this.price = this.price;
  790. if (this.price == 0)return;
  791. this.detail.ladderPrice?this.price=(parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2):this.price -= 1
  792. // if(this.detail.ladderPrice){
  793. // if((this.price-this.detail.ladderPrice)>this.biddinglistInformation[0].money){
  794. // this.price-=this.detail.ladderPrice
  795. // }else{
  796. // this.$toast({
  797. // icon: 'error', // 找到自己需要的图标
  798. // message: '出价不能低于当前最高价',
  799. // duration:"1000",
  800. // })
  801. // }
  802. // }else{
  803. // if((this.price-1)>this.biddinglistInformation[0].money){
  804. // this.price-=1
  805. // }else{
  806. // this.$toast({
  807. // icon: 'error', // 找到自己需要的图标
  808. // message: '出价不能低于当前最高价',
  809. // duration:"1000",
  810. // })
  811. // }
  812. // }
  813. },
  814. timerChange(value){
  815. let d = value.days;
  816. let h = value.hours;
  817. let m = value.minutes;
  818. let s = value.seconds;
  819. if (d==0 && h==0 && m<2){
  820. console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  821. if (m == 0 && s==0){
  822. console.log("竞价结束22222222222")
  823. this.reload();
  824. }
  825. getBiddingList(this.id).then(response =>{
  826. this.biddinglistInformation = response.rows
  827. if (response.rows.length>this.biddinglistInformationLength){
  828. console.log("有人出价")
  829. this.biddinglistInformationLength = response.rows.length;
  830. this.time = 120000
  831. }
  832. });
  833. }
  834. }
  835. },
  836. destroyed () {
  837. console.log('bbbbbbbbbb')
  838. clearInterval(this.timer);
  839. },
  840. beforeDestory() {
  841. clearInterval(this.timer)
  842. },
  843. //离开页面清除定时器失效问题
  844. beforeRouteLeave (to, from, next) {
  845. console.log("我离开了")
  846. clearInterval(this.timer)
  847. next()
  848. }
  849. };
  850. </script>
  851. <style scoped lang="scss">
  852. .app-container {
  853. }
  854. .custom-indicator {
  855. position: absolute;
  856. right: 20px;
  857. bottom: 20px;
  858. padding: 0px 20px;
  859. font-size: 12px;
  860. /*rgba(0, 0, 0, 0.1)*/
  861. background: rgba(0, 0, 0, 0.2);
  862. color: #FFF;
  863. border-radius: 20px;
  864. line-height: 0.5rem;
  865. }
  866. .title{
  867. font-size: 0.45rem;
  868. }
  869. .my-swipe{
  870. width: 100%;
  871. }
  872. .my-swipe .van-swipe-item .van-image{
  873. width: 100%;
  874. }
  875. .information{
  876. background-color: #FFF;
  877. margin-top: 0.3rem;
  878. padding: 0.4rem 0.5rem;
  879. }
  880. .van-row{
  881. line-height: 0.7rem;
  882. }
  883. .price{
  884. color: #C21F3A;
  885. }
  886. .price span{
  887. font-size: 0.5rem;
  888. font-weight: bold;
  889. }
  890. .money{
  891. color: #C21F3A;
  892. }
  893. .money span{
  894. font-size: 0.5rem;
  895. font-weight: bold;
  896. }
  897. .van-count-down{
  898. line-height: 0.7rem;
  899. }
  900. .lead{
  901. background-color: #FFF;
  902. margin-top: 0.3rem;
  903. padding: 0.1rem 0.5rem;
  904. color: #C21F3A;
  905. }
  906. .detail{
  907. background-color: #FFF;
  908. margin-top: 0.3rem;
  909. padding: 0.2rem 0.5rem;
  910. }
  911. .detail span{
  912. color: #8A8A8A;
  913. }
  914. .delTitle{
  915. font-size: 0.4rem;
  916. color: #007E72;
  917. padding: 0.2rem 0.5rem;
  918. }
  919. .introduce{
  920. padding: 0.2rem 0.5rem 0.5rem;
  921. background-color: #FFF;
  922. }
  923. .introduce span{
  924. color: #8A8A8A;
  925. margin-right: 20px;
  926. }
  927. .project_info{
  928. border: 1px solid #DCDCDC;
  929. padding: 0px 20px;
  930. margin-top: 10px;
  931. border-radius: 10px;
  932. }
  933. .notice{
  934. padding: 0.5rem;
  935. background-color: #FFF;
  936. }
  937. .notice p{
  938. line-height: 0.7rem;
  939. }
  940. .biddingList{
  941. padding: 0.5rem;
  942. background-color: #FFF;
  943. margin-bottom: 0.4rem;
  944. }
  945. .biddingList table{
  946. text-align: center;
  947. }
  948. .biddingList table td{
  949. text-align: center;
  950. padding: 10px 0px;
  951. }
  952. .biddingList table tr:first-child td{
  953. background-color: #007E72;
  954. color: #FFF;
  955. }
  956. .bottomBtn{
  957. padding: 0.2rem 0.5rem;
  958. background-color: #FFF;
  959. position: fixed;
  960. bottom: 0;
  961. width: 100%;
  962. }
  963. .popup{
  964. text-align: center;
  965. padding: 0.5rem;
  966. border-radius: 20px;
  967. width: 70%;
  968. padding-top: 1.5rem;
  969. }
  970. .popupTit{
  971. color: #007E72;
  972. font-size: 0.4rem;
  973. line-height: 0.9rem;
  974. }
  975. .popupContent{
  976. color: #666666;
  977. }
  978. .iKnow{
  979. margin-top: 1rem;
  980. }
  981. .updatePopup{
  982. color: #007E72;
  983. margin-top: 0.5rem;
  984. }
  985. </style>