浏览代码

挂牌项目(列表,详情,报名,出价)数据对接。

wulanhaote
nsgkyjk 3 年前
父节点
当前提交
00e770a20b
共有 4 个文件被更改,包括 385 次插入118 次删除
  1. +33
    -1
      src/api/project/index.js
  2. +2
    -1
      src/views/project/index.vue
  3. +254
    -90
      src/views/project/projectDetail.vue
  4. +96
    -26
      src/views/project/signUp.vue

+ 33
- 1
src/api/project/index.js 查看文件

@@ -38,8 +38,40 @@ export function getBiddingList(id){
}
export function uploadPic (params) {
return request({
url: 'http://example.com/upload/image', // 替换成您需要上传的接口
url:'/common/base64Attach',// 替换成您需要上传的接口
method: 'post',
data: params
})
}
//会员信息查询
export function getMember(id){
return request({
url:'/transaction/member/userId/'+id,
method:'get',
})
}
//提交报名
export function submmitSignup (params) {
return request({
url:'/transaction/signup',
method: 'post',
data: params
})
}
// 查询报名状态
export function getSignup (params) {
return request({
url:'/transaction/signup/getSignupByMemberIdAndProId',
method: 'get',
params:params
})
}
// 出价
export function biddingSubmit (params) {
return request({
url:'/transaction/bidding',
method: 'post',
data:params
})
}


+ 2
- 1
src/views/project/index.vue 查看文件

@@ -17,7 +17,7 @@
</van-dropdown-menu>
<van-list v-model="loading" :finished="finished" finished-text="没有更多了">
<router-link :to="{path:'project/projectDetail',query:{id:item.id}}" v-for="(item,index) in infoList">
<van-card :thumb="item.fileUrl?item.fileUrl:'../../static/images/index/projectImg.png'" >
<van-card :thumb="item.fileUrl?''+item.fileUrl:'../../static/images/index/projectImg.png'" >
<template #tags>
<p class="title">【{{item.rollout}}】{{item.projectName}}</p>
<p class="type">{{ item.projectShowStatus }}</p>
@@ -127,6 +127,7 @@ export default {
}
}
this.infoList = newList
console.log(this.infoList)
}
});
},


+ 254
- 90
src/views/project/projectDetail.vue 查看文件

@@ -11,7 +11,7 @@
<van-tab title="竞拍信息" title-style="font-size:12px;">
<van-swipe class="my-swipe" height="235" indicator-color="white" @change="onChange">
<template v-if="detail.fileUrlList !== undefined &&detail.fileUrlList.length>0">
<van-swipe-item v-for="(item,index) in detail.fileUrlList"><van-image :src="item?item:'../../static/images/index/banner.png'" height="235" /></van-swipe-item>
<van-swipe-item v-for="(item,index) in detail.fileUrlList"><van-image :src="item.fileUrl?''+item.fileUrl:'../../static/images/index/banner.png'" height="235" /></van-swipe-item>
</template>
<template v-else>
<van-swipe-item><van-image src="../../static/images/index/banner.png" height="235" /></van-swipe-item>
@@ -128,7 +128,7 @@
<van-col span="10"><span>拟转出面积/数量</span> {{detail.allCount}}{{detail.allCountUnit}} </van-col>
</van-row>
<van-row>
<van-col span="24"><span>拟转出期限</span>{{detail.outStartTime}}至{{detail.outStopTime}}共{{detail.outYearNum}}年</van-col>
<van-col span="24"><span>拟转出期限</span>{{detail.outStartTime}} {{detail.outStopTime}}&nbsp&nbsp&nbsp&nbsp&nbsp共{{detail.outYearNum}}年</van-col>
</van-row>
<van-row>
<van-col span="24"><span>涉及农户数</span>{{ detail.peasantNum }}</van-col>
@@ -150,7 +150,7 @@
<van-tab title="标的物图片" title-style="font-size:12px;">
<p class="delTitle">标的物图片</p>
<template v-if="detail.fileUrlList !== undefined &&detail.fileUrlList.length>0">
<van-image v-for="(item,index) in detail.fileUrlList" :src="item?item:'../../static/images/index/detailImg.png'" style="vertical-align: text-top;" />
<van-image v-for="(item,index) in detail.fileUrlList" :src="item.fileUrl?''+item.fileUrl:'../../static/images/index/detailImg.png'" style="vertical-align: text-top;" />
</template>
<template v-else>
<van-image src="../../static/images/index/detailImg.png" style="vertical-align: text-top;" />
@@ -189,31 +189,31 @@
</van-tab>
</van-tabs>
<div style="height: 2rem;"></div>
<div class="bottomBtn">
<van-row>
<div class="bottomBtn" v-if="">
<van-row v-if="!showBtn">
<van-col span="8" style="margin-top: 4px;" @click="showPopup">
<van-image src="../../static/images/icon/clock.png" style="vertical-align: text-bottom;" />
<p style="line-height: 0.2rem;color: #999999">提醒</p>
</van-col>
<van-col span="16">
<van-button round color="#C21F3A" block :to="{path:'signUp',query:{id:detail.id}}">
<van-button round color="#C21F3A" block :disabled="isSignup" :to="{path:'signUp',query:{projectId:detail.id,deposit:detail.deposit,projectName:detail.projectName}}">
{{ btnMsg }}<br/>
<span style="font-size: 10px">保证金¥{{detail.deposit}}</span>
</van-button>
</van-col>
</van-row>
<van-row style="display: none;">
<van-col span="3" style="text-align: center;line-height: 1rem">
<van-button color="#e2e2e2" icon="plus" size="mini"></van-button>
<van-row v-if="showBtn">
<van-col span="4" style="text-align: center;line-height: 1rem">
<van-button color="#e2e2e2" icon="minus" size="small" @click="sub"></van-button>
</van-col>
<van-col span="18">
<van-button round color="#C21F3A" block>
<van-col span="16">
<van-button round color="#C21F3A" block @click="offer">
<p>出价</p>
<p>434,000</p>
<p>{{price}}元</p>
</van-button>
</van-col>
<van-col span="3" style="text-align: center;line-height: 1rem">
<van-button color="#e2e2e2" icon="minus" size="mini"></van-button>
<van-col span="4" style="text-align: center;line-height: 1rem">
<van-button color="#e2e2e2" icon="plus" size="small" @click="add"></van-button>
</van-col>
</van-row>
</div>
@@ -230,10 +230,23 @@
</template>

<script>
import {getBiddingList, getOutProjectDetail, getWebConfig} from "../../api/project";
import {
biddingSubmit,
getBiddingList,
getMember,
getOutProjectDetail,
getSignup,
getWebConfig
} from "../../api/project";
import {getInfo} from "../../api/login";

export default {
name: "projectDetail",
provide(){
return{
reload:this.reload
}
},
data() {
return {
current: 0,
@@ -247,86 +260,48 @@ export default {
tip:"",
btnMsg:"",
time:0,
timeMsg:""
timeMsg:"",
isSignup:false,
showBtn:false,
price:0,
userAccount:"",
userName:"",
userId:""
};
},
mounted() {

computed: {
getNowFormatDate:function(){
let date = new Date();
let seperator1 = "-";
let seperator2 = ":";
let month = date.getMonth() + 1;
let day = date.getDate();
let hours = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (day >= 0 && day <= 9) {
day = "0" + day;
}
if (hours >= 0 && hours <= 9) {
hours = "0" + hours;
}
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
let currentdate = date.getFullYear() + seperator1 + month + seperator1 + day + " " + hours + seperator2 + minutes + seperator2 + seconds;
console.log(currentdate)
return currentdate;
}
},
created() {
getOutProjectDetail(this.id).then(response =>{
this.detail=response.data
this.getDicts("rollout_type").then(res =>{
this.detail.rollout = this.selectDictLabel(res.data,response.data.rollout);
if(this.detail.oneout==0){
this.detail.oneout = "无"
}else{
this.detail.oneout = this.selectDictLabel(res.data,response.data.oneout);
}
})
this.getDicts("project_type").then(res => {
this.detail.projectNumber = this.selectDictLabel(res.data,response.data.projectNumber);
});
this.getDicts("sub_object_type").then(res => {
this.detail.projectType = this.selectDictLabel(res.data,response.data.projectType);
});
this.getDicts("economic_type").then(res => {
this.detail.economicType = this.selectDictLabel(res.data,response.data.economicType);
});
this.getDicts("area_unit").then(res => {
this.detail.allCountUnit = this.selectDictLabel(res.data,response.data.allCountUnit);
});
this.getDicts("bidding_type").then(res => {
this.detail.biddingType = this.selectDictLabel(res.data,response.data.biddingType);
});
let biddingStartTime = Date.parse(this.detail.biddingStartTime);
let biddingStopTime = Date.parse(this.detail.biddingStopTime);
let signupStartTime = Date.parse(this.detail.signupStartTime);
let signupStopTime = Date.parse(this.detail.signupStopTime);
let nowDate = Date.parse(new Date());
if(signupStartTime>nowDate){
this.process= "报名未开始"
this.tip=this.detail.signupStartTime+"开始报名"
this.btnMsg="立即报名"
this.timeMsg="距报名开始"
this.time = signupStartTime-nowDate
}else if(signupStopTime>nowDate>signupStartTime){
this.process= "报名中"
this.tip=this.detail.signupStopTime+"报名截止"
this.btnMsg="立即报名"
this.timeMsg="距报名截止"
this.time = signupStopTime-nowDate
}else if(biddingStartTime>nowDate>signupStopTime){
this.process= "竞价未开始"
this.tip=this.detail.biddingStartTime+"开始竞价"
this.btnMsg="立即竞价"
this.timeMsg="距竞价开始"
this.time = biddingStartTime-nowDate
}else if(biddingStopTime>nowDate>biddingStartTime){
this.process= "竞价中"
this.tip=this.detail.biddingStopTime+"结束竞价"
this.btnMsg="立即竞价"
this.timeMsg="距竞价结束"
this.time = biddingStopTime-nowDate
}else if(nowDate>biddingStopTime){
this.process= "竞价结束"
this.tip=this.detail.biddingStopTime+"结束竞价"
this.btnMsg="立即竞价"
this.timeMsg="竞价结束"
this.time = 0
}
});
getWebConfig().then(response =>{
response.data.map(item =>{
if(item.configKey=="cqjy.website.bidInfo"){
this.webConfig += item.configValue
}
})
});
getBiddingList(this.id).then(response =>{
this.biddinglistInformation = response.rows
});

this.reload();
},
methods: {
onChange(index) {
@@ -335,6 +310,195 @@ export default {
showPopup() {
this.show = true;
},
reload(){
getOutProjectDetail(this.id).then(response =>{
this.detail=response.data
this.getDicts("rollout_type").then(res =>{
this.detail.rollout = this.selectDictLabel(res.data,response.data.rollout);
if(this.detail.oneout==0){
this.detail.oneout = "无"
}else{
this.detail.oneout = this.selectDictLabel(res.data,response.data.oneout);
}
})
this.getDicts("project_type").then(res => {
this.detail.projectNumber = this.selectDictLabel(res.data,response.data.projectNumber);
});
this.getDicts("sub_object_type").then(res => {
this.detail.projectType = this.selectDictLabel(res.data,response.data.projectType);
});
this.getDicts("economic_type").then(res => {
this.detail.economicType = this.selectDictLabel(res.data,response.data.economicType);
});
this.getDicts("area_unit").then(res => {
this.detail.allCountUnit = this.selectDictLabel(res.data,response.data.allCountUnit);
});
this.getDicts("bidding_type").then(res => {
this.detail.biddingType = this.selectDictLabel(res.data,response.data.biddingType);
});
for(let i of this.detail.subjectList){
this.getDicts("area_unit").then(res => {
i.areaUnit = this.selectDictLabel(res.data,i.areaUnit);
});
}
let biddingStartTime = Date.parse(this.detail.biddingStartTime)+0
let biddingStopTime = Date.parse(this.detail.biddingStopTime)+0
let signupStartTime = Date.parse(this.detail.signupStartTime)+0
let signupStopTime = Date.parse(this.detail.signupStopTime)+0
let nowDate = Date.parse(new Date());
if(signupStartTime>nowDate){
this.process= "报名未开始"
this.tip=this.detail.signupStartTime+"开始报名"
this.btnMsg="立即报名"
this.timeMsg="距报名开始"
this.time = signupStartTime-nowDate
this.isSignup=true
}else if(signupStopTime>nowDate&&signupStopTime>signupStartTime){
this.process= "报名中"
this.tip=this.detail.signupStopTime+"报名截止"
this.btnMsg="立即报名"
this.timeMsg="距报名截止"
this.time = signupStopTime-nowDate
getInfo().then(response => {
let _this = this
getMember(response.user.userId).then(res => {
console.log(res)
let data= {
projectId:this.id,
memberId:res.data.id,
};
getSignup(data).then(r =>{
if(r.data=="1"){
_this.isSignup=true
this.btnMsg="已报名"
}
})
})
})
}else if(biddingStartTime>nowDate&&nowDate>signupStopTime){
this.process= "竞价未开始"
this.tip=this.detail.biddingStartTime+"开始竞价"
this.timeMsg="距竞价开始"
this.time = biddingStartTime-nowDate
getInfo().then(response => {
let _this = this
getMember(response.user.userId).then(res => {
let data= {
projectId:this.id,
memberId:res.data.id,
};
getSignup(data).then(r =>{
if(r.data=="1"){
_this.isSignup=true
this.btnMsg="立即竞价"
this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
}else{
this.btnMsg="未报名"
}
})
})
})
}else if(biddingStopTime>nowDate&&nowDate>biddingStartTime){
this.process= "竞价中"
this.tip=this.detail.biddingStopTime+"结束竞价"
this.timeMsg="距竞价结束"
this.time = biddingStopTime-nowDate
getInfo().then(response => {
let _this = this
this.userId=response.user.userId
getMember(response.user.userId).then(res => {
this.userAccount=res.data.phone
this.userName=res.data.realname
this.memberId=res.data.id
let data= {
projectId:this.id,
memberId:res.data.id,
};
getSignup(data).then(r =>{
if(r.data=="1"){
_this.isSignup=true
this.btnMsg="立即竞价"
this.showBtn=true
this.price=this.detail.ladderPrice?this.biddinglistInformation[0].money+this.detail.ladderPrice:this.biddinglistInformation[0].money+1
}else{
this.btnMsg="未报名"
_this.isSignup=true
}
})
})
})
}else if(nowDate>biddingStopTime){
this.process= "竞价结束"
this.tip=this.detail.biddingStopTime+"结束竞价"
this.btnMsg="竞价结束"
this.timeMsg="竞价结束"
this.time = 0
this.isSignup = true
}
});
getWebConfig().then(response =>{
response.data.map(item =>{
if(item.configKey=="cqjy.website.bidInfo"){
this.webConfig += item.configValue
}
})
});
getBiddingList(this.id).then(response =>{
this.biddinglistInformation = response.rows
});
},
offer(){
let data= {
projectId:this.id,
memberId:this.memberId,
userId:this.userId,
userAccount:this.userAccount,
userName:this.userName,
money:this.price,
loginTime:this.getNowFormatDate
};
console.log(data)
biddingSubmit(data).then(response =>{
let _this = this
if(response){
this.$toast({
icon: 'success', // 找到自己需要的图标
message: '出价成功',
duration:"1000",
onClose:function(){
_this.reload()
}
})

}
})
},
add(){
this.detail.ladderPrice?this.price=this.price+this.detail.ladderPrice:this.price+=1
},
sub(){
if(this.detail.ladderPrice){
if((this.price-this.detail.ladderPrice)>this.biddinglistInformation[0].money){
this.price-=this.detail.ladderPrice
}else{
this.$toast({
icon: 'error', // 找到自己需要的图标
message: '出价不能低于当前最高价',
duration:"1000",
})
}
}else{
if((this.price-1)>this.biddinglistInformation[0].money){
this.price-=1
}else{
this.$toast({
icon: 'error', // 找到自己需要的图标
message: '出价不能低于当前最高价',
duration:"1000",
})
}
}
},
}
};
</script>


+ 96
- 26
src/views/project/signUp.vue 查看文件

@@ -10,11 +10,11 @@
<van-row>
<p class="" style="padding:20px 20px 0px;font-size: 0.4rem">
<span>项目名称:</span>
<span style="color:#007E72;font-size: 0.45rem;font-weight: bold;">管家堡乡左云村500亩水田出租</span>
<span style="color:#007E72;font-size: 0.45rem;font-weight: bold;">{{ projectName }}</span>
</p>
<p style="padding:10px 20px 0;font-size: 0.4rem;margin-bottom: 20px">
<span>缴纳保证金:</span>
<span style="color:#C21F3A;font-size: 0.45rem;font-weight: bold;">¥1000</span>
<span style="color:#C21F3A;font-size: 0.45rem;font-weight: bold;">¥{{ deposit }}</span>
</p>
</van-row>
<van-row style="padding:0 20px;">
@@ -30,43 +30,63 @@
<h2 style="margin-bottom:10px;padding:0 10px">2.竞买人身份确认</h2>
<van-form @submit="onSubmit">
<van-field
v-model="username"
name="姓名"
v-model="nickName"
name="nickName"
label="姓名"
placeholder="姓名"
required
:rules="[{ required: true, message: '请填写姓名' }]"
/>
<van-field
v-model="password"
name="会员账号"
v-model="phone"
name="phone"
label="会员账号"
placeholder="会员账号"
required
:rules="[{ required: true, message: '请填写会员账号' }]"
/>
<van-field
v-model="password"
name="开户银行"
v-model="bankCardName"
name="bankCardName"
label="开户银行"
placeholder="密码"
placeholder="开户银行"
required
:rules="[{ required: true, message: '请填写开户银行' }]"
/>
<van-field
v-model="password"
name="银行卡号"
v-model="bankCardNum"
name="bankCardNum"
label="银行卡号"
placeholder="银行卡号"
required
:rules="[{ required: true, message: '请填写银行卡号' }]"
/>
<van-field
v-model="password"
name="身份证号"
v-model="idCardNum"
name="idCardNum"
label="身份证号"
placeholder="身份证号"
required
:rules="[{ required: true, message: '请填写身份证号' }]"
/>
<van-field
v-model="projectId"
name="projectId"
style="display: none"
/>
<van-field
v-model="memberId"
name="memberId"
style="display: none"
/>
<van-field
v-model="status"
name="status"
style="display: none"
/>
<van-field label="上传相关凭证" required>
<template #input>
<van-uploader accept="*" :after-read="onRead">
<van-uploader accept="*" v-model="fileList" multiple>
<van-button icon="plus" size="small" round color="#007E72">点击上传</van-button>
</van-uploader>
</template>
@@ -80,32 +100,82 @@
</template>

<script>
import {uploadPic} from "../../api/project";
import {getMember, submmitSignup, uploadPic} from "../../api/project";
import {getInfo} from "../../api/login";

export default {
name: "signUp",
data() {
return {
projectId:this.$route.query.projectId,
deposit:this.$route.query.deposit,
projectName:this.$route.query.projectName,
bankCardName:"",
bankCardNum:"",
idCardNum:"",
phone:"",
memberId:"",
status:"Y",
checked: true,
color:"#007E72",
username:"",
nickName:"",
userName:"",
password:"",
activeIcon: 'https://img01.yzcdn.cn/vant/user-active.png',
inactiveIcon: 'https://img01.yzcdn.cn/vant/user-inactive.png',
fileList:[],
tableId:"",
};
},
created() {

getInfo().then(response => {
getMember(response.user.userId).then(res => {
this.nickName = res.data.realname
this.idCardNum = res.data.idCardNum
this.bankCardName = res.data.bankCardName
this.bankCardNum = res.data.bankCardNum
this.phone = res.data.phone
this.memberId = res.data.id
})
})
},
methods: {
onRead (file) {
let data = new FormData()
data.append('file', file.file)
uploadPic(data).then((data) => {
console.log(data)
let data = {};
let f = []
for (let i of file){
f.push(i.content)
}
data['files']= f
data['fileType']= ""
data['bizPath']= "transaction"
data['tableName']= "t_transaction_signup"
data['tableId']= this.tableId
uploadPic(data).then(response => {
if(response.code=="200"){
let _this = this
this.$toast({
icon: 'success', // 找到自己需要的图标
message: '提交申请,等待审核',
duration:"2000",
onClose:function(){
_this.$router.back(-1);
}
})
}
})
},
onSubmit(values){
if(!this.checked){
this.$toast({
icon: 'warning', // 找到自己需要的图标
message: '保存之前,请先勾选<<竞拍服务协议>>!'
})
}
submmitSignup(values).then(response =>{
if(response.code==200){
this.tableId = response.data
this.onRead(this.fileList)
}
})
},onSubmit(){

}
},
watch:{
@@ -116,6 +186,6 @@ export default {
}
</script>

<style scoped>
<style scoped lang="scss">

</style>

正在加载...
取消
保存