修改消息列表

This commit is contained in:
闫晓茹 2023-11-09 15:07:35 +08:00
parent ac636bf3f0
commit e2bcae1545
6 changed files with 180 additions and 48 deletions

View File

@ -31,7 +31,7 @@ export function closeHealthConsultationOrder(data) {
//消息列表 //消息列表
export function consultationInfolist(data) { export function consultationInfolist(data) {
return request({ return request({
url: `/nurseApplet/consultationInfo/list`, url: '/nurseApplet/consultationInfo/list',
method: 'get', method: 'get',
data: data data: data
}) })

View File

@ -8,7 +8,21 @@ export function sendMessage(data) {
data: data data: data
}) })
} }
export function consultationlnfo(id) {
return request({
url: '/nurseApplet/consultationInfo/'+id,
method: 'get',
})
}
// export function updateReadStatus(data) {
// return request({
// url: '/nurseApplet/chatRecord/updateReadStatus',
// method: 'put',
// data:data,
// })
// }
// 查询聊天记录 // 查询聊天记录
export function getChatRecord(data) { export function getChatRecord(data) {

View File

@ -47,7 +47,17 @@
{ {
"path": "pages/homepage/homepage", "path": "pages/homepage/homepage",
"style": { "style": {
"navigationBarTitleText": "工单", // "navigationBarTitleText": "工单",
"navigationStyle": "custom",
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px
"enablePullDownRefresh": true //设置参数为true
}
},
{
"path": "pages/quanyi/quanyi",
"style": {
// "navigationBarTitleText": "工单",
"navigationStyle": "custom",
"onReachBottomDistance": 40, //距离底部多远时触发 单位为px "onReachBottomDistance": 40, //距离底部多远时触发 单位为px
"enablePullDownRefresh": true //设置参数为true "enablePullDownRefresh": true //设置参数为true
} }
@ -79,8 +89,25 @@
"navigationBarTitleText": "视频通话", "navigationBarTitleText": "视频通话",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "pages/seekadvicefrom/seekadvicefrom",
"style": {
"navigationBarTitleText": "消息",
"enablePullDownRefresh": false
}
},
{
"path": "pages/information/information",
"style": {
"navigationBarTitleText": "查看患者信息",
"enablePullDownRefresh": false
// "navigationStyle": "custom"
}
} }
],
],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarTitleText": "", "navigationBarTitleText": "",

View File

@ -1,8 +1,10 @@
<template> <template>
<view class="app"> <view class="app">
<u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange" inactive-color='#fff' <!-- 泉医到家 -->
active-color='#fff'></u-tabs> <view class="" v-if="status==2">
<view class=""> <uni-nav-bar title="工单" background-color="#18CBB3" color="white"></uni-nav-bar>
<u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange"
inactive-color='#fff' active-color='#fff'></u-tabs>
<view class="top" v-if="tabscurrent==0"> <view class="top" v-if="tabscurrent==0">
<u-dropdown active-color='#26A888'> <u-dropdown active-color='#26A888'>
<u-dropdown-item v-model="optionindex" :title="optionname" :options="options" <u-dropdown-item v-model="optionindex" :title="optionname" :options="options"
@ -100,25 +102,14 @@
<u-empty text="暂无工单" mode="list" icon-size='240' font-size='32'></u-empty> <u-empty text="暂无工单" mode="list" icon-size='240' font-size='32'></u-empty>
</view> </view>
</view> </view>
<!-- <view class=""> <!-- 家医 -->
<view class="inputs" style="width: 90%;height: 60rpx;transform: none;margin: 20rpx auto;"> <view class="" v-if="status==1">
<i class="icon"></i> <protocol :Refresh="Refresh" :down="down">
<input type="text" name="" id="" class="input" placeholder="搜索" v-model="formdata.name"> </protocol>
</view> </view>
<view class="lists" v-if="listinfo"> <!-- 专病-->
<view class="item" v-for="item in listinfo" @tap='goseekadvicefrom(item)'> <!-- view class="" v-if="status==3">
<image src="../../static/headsculpture.png" mode=""></image> <image src="../../static/bg.png" mode=""></image>
<view class="name">
{{item.patientName}}
</view>
<view class="text">
{{item.content}}
</view>
<view class="count" v-if="item.messageCount>0">
{{item.messageCount}}
</view>
</view>
</view>
</view> --> </view> -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
@ -134,12 +125,19 @@
consultation, consultation,
} from '@/api/homepage/index.js' } from '@/api/homepage/index.js'
import { import {
getSex getSex
} from '@/utils/conversion.js' } from '@/utils/conversion.js'
import protocol from '../quanyi/quanyi.vue'
export default { export default {
components: {
protocol,
},
data() { data() {
return { return {
Refresh: 1,
down: 2,
tabslist: [{ tabslist: [{
name: '全部工单', name: '全部工单',
value: '', value: '',
@ -188,7 +186,12 @@
} }
}, },
onShow() { onShow() {
this.info(); if (this.status == 2) {
this.info();
}
this.status = uni.getStorageSync("status", )
// console.log(this.status, '555')
}, },
methods: { methods: {
//前往聊天 //前往聊天
@ -277,19 +280,29 @@
}, },
}, },
onReachBottom() { //下滑加载 onReachBottom() { //下滑加载
// if(this.status==2){
if (this.missionlist.length >= this.missiontotal) {} else { if (this.missionlist.length >= this.missiontotal) {} else {
// this.down++
this.query.pageNum++ this.query.pageNum++
getList(this.query).then( getList(this.query).then(
res => { res => {
console.log(res, '77')
res.rows.forEach(e => { res.rows.forEach(e => {
console.log(e, '787')
e.sex = getSex(e.cardNo) e.sex = getSex(e.cardNo)
this.missionlist.push(e) this.missionlist.push(e)
}) })
}) })
} }
// }
}, },
onPullDownRefresh() { //下拉刷新 onPullDownRefresh() { //下拉刷新
this.info(); if (this.status == 2) {
this.info();
} else {
this.Refresh++
}
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 1000); }, 1000);
@ -309,6 +322,28 @@
background-color: #fff; background-color: #fff;
font-size: 24rpx; font-size: 24rpx;
.titlelist {
font-size: 20px;
text-align: center;
height: 80rpx;
border-bottom: 1rpx solid #f6f6f6;
padding-top: 100rpx;
position: fixed;
width: 100%;
background: #18CBB3;
z-index: 10;
color: #fff;
image {
width: 20rpx;
height: 30rpx;
transform: rotate(180deg);
position: absolute;
left: 40rpx;
bottom: 38rpx;
}
}
.lists { .lists {
width: 96%; width: 96%;
margin: 0 auto; margin: 0 auto;

View File

@ -62,21 +62,32 @@
if (res.data.code == 200) { if (res.data.code == 200) {
uni.setStorageSync("id", res.data.data.id) uni.setStorageSync("id", res.data.data.id)
uni.setStorageSync("status", res.data.data.status) uni.setStorageSync("status", res.data.data.status)
if(res.data.data.status==3){
that.$refs.uToast.show({
title: '当前用户无权限',
type: 'error',
duration: '1500'
})
}else if(res.data.data.status==2||res.data.data.status==1){
that.$refs.uToast.show({
title: '登录成功',
type: 'success',
duration: '1500'
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.reLaunch({
url: '/pages/homepage/homepage',
})
}, 1500)
}
// uni.setStorageSync("nursePersonName", res.data.nursePersonName) // uni.setStorageSync("nursePersonName", res.data.nursePersonName)
// uni.setStorageSync("nurseStationId", res.data.nurseStationId) // uni.setStorageSync("nurseStationId", res.data.nurseStationId)
that.$refs.uToast.show({
title: '登录成功',
type: 'success',
duration: '1500'
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.reLaunch({
url: '/pages/homepage/homepage',
})
}, 1500)
} else { } else {
that.$refs.uToast.show({ that.$refs.uToast.show({
title: res.data.msg, title: res.data.msg,

View File

@ -1,9 +1,10 @@
<template> <template>
<view class="content"> <view class="content">
<!-- <view class="title"> <!-- <view class="title">
<image src="../../static/huijiantou.png" @click="back"></image> <image src="../../static/huijiantou.png" @click="back"></image>
{{currentItem.senderName}} {{currentItem.senderName}}
</view> --> </view> -->
<!-- 聊天渲染列表 --> <!-- 聊天渲染列表 -->
<!-- scroll-y scroll-into-view="placeholder" scroll-top="500" scroll-with-animation --> <!-- scroll-y scroll-into-view="placeholder" scroll-top="500" scroll-with-animation -->
<scroll-view scroll-y="true" :scroll-top='scrollTop' id="demo" <scroll-view scroll-y="true" :scroll-top='scrollTop' id="demo"
@ -24,10 +25,14 @@
</view> </view>
<video v-if="item.video" :src="item.video"></video> <video v-if="item.video" :src="item.video"></video>
</view> </view>
<view class="placeholder" id="placeholder" ></view>
</view>
</scroll-view>
<view class="placeholder" id="placeholder"></view>
</view>
</scroll-view>
<view class="background" @tap="information">
<image src="/static/huanzhe.png" mode=""></image>
</view>
<!-- 底部输入 --> <!-- 底部输入 -->
<view class="input-box" :class="{ 'input-box-mpInputMargin': mpInputMargin }"> <view class="input-box" :class="{ 'input-box-mpInputMargin': mpInputMargin }">
<view class="input-box-flex"> <view class="input-box-flex">
@ -79,7 +84,8 @@
import { import {
sendMessage, sendMessage,
getChatRecord, getChatRecord,
markRead markRead,
} from '@/api/seekadvicefrom/seekadvicefrom.js'; } from '@/api/seekadvicefrom/seekadvicefrom.js';
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
export default { export default {
@ -143,6 +149,7 @@
], ],
scrollTop: 999999, scrollTop: 999999,
inputboxtop: undefined, inputboxtop: undefined,
id: '',
}; };
}, },
onReady() { //更改导航栏文字 onReady() { //更改导航栏文字
@ -151,9 +158,11 @@
}); });
}, },
onLoad(options) { onLoad(options) {
console.log(options, '888')
this.baseurl = baseurl; this.baseurl = baseurl;
// uni.closeSocket() // uni.closeSocket()
this.currentItem = JSON.parse(options.item) this.currentItem = JSON.parse(options.item)
this.id = this.currentItem.id
this.title = this.currentItem.patientName //导航栏标题 this.title = this.currentItem.patientName //导航栏标题
this.userName = this.currentItem.doctorName this.userName = this.currentItem.doctorName
this.SOCKETURL = this.SOCKETURL + this.currentItem.doctorId this.SOCKETURL = this.SOCKETURL + this.currentItem.doctorId
@ -161,11 +170,26 @@
this.scoket() this.scoket()
}, },
mounted() { mounted() {
// this.infolist()
// wx.pageScrollTo({ // wx.pageScrollTo({
// scrollTop: 9999999 // scrollTop: 9999999
// }) // })
}, },
methods: { methods: {
// infolist() {
// let objLIST = {
// consultationId: this.currentItem.id,
// recipientId: this.currentItem.doctorId,
// }
// updateReadStatus(this.objLIST).then(res => {
// console.log(res, '444')
// })
// },
information() {
uni.navigateTo({
url: `/pages/information/information?item=${this.id}`
})
},
getPageHistory() { getPageHistory() {
let obj = { let obj = {
consultationId: this.currentItem.id, consultationId: this.currentItem.id,
@ -190,11 +214,14 @@
}) })
}, },
Read() { Read() {
console.log(this.currentItem.doctorId,'888888888')
let markReadData = { let markReadData = {
consultationId: this.currentItem.id, consultationId: this.currentItem.id,
recipientId: this.currentItem.patientId, recipientId: Number(this.currentItem.doctorId),
} }
console.log(markReadData,'6')
markRead(markReadData) markRead(markReadData)
}, },
//键盘发送 //键盘发送
sendconfirm(value) { sendconfirm(value) {
@ -509,6 +536,24 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.background {
font-size: 24rpx;
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
font-weight: 400;
color: #18CBB3;
line-height: 38rpx;
// background-color: red;
position: absolute;
left: 6%;
bottom: 8%;
image {
width: 277rpx;
height: 32rpx;
}
}
page { page {
background-color: #f3f3f3; background-color: #f3f3f3;
} }
@ -755,4 +800,4 @@
bottom: 38rpx; bottom: 38rpx;
} }
} }
</style> </style>