@@ -12,7 +12,8 @@ module.exports = { | |||||
proxyTable: { | proxyTable: { | ||||
"/dev-api": { | "/dev-api": { | ||||
// 请求的目标主机 | // 请求的目标主机 | ||||
target: 'http://116.255.135.38:8081/nsgk_test/', | |||||
//target: 'http://116.255.135.38:8081/nsgk_test/', | |||||
target: 'http://192.168.31.47:8080/', | |||||
changeOrigin: true, | changeOrigin: true, | ||||
pathRewrite: { | pathRewrite: { | ||||
'^/dev-api': '' | '^/dev-api': '' | ||||
@@ -1,10 +1,95 @@ | |||||
import request from '@/utils/request' | import request from '@/utils/request' | ||||
//新闻列表 | |||||
export function userData(query){ | |||||
// 用户信息 | |||||
export function getMember(id){ | |||||
return request({ | return request({ | ||||
url: '/transaction/website/newsList', | |||||
url: '/transaction/member/userId/'+id, | |||||
method: 'get', | method: 'get', | ||||
params: query | |||||
}) | |||||
} | |||||
// 展示图片 | |||||
export function showUserImg(id){ | |||||
return request({ | |||||
url: 'transaction/member/showImg/memberId/'+id, | |||||
method: 'get', | |||||
}) | |||||
} | |||||
//更新用户资料 | |||||
export function userUpdate(query){ | |||||
return request({ | |||||
url: '/transaction/member', | |||||
method: 'put', | |||||
data: query | |||||
}) | |||||
} | |||||
//上传用户图片 | |||||
export function base64Attach(query){ | |||||
return request({ | |||||
url: '/common/base64Attach', | |||||
method: 'post', | |||||
data: query | |||||
}) | |||||
} | |||||
//删除用户图片 | |||||
export function deleteUserImg(id){ | |||||
return request({ | |||||
url: '/transaction/member/deleteImg/attachId/'+id, | |||||
method: 'delete', | |||||
}) | |||||
} | |||||
//发布咨询 | |||||
export function userCommunicate(query){ | |||||
return request({ | |||||
url: '/transaction/communicate', | |||||
method: 'post', | |||||
data: query | |||||
}) | |||||
} | |||||
//查询咨询 | |||||
export function userConsulting(query){ | |||||
return request({ | |||||
url: '/transaction/communicate/communicateList/member', | |||||
method: 'get', | |||||
data: query | |||||
}) | |||||
} | |||||
//修改咨询 | |||||
export function updateCommunicate(query){ | |||||
return request({ | |||||
url: '/transaction/communicate', | |||||
method: 'put', | |||||
data: query | |||||
}) | |||||
} | |||||
//咨询详情 | |||||
export function selectCommunicate(id){ | |||||
return request({ | |||||
url: '/transaction/communicate/'+id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
//删除咨询 | |||||
export function deleteInteraction(id){ | |||||
return request({ | |||||
url: '/transaction/communicate/'+id, | |||||
method: 'delete' | |||||
}) | |||||
} | |||||
//查询供求 | |||||
export function supplyList(query){ | |||||
return request({ | |||||
url: '/transaction/demand/supplyDemandList/member', | |||||
method: 'get', | |||||
data: query | |||||
}) | }) | ||||
} | } |
@@ -12,12 +12,13 @@ import store from './store/' | |||||
import './permission' // permission control | import './permission' // permission control | ||||
import { getDicts } from "@/utils/data"; | import { getDicts } from "@/utils/data"; | ||||
import { selectDictLabel , onClickLeft } from "@/utils/utils"; | |||||
import { selectDictLabel , onClickLeft , getNowFormatDate } from "@/utils/utils"; | |||||
//全局方法挂载 | //全局方法挂载 | ||||
Vue.prototype.getDicts = getDicts | Vue.prototype.getDicts = getDicts | ||||
Vue.prototype.selectDictLabel = selectDictLabel | Vue.prototype.selectDictLabel = selectDictLabel | ||||
Vue.prototype.onClickLeft = onClickLeft | Vue.prototype.onClickLeft = onClickLeft | ||||
Vue.prototype.getNowFormatDate = getNowFormatDate | |||||
// Vant 引用 | // Vant 引用 | ||||
import Vant from 'vant'; | import Vant from 'vant'; | ||||
@@ -293,6 +293,24 @@ export const constantRoutes = [ | |||||
hidden: true, | hidden: true, | ||||
}, | }, | ||||
component: (resolve) => require(['@/views/policy/policyDetail'], resolve) | component: (resolve) => require(['@/views/policy/policyDetail'], resolve) | ||||
}, | |||||
{ | |||||
path: '/interactionAdd', | |||||
name: 'interactionAdd', | |||||
meta: { | |||||
title: '添加互动交流', | |||||
hidden: true, | |||||
}, | |||||
component: (resolve) => require(['@/views/user/interaction/interactionAdd'], resolve) | |||||
}, | |||||
{ | |||||
path: '/supplyAdd', | |||||
name: 'supplyAdd', | |||||
meta: { | |||||
title: '添加互动交流', | |||||
hidden: true, | |||||
}, | |||||
component: (resolve) => require(['@/views/user/supply/supplyAdd'], resolve) | |||||
} | } | ||||
]; | ]; | ||||
@@ -14,3 +14,32 @@ export function selectDictLabel(datas, value) { | |||||
export function onClickLeft(){ | export function onClickLeft(){ | ||||
history.back(-1); | history.back(-1); | ||||
} | } | ||||
export function getNowFormatDate() { | |||||
var date = new Date(); | |||||
var seperator1 = "-"; | |||||
var seperator2 = ":"; | |||||
var month = date.getMonth() + 1; | |||||
var day = date.getDate(); | |||||
var hours = date.getHours(); | |||||
var minutes = date.getMinutes(); | |||||
var 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; | |||||
} | |||||
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + day + " " + hours + seperator2 + minutes + seperator2 + seconds; | |||||
console.log(currentdate) | |||||
return currentdate; | |||||
} |
@@ -5,11 +5,12 @@ | |||||
left-arrow | left-arrow | ||||
fixed | fixed | ||||
placeholder | placeholder | ||||
@click-left="onClickLeft" | |||||
/> | /> | ||||
<van-form> | |||||
<van-field value="中国工商银行" label="开户银行" placeholder="请输入开户银行" required :rules="[{ required:true }]"/> | |||||
<van-field value="张三" label="开户姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||||
<van-field value="230381199705255176" label="开户账号" placeholder="请输入开户账号" required :rules="[{ required:true }]"/> | |||||
<van-form @submit="submitBank"> | |||||
<van-field v-model="form.bankAddress" label="开户银行" placeholder="请输入开户银行" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.bankCardName" label="开户姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.bankCardNum" label="开户账号" placeholder="请输入开户账号" required :rules="[{ required:true }]"/> | |||||
<div class="submit"> | <div class="submit"> | ||||
<van-button round block type="info" color="#007E72" native-type="submit">保存</van-button> | <van-button round block type="info" color="#007E72" native-type="submit">保存</van-button> | ||||
</div> | </div> | ||||
@@ -18,24 +19,52 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import { getMember , userUpdate } from "@/api/user/index"; | |||||
import { getInfo } from "@/api/login/index"; | |||||
import {Dialog} from "vant"; | |||||
export default { | export default { | ||||
name: "notice", | |||||
name: "bankInformation", | |||||
data() { | data() { | ||||
return { | return { | ||||
height:0, | height:0, | ||||
tel:'', | tel:'', | ||||
fileList:[] | |||||
fileList:[], | |||||
form:{ | |||||
bankCardName:'', | |||||
bankCardNum:'', | |||||
bankAddress:'', | |||||
id:'', | |||||
} | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.height = document.body.clientHeight | |||||
this.height = document.body.clientHeight; | |||||
this.getInfo(); | |||||
}, | }, | ||||
methods: { | methods: { | ||||
afterRead(file) { | |||||
// 此时可以自行将文件上传至服务器 | |||||
console.log(this.fileList) | |||||
console.log(file); | |||||
getInfo(){ | |||||
getInfo().then(response => { | |||||
getMember(response.user.userId).then(response => { | |||||
console.log(response) | |||||
this.form.bankCardName = response.data.bankCardName; | |||||
this.form.bankCardNum = response.data.bankCardNum; | |||||
this.form.bankAddress = response.data.bankAddress; | |||||
this.form.id = response.data.id; | |||||
}); | |||||
}); | |||||
}, | }, | ||||
submitBank(){ | |||||
userUpdate(this.form).then(response => { | |||||
console.log(response) | |||||
if (response.code == 200){ | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '修改成功', | |||||
confirmButtonText: '确定', | |||||
}) | |||||
} | |||||
}); | |||||
} | |||||
}, | }, | ||||
}; | }; | ||||
</script> | </script> | ||||
@@ -5,6 +5,7 @@ | |||||
left-arrow | left-arrow | ||||
fixed | fixed | ||||
placeholder | placeholder | ||||
@click-left="onClickLeft" | |||||
/> | /> | ||||
<van-form> | <van-form> | ||||
<van-field value="15314031621" type="tel" label="当前号码" placeholder="请输入手机号" required :rules="[{ required:true }]" /> | <van-field value="15314031621" type="tel" label="当前号码" placeholder="请输入手机号" required :rules="[{ required:true }]" /> | ||||
@@ -5,24 +5,24 @@ | |||||
left-arrow | left-arrow | ||||
fixed | fixed | ||||
placeholder | placeholder | ||||
@click-left="onClickLeft" | |||||
/> | /> | ||||
<van-form> | |||||
<van-field value="15314031621" type="tel" label="手机号" placeholder="请输入手机号" required :rules="[{ required:true }]" > | |||||
<van-form @submit="submitForm"> | |||||
<van-field v-model="userForm.phone" type="tel" label="手机号" placeholder="请输入手机号" readonly required :rules="[{ required:true }]" > | |||||
<template #extra > | <template #extra > | ||||
<p style="color: #007e72" onclick="window.location='phoneInformation'">修改手机号</p> | <p style="color: #007e72" onclick="window.location='phoneInformation'">修改手机号</p> | ||||
</template> | </template> | ||||
</van-field> | </van-field> | ||||
<van-field value="123456" label="密码" placeholder="请输入密码" required :rules="[{ required:true }]"/> | |||||
<van-field value="张三" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||||
<van-field value="230381199705255176" label="身份证号" placeholder="请输入身份证号" required :rules="[{ required:true }]"/> | |||||
<van-field value="山东威海" label="联系地址" placeholder="请输入联系地址" /> | |||||
<van-field v-model="userForm.realname" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="userForm.idCardNum" label="身份证号" placeholder="请输入身份证号" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="userForm.address" label="联系地址" placeholder="请输入联系地址" /> | |||||
<van-field name="uploader" label="上传相关附件"> | <van-field name="uploader" label="上传相关附件"> | ||||
<template #input> | <template #input> | ||||
<van-uploader :after-read="afterRead" v-model="fileList" multiple /> | |||||
<van-uploader :after-read="afterRead" :before-delete="deleteFile" v-model="fileList" multiple :max-count="5" /> | |||||
</template> | </template> | ||||
</van-field> | </van-field> | ||||
<div class="submit"> | <div class="submit"> | ||||
<van-button round block type="info" color="#007E72" native-type="submit">保存</van-button> | |||||
<van-button round block type="info" color="#007E72" native-type="submit" >保存</van-button> | |||||
</div> | </div> | ||||
</van-form> | </van-form> | ||||
</div> | </div> | ||||
@@ -30,30 +30,89 @@ | |||||
<script> | <script> | ||||
import { getInfo } from "@/api/login/index"; | import { getInfo } from "@/api/login/index"; | ||||
import { getMember , base64Attach , userUpdate , showUserImg , deleteUserImg} from "@/api/user/index"; | |||||
import {Dialog} from "vant"; | |||||
export default { | export default { | ||||
name: "userInformation", | name: "userInformation", | ||||
data() { | data() { | ||||
return { | return { | ||||
height:0, | height:0, | ||||
tel:'', | tel:'', | ||||
fileList:[] | |||||
fileList:[], | |||||
form: { | |||||
files:[], | |||||
fileType:'', | |||||
bizPath:'transaction', | |||||
tableName:'t_transaction_member', | |||||
tableId:'' | |||||
}, | |||||
userForm:{ | |||||
phone:'', | |||||
idCardNum:'', | |||||
realname:'', | |||||
address:'', | |||||
}, | |||||
userInfo:[], | |||||
upLoadList:[] | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.height = document.body.clientHeight; | this.height = document.body.clientHeight; | ||||
this.getList(); | |||||
this.getInfo(); | |||||
}, | }, | ||||
methods: { | methods: { | ||||
getList(){ | |||||
getInfo(){ | |||||
getInfo().then(response => { | getInfo().then(response => { | ||||
console.log(response) | |||||
getMember(response.user.userId).then(response => { | |||||
this.userForm.idCardNum = response.data.idCardNum; | |||||
this.userForm.realname = response.data.realname; | |||||
this.userForm.address = response.data.address; | |||||
this.userForm.phone = response.data.phone; | |||||
this.userForm.id = response.data.id; | |||||
this.form.tableId = response.data.id; | |||||
showUserImg(response.data.id).then(responseSecond => { | |||||
console.log(responseSecond) | |||||
for (var i = 0 ; i < responseSecond.data.length ; i++){ | |||||
this.fileList.push({url:'http://116.255.135.38:8081/nsgk_test'+responseSecond.data[i].fileUrl,id:responseSecond.data[i].id}) | |||||
} | |||||
}); | |||||
}); | |||||
}); | }); | ||||
}, | }, | ||||
afterRead(file) { | afterRead(file) { | ||||
// 此时可以自行将文件上传至服务器 | // 此时可以自行将文件上传至服务器 | ||||
console.log(this.fileList) | |||||
console.log(file); | |||||
this.fileList[this.fileList.length-1] = {url:file.content,id:'',isImage: true}; | |||||
}, | }, | ||||
deleteFile(elIndex){ | |||||
deleteUserImg(elIndex.id).then(response => {}); | |||||
return (file, name) => { | |||||
let fileIndex = name.index | |||||
this.fileList[elIndex].splice(fileIndex, 1) | |||||
this.upLoadList[elIndex].splice(fileIndex, 1) | |||||
} | |||||
}, | |||||
submitForm(){ | |||||
this.form.files = []; | |||||
userUpdate(this.userForm).then(response => { | |||||
var imgList = []; | |||||
console.log(this.fileList) | |||||
for (var i = 0 ; i < this.fileList.length ; i++){ | |||||
if(this.fileList[i].url.indexOf('http') == -1&&this.fileList!=''){ | |||||
this.form.files.push(this.fileList[i].url); | |||||
} | |||||
} | |||||
console.log(this.form.files) | |||||
base64Attach(this.form).then(responseSecond => { | |||||
if(response.code == 200 && responseSecond.code == 200){ | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '修改成功', | |||||
confirmButtonText: '确定', | |||||
}) | |||||
} | |||||
}); | |||||
}); | |||||
} | |||||
}, | }, | ||||
}; | }; | ||||
</script> | </script> | ||||
@@ -22,10 +22,12 @@ | |||||
<van-cell title="我的咨询" is-link icon="service-o" to="userInteraction" /> | <van-cell title="我的咨询" is-link icon="service-o" to="userInteraction" /> | ||||
<van-cell title="我的供求" is-link icon="bag-o" to="userSupply" /> | <van-cell title="我的供求" is-link icon="bag-o" to="userSupply" /> | ||||
</div> | </div> | ||||
<van-button plain type="warning" class="loginOut" @click="loginOut">退出登录</van-button> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { logout } from "@/api/login/index"; | |||||
export default { | export default { | ||||
name: "notice", | name: "notice", | ||||
data() { | data() { | ||||
@@ -33,8 +35,15 @@ export default { | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
}, | |||||
methods: { | |||||
loginOut(){ | |||||
logout().then(response => { | |||||
console.log(response) | |||||
}); | |||||
}, | |||||
}, | }, | ||||
methods: {}, | |||||
}; | }; | ||||
</script> | </script> | ||||
@@ -64,4 +73,11 @@ export default { | |||||
.van-icon{ | .van-icon{ | ||||
color: #007E72; | color: #007E72; | ||||
} | } | ||||
.loginOut{ | |||||
width: 94%; | |||||
margin-left: 3%; | |||||
background-color: transparent; | |||||
color:red; | |||||
border-color: red; | |||||
} | |||||
</style> | </style> |
@@ -6,53 +6,121 @@ | |||||
right-text="发布" | right-text="发布" | ||||
fixed | fixed | ||||
placeholder | placeholder | ||||
@click-left="onClickLeft" | |||||
@click-left="goClickLeft" | |||||
@click-right="goAdd" | |||||
/> | /> | ||||
<van-list | <van-list | ||||
v-model="loading" | v-model="loading" | ||||
:finished="finished" | :finished="finished" | ||||
finished-text="没有更多了" | finished-text="没有更多了" | ||||
style="margin-top: 10px;" | style="margin-top: 10px;" | ||||
@load="getList()" | |||||
> | > | ||||
<van-cell> | |||||
<van-cell v-for="(item,index) in interactionList" :key="index"> | |||||
<template #title> | <template #title> | ||||
<van-row> | <van-row> | ||||
<van-col span="20"><van-icon name="../../static/images/icon/questions.png" size="18" style="top: 5px;margin-right: 5px;"/>没拍到,钱怎么自动退回?</van-col> | |||||
<van-col span="4" style="text-align: right;font-size: 0.2rem;color: #007E72;">已回复</van-col> | |||||
<van-col span="20"><van-icon name="../../static/images/icon/questions.png" size="18" style="top: 5px;margin-right: 5px;"/> | |||||
{{item.content}}</van-col> | |||||
<van-col span="4" style="text-align: right;font-size: 0.2rem;color: #007E72;" v-if="item.reply != null">已回复</van-col> | |||||
<van-col span="4" style="text-align: right;font-size: 0.2rem;color: #c21F3a;" v-if="item.reply == null">未回复</van-col> | |||||
</van-row> | </van-row> | ||||
</template> | </template> | ||||
<template #label> | <template #label> | ||||
<van-icon name="../../static/images/icon/answer.png" size="18" style="top: 5px;margin-right: 5px;"/>如果报名后未出价或者未竞价成功,保证金会在拍卖结束后的24小时内解冻。 钱款需要退回银行卡方法如下: 通过银行专用款项交保,请在支付宝app搜索“银行专用款项”,点击转出自行提现,无需手续费; 通过网银交保,保证金会在1-3个工作日内自动退回您的银行卡; 通过余额宝交保,请在支付宝app找到余额宝,点击转出; 通过余额交保,如果钱款是通过银行卡充值到余额的,请在自充值之日起30天内点击“免费退回”申请免手续费退回银行卡。 | |||||
<van-icon name="../../static/images/icon/answer.png" size="18" style="top: 5px;margin-right: 5px;"/>{{item.reply}} | |||||
<van-row> | <van-row> | ||||
<van-col span="18">发布时间:2021-06-30</van-col> | |||||
<van-col span="3" style="color: #007E72;text-align: right;"> | |||||
<van-col span="18">发布时间:{{item.logintime}}</van-col> | |||||
<van-col span="3" style="color: #007E72;text-align: right;" @click="goAdd('update',item.id)" v-if="item.reply == null"> | |||||
<van-icon name="edit" size="15" style="top:3px"/>修改 | <van-icon name="edit" size="15" style="top:3px"/>修改 | ||||
</van-col> | </van-col> | ||||
<van-col span="3" style="color: #007E72;text-align: right;"> | |||||
<van-col span="3" style="color: #007E72;text-align: right;" @click="deleteInteraction(item.id)" v-if="item.reply == null"> | |||||
<van-icon name="delete-o" size="15" style="top:3px"/>删除 | <van-icon name="delete-o" size="15" style="top:3px"/>删除 | ||||
</van-col> | </van-col> | ||||
</van-row> | </van-row> | ||||
<p></p> | <p></p> | ||||
</template> | </template> | ||||
</van-cell> | </van-cell> | ||||
</van-list> | </van-list> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { getMember , userConsulting , deleteInteraction } from "@/api/user/index"; | |||||
import { getInfo } from "@/api/login/index"; | |||||
import {Dialog} from "vant"; | |||||
export default { | export default { | ||||
name: "notice", | |||||
name: "interaction", | |||||
data() { | data() { | ||||
return { | return { | ||||
//是否显示加载 | //是否显示加载 | ||||
loading: false, | loading: false, | ||||
//是否滚动到底部 | //是否滚动到底部 | ||||
finished: true, | |||||
finished: false, | |||||
//数据集合 | |||||
interactionList:[], | |||||
//查询参数 | |||||
queryParams:{ | |||||
memberId:'', | |||||
pageNum:1, | |||||
pageSize:10 | |||||
} | |||||
}; | }; | ||||
}, | }, | ||||
mounted() {}, | |||||
methods: {}, | |||||
created() { | |||||
this.getInfo(); | |||||
}, | |||||
methods: { | |||||
goAdd(type,id){ | |||||
console.log(id) | |||||
if (id == undefined){ | |||||
window.location='interactionAdd'; | |||||
}else{ | |||||
window.location='interactionAdd?type='+type+'&id='+id; | |||||
} | |||||
}, | |||||
goClickLeft(){ | |||||
window.location='user'; | |||||
}, | |||||
getInfo(){ | |||||
getInfo().then(response => { | |||||
getMember(response.user.userId).then(response => { | |||||
this.queryParams.memberId = response.data.id; | |||||
}); | |||||
}); | |||||
}, | |||||
getList(){ | |||||
this.loading = true; | |||||
userConsulting(this.queryParams).then(response => { | |||||
for (var i = 0; i < response.rows.length; i++) { | |||||
this.interactionList.push(response.rows[i]); | |||||
} | |||||
if(this.interactionList.length >= response.total){ | |||||
this.finished = true; | |||||
return; | |||||
} | |||||
this.queryParams.pageNum += 1 ; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
deleteInteraction(id){ | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '是否删除?', | |||||
confirmButtonText: '确定', | |||||
}).then(() => { | |||||
deleteInteraction(id).then(response => { | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '删除成功', | |||||
confirmButtonText: '确定', | |||||
showCancelButton:false | |||||
}).then(() => { | |||||
this.interactionList = []; | |||||
this.getList(); | |||||
}) | |||||
}); | |||||
}) | |||||
} | |||||
}, | |||||
}; | }; | ||||
</script> | </script> | ||||
@@ -0,0 +1,125 @@ | |||||
<template> | |||||
<div class="app-container" :style="{height:height+'px'}"> | |||||
<van-nav-bar | |||||
:title="pageTit" | |||||
left-arrow | |||||
fixed | |||||
placeholder | |||||
@click-left="onClickLeft" | |||||
/> | |||||
<van-form @submit="submitInteraction"> | |||||
<van-field v-model="form.title" label="标题" placeholder="请输入标题" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.realname" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.phone" label="联系电话" placeholder="请输入联系电话" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.content" label="咨询内容" type="textarea" autosize placeholder="请输入咨询内容" required :rules="[{ required:true }]"/> | |||||
<div class="submit"> | |||||
<van-button round block type="info" color="#007E72" native-type="submit">发布</van-button> | |||||
</div> | |||||
</van-form> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { getMember , userCommunicate , updateCommunicate , selectCommunicate } from "@/api/user/index"; | |||||
import { getInfo } from "@/api/login/index"; | |||||
import {Dialog} from "vant"; | |||||
export default { | |||||
name: "interactionAdd", | |||||
data() { | |||||
return { | |||||
height:0, | |||||
pageTit:'', | |||||
form:{ | |||||
title:'', | |||||
realname:'', | |||||
phone:'', | |||||
content:'', | |||||
logintime:'', | |||||
deptId:100, | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.height = document.body.clientHeight; | |||||
console.log(this.$route.query.type) | |||||
if (this.$route.query.type == 'update'){ | |||||
this.getInteraction(); | |||||
this.pageTit = '修改咨询'; | |||||
}else{ | |||||
this.getInfo(); | |||||
this.pageTit = '发布咨询'; | |||||
} | |||||
}, | |||||
methods: { | |||||
getInfo(){ | |||||
getInfo().then(response => { | |||||
getMember(response.user.userId).then(response => { | |||||
this.form.realname = response.data.realname; | |||||
this.form.phone = response.data.phone; | |||||
this.form.memberId = response.data.id; | |||||
}); | |||||
}); | |||||
}, | |||||
getInteraction(){ | |||||
selectCommunicate(this.$route.query.id).then(response => { | |||||
this.form.content = response.data.content; | |||||
this.form.title = response.data.title; | |||||
this.form.realname = response.data.realname; | |||||
this.form.phone = response.data.phone; | |||||
this.form.id = this.$route.query.id; | |||||
}); | |||||
}, | |||||
submitInteraction(){ | |||||
this.form.logintime = this.getNowFormatDate(); | |||||
if(this.$route.query.type == 'update'){ | |||||
updateCommunicate(this.form).then(response => { | |||||
if (response.code == 200){ | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '修改成功', | |||||
confirmButtonText: '确定', | |||||
showCancelButton:false | |||||
}).then(() => { | |||||
self.location=document.referrer; | |||||
}) | |||||
} | |||||
}); | |||||
}else{ | |||||
userCommunicate(this.form).then(response => { | |||||
if (response.code == 200){ | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '发布成功', | |||||
confirmButtonText: '确定', | |||||
showCancelButton:false | |||||
}).then(() => { | |||||
self.location=document.referrer; | |||||
}) | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
}, | |||||
}; | |||||
</script> | |||||
<style scoped lang="scss"> | |||||
.app-container { | |||||
background-color: #FFF; | |||||
} | |||||
.submit{ | |||||
position: absolute; | |||||
bottom: 5%; | |||||
width: 90%; | |||||
left: 5%; | |||||
p{ | |||||
text-align: center; | |||||
margin-bottom: 0.2rem; | |||||
span{ | |||||
color: #007E72; | |||||
} | |||||
} | |||||
} | |||||
</style> |
@@ -2,9 +2,12 @@ | |||||
<div class="app-container"> | <div class="app-container"> | ||||
<van-nav-bar | <van-nav-bar | ||||
title="我的供求" | title="我的供求" | ||||
right-text="发布" | |||||
left-arrow | left-arrow | ||||
fixed | fixed | ||||
placeholder | placeholder | ||||
@click-left="goClickLeft" | |||||
@click-right="goAdd" | |||||
/> | /> | ||||
<van-tabs animated color="#007b76" type="card" style="margin-top: 10px;"> | <van-tabs animated color="#007b76" type="card" style="margin-top: 10px;"> | ||||
<van-tab> | <van-tab> | ||||
@@ -14,28 +17,17 @@ | |||||
:finished="finished" | :finished="finished" | ||||
finished-text="没有更多了" | finished-text="没有更多了" | ||||
style="margin-top: 10px;" | style="margin-top: 10px;" | ||||
@load="getList" | |||||
> | > | ||||
<van-cell icon="play"> | |||||
<van-cell icon="play" v-for="(item , index) in supplyList" v-if="item.supplyDemandType == 1" :key="index"> | |||||
<template #title> | <template #title> | ||||
<span style="color: #007E72;">已审核</span> 海勃湾区森林草原防火区划定:哪些地方是重点防火区严禁做什么? | |||||
<span :style="{color:item.isAuditStatus == 'Y' ? '#007E72':'#c21F3a'}">{{item.isAuditStatus == 'Y' ? '已审核':'未审核'}}</span> {{item.projectName}} | |||||
</template> | </template> | ||||
<template #label> | <template #label> | ||||
联系电话:13306310001 <p style="float: right;">发布时间:2021-06-30</p> | |||||
</template> | |||||
</van-cell> | |||||
<van-cell icon="play"> | |||||
<template #title> | |||||
<span style="color: #c21F3a;">未审核</span> 海勃湾区森林草原防火区划定:哪些地方是重点防火区严禁做什么? | |||||
</template> | |||||
<template #label> | |||||
联系电话:13306310001 <p style="float: right;">发布时间:2021-06-30</p> | |||||
</template> | |||||
</van-cell> | |||||
<van-cell icon="play" title="海勃湾区森林草原防火区划定:哪些地方是重点防火区严禁做什么?"> | |||||
<template #label> | |||||
联系电话:13306310001 <p style="float: right;">发布时间:2021-06-30</p> | |||||
联系电话:{{item.phone}} <p style="float: right;">发布时间:{{item.logintime}}</p> | |||||
</template> | </template> | ||||
</van-cell> | </van-cell> | ||||
</van-list> | </van-list> | ||||
</van-tab> | </van-tab> | ||||
<van-tab title="选项"> | <van-tab title="选项"> | ||||
@@ -46,19 +38,12 @@ | |||||
finished-text="没有更多了" | finished-text="没有更多了" | ||||
style="margin-top: 10px;" | style="margin-top: 10px;" | ||||
> | > | ||||
<van-cell icon="play" title="海勃湾区森林草原防火区划定:哪些地方是重点防火区严禁做什么?"> | |||||
<template #label> | |||||
联系电话:13306310001 <p style="float: right;">发布时间:2021-06-30</p> | |||||
</template> | |||||
</van-cell> | |||||
<van-cell icon="play" title="海勃湾区森林草原防火区划定:哪些地方是重点防火区严禁做什么?"> | |||||
<template #label> | |||||
联系电话:13306310001 <p style="float: right;">发布时间:2021-06-30</p> | |||||
<van-cell icon="play" v-for="(item , index) in supplyList" v-if="item.supplyDemandType == 2" :key="index"> | |||||
<template #title> | |||||
<span :style="{color:item.isAuditStatus == 'Y' ? '#007E72':'#c21F3a'}">{{item.isAuditStatus == 'Y' ? '已审核':'未审核'}}</span> {{item.projectName}} | |||||
</template> | </template> | ||||
</van-cell> | |||||
<van-cell icon="play" title="海勃湾区森林草原防火区划定:哪些地方是重点防火区严禁做什么?"> | |||||
<template #label> | <template #label> | ||||
联系电话:13306310001 <p style="float: right;">发布时间:2021-06-30</p> | |||||
联系电话:{{item.phone}} <p style="float: right;">发布时间:{{item.logintime}}</p> | |||||
</template> | </template> | ||||
</van-cell> | </van-cell> | ||||
</van-list> | </van-list> | ||||
@@ -68,25 +53,63 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import { getMember , supplyList } from "@/api/user/index"; | |||||
import { getInfo } from "@/api/login/index"; | |||||
export default { | export default { | ||||
name: "notice", | |||||
name: "userSupply", | |||||
data() { | data() { | ||||
return { | return { | ||||
//是否显示加载 | //是否显示加载 | ||||
loading: false, | loading: false, | ||||
//是否滚动到底部 | //是否滚动到底部 | ||||
finished: true, | |||||
finished: false, | |||||
//数据集合 | |||||
supplyList:[], | |||||
//查询参数 | |||||
queryParams:{ | |||||
memberId:'', | |||||
pageNum:1, | |||||
pageSize:10 | |||||
} | |||||
}; | }; | ||||
}, | }, | ||||
mounted() {}, | |||||
methods: {}, | |||||
created() { | |||||
this.getInfo(); | |||||
}, | |||||
methods: { | |||||
goAdd(type,id){ | |||||
console.log(id) | |||||
if (id == undefined){ | |||||
window.location='supplyAdd'; | |||||
}else{ | |||||
window.location='supplyAdd?type='+type+'&id='+id; | |||||
} | |||||
}, | |||||
goClickLeft(){ | |||||
window.location='user'; | |||||
}, | |||||
getInfo(){ | |||||
getInfo().then(response => { | |||||
getMember(response.user.userId).then(response => { | |||||
this.queryParams.memberId = response.data.id; | |||||
}); | |||||
}); | |||||
}, | |||||
getList(){ | |||||
this.loading = true; | |||||
supplyList(this.queryParams).then(response => { | |||||
console.log(response) | |||||
for (var i = 0; i < response.rows.length; i++) { | |||||
this.supplyList.push(response.rows[i]); | |||||
} | |||||
if(this.supplyList.length >= response.total){ | |||||
this.finished = true; | |||||
return; | |||||
} | |||||
this.queryParams.pageNum += 1 ; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
}, | |||||
}; | }; | ||||
</script> | </script> | ||||
<style scoped lang="scss"> | |||||
.app-container { | |||||
} | |||||
.titleClass{ | |||||
} | |||||
</style> |
@@ -0,0 +1,125 @@ | |||||
<template> | |||||
<div class="app-container" :style="{height:height+'px'}"> | |||||
<van-nav-bar | |||||
:title="pageTit" | |||||
left-arrow | |||||
fixed | |||||
placeholder | |||||
@click-left="onClickLeft" | |||||
/> | |||||
<van-form @submit="submitInteraction"> | |||||
<van-field v-model="form.title" label="标题" placeholder="请输入标题" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.realname" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.phone" label="联系电话" placeholder="请输入联系电话" required :rules="[{ required:true }]"/> | |||||
<van-field v-model="form.content" label="咨询内容" type="textarea" autosize placeholder="请输入咨询内容" required :rules="[{ required:true }]"/> | |||||
<div class="submit"> | |||||
<van-button round block type="info" color="#007E72" native-type="submit">发布</van-button> | |||||
</div> | |||||
</van-form> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { getMember , userCommunicate , updateCommunicate , selectCommunicate } from "@/api/user/index"; | |||||
import { getInfo } from "@/api/login/index"; | |||||
import {Dialog} from "vant"; | |||||
export default { | |||||
name: "supplyAdd", | |||||
data() { | |||||
return { | |||||
height:0, | |||||
pageTit:'', | |||||
form:{ | |||||
title:'', | |||||
realname:'', | |||||
phone:'', | |||||
content:'', | |||||
logintime:'', | |||||
deptId:100, | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.height = document.body.clientHeight; | |||||
console.log(this.$route.query.type) | |||||
if (this.$route.query.type == 'update'){ | |||||
this.getInteraction(); | |||||
this.pageTit = '修改供求'; | |||||
}else{ | |||||
this.getInfo(); | |||||
this.pageTit = '发布供求'; | |||||
} | |||||
}, | |||||
methods: { | |||||
getInfo(){ | |||||
getInfo().then(response => { | |||||
getMember(response.user.userId).then(response => { | |||||
this.form.realname = response.data.realname; | |||||
this.form.phone = response.data.phone; | |||||
this.form.memberId = response.data.id; | |||||
}); | |||||
}); | |||||
}, | |||||
getInteraction(){ | |||||
selectCommunicate(this.$route.query.id).then(response => { | |||||
this.form.content = response.data.content; | |||||
this.form.title = response.data.title; | |||||
this.form.realname = response.data.realname; | |||||
this.form.phone = response.data.phone; | |||||
this.form.id = this.$route.query.id; | |||||
}); | |||||
}, | |||||
submitInteraction(){ | |||||
this.form.logintime = this.getNowFormatDate(); | |||||
if(this.$route.query.type == 'update'){ | |||||
updateCommunicate(this.form).then(response => { | |||||
if (response.code == 200){ | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '修改成功', | |||||
confirmButtonText: '确定', | |||||
showCancelButton:false | |||||
}).then(() => { | |||||
self.location=document.referrer; | |||||
}) | |||||
} | |||||
}); | |||||
}else{ | |||||
userCommunicate(this.form).then(response => { | |||||
if (response.code == 200){ | |||||
Dialog.confirm({ | |||||
title: '系统提示', | |||||
message: '发布成功', | |||||
confirmButtonText: '确定', | |||||
showCancelButton:false | |||||
}).then(() => { | |||||
self.location=document.referrer; | |||||
}) | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
}, | |||||
}; | |||||
</script> | |||||
<style scoped lang="scss"> | |||||
.app-container { | |||||
background-color: #FFF; | |||||
} | |||||
.submit{ | |||||
position: absolute; | |||||
bottom: 5%; | |||||
width: 90%; | |||||
left: 5%; | |||||
p{ | |||||
text-align: center; | |||||
margin-bottom: 0.2rem; | |||||
span{ | |||||
color: #007E72; | |||||
} | |||||
} | |||||
} | |||||
</style> |