xinelu-applet-ui/pagesB/imagetextConsultation/imagetextConsultation.vue
2023-10-09 15:19:17 +08:00

205 lines
3.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="app">
<image src="../../static/pagesB/xinjianwenzhen.png" mode="" @tap='gocreatenewconsultation'></image>
<view class="title">
<view class="text" v-for='(item,index) in titlelist' :key='index'
:class="formdata.status==item.status?'Selectedtext':''" @tap='selecttitltext(item)'>
{{item.text}}
</view>
</view>
<view class="list">
<view class="item" v-for='item in listinfo' :key="item.id">
<view class="time">
2023-12-12 12:12
</view>
<image src="../../static/pagesB/Behave.png" mode=""></image>
<view class="name">
张三
</view>
<view class="text">
你好请问今天下午方便吗
</view>
</view>
</view>
</view>
</template>
<script>
import {
consultationInfolist
} from '@/api/pagesB/imagetextConsultation/imagetextConsultation.js'
export default {
data() {
return {
titlelist: [{
text: '本周全部',
status: ''
},
{
text: '已解答',
status: 2
},
{
text: '未解答',
status: 1
},
],
formdata: {
pageNum: 1,
pageSize: 10,
patientId: 1,
consultationType: 'IMAGE_TEXT_CONSULTATION',
status: '',
},
listtotal: 0,
listinfo: [],
};
},
onShow() {
this.info();
},
methods: {
//选择
selecttitltext(item) {
this.formdata.status = item.status
this.info();
},
info() {
consultationInfolist(this.formdata).then(res => {
this.listinfo = res.rows
this.listtotal = res.rows
})
},
//新建图文咨询
gocreatenewconsultation() {
uni.navigateTo({
url: "/pagesB/createnewconsultation/createnewconsultation"
})
},
},
onReachBottom() { //下滑加载
if (this.listinfo.length >= this.listtotal) {} else {
this.formdata.pageNum++;
consultationInfolist(this.formdata).then(res => {
if (res.code == 200) {
res.rows.forEach(e => {
this.listinfo.push(e)
})
}
})
}
},
onPullDownRefresh() { //下拉刷新
this.formdata.pageNum = 1;
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
page {
background-color: #F4F5F7;
}
.app {
width: 96%;
margin: 20rpx auto;
padding: 20rpx 0;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
.list {
width: 94%;
margin: 0 auto;
.item {
width: 100%;
position: relative;
height: 300rpx;
background: #F6F6F6;
border-radius: 5rpx;
.text {
position: absolute;
left: 190rpx;
top: 180rpx;
font-size: 28rpx;
font-weight: 400;
color: #5F5F5F;
padding-right: 20rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
word-break: break-all;
}
.name {
position: absolute;
left: 190rpx;
top: 120rpx;
font-size: 32rpx;
font-weight: 500;
color: #000000;
}
.time {
width: 100%;
padding-left: 20rpx;
height: 80rpx;
line-height: 80rpx;
border-bottom: 2rpx solid #DADADA;
font-size: 26rpx;
font-weight: 400;
color: #5F5F5F;
}
image {
position: absolute;
left: 20rpx;
top: 110rpx;
width: 150rpx;
height: 150rpx;
}
}
}
.title {
text-align: center;
width: 94%;
margin: 30rpx auto;
display: flex;
.text {
margin-right: 20rpx;
height: 70rpx;
line-height: 70rpx;
background: #FFFFFF;
border: 1px solid #26A888;
border-radius: 5rpx;
width: 25%;
color: #26A888;
}
.Selectedtext {
color: #fff;
background: #26A888 !important;
}
}
image {
width: 94%;
display: block;
margin: 0 auto;
height: 130rpx;
}
}
</style>