移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1016 lines
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. clearInterval(this.timer);
  315. this.reload();
  316. },
  317. methods: {
  318. goSignUp(){
  319. getInfo().then(response => {
  320. getMember(response.user.userId).then(response => {
  321. if (response.data.auditStatus == 'Y'){
  322. this.$router.push(
  323. {
  324. path: 'signUp',
  325. query: {
  326. projectId: this.detail.id,
  327. deposit: this.detail.deposit,
  328. projectName: this.detail.projectName
  329. }
  330. }
  331. );
  332. }else{
  333. this.$toast({
  334. icon: 'error', // 找到自己需要的图标
  335. message: '交易中心审核注册信息后方可进行报名!',
  336. duration:"2000",
  337. onClose:function(){
  338. }
  339. })
  340. }
  341. })
  342. })
  343. },
  344. onChange(index) {
  345. this.current = index;
  346. },
  347. showPopup() {
  348. this.show = true;
  349. },
  350. reload(){
  351. console.log("结束进入")
  352. getOutProjectDetail(this.id).then(response =>{
  353. this.detail=response.data
  354. this.getDicts("rollout_type").then(res =>{
  355. this.detail.rollout = this.selectDictLabel(res.data,response.data.rollout);
  356. if(this.detail.oneout==0){
  357. this.detail.oneout = "无"
  358. }else{
  359. this.detail.oneout = this.selectDictLabel(res.data,response.data.oneout);
  360. }
  361. })
  362. this.getDicts("project_type").then(res => {
  363. this.detail.projectNumber = this.selectDictLabel(res.data,response.data.projectNumber);
  364. });
  365. this.getDicts("sub_object_type").then(res => {
  366. // this.detail.projectType = this.selectDictLabel(res.data,response.data.projectType);
  367. });
  368. this.getDicts("economic_type").then(res => {
  369. this.detail.economicType = this.selectDictLabel(res.data,response.data.economicType);
  370. });
  371. this.getDicts("area_unit").then(res => {
  372. this.detail.allCountUnit = this.selectDictLabel(res.data,response.data.allCountUnit);
  373. });
  374. this.getDicts("bidding_type").then(res => {
  375. this.detail.biddingType = this.selectDictLabel(res.data,response.data.biddingType);
  376. });
  377. this.getDicts("bidding_direct").then(res => {
  378. this.detail.biddingDirect = this.selectDictLabel(res.data,response.data.biddingDirect);
  379. });
  380. this.getDicts("price_unit").then(res => {
  381. this.detail.unit = this.selectDictLabel(res.data,response.data.unit);
  382. });
  383. this.getDicts("payment_type").then(res => {
  384. this.detail.paymentType = this.selectDictLabel(res.data,response.data.paymentType);
  385. });
  386. for(let i of this.detail.subjectList){
  387. this.getDicts("area_unit").then(res => {
  388. i.areaUnit = this.selectDictLabel(res.data,i.areaUnit);
  389. });
  390. }
  391. var that = this;
  392. getBiddingList(that.id).then(response =>{
  393. that.biddinglistInformation = response.rows
  394. that.biddinglistInformationLength = response.total
  395. if (that.detail.biddingType == '阶梯竞价'){
  396. if (response.rows.length>0&&that.detail.ladderPrice){
  397. if (that.price == 0){return;}
  398. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  399. that.price = parseFloat(response.rows[0].money - that.detail.ladderPrice).toFixed(2)
  400. }else{
  401. that.price = parseFloat(response.rows[0].money + that.detail.ladderPrice).toFixed(2)
  402. }
  403. }else if (response.rows.length>0&&!that.detail.ladderPrice){
  404. if (that.price == 0){return;}
  405. that.price = response.rows[0].money
  406. }else{
  407. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  408. that.price = parseFloat(that.detail.price - that.detail.ladderPrice).toFixed(2)
  409. }else{
  410. that.price = parseFloat(that.detail.price + that.detail.ladderPrice).toFixed(2)
  411. }
  412. }
  413. }
  414. });
  415. let biddingStartTime = Date.parse(this.detail.biddingStartTime)+0
  416. let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
  417. let signupStartTime = Date.parse(this.detail.signupStartTime)+0
  418. let signupStopTime = Date.parse(this.detail.signupStopTime)+0
  419. let nowDate = Date.parse(new Date());
  420. if(signupStartTime>nowDate){
  421. console.log('未开始')
  422. this.process= "报名未开始"
  423. this.tip=this.detail.signupStartTime+"开始报名"
  424. this.btnMsg="立即报名"
  425. this.timeMsg="距报名开始"
  426. this.time = signupStartTime-nowDate
  427. this.isSignup=true
  428. }
  429. if(signupStopTime>nowDate&&signupStopTime>signupStartTime){
  430. console.log('报名中')
  431. this.process= "报名中"
  432. this.tip=this.detail.signupStopTime+"报名截止"
  433. this.btnMsg="立即报名"
  434. this.timeMsg="距报名截止"
  435. this.time = signupStopTime-nowDate
  436. getInfo().then(response => {
  437. let _this = this
  438. getMember(response.user.userId).then(res => {
  439. console.log(res)
  440. let data= {
  441. projectId:this.id,
  442. memberId:res.data.id,
  443. depositStatus:'1'
  444. };
  445. getSignup(data).then(r =>{
  446. if(r.data=="1"){
  447. _this.isSignup=true
  448. this.btnMsg="已报名"
  449. }
  450. })
  451. })
  452. })
  453. }
  454. if(biddingStartTime>nowDate&&nowDate>signupStopTime){
  455. console.log('竞价未开始')
  456. this.biddingTimeType = 3;
  457. this.process= "竞价未开始"
  458. this.tip=this.detail.biddingStartTime+"开始竞价"
  459. this.timeMsg="距竞价开始"
  460. this.time = biddingStartTime-nowDate
  461. getInfo().then(response => {
  462. let _this = this
  463. getMember(response.user.userId).then(res => {
  464. let data= {
  465. projectId:this.id,
  466. memberId:res.data.id,
  467. depositStatus:'1'
  468. };
  469. getSignup(data).then(r =>{
  470. if(r.data=="1"){
  471. _this.isSignup=true;
  472. this.btnMsg="立即竞价"
  473. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  474. }else{
  475. this.btnMsg="未报名"
  476. }
  477. })
  478. })
  479. })
  480. }
  481. if(biddingStopTime>nowDate&&nowDate>biddingStartTime){
  482. console.log('竞价中')
  483. this.biddingTimeType = 1;
  484. this.process= "竞价中"
  485. this.tip=this.detail.biddingStopTime+"结束竞价"
  486. this.timeMsg="距竞价结束"
  487. this.time = biddingStopTime-nowDate
  488. getInfo().then(response => {
  489. let _this = this
  490. this.userId=response.user.userId
  491. getMember(response.user.userId).then(res => {
  492. this.userAccount=res.data.phone
  493. this.userName=res.data.realname
  494. this.memberId=res.data.id
  495. let data= {
  496. projectId:this.id,
  497. memberId:res.data.id,
  498. depositStatus:'1'
  499. };
  500. getSignup(data).then(r =>{
  501. if(r.data=="1"){
  502. _this.isSignup=true
  503. this.btnMsg="立即竞价"
  504. this.showBtn=true
  505. _this.isFirst = r.signup.isFirst;
  506. // this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
  507. }else{
  508. this.btnMsg="未报名"
  509. _this.isSignup=true
  510. }
  511. })
  512. })
  513. })
  514. this.timer = setInterval(function () {
  515. getBiddingList(that.id).then(response =>{
  516. that.biddinglistInformation = response.rows
  517. if((response.rows.length != that.biddinglistInformationLength) && that.detail.ladderPrice){
  518. if (that.detail.biddingDirect == 2 ||that.detail.biddingDirect == '反向竞价') {
  519. that.price = parseInt(response.rows[0].money) - parseInt(that.detail.ladderPrice)
  520. }else{
  521. that.price = parseInt(response.rows[0].money) + parseInt(that.detail.ladderPrice)
  522. }
  523. }
  524. that.biddinglistInformationLength = response.total
  525. });
  526. },10000)
  527. }
  528. if(nowDate>biddingStopTime){
  529. console.log('竞价结束')
  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. }
  539. });
  540. getWebConfig().then(response =>{
  541. this.timeConfig = response.data[8].configValue;
  542. response.data.map(item =>{
  543. if(item.configKey=="cqjy.website.bidInfo"){
  544. this.webConfig = item.configValue
  545. }
  546. })
  547. });
  548. },
  549. offerFirst(){
  550. clearInterval(this.timer);
  551. let newMoney;
  552. projectNewBidMoney(this.id).then(response =>{
  553. if (response.data&&response.code==200){
  554. newMoney = response.data;
  555. }else{
  556. newMoney = this.detail.price;
  557. }
  558. let data= {
  559. projectId:this.id,
  560. memberId:this.memberId,
  561. userId:this.userId,
  562. userAccount:this.userAccount,
  563. userName:this.userName,
  564. money:parseFloat(newMoney),
  565. };
  566. biddingSubmit(data).then(response =>{
  567. let _this = this
  568. if(response){
  569. this.$toast({
  570. icon: 'success', // 找到自己需要的图标
  571. message: '出价成功',
  572. duration:"1000",
  573. onClose:function(){
  574. _this.reload()
  575. }
  576. })
  577. }
  578. })
  579. });
  580. },
  581. offer(){
  582. let newMoney;
  583. projectNewBidMoney(this.id).then(response =>{
  584. if (response.data&&response.code==200){
  585. newMoney = response.data;
  586. }else{
  587. newMoney = this.detail.price;
  588. }
  589. if (this.price==''||this.price==0||this.price<0||this.price == null){
  590. this.$toast({
  591. icon: 'fail', // 找到自己需要的图标
  592. message: '请输入出价金额',
  593. duration:"1000",
  594. onClose:function(){
  595. }
  596. })
  597. return;
  598. }
  599. if (this.detail.biddingDirect == '反向竞价'){
  600. // if (this.biddinglistInformation.length<1){
  601. if(this.detail.price<this.price){
  602. this.$toast({
  603. icon: 'fail', // 找到自己需要的图标
  604. message: '出价不能高于挂牌价格',
  605. duration:"1000",
  606. onClose:function(){
  607. }
  608. })
  609. return;
  610. }else{
  611. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  612. if (this.biddinglistInformation.length>1){
  613. //判断用户出价不能高于当前出价最低价格
  614. if(newMoney <= this.price){
  615. this.$toast({
  616. icon: 'fail', // 找到自己需要的图标
  617. message: '出价不能高于当前出价最低价格',
  618. duration:"1000",
  619. onClose:function(){
  620. }
  621. })
  622. return;
  623. }
  624. }
  625. }
  626. }
  627. }else{
  628. if(this.detail.price>this.price){
  629. this.$toast({
  630. icon: 'fail', // 找到自己需要的图标
  631. message: '出价不能低于挂牌价格',
  632. duration:"1000",
  633. onClose:function(){
  634. }
  635. })
  636. return;
  637. }else{
  638. if (this.detail.biddingType=='阶梯竞价'||this.detail.biddingType=='公开竞价'){
  639. if (this.biddinglistInformation.length>1){
  640. //判断用户出价不能高于当前出价最低价格
  641. console.log(newMoney)
  642. console.log(this.price)
  643. if(newMoney >= this.price){
  644. this.$toast({
  645. icon: 'fail', // 找到自己需要的图标
  646. message: '出价不能低于当前出价最高价格',
  647. duration:"1000",
  648. onClose:function(){
  649. }
  650. })
  651. return;
  652. }
  653. }
  654. }
  655. }
  656. }
  657. let data= {
  658. projectId:this.id,
  659. memberId:this.memberId,
  660. userId:this.userId,
  661. userAccount:this.userAccount,
  662. userName:this.userName,
  663. money:parseFloat(this.price),
  664. };
  665. console.log(data)
  666. biddingSubmit(data).then(response =>{
  667. let _this = this
  668. if(response){
  669. clearInterval(this.timer);
  670. this.$toast({
  671. icon: 'success', // 找到自己需要的图标
  672. message: '出价成功',
  673. duration:"1000",
  674. onClose:function(){
  675. clearInterval(this.timer);
  676. _this.reload()
  677. if (_this.detail.biddingType=='自由竞价'||_this.detail.biddingType=='公开竞价'){
  678. _this.price = null;
  679. }else{
  680. _this.price = _this.price-_this.detail.ladderPrice;
  681. }
  682. }
  683. })
  684. }
  685. })
  686. });
  687. },
  688. add(){
  689. if (this.detail.biddingDirect == '反向竞价'){
  690. if (this.biddinglistInformation.length<1){
  691. if(this.detail.price <= this.price){
  692. this.$toast({
  693. icon: 'fail', // 找到自己需要的图标
  694. message: '出价不能高于挂牌价格',
  695. duration:"1000",
  696. onClose:function(){
  697. }
  698. })
  699. return;
  700. }
  701. }else{
  702. if(this.biddinglistInformation[0].money <= (parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2)){
  703. this.$toast({
  704. icon: 'fail', // 找到自己需要的图标
  705. message: '出价不能高于当前出价最低价格',
  706. duration:"1000",
  707. onClose:function(){
  708. }
  709. })
  710. return;
  711. }
  712. }
  713. }else{
  714. if (this.biddinglistInformation.length<1){
  715. if(this.detail.price>this.price){
  716. this.$toast({
  717. icon: 'fail', // 找到自己需要的图标
  718. message: '出价不能低于挂牌价格',
  719. duration:"1000",
  720. onClose:function(){
  721. }
  722. })
  723. return;
  724. }
  725. }else{
  726. if(this.biddinglistInformation[0].money>this.price){
  727. this.$toast({
  728. icon: 'fail', // 找到自己需要的图标
  729. message: '出价不能低于当前出价最高价格',
  730. duration:"1000",
  731. onClose:function(){
  732. }
  733. })
  734. return;
  735. }
  736. }
  737. }
  738. console.log(this.price == null)
  739. this.price == null?this.price = 0:this.price = this.price;
  740. this.detail.ladderPrice?this.price=(parseFloat(this.price)+parseFloat(this.detail.ladderPrice)).toFixed(2):this.price += 1
  741. },
  742. sub(){
  743. if (this.detail.biddingDirect == '反向竞价'){
  744. if (this.biddinglistInformation.length<1){
  745. if(this.detail.price<this.price){
  746. this.$toast({
  747. icon: 'fail', // 找到自己需要的图标
  748. message: '出价不能高于挂牌价格',
  749. duration:"1000",
  750. onClose:function(){
  751. }
  752. })
  753. return;
  754. }
  755. }else{
  756. if(this.biddinglistInformation[0].money<this.price){
  757. this.$toast({
  758. icon: 'fail', // 找到自己需要的图标
  759. message: '出价不能高于当前出价最低价格',
  760. duration:"1000",
  761. onClose:function(){
  762. }
  763. })
  764. return;
  765. }
  766. }
  767. }else{
  768. if (this.biddinglistInformation.length<1){
  769. if(this.detail.price>=this.price){
  770. this.$toast({
  771. icon: 'fail', // 找到自己需要的图标
  772. message: '出价不能低于挂牌价格',
  773. duration:"1000",
  774. onClose:function(){
  775. }
  776. })
  777. return;
  778. }
  779. }else{
  780. if(this.biddinglistInformation[0].money >= (parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2)){
  781. this.$toast({
  782. icon: 'fail', // 找到自己需要的图标
  783. message: '出价不能低于当前出价最高价格',
  784. duration:"1000",
  785. onClose:function(){
  786. }
  787. })
  788. return;
  789. }
  790. }
  791. }
  792. this.price == null?this.price = 0:this.price = this.price;
  793. if (this.price == 0)return;
  794. this.detail.ladderPrice?this.price=(parseFloat(this.price)-parseFloat(this.detail.ladderPrice)).toFixed(2):this.price -= 1
  795. // if(this.detail.ladderPrice){
  796. // if((this.price-this.detail.ladderPrice)>this.biddinglistInformation[0].money){
  797. // this.price-=this.detail.ladderPrice
  798. // }else{
  799. // this.$toast({
  800. // icon: 'error', // 找到自己需要的图标
  801. // message: '出价不能低于当前最高价',
  802. // duration:"1000",
  803. // })
  804. // }
  805. // }else{
  806. // if((this.price-1)>this.biddinglistInformation[0].money){
  807. // this.price-=1
  808. // }else{
  809. // this.$toast({
  810. // icon: 'error', // 找到自己需要的图标
  811. // message: '出价不能低于当前最高价',
  812. // duration:"1000",
  813. // })
  814. // }
  815. // }
  816. },
  817. timerChange(value){
  818. let d = value.days;
  819. let h = value.hours;
  820. let m = value.minutes;
  821. let s = value.seconds;
  822. if (d==0 && h==0 && m<2){
  823. console.log("竞价剩余两分钟"+"m:"+m+"s:"+s)
  824. if (m == 0 && s==0){
  825. console.log("竞价结束22222222222")
  826. this.reload();
  827. }
  828. getBiddingList(this.id).then(response =>{
  829. this.biddinglistInformation = response.rows
  830. if (response.rows.length>this.biddinglistInformationLength){
  831. console.log("有人出价")
  832. this.biddinglistInformationLength = response.rows.length;
  833. this.time = 120000
  834. }
  835. });
  836. }
  837. }
  838. },
  839. destroyed () {
  840. console.log('bbbbbbbbbb')
  841. clearInterval(this.timer);
  842. },
  843. beforeDestory() {
  844. clearInterval(this.timer)
  845. },
  846. //离开页面清除定时器失效问题
  847. beforeRouteLeave (to, from, next) {
  848. console.log("我离开了")
  849. clearInterval(this.timer)
  850. next()
  851. }
  852. };
  853. </script>
  854. <style scoped lang="scss">
  855. .app-container {
  856. }
  857. .custom-indicator {
  858. position: absolute;
  859. right: 20px;
  860. bottom: 20px;
  861. padding: 0px 20px;
  862. font-size: 12px;
  863. /*rgba(0, 0, 0, 0.1)*/
  864. background: rgba(0, 0, 0, 0.2);
  865. color: #FFF;
  866. border-radius: 20px;
  867. line-height: 0.5rem;
  868. }
  869. .title{
  870. font-size: 0.45rem;
  871. }
  872. .my-swipe{
  873. width: 100%;
  874. }
  875. .my-swipe .van-swipe-item .van-image{
  876. width: 100%;
  877. }
  878. .information{
  879. background-color: #FFF;
  880. margin-top: 0.3rem;
  881. padding: 0.4rem 0.5rem;
  882. }
  883. .van-row{
  884. line-height: 0.7rem;
  885. }
  886. .price{
  887. color: #C21F3A;
  888. }
  889. .price span{
  890. font-size: 0.5rem;
  891. font-weight: bold;
  892. }
  893. .money{
  894. color: #C21F3A;
  895. }
  896. .money span{
  897. font-size: 0.5rem;
  898. font-weight: bold;
  899. }
  900. .van-count-down{
  901. line-height: 0.7rem;
  902. }
  903. .lead{
  904. background-color: #FFF;
  905. margin-top: 0.3rem;
  906. padding: 0.1rem 0.5rem;
  907. color: #C21F3A;
  908. }
  909. .detail{
  910. background-color: #FFF;
  911. margin-top: 0.3rem;
  912. padding: 0.2rem 0.5rem;
  913. }
  914. .detail span{
  915. color: #8A8A8A;
  916. }
  917. .delTitle{
  918. font-size: 0.4rem;
  919. color: #007E72;
  920. padding: 0.2rem 0.5rem;
  921. }
  922. .introduce{
  923. padding: 0.2rem 0.5rem 0.5rem;
  924. background-color: #FFF;
  925. }
  926. .introduce span{
  927. color: #8A8A8A;
  928. margin-right: 20px;
  929. }
  930. .project_info{
  931. border: 1px solid #DCDCDC;
  932. padding: 0px 20px;
  933. margin-top: 10px;
  934. border-radius: 10px;
  935. }
  936. .notice{
  937. padding: 0.5rem;
  938. background-color: #FFF;
  939. }
  940. .notice p{
  941. line-height: 0.7rem;
  942. }
  943. .biddingList{
  944. padding: 0.5rem;
  945. background-color: #FFF;
  946. margin-bottom: 0.4rem;
  947. }
  948. .biddingList table{
  949. text-align: center;
  950. }
  951. .biddingList table td{
  952. text-align: center;
  953. padding: 10px 0px;
  954. }
  955. .biddingList table tr:first-child td{
  956. background-color: #007E72;
  957. color: #FFF;
  958. }
  959. .bottomBtn{
  960. padding: 0.2rem 0.5rem;
  961. background-color: #FFF;
  962. position: fixed;
  963. bottom: 0;
  964. width: 100%;
  965. }
  966. .popup{
  967. text-align: center;
  968. padding: 0.5rem;
  969. border-radius: 20px;
  970. width: 70%;
  971. padding-top: 1.5rem;
  972. }
  973. .popupTit{
  974. color: #007E72;
  975. font-size: 0.4rem;
  976. line-height: 0.9rem;
  977. }
  978. .popupContent{
  979. color: #666666;
  980. }
  981. .iKnow{
  982. margin-top: 1rem;
  983. }
  984. .updatePopup{
  985. color: #007E72;
  986. margin-top: 0.5rem;
  987. }
  988. </style>