Commit 0278ac1b authored by 王玉鑫's avatar 王玉鑫

feat: 咨询列表

parent 1f5a2fb0
......@@ -18,4 +18,8 @@ export default {
infoSubmit: '/postcard/api/investClueInfo/save',
// 查询条件列表(字典表)
queryConditionList: '/postcard/api/sysDictData/listByCodes',
// 查询是否有权限查看列表
haveAuth: '/postcard/api/investClueInfo/haveAuth',
// 查询咨询列表
queryInvestInfos: '/postcard/api/investClueInfo/page',
}
......@@ -7,6 +7,12 @@
}
},
"pages": [
{
"path": "pages/investment/investment-list",
"style": {
"navigationBarTitleText": "咨询列表"
}
},
{
"path": "pages/index/index",
"style": {
......
......@@ -68,7 +68,16 @@
></u--textarea>
</u-form-item>
</u--form>
<div class="submit-btn" @click="handleSubmit">提交</div>
<div class="submit-btn" @tap="handleSubmit">提交</div>
<div class="to-list" @tap="handleToList">
<div>
<image
class="customer-icon"
src="@/static/img/customer.png"
></image>
</div>
<div>咨询列表</div>
</div>
</div>
</div>
<u-picker
......@@ -249,6 +258,26 @@ export default {
this.selectedType = this.typeList[indexs[0]];
this.changeShowPicker(false);
},
/**
* 查询是否有列表及数量
*/
async queryHaveAuth() {
try {
const result = await this.$fetch({
url: API.haveAuth,
data: {},
methods: "get",
});
return result;
} catch (error) {
return false;
}
},
handleToList() {
uni.navigateTo({
url: `/pages/investment/investment-list`,
});
},
},
};
</script>
......@@ -302,5 +331,25 @@ export default {
background-color: unset !important;
padding: 0 !important;
}
.to-list {
position: fixed;
right: 40rpx;
bottom: 318rpx;
width: 151rpx;
height: 151rpx;
z-index: 100;
background: #fdfeff;
box-shadow: 2rpx 0 8rpx 0 #4374ef;
border-radius: 50%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: PingFang-SC, PingFang-SC;
.customer-icon {
width: 54rpx;
height: 48rpx;
}
}
}
</style>
<template>
<div class="invest-list">
<div class="body">
<div class="list-item" v-for="item of dataList" :key="item.id">
<div class="title">
<div>{{ getTypeName(item.consultType) }}</div>
<div class="company">{{ item.company }}</div>
</div>
<div class="info-cell">
<div>
<div class="name">姓名</div>
<div class="value">{{ item.name || "--" }}</div>
</div>
<div>
<div class="name">联系方式</div>
<div class="value">{{ item.phone || "--" }}</div>
</div>
<div>
<div class="name">提交时间</div>
<div class="value">{{ item.updateTime || "--" }}</div>
</div>
</div>
<div class="desc-cell">
<div class="desc-name">需求描述:</div>
<div class="desc-value">
{{ item.details || "--" }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import API from "@/api/url";
export default {
name: "InvestmentList",
data() {
return {
dataList: [
{
company: "12312312",
consultType: "1",
createBy: "",
createTime: "",
details: "afoijwoifejwofiew",
email: "18500055742@qq.com",
id: 0,
name: "王一二",
phone: "199040222--3",
updateBy: "",
updateTime: "2022-01-04 18:32",
version: 0,
},
{
company: "",
consultType: 0,
createBy: "",
createTime: "",
details: "",
email: "",
id: 0,
name: "",
phone: "",
updateBy: "",
updateTime: "",
version: 0,
},
],
pageNum: 1,
haveMore: true,
isLoading: true,
typeList: [],
};
},
mounted() {
this.initTypeList();
this.getList();
},
methods: {
initTypeList() {
this.$fetch({
url: API.queryConditionList,
data: {
code: "invest_type",
},
}).then((res) => {
this.typeList = res.invest_type;
});
},
getList() {
if (!this.haveMore) return;
this.isLoading = true;
this.$fetch({
url: API.queryInvestInfos,
methods: "post",
header: {
"Content-Type": "application/json",
},
data: {
current: this.pageNum,
size: 20,
condition: {},
},
success: (res) => {
this.isLoading = false;
this.dataList.push(...res.records);
this.haveMore = this.dataList.length < res.total;
},
});
},
getTypeName(type) {
return (
this.typeList.find(({ dictValue }) => dictValue === type)?.dictLabel ||
""
);
},
},
watch: {
refreshCollectionPage() {
this.dataList = [];
this.pageNum = 1;
this.haveMore = true;
this.getList();
},
},
onReachBottom() {
if (this.haveMore && !this.isLoading) {
this.pageNum++;
this.getList();
}
},
};
</script>
<style lang="scss">
.invest-list {
overflow-y: auto;
overflow-x: hidden;
scroll-behavior: smooth;
.body {
padding: 30rpx;
.title {
display: flex;
align-items: center;
font-size: 32rpx;
font-family: HiraginoSansGB, HiraginoSansGB;
color: #333333;
}
.company {
margin-left: 20rpx;
border-radius: 16rpx;
background: #4374ef;
font-size: 28rpx;
color: white;
padding: 0 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.list-item {
padding: 40rpx;
background: white;
border-radius: 10rpx;
& ~ .list-item {
margin-top: 20rpx;
}
.info-cell {
margin-top: 40rpx;
display: flex;
justify-content: space-between;
font-family: PingFang-SC, PingFang-SC;
.name {
font-size: 24rpx;
font-weight: 500;
color: #999999;
}
.value {
margin-top: 30rpx;
font-size: 24rpx;
font-weight: 500;
color: #606266;
}
}
.desc-cell {
margin-top: 40rpx;
font-family: PingFang-SC, PingFang-SC;
.desc-name {
font-size: 28rpx;
font-weight: bold;
color: #333333;
}
.desc-value {
margin-top: 30rpx;
font-size: 24rpx;
font-weight: 500;
color: #606266;
}
}
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment