Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	pages/homepage/homepage.vue
This commit is contained in:
shidongli 2023-10-10 13:22:38 +08:00
commit dc3378ef9a
12 changed files with 470 additions and 154 deletions

View File

@ -0,0 +1,10 @@
import request from "@/api/request.js"
// 新增问诊
export function consultationInfo(data) {
return request({
url: `/nurseApplet/consultationInfo`,
method: 'post',
data: data
})
}

View File

@ -0,0 +1,10 @@
import request from "@/api/request.js"
// 聊天记录
export function consultationInfolist(data) {
return request({
url: `/nurseApplet/consultationInfo/list`,
method: 'get',
data: data
})
}

View File

@ -0,0 +1,29 @@
import request from "@/api/request.js"
// 发送即使消息
export function sendMessage(data) {
return request({
url: `/nurseApplet/chatRecord/sendMessage`,
method: 'post',
data: data
})
}
// 查询聊天记录
export function getChatRecord(data) {
return request({
url: `/nurseApplet/chatRecord/getChatRecord`,
method: 'get',
data: data
})
}
// 标记为已读
export function markRead(data) {
return request({
url: `/nurseApplet/chatRecord/updateReadStatus`,
method: 'PUT',
data: data
})
}

View File

@ -98,6 +98,19 @@
"navigationBarTitleText": "院内陪护", "navigationBarTitleText": "院内陪护",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "imagetextConsultation/imagetextConsultation",
"style": {
"navigationBarTitleText": "图文问诊",
"onReachBottomDistance": 40, // px
"enablePullDownRefresh": true //true
}
}, {
"path": "createnewconsultation/createnewconsultation",
"style": {
"navigationBarTitleText": "新建图文问诊",
"enablePullDownRefresh": false
}
}, { }, {
"path": "appointmenttime/appointmenttime", "path": "appointmenttime/appointmenttime",
"style": { "style": {
@ -474,17 +487,15 @@
"navigationBarTitleText": "体征检测", "navigationBarTitleText": "体征检测",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "seekadvicefrom/seekadvicefrom",
"path" : "seekadvicefrom/seekadvicefrom", "style": {
"style" : "navigationBarTitleText": "咨询医生",
{ "enablePullDownRefresh": false
"navigationBarTitleText": "咨询医生", }
"enablePullDownRefresh": false
}
} }
] ]
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
@ -533,4 +544,4 @@
// } // }
] ]
} }
} }

View File

@ -69,7 +69,7 @@
getOpenId, getOpenId,
getCurrentUser, getCurrentUser,
detail detail
} from '@/api/pages/homepage/homepage.js' } from '@/api/pages/homepage/homepage.js'
export default { export default {
data() { data() {
@ -88,7 +88,7 @@
onShow() { onShow() {
var that = this var that = this
this.userinfo= uni.getStorageSync('userinfo'); this.userinfo= uni.getStorageSync('userinfo');
this.cityCode = this.userinfo.cityCode; this.cityCode = this.userinfo.cityCode;
var openid = this.userinfo.openid; var openid = this.userinfo.openid;
that.identity = this.userinfo.cardNo; that.identity = this.userinfo.cardNo;
@ -99,14 +99,14 @@
type: 'error', type: 'error',
duration: '1000', duration: '1000',
}) })
} else { } else {
} }
if(openid&&that.cityCode){ if(openid&&that.cityCode){
// isWxBing(openid, cityCode) { // isWxBing(openid, cityCode) {
getCurrentUser(openid,that.cityCode).then(res => { getCurrentUser(openid,that.cityCode).then(res => {
this.patientName=res.data.patientName this.patientName=res.data.patientName
console.log(res); console.log(res);
@ -115,15 +115,15 @@
// } // }
}) })
// } // }
} }
}, },
methods: { methods: {
// //
login(){ login(){
this.gologin(); this.gologin();
}, },
gologin() { gologin() {
this.$refs.uToast.show({ this.$refs.uToast.show({
@ -154,11 +154,11 @@
// duration: '1000', // duration: '1000',
// // url: '/pages/login/login' // // url: '/pages/login/login'
// }) // })
// } // }
// }) // })
// }, // },
// //
goonline() { goonline() {
@ -174,9 +174,9 @@
title: '未签约,请先签约', title: '未签约,请先签约',
type: 'error', type: 'error',
duration: '1000', duration: '1000',
}) })
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/mysigning/mysigning' url: '/pagesB/mysigning/mysigning'
@ -184,12 +184,12 @@
} }
}) })
}else{ }else{
} }
} }
}, },
// //
count(){ count(){
@ -205,9 +205,9 @@
title: '未签约,请先签约', title: '未签约,请先签约',
type: 'error', type: 'error',
duration: '1000', duration: '1000',
}) })
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '' url: ''
@ -215,13 +215,13 @@
} }
}) })
}else{ }else{
} }
} }
}, },
// //
goHealthrecords() { goHealthrecords() {
@ -231,9 +231,9 @@
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Healthrecords/Healthrecords' url: '/pagesC/Healthrecords/Healthrecords'
}) })
} }
}, },
// //
gorecords() { gorecords() {
@ -243,9 +243,9 @@
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Screeningrecords/Screeningrecords' url: '/pagesC/Screeningrecords/Screeningrecords'
}) })
} }
}, },
// //
healthtest() { healthtest() {
@ -255,10 +255,10 @@
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/healthtest/healthtest' url: '/pagesC/healthtest/healthtest'
}) })
} }
}, },
// //
sign() { sign() {
@ -268,9 +268,9 @@
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Physicalexamination/Physicalexamination' url: '/pagesC/Physicalexamination/Physicalexamination'
}) })
} }
}, },
// //
@ -287,9 +287,9 @@
title: '未签约,请先签约', title: '未签约,请先签约',
type: 'error', type: 'error',
duration: '1000', duration: '1000',
}) })
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/ServiceAppointment/ServiceAppointment' url: '/pagesC/ServiceAppointment/ServiceAppointment'
@ -297,12 +297,12 @@
} }
}) })
}else{ }else{
} }
} }
}, },
// //
servicerecord() { servicerecord() {
@ -312,9 +312,9 @@
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/servicerecord/servicerecord' url: '/pagesC/servicerecord/servicerecord'
}) })
} }
}, },
// //
myappointment() { myappointment() {
@ -324,9 +324,9 @@
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Myappointment/Myappointment' url: '/pagesC/Myappointment/Myappointment'
}) })
} }
}, },
// login() { // login() {
// const _this = this // const _this = this
@ -340,7 +340,7 @@
// } // }
// }) // })
// }, // },
} }
} }
</script> </script>

View File

@ -90,7 +90,7 @@
常用功能 常用功能
</view> </view>
<view class="orderStatus"> <view class="orderStatus">
<view class="item"> <view class="item" @tap='goHealthrecords'>
<image src="../../static/pages/jiankangdangan.png" mode=""></image> <image src="../../static/pages/jiankangdangan.png" mode=""></image>
<view class="text"> <view class="text">
健康档案 健康档案
@ -305,6 +305,12 @@
this.gologin(); this.gologin();
} }
}, },
//
goHealthrecords() {
uni.navigateTo({
url: '/pagesC/Healthrecords/Healthrecords'
})
},
// //
goorder(index, item) { goorder(index, item) {
console.log(index, item) console.log(index, item)
@ -380,9 +386,9 @@
} }
}, },
// //
expertOrder(){ expertOrder() {
uni.navigateTo({ uni.navigateTo({
url:"/pagesB/ExpertlookOrder/ExpertlookOrder" url: "/pagesB/ExpertlookOrder/ExpertlookOrder"
}) })
} }
} }

View File

@ -11,27 +11,33 @@
<view class="text"> <view class="text">
现住址所在区 现住址所在区
</view> </view>
<view class="input"> <view class="input" @tap='showPicker'>
<input class="uinput" placeholder="请选择所属地区" type="text" placeholder-class="phsy" /> <view class="inputtext"
:style="address=='请选择所属地区'?'font-size:22rpx;font-weight: 400;color: #8E8E8E !important;':''">
{{address}}
</view>
<image src="../../static/huijiantou.png" mode=""></image> <image src="../../static/huijiantou.png" mode=""></image>
</view> </view>
<view class="text"> <view class="text">
患者姓名 患者姓名
</view> </view>
<view class="input"> <view class="input">
<input class="uinput noimageuinput" placeholder="请输入患者姓名" type="text" placeholder-class="phsy" /> <input v-model="formdata.patientName" class="uinput noimageuinput" placeholder="请输入患者姓名" type="text"
placeholder-class="phsy" />
</view> </view>
<view class="text"> <view class="text">
患者身份证号 患者身份证号
</view> </view>
<view class="input"> <view class="input">
<input class="uinput noimageuinput" placeholder="请输入患者身份证号" type="text" placeholder-class="phsy" /> <input v-model="formdata.cardNo" class="uinput noimageuinput" placeholder="请输入患者身份证号" type="text"
placeholder-class="phsy" />
</view> </view>
<view class="text"> <view class="text">
患者联系电话 患者联系电话
</view> </view>
<view class="input"> <view class="input">
<input class="uinput noimageuinput" placeholder="请输入患者联系电话" type="text" placeholder-class="phsy" /> <input v-model="formdata.phone" class="uinput noimageuinput" placeholder="请输入患者联系电话" type="text"
placeholder-class="phsy" />
</view> </view>
</view> </view>
<view class="title"> <view class="title">
@ -46,25 +52,29 @@
问题简述 问题简述
</view> </view>
<view class="input"> <view class="input">
<input class="uinput noimageuinput" placeholder="不多于五个字" type="text" placeholder-class="phsy" /> <input v-model="formdata.problemDescription" class="uinput noimageuinput" placeholder="不多于五个字"
type="text" placeholder-class="phsy" />
</view> </view>
<view class="text"> <view class="text">
患者个体情况说明 患者个体情况说明
</view> </view>
<view class="input" style="height: 200rpx;overflow-Y: scroll;"> <view class="input" style="height: 200rpx;overflow-Y: scroll;">
<u-input class="uinput noimageuinput" placeholder=" " type="textarea" :maxlength="100" /> <u-input v-model="formdata.situationDescription" class="uinput noimageuinput" placeholder=" "
type="textarea" :maxlength="100" />
</view> </view>
<view class="text"> <view class="text">
问题描述 问题描述
</view> </view>
<view class="input" style="height: 200rpx;overflow-Y: scroll;"> <view class="input" style="height: 200rpx;overflow-Y: scroll;">
<u-input class="uinput noimageuinput" placeholder=" " type="textarea" :maxlength="500" /> <u-input v-model="formdata.problemStatement" class="uinput noimageuinput" placeholder=" "
type="textarea" :maxlength="500" />
</view> </view>
<view class="text"> <view class="text">
既往疾病史 既往疾病史
</view> </view>
<view class="input" style="height: 200rpx;overflow-Y: scroll;"> <view class="input" style="height: 200rpx;overflow-Y: scroll;">
<u-input class="uinput noimageuinput" placeholder=" " type="textarea" :maxlength="100" /> <u-input v-model="formdata.medicalRecord" class="uinput noimageuinput" placeholder=" " type="textarea"
:maxlength="100" />
</view> </view>
</view> </view>
<view class="title"> <view class="title">
@ -78,24 +88,140 @@
<view class="text"> <view class="text">
附件材料上传 附件材料上传
</view> </view>
<u-upload ref="uUpload" :max-count='9' :action="uoloadaction" :auto-upload="false" upload-text=' '
@on-choose-complete='onchoosecomplete' @on-success='onsuccess' @on-uploaded='onuploaded'></u-upload>
<view class="textarea">
<view class="">
最多支持9个文件
</view>
<view class="">
单个文件大小不允许超过10MB
</view>
<view class="">
只支持上传照片图片视频文件后缀类型为JPG.PNG.MP4
</view>
</view>
</view> </view>
<view class="btns"> <view class="btns">
<view class="btnleft"> <view class="btnleft">
返回 返回
</view> </view>
<view class="btnright"> <view class="btnright" @tap='updata'>
保存 保存
</view> </view>
</view> </view>
<view class="">
<m-city style='z-index: 10076;' :provinceData="list" headTitle="请选择所属地区" ref="cityPicker"
@funcValue="getpickerParentValue" pickerSize="4">
</m-city>
</view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import {
getSubordinateRegions,
} from '@/api/pagesB/modifyAddress/modifyAddress.js';
import gkcity from "../../components/m-city/m-city.vue";
import baseurl from '@/api/baseurl.js'
import {
consultationInfo
} from '@/api/pagesB/createnewconsultation/createnewconsultation.js'
export default { export default {
components: {
"m-city": gkcity
},
data() { data() {
return { return {
//
uoloadaction: '',
list: [],
addresslength: null,
imglistlength: null,
address: '请选择所属地区', //
formdata: {
address: '请选择所属地区', //
patientId: 1,
patientName: '李广君',
cardNo: '370882199909092123',
phone: '17615455437',
address: '',
doctorId: 1,
doctorName: '李医生',
consultationType: 'IMAGE_TEXT_CONSULTATION',
problemDescription: '',
situationDescription: '',
problemStatement: '',
medicalRecord: '',
fileUrls: []
}
}; };
},
onLoad(options) {
this.uoloadaction = baseurl + '/nurseApplet/consultationInfo/uploadConsultationFile'
},
onShow() {
this.areaInfo();
},
methods: {
updata() {
if (this.imglistlength > 0) {
this.$refs.uUpload.upload()
} else {
this.info();
}
},
onchoosecomplete(lists, name) {
this.imglistlength = lists.length
},
onsuccess(data, index, lists, name) {
if (data.code == 200) {
this.formdata.fileUrls.push(data.fileUrl)
}
},
onuploaded() {
this.info();
},
info() {
consultationInfo(this.formdata).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '新建图文问诊成功',
type: 'success',
duration: '1500',
back: 1
})
}
})
},
//
showPicker() {
this.$refs.cityPicker.show();
},
//
areaInfo() {
getSubordinateRegions().then(res => {
this.list = res.data;
})
},
//
getpickerParentValue(e) {
e = e.filter(ele => ele.localName != '暂不选择')
e = e.filter(ele => ele.localName != '暂无需选择')
this.addresslength = e
this.formdata.address = ''
this.address = ''
if (e && e.length >= 1) {
e.forEach(el => {
this.formdata.address = this.formdata.address + el.localName
this.address = this.address + el.localName
})
} else {
this.formdata.address = ''
this.address = '请选择所属地区'
}
},
} }
} }
</script> </script>
@ -147,6 +273,14 @@
border-radius: 5rpx; border-radius: 5rpx;
padding-bottom: 50rpx; padding-bottom: 50rpx;
.textarea {
font-size: 18rpx;
font-weight: 400;
color: #8E8E8E;
line-height: 42rpx;
padding: 30rpx 0 0 40rpx;
}
.text { .text {
font-size: 30rpx; font-size: 30rpx;
font-weight: 400; font-weight: 400;
@ -154,6 +288,10 @@
padding: 30rpx 0 0 40rpx; padding: 30rpx 0 0 40rpx;
} }
::v-deep .u-upload {
padding: 30rpx 30rpx 0 30rpx;
}
.input { .input {
width: 90%; width: 90%;
height: 80rpx; height: 80rpx;
@ -186,6 +324,15 @@
color: #8E8E8E !important; color: #8E8E8E !important;
} }
.inputtext {
padding-left: 12rpx;
color: black;
font-size: 26rpx;
width: 90%;
height: 80rpx;
line-height: 80rpx;
}
.uinput { .uinput {
color: black; color: black;
font-size: 26rpx; font-size: 26rpx;

View File

@ -3,21 +3,29 @@
<image src="../../static/pagesB/xinjianwenzhen.png" mode="" @tap='gocreatenewconsultation'></image> <image src="../../static/pagesB/xinjianwenzhen.png" mode="" @tap='gocreatenewconsultation'></image>
<view class="title"> <view class="title">
<view class="text" v-for='(item,index) in titlelist' :key='index' <view class="text" v-for='(item,index) in titlelist' :key='index'
:class="titletext==item.text?'Selectedtext':''" @tap='selecttitltext(item)'> :class="formdata.status==item.status?'Selectedtext':''" @tap='selecttitltext(item)'>
{{item.text}} <!-- <view class="topright" v-if="index==0">
{{listinfo?listinfo.length:''}}
</view> -->
<view class="">
{{item.text}}
</view>
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view class="item"> <view class="item" v-for='item in listinfo' :key="item.id" @tap='goseekadvicefrom(item)'>
<view class="time"> <view class="time">
2023-12-12 12:12 {{item.createTime?item.createTime:''}}
</view> </view>
<image src="../../static/pagesB/Behave.png" mode=""></image> <image src="../../static/pagesB/Behave.png" mode=""></image>
<view class="name"> <view class="name">
张三 {{item.doctorName?item.doctorName:''}}
</view> </view>
<view class="text"> <view class="text">
你好请问今天下午方便吗 {{item.problemDescription?item.problemDescription:''}}
</view>
<view class="messageCount" v-if="item.messageCount>0">
{{item.messageCount}}
</view> </view>
</view> </view>
</view> </view>
@ -25,26 +33,50 @@
</template> </template>
<script> <script>
import {
consultationInfolist
} from '@/api/pagesB/imagetextConsultation/imagetextConsultation.js'
export default { export default {
data() { data() {
return { return {
titletext: '本周全部',
titlelist: [{ titlelist: [{
text: '本周全部', text: '本周全部',
status: ''
}, },
{ {
text: '已解答', text: '已解答',
status: 2
}, },
{ {
text: '未解答', text: '未解答',
status: 1
}, },
], ],
formdata: {
pageNum: 1,
pageSize: 10,
patientId: 1,
consultationType: 'IMAGE_TEXT_CONSULTATION',
status: '',
},
listtotal: 0,
listinfo: [],
}; };
}, },
onShow() {
this.info();
},
methods: { methods: {
// //
selecttitltext(item) { selecttitltext(item) {
this.titletext = item.text this.formdata.status = item.status
this.info();
},
info() {
consultationInfolist(this.formdata).then(res => {
this.listinfo = res.rows
this.listtotal = res.rows
})
}, },
// //
gocreatenewconsultation() { gocreatenewconsultation() {
@ -52,7 +84,32 @@
url: "/pagesB/createnewconsultation/createnewconsultation" url: "/pagesB/createnewconsultation/createnewconsultation"
}) })
}, },
} //
goseekadvicefrom(item) {
uni.navigateTo({
url: `/pagesC/seekadvicefrom/seekadvicefrom?item=${JSON.stringify(item)}`
})
},
},
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> </script>
@ -80,6 +137,21 @@
background: #F6F6F6; background: #F6F6F6;
border-radius: 5rpx; border-radius: 5rpx;
.messageCount {
position: absolute;
top: 50%;
right: 5%;
width: 33rpx;
height: 33rpx;
background: #F44B2F;
border-radius: 50%;
font-size: 24rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 33rpx;
text-align: center;
}
.text { .text {
position: absolute; position: absolute;
left: 190rpx; left: 190rpx;
@ -144,6 +216,23 @@
border-radius: 5rpx; border-radius: 5rpx;
width: 25%; width: 25%;
color: #26A888; color: #26A888;
position: relative;
.topright {
width: 33rpx;
height: 33rpx;
background: #FFA115;
border-radius: 50%;
text-align: center;
line-height: 33rpx;
font-size: 24rpx;
font-weight: 400;
color: #FFFFFF;
position: absolute;
right: 0;
top: 0;
transform: translate(50%, -50%);
}
} }
.Selectedtext { .Selectedtext {

View File

@ -397,4 +397,4 @@
</script> </script>
<style lang="scss"> <style lang="scss">
@import './information.scss'; @import './information.scss';
</style> </style>

View File

@ -3,7 +3,7 @@
<view class="userinfo"> <view class="userinfo">
<view class="itemimgs"> <view class="itemimgs">
<image class="picture" :src="img" mode="" v-if="img" @tap='uploadImag'></image> <image class="picture" :src="img" mode="" v-if="img" @tap='uploadImag'></image>
<image class="picture" src="../../static/pagesB/userl.png" mode="" v-else @tap='uploadImag'></image> <image class="picture" src="../../static/headsculpture.png" mode="" v-else @tap='uploadImag'></image>
<view class="text" @tap='uploadImag'> <view class="text" @tap='uploadImag'>
点击编辑头像 点击编辑头像
</view> </view>

View File

@ -5,25 +5,28 @@
{{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 -->
<view style="height: 85vh; padding-top: 200rpx;" @tap='touchend'> <scroll-view scroll-y="true" :scroll-top='scrollTop'>
<view class="snedItem" v-for="(item, index) in newsList" :key="index"> <view style="height: 85vh; padding-top: 200rpx;" @tap='touchend'>
<view class="ifSend" v-if="item.senderName == userName"> <view class="snedItem" v-for="(item, index) in newsList" :key="index">
<view class="sendBox" v-if="item.content">{{item.content}}</view> <view class="ifSend" v-if="item.senderName == userName">
<image class="head" src="../../static//myHead.png"></image>
</view>
<view class="doctorSend" v-else>
<image class="head" src="../../static/docHead.png"></image>
<view class="">
<text>{{item.senderName}}</text>
<view class="sendBox" v-if="item.content">{{item.content}}</view> <view class="sendBox" v-if="item.content">{{item.content}}</view>
<image class="head" src="@/static/headsculpture.png"></image>
</view> </view>
</view> <view class="doctorSend" v-else>
<!-- <image v-if="item.img" :src="item.img" mode="scaleToFill" class="touch-active" /> <image class="head" src="@/static/docHead.png"></image>
<view class="">
<text>{{item.senderName}}</text>
<view class="sendBox" v-if="item.content">{{item.content}}</view>
</view>
</view>
<!-- <image v-if="item.img" :src="item.img" mode="scaleToFill" class="touch-active" />
<video v-if="item.video" :src="item.video"></video> --> <video v-if="item.video" :src="item.video"></video> -->
</view>
<view class="placeholder" id="placeholder" v-if="showFunBtn"></view>
</view> </view>
<view class="placeholder" id="placeholder"></view> </scroll-view>
</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">
@ -34,7 +37,7 @@
v-model="formData.content" :hold-keyboard="true" :confirm-type="'send'" :confirm-hold="true" v-model="formData.content" :hold-keyboard="true" :confirm-type="'send'" :confirm-hold="true"
placeholder-style="color:#DDDDDD;" :cursor-spacing="10" /> </view> placeholder-style="color:#DDDDDD;" :cursor-spacing="10" /> </view>
<!-- 选择表情包 --> <!-- 选择表情包 -->
<image class=" icon_btn_add" :src="require('@/static/ico/emoji.png')" @tap="exprec"></image> <!-- <image class=" icon_btn_add" :src="require('@/static/ico/emoji.png')" @tap="exprec"></image> -->
<!-- 发送消息按钮 --> <!-- 发送消息按钮 -->
<image class=" icon_btn_add" :src="require('@/static/ico/send.png')" @tap="sendout" <image class=" icon_btn_add" :src="require('@/static/ico/send.png')" @tap="sendout"
v-if="formData.content!==''" mode=""></image> v-if="formData.content!==''" mode=""></image>
@ -72,25 +75,22 @@
</template> </template>
<script> <script>
// import { import {
// sendMessage, sendMessage,
// getChatHistory, getChatRecord,
// markRead markRead
// } from '@/service/api/api.js'; } from '@/api/pagesC/seekadvicefrom/seekadvicefrom.js';
export default { export default {
data() { data() {
return { return {
title: '', title: '',
SOCKETURL: 'wss://fdmp.xinelu.cn/fm/webSocket/' + uni.getStorageSync('userInfo').bindingNo, SOCKETURL: 'ws://192.168.16.212:8088/webSocket/1',
// SOCKETURL: 'wss://fdmp.xinelu.cn/fm/webSocket/' + uni.getStorageSync('userInfo').bindingNo,
socketOpen: false, socketOpen: false,
sendInfo: {}, sendInfo: {},
currentItem: '', currentItem: '',
userName: uni.getStorageSync('userInfo').residentName, userName: '',
imgUrl22: this.$imgUrl22,
mpInputMargin: true, // mpInputMargin: true, //
// //
text: '',
formData: { formData: {
content: "", content: "",
limit: 15, limit: 15,
@ -138,6 +138,7 @@
title: "在吗", title: "在吗",
}, },
], ],
scrollTop: 999999,
}; };
}, },
onReady() { // onReady() { //
@ -146,41 +147,41 @@
}); });
}, },
onLoad(options) { onLoad(options) {
if (options.title) { // uni.closeSocket()
this.title = options.title // this.currentItem = JSON.parse(options.item)
} this.title = this.currentItem.doctorName //
this.currentItem = JSON.parse(options.currentItem) this.userName = this.currentItem.patientName
this.getPageHistory() this.getPageHistory()
this.scoket() this.scoket()
}, },
mounted() { mounted() {
wx.pageScrollTo({ // wx.pageScrollTo({
scrollTop: 9999999 // scrollTop: 9999999
}) // })
}, },
methods: { methods: {
getPageHistory() { getPageHistory() {
let obj = { let obj = {
bindingNo: this.currentItem.recipientNo, consultationId: this.currentItem.id,
messageCategory: this.currentItem.messageCategory, senderId: this.currentItem.patientId,
recipientNo: this.currentItem.senderNo, recipientId: this.currentItem.doctorId,
senderNo: this.currentItem.recipientNo
} }
getChatHistory(obj).then(res => { getChatRecord(obj).then(res => {
if (res.data.code == '1') { res.data.forEach(e => {
this.newsList = res.data.data if (e.readStatus == 0) {
if (this.currentItem.unreadCount == 0) { this.Read()
return
} }
this.Read() })
} this.newsList = res.data
setTimeout(() => {
this.scrollTop = this.scrollTop + 1;
}, 100)
}) })
}, },
Read() { Read() {
let markReadData = { let markReadData = {
bindingNo: this.currentItem.recipientNo, consultationId: this.currentItem.id,
messageCategory: this.currentItem.messageCategory, recipientId: this.currentItem.doctorId,
senderNo: this.currentItem.senderNo
} }
markRead(markReadData) markRead(markReadData)
}, },
@ -188,9 +189,14 @@
this.showFunBtn = false; // this.showFunBtn = false; //
this.showExpre = false; // this.showExpre = false; //
this.showOften = false; // this.showOften = false; //
uni.hideKeyboard();
}, },
goshowFunBtn() { goshowFunBtn() {
this.showFunBtn = true; // this.showFunBtn = true; //
uni.hideKeyboard();
setTimeout(() => {
this.scrollTop = this.scrollTop + 1;
}, 100)
}, },
sendout() { sendout() {
if (this.socketOpen == false) { if (this.socketOpen == false) {
@ -202,26 +208,33 @@
}) })
let message = this.formData.content let message = this.formData.content
try { try {
const _this = this const that = this
uni.sendSocketMessage({ uni.sendSocketMessage({
data: message, data: message,
success(res) { success(res) {
console.log(that.currentItem)
let obj = { let obj = {
content: message, consultationId: that.currentItem.id,
recipientName: _this.currentItem.senderName, senderId: that.currentItem.patientId,
recipientNo: _this.currentItem.senderNo, senderName: that.currentItem.patientName,
senderName: _this.currentItem.recipientName, recipientId: that.currentItem.doctorId,
senderNo: _this.currentItem.recipientNo, recipientName: that.currentItem.doctorName,
messageType: '1' messageType: 1,
sendTime: new Date(),
// messageType: (0 1 2 3 4 5 6 )
content: message
} }
sendMessage(obj).then(res => { sendMessage(obj).then(res => {
console.log(res); console.log(res);
setTimeout(() => {
that.scrollTop = that.scrollTop + 1;
}, 100)
}) })
} }
}) })
} catch (e) { } catch (e) {
console.log(e, '断线了') console.log(e, '断线了')
uni.closeSocket(); // uni.closeSocket();
} }
this.formData.content = '' // this.formData.content = '' //
@ -299,28 +312,26 @@
touchstart() { touchstart() {
uni.hideKeyboard(); uni.hideKeyboard();
}, },
scoket() { scoket() {
const _this = this const that = this
uni.closeSocket()
this.socketOpen = false this.socketOpen = false
try { try {
uni.connectSocket({ uni.connectSocket({
url: _this.SOCKETURL url: that.SOCKETURL
}) })
uni.onSocketOpen(res => { uni.onSocketOpen(res => {
console.log('webScoket连接已打开', res); console.log('webScoket连接已打开', res);
_this.socketOpen = true that.socketOpen = true
_this.reset() that.reset()
}) })
uni.onSocketError(err => { uni.onSocketError(err => {
console.log('webScoket连接打开失败', err); console.log('webScoket连接打开失败', err);
if (err && err.code != 1000) { if (err && err.code != 1000) {
setTimeout(() => { setTimeout(() => {
_this.socketOpen = true that.socketOpen = true
uni.connectSocket({ uni.connectSocket({
url: _this.SOCKETURL url: that.SOCKETURL
}) })
}, 3 * 1000) }, 3 * 1000)
} }
@ -330,9 +341,9 @@
console.log('webScoket连接关闭', err); console.log('webScoket连接关闭', err);
if (err && err.code !== 1000) { if (err && err.code !== 1000) {
setTimeout(() => { setTimeout(() => {
_this.socketOpen = true that.socketOpen = true
uni.connectSocket({ uni.connectSocket({
url: _this.SOCKETURL url: that.SOCKETURL
}) })
}, 3 * 1000) }, 3 * 1000)
} }
@ -340,11 +351,11 @@
uni.onSocketMessage(res => { uni.onSocketMessage(res => {
console.log("webScoket监听收到的信息", res); console.log("webScoket监听收到的信息", res);
_this.newsList.push({ that.newsList.push({
senderName: _this.currentItem.senderName, senderName: that.currentItem.patientName,
content: JSON.parse(res.data).message content: JSON.parse(res.data).message
}) })
_this.Read() that.Read()
}) })
} catch (e) { } catch (e) {
console.log(e); console.log(e);
@ -352,9 +363,9 @@
}, },
// //
reset() { reset() {
let _this = this let that = this
clearInterval(_this.timeoutObj); clearInterval(that.timeoutObj);
_this.timeoutObj = setInterval(() => { that.timeoutObj = setInterval(() => {
uni.sendSocketMessage({ uni.sendSocketMessage({
data: 'ping', data: 'ping',
success(res) { success(res) {
@ -368,7 +379,7 @@
}) })
} }
}) })
}, _this.timeout) }, that.timeout)
}, },
back() { back() {
uni.navigateBack({ uni.navigateBack({
@ -458,8 +469,9 @@
.fun-box { .fun-box {
opacity: 0; opacity: 0;
transition: all 0.1s ease-in-out;
height: 0; height: 0;
transition: all 0.3s ease;
transform: translateY(100%);
.grid-text { .grid-text {
padding-top: 10rpx; padding-top: 10rpx;
@ -532,6 +544,8 @@
.show-fun-box { .show-fun-box {
opacity: 1; opacity: 1;
height: 300rpx; height: 300rpx;
transition: all 0.3s ease;
transform: translateY(0%) !important;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB