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

This commit is contained in:
闫晓茹 2023-10-24 10:53:50 +08:00
commit a07ffbca47
24 changed files with 1602 additions and 334 deletions

38
api/homepage/index.js Normal file
View File

@ -0,0 +1,38 @@
import request from "../request.js"
// 查询工单列表
export function getList(data) {
return request({
url: `/nurseApp/orders/getList`,
method: 'GET',
data: data
})
}
//修改订单状态
export function updateStatus(data) {
return request({
url: `/nurseApp/orders/updateStatus`,
method: 'post',
data: data
})
}
//拒单接口
export function closeHealthConsultationOrder(data) {
return request({
url: `/nurseApp/weChatPayment/closeHealthConsultationOrder`,
method: 'post',
data: data
})
}
//消息列表
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
})
}

9
api/taskDetails/index.js Normal file
View File

@ -0,0 +1,9 @@
import request from "../request.js"
// 工单详情
export function consultationInfo(id) {
return request({
url: `/nurseApplet/consultationInfo/${id}`,
method: 'GET',
})
}

View File

@ -3,6 +3,14 @@
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/homepage/homepage",
"style": {
"navigationBarTitleText": "工单",
"onReachBottomDistance": 20, // px
"enablePullDownRefresh": true //true
}
},
{
"path": "pages/ServiceSchedule/ServiceSchedule",
"style": {
@ -10,10 +18,17 @@
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#4ac4ab"
}
}, {
},
{
"path": "pages/seekadvicefrom/seekadvicefrom",
"style": {
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
@ -21,31 +36,17 @@
{
"path": "pages/myinformation/myinformation",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
// "navigationStyle": "custom"
}
},
{
"path": "pages/homepage/homepage",
}, {
"path": "pages/taskDetails/taskDetails",
"style": {
"enablePullDownRefresh": false,
"navigationBarTitleText": "工单"
"navigationBarTitleText": "工单详情",
"enablePullDownRefresh": false
}
}
// {
// "path": "pages/index/index",
// "style": {
// "enablePullDownRefresh": false,
// "navigationStyle": "custom"
// }
// }
, {
}, {
"path": "pages/Personalinfo/Personalinfo",
"style": {
"navigationBarTitleText": "个人信息",
@ -59,7 +60,6 @@
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#18CBB3",
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {},
"tabBar": {
@ -70,13 +70,13 @@
"list": [{
"pagePath": "pages/homepage/homepage",
"iconPath": "static/homepage.png",
"selectedIconPath": "static/homepage.png",
"selectedIconPath": "static/homepages.png",
"text": "首页"
},
{
"pagePath": "pages/myinformation/myinformation",
"iconPath": "static/myinformations.png",
"selectedIconPath": "static/myinformation.png",
"iconPath": "static/my.png",
"selectedIconPath": "static/mys.png",
"text": "我的"
}
]

View File

@ -2,61 +2,294 @@
<view class="app">
<u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange" inactive-color='#fff'
active-color='#fff'></u-tabs>
<view class="top">
<u-dropdown active-color='#26A888'>
<u-dropdown-item v-model="optionindex" :title="optionname" :options="options"
@change='dropitemchange'></u-dropdown-item>
</u-dropdown>
<view class="inputs">
<!-- <i class="icon"></i> -->
<!-- <input type="text" name="" id="" class="input" placeholder="搜索" v-model="query.label"> -->
<!-- <view class="">
<view class="top" v-if="tabscurrent==0">
<u-dropdown active-color='#26A888'>
<u-dropdown-item v-model="optionindex" :title="optionname" :options="options"
@change='dropitemchange'></u-dropdown-item>
</u-dropdown>
<view class="inputs"></view>
</view>
<view class="items" v-if="missionlist.length>0">
<view class="item" v-for="(item,index) in missionlist" @click.stop='gotaskDetails(item)'>
<view class="title">
<view class="text">
专家咨询{{item.patientName}}
</view>
<view class="image">
<image src="../../static/jinbi.png" mode=""></image>
<span v-if="item.orderCommissionAmount&&item.orderCommissionAmount>=0">
+ {{item.orderCommissionAmount}}
</span>
<span v-else>
+ 0
</span>
</view>
</view>
<view class="time">
预约时间:
<span>{{item.appointmentDate}}{{' '+item.appointmentStartTime}}{{'-'+item.appointmentEndTime}}</span>
</view>
<view class="time" style="line-height: 40rpx;">
问题简述:
<span>{{item.problemDescription}}</span>
</view>
<view class="address" @click.stop='goMap(item)'>
<view class="text">
{{item.serviceAddress}}
</view>
</view>
<view class="btns">
<view class="text" v-if="item.orderStatus=='WAIT_RECEIVED_GOODS'">
待接单
</view>
<view class="text" v-if="item.orderStatus=='RECEIVED_GOODS'">
待服务
</view>
<view class="text" v-if="item.orderStatus=='COMPLETED'" style="color: #9D9D9D;">
已完成
</view>
<view class="btnreturn" @click.stop='gotaskReturn(item)'
v-if="item.orderStatus=='WAIT_RECEIVED_GOODS'">
退回
</view>
<view class="btnaccept" @click.stop='Receivingorders(item)'
v-if="item.orderStatus=='WAIT_RECEIVED_GOODS'">
接单
</view>
<view class="btnreturn" @click.stop='goconfirmCompletion(item)'
v-if="item.orderStatus=='RECEIVED_GOODS'">
完成
</view>
<view class="btnaccept" @click.stop='govideo(item)' v-if="item.orderStatus=='RECEIVED_GOODS'">
视频通话
</view>
</view>
</view>
</view>
<view v-else class="" style="margin-top: 100rpx;">
<u-empty text="暂无工单" mode="list" icon-size='240' font-size='32'></u-empty>
</view>
<u-popup v-model="taskReturnshow" mode="center" closeable border-radius='5' width='80%' height="500rpx">
<view class="titletext">
<text style="font-size: 26rpx;">退回原因</text>
<textarea name="" id="" cols="30" rows="10" style="width: 60%;" placeholder="请输入退回原因"
v-model="remark"></textarea>
</view>
<view class="btnss">
<view class="cancel" @click="taskReturnshow=false">
取消
</view>
<view class="Rescind" @click="truetaskReturn">
退回
</view>
</view>
</u-popup>
</view> -->
<view class="">
<view class="inputs" style="width: 90%;height: 60rpx;transform: none;margin: 20rpx auto;">
<i class="icon"></i>
<input type="text" name="" id="" class="input" placeholder="搜索" v-model="query.label">
</view>
<view class="lists">
<view class="item">
<image src="../../static/homepages.png" mode=""></image>
<view class="name">
心如止水
</view>
<view class="text">
大夫我女儿吃了药后有点发烧怎么回事,您给看点好看说不定倒是波动的的的的
</view>
<view class="count">
1
</view>
</view>
<view class="item">
<image src="../../static/homepages.png" mode=""></image>
<view class="name">
心如止水
</view>
<view class="text">
大夫我女儿吃了药后有点发烧怎么回事,您给看点好看说不定倒是波动的的的的
</view>
<view class="count">
1
</view>
</view>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
getList,
updateStatus,
closeHealthConsultationOrder,
consultationInfolist
} from '@/api/homepage/index.js'
export default {
data() {
return {
tabslist: [{
name: '全部工单'
name: '全部',
value: '',
}, {
name: '我的工单'
name: '未解决',
value: 'RECEIVED_GOODS',
}, {
name: '已完成工单',
name: '已解决',
value: 'COMPLETED',
}],
// {
// name: '',
// value: '',
// }, {
// name: '',
// value: 'RECEIVED_GOODS',
// }, {
// name: '',
// value: 'COMPLETED',
// }
tabscurrent: 0,
optionindex: 1,
optionname: '待处理',
optionname: '全部',
options: [{
label: '待处理',
value: 1,
label: '全部',
value: '',
}, {
label: '待接单',
value: 'WAIT_RECEIVED_GOODS',
}, {
label: '待服务',
value: 'RECEIVED_GOODS',
}, {
label: '已完成',
value: 2,
value: 'COMPLETED',
}],
query: {
label: '',
}
hospitalPersonId: 1,
orderStatus: '',
orderType: 'HEALTH_CONSULTATION',
pageNum: 1,
pageSize: 10,
},
missionlist: [],
missiontotal: 0,
taskReturnshow: false,
remark: '',
}
},
onLoad() {
onShow() {
// this.info();
},
methods: {
//
gotaskDetails(item) {
uni.navigateTo({
url: `/pages/taskDetails/taskDetails?id=${item.consultationInfoId}`
})
},
//
goconfirmCompletion(item) {
var obj = {
"goodsOrderId": item.goodsOrderId,
"orderStatus": "COMPLETED",
}
updateStatus(obj).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '工单已成功',
type: 'success',
duration: '1500'
})
this.info();
}
})
},
//退
gotaskReturn(item) {
this.query.orderNo = item.orderNo
this.taskReturnshow = true
},
truetaskReturn() {
var obj = {
orderNo: this.query.orderNo,
remark: this.remark,
}
closeHealthConsultationOrder(obj).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '工单退回成功',
type: 'success',
duration: '1500'
})
this.info();
}
})
},
//
Receivingorders(item) {
var obj = {
"goodsOrderId": item.goodsOrderId,
"orderStatus": "RECEIVED_GOODS",
}
updateStatus(obj).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '接单成功',
type: 'success',
duration: '1500'
})
this.info();
}
})
},
info() {
this.query.pageNum = 1
getList(this.query).then(res => {
this.missionlist = res.rows
this.missiontotal = res.total
})
},
tabschange(index) {
this.tabscurrent = index;
this.query.orderStatus = this.tabslist[index].value
this.optionname = '全部'
this.info();
},
dropitemchange(e) {
this.optionname = this.options.find(m => m.value === e).label
console.log(e)
this.query.orderStatus = this.options.find(m => m.value === e).value
this.info();
},
}
},
onReachBottom() { //
if (this.missionlist.length >= this.missiontotal) {} else {
this.query.pageNum++
getList(this.query).then(
res => {
res.rows.forEach(e => {
this.missionlist.push(e)
})
})
}
},
onPullDownRefresh() { //
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.app {
width: 100%;
// margin: 20rpx auto;
@ -64,55 +297,287 @@
background-color: #fff;
font-size: 24rpx;
.lists {
width: 96%;
margin: 0 auto;
.item {
position: relative;
height: 180rpx;
.count {
position: absolute;
right: 10rpx;
bottom: 50rpx;
width: 28rpx;
height: 28rpx;
background: #FF0000;
border-radius: 50%;
text-align: center;
line-height: 28rpx;
color: #fff;
font-weight: 400;
color: #FFFFFF;
}
.text {
font-size: 24rpx;
font-weight: 400;
color: #999999;
position: absolute;
left: 160rpx;
bottom: 50rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: calc(100% - 220rpx);
}
.name {
position: absolute;
left: 160rpx;
top: 40rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
}
image {
position: absolute;
top: 50%;
left: 20rpx;
transform: translateY(-50%);
width: 110rpx;
height: 110rpx;
border-radius: 50%;
}
}
}
.inputs {
background-color: #fff;
width: 65%;
// height: 60rpx;
// border: 1px solid #F6F6F6;
height: 0rpx;
border-radius: 5rpx;
background-color: #ffffff;
z-index: 999;
position: relative;
top: 50%;
transform: translateY(-50%);
background: #F6F6F6;
border-radius: 38rpx;
.input {
margin: 0 auto;
position: absolute;
height: 60rpx;
// top: 8%;
left: 13%;
width: 80%;
font-size: 26rpx;
color: #000000;
}
.icon {
background: url(@/static/sousuo.png) no-repeat;
width: 30rpx;
height: 28rpx;
background-size: cover;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 3%;
}
}
.btnss {
display: flex;
text-align: center;
border-top: 1rpx solid #f6f6f6;
font-size: 32rpx;
line-height: 100rpx;
width: 100%;
position: absolute;
bottom: 0;
.cancel {
width: 50%;
height: 100rpx;
border-right: 0.5rpx solid #f6f6f6;
}
.Rescind {
width: 50%;
height: 100rpx;
color: #18CBB3;
border-left: 0.5rpx solid #f6f6f6;
}
}
.titletext {
width: 100%;
padding: 80rpx 30rpx 0;
display: flex;
textarea {
padding: 10rpx 20rpx;
font-size: 24rpx;
border: 1rpx solid #d0d0d0;
flex: 1;
}
}
.items {
width: 96%;
margin: 0 auto;
.item {
margin: 15rpx auto;
background-color: #fff;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
padding: 3%;
width: 100%;
position: relative;
color: #333333;
font-size: 30rpx;
padding-bottom: 60rpx;
.btns {
margin-top: 60rpx;
display: flex;
position: relative;
height: 30rpx;
.text {
width: 82rpx;
height: 27rpx;
font-size: 28rpx;
font-weight: 500;
color: #E57726;
line-height: 55rpx;
}
.btnaccept,
.btnreturn {
width: 170rpx;
height: 60rpx;
text-align: center;
line-height: 55rpx;
border-radius: 5rpx;
border: 1px solid #18CBB3;
position: absolute;
}
.btnaccept {
right: 24rpx;
color: #fff;
background-color: #18CBB3;
}
.btnreturn {
right: 220rpx;
color: #18CBB3;
background: #FFFFFF;
}
}
.address {
position: relative;
.text {
width: 80%;
}
.p {
padding-left: 30rpx;
font-size: 24rpx;
color: #EA706A;
}
image {
position: absolute;
top: 50%;
left: 0rpx;
transform: translateY(-40%);
width: 25rpx;
height: 25rpx;
}
}
.time {
line-height: 60rpx;
font-size: 24rpx;
font-weight: 400;
color: #333333;
span {
word-break: break-all;
padding-left: 10rpx;
}
}
.itemimg {
position: absolute;
right: 15rpx;
top: 18rpx;
width: 140rpx;
height: 120rpx;
}
.title {
font-size: 32rpx;
line-height: 100rpx;
border-bottom: 1rpx solid #E6E6E6;
color: #333333;
position: relative;
height: 100rpx;
.text {
height: 100%;
overflow: hidden; //
display: -webkit-box;
-webkit-line-clamp: 1; //
-webkit-box-orient: vertical;
width: 50%;
}
.image {
position: absolute;
right: 0%;
top: 50%;
transform: translateY(-50%);
display: inline-block;
font-size: 30rpx;
color: #EA706A;
image {
// vertical-align: middle;
transform: translateY(20%);
width: 40rpx;
height: 40rpx;
padding-right: 10rpx;
}
}
}
}
}
::v-deep .u-tabs {
background-color: #18CBB3 !important;
}
.top {
width: 90%;
width: 82%;
margin: 0 auto;
display: flex;
height: 84rpx;
justify-content: space-around;
.inputs {
background-color: #fff;
width: 65%;
// height: 60rpx;
// border: 1px solid #F6F6F6;
height: 0rpx;
border-radius: 5rpx;
background-color: #ffffff;
z-index: 999;
position: relative;
top: 50%;
transform: translateY(-50%);
background: #F6F6F6;
border-radius: 38rpx;
.input {
margin: 0 auto;
position: absolute;
height: 60rpx;
// top: 8%;
left: 13%;
width: 80%;
font-size: 26rpx;
color: #000000;
}
.icon {
background: url(@/static/sousuo.png) no-repeat;
width: 30rpx;
height: 28rpx;
background-size: cover;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 3%;
}
}
::v-deep .u-flex {
width: 100% !important;
}

View File

@ -1,173 +0,0 @@
<template>
<view class="app">
<image src="../../static/logos.png" mode=""></image>
<view class="text">
欢迎加入新医路
</view>
<view class="body">
<view class="login">
<view class="logins">
登录
</view>
<view class="border">
</view>
</view>
<view class="name">
<u-form :model="form" ref="uForm" label-width="110">
<u-form-item label="用户名:"><u-input placeholder="请输入用户名" /></u-form-item>
</u-form>
<u-form :model="form" ref="uForm">
<u-form-item label="密码:">
<u-input placeholder="请输入密码" :password-icon="true" type="password"/>
<!-- <span class="pwd">忘记密码</span> -->
</u-form-item>
</u-form>
</view>
<view class="loginsubmit">
登录
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello',
form: {
name: '',
}
}
},
// onReady() {
// this.$refs.uForm.setRules(this.rules);
// },
onLoad() {
},
methods: {
}
}
</script>
<style lang="scss">
.app {
height: 100vh;
background-image: url(../../static/bg.png);
background-size: 100% 100%;
position: relative;
overflow: scroll;
.text {
width: 235rpx;
height: 30rpx;
font-size: 32rpx;
font-family: SourceHanSansCN-Medium, SourceHanSansCN;
font-weight: 500;
color: #333333;
position: absolute;
top: 22%;
left: 50%;
transform: translateX(-50%);
}
image {
position: absolute;
width: 114rpx;
height: 114rpx;
left: 50%;
top: 12%;
transform: translateX(-50%);
}
.body {
width: 100%;
height: 70%;
position: relative;
top: 32%;
overflow: scroll;
background: #F9F9F9;
border-radius: 30rpx 0rpx 0rpx 30rpx;
opacity: 1;
.login {
top: 31px;
width: 36%;
height: 49px;
font-size: 23px;
font-family: SourceHanSansCN-Medium, SourceHanSansCN;
font-weight: 500;
color: #18CBB3;
/* background: red; */
position: relative;
.logins {
position: absolute;
left: 50%;
transform: translateX(-50%);
// top: 5%;
}
.border {
width: 30rpx;
height: 8rpx;
background: #18CBB3;
border-radius: 4rpx 4rpx 4rpx 4rpx;
opacity: 1;
position: absolute;
left: 50%;
transform: translateX(-50%);
border: 1rpx solid #18CBB3;
top: 65rpx;
}
}
.name {
position: relative;
width: 83%;
/* background: red; */
left: 50%;
transform: translateX(-50%);
top: 9%;
::v-deep .u-form-item--left {
font-size: 30rpx;
}
.pwd{
display: inline-block;
position: absolute;
right: 10%;
font-size: 30rpx;
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
font-weight: 400;
color: #18CBB3;
line-height: 38rpx;
}
}
.loginsubmit{
text-align: center;
width: 83%;
height: 88rpx;
line-height: 88rpx;
background: #18CBB3;
/* position: absolute; */
margin: 177rpx auto;
color: #fff;
border-radius: 100rpx
}
}
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<view class="app">
<!-- 家医 -->
<!-- <view class="Familydoctor">
<!-- <view class="Familydoctor">
<div class="imgs">
<image src="../../static/top.png" mode=""></image>
<view class="my">
@ -55,12 +55,12 @@
<!-- 泉医 -->
<view class="Quanyi">
<view class="Quanyi">
<div class="imgs">
<image src="../../static/top.png" mode=""></image>
<view class="my">
<!-- <view class="my">
我的
</view>
</view> -->
</div>
<image src="/static/headsculpture.png" mode="" class="headsculpture">
</image>
@ -114,29 +114,34 @@
},
methods: {
//
personlinfo(){
personlinfo() {
uni.navigateTo({
url:'/pages/Personalinfo/Personalinfo'
url: '/pages/Personalinfo/Personalinfo'
})
},
gotime(){
gotime() {
uni.navigateTo({
url:'/pages/ServiceSchedule/ServiceSchedule'
url: '/pages/ServiceSchedule/ServiceSchedule'
})
},
}
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.app {
background-color: #fff;
height: 100vh;
overflow: hidden;
height: 100%;
//
.Familydoctor {
@ -151,6 +156,7 @@
width: 100%;
// top: 0;
}
.my {
padding-top: 50rpx;
height: 150rpx;
@ -168,8 +174,8 @@
.Familybody {
width: 100%;
background: #fff;
position: absolute;
background: #fff;
position: absolute;
.myorder {
position: relative;
@ -216,17 +222,18 @@
width: 93%;
}
}
}
}
//
.Quanyi {
width: 100%;
position: relative;
height: 80vh;
.imgs {
width: 100%;
height: 100rpx;
image {
position: absolute;
@ -243,9 +250,7 @@
font-weight: 500;
color: #FFFFFF;
position: relative;
}
}
.bodys {
@ -255,7 +260,6 @@
background: #FFFFFF;
border-radius: 12px;
opacity: 1;
height: 100vh;
overflow: hidden;
position: relative;
@ -288,9 +292,11 @@
left: 72%;
top: 7%;
}
.myorder {
position: relative;
top: 10%;
.orderStatus {
text-align: center;
margin: 60rpx auto 30rpx;
@ -333,15 +339,13 @@
.headsculpture {
position: absolute;
top: 13%;
top: 25rpx;
left: 50%;
transform: translateX(-50%);
width: 150rpx;
height: 150rpx;
z-index: 999;
}
}
}
</style>

View File

@ -0,0 +1,755 @@
<template>
<view class="content">
<!-- <view class="title">
<image src="../../static/huijiantou.png" @click="back"></image>
{{currentItem.senderName}}
</view> -->
<!-- 聊天渲染列表 -->
<!-- scroll-y scroll-into-view="placeholder" scroll-top="500" scroll-with-animation -->
<scroll-view scroll-y="true" :scroll-top='scrollTop' id="demo"
:style="'height:calc(100vh - '+ inputboxtop +'px)'" scroll-with-animation="true">
<view style="height: 85vh; padding-top: 200rpx;" @tap='touchend'>
<view class="snedItem" v-for="(item, index) in newsList" :key="index">
<view class="ifSend" v-if="item.senderName == userName">
<view class="sendBox" v-if="item.messageType=='1'">{{item.content}}</view>
<image v-if="item.messageType=='2'" :src="baseurl+item.content" class="snedItemimage" />
<image class="head" src="@/static/headsculpture.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>
</view>
<video v-if="item.video" :src="item.video"></video>
</view>
<!-- <view class="placeholder" id="placeholder" v-if="showFunBtn"></view> -->
</view>
</scroll-view>
<!-- 底部输入 -->
<view class="input-box" :class="{ 'input-box-mpInputMargin': mpInputMargin }">
<view class="input-box-flex">
<!--弹出常用 -->
<!-- <image class="icon_img" :src="require('@/static/ico/often.png')" @tap="oftenx"></image> -->
<!-- 输入框 -->
<view class="input-box-flex-grow"> <input type="text" class="contenxxt" id="input"
v-model="formData.content" :hold-keyboard="true" :confirm-type="'send'" :confirm-hold="true"
placeholder-style="color:#DDDDDD;" :cursor-spacing="10" @confirm='sendconfirm' /> </view>
<!-- 选择表情包 -->
<!-- <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"
v-if="formData.content!==''" mode=""></image>
<!-- <text class="send-out iconfont icon-fasong" ></text> -->
<!-- 弹出拍照-->
<!-- @tap="switchFun" -->
<uni-icons type="plus" size="33" class="icon_btn_add" v-else @tap='goshowFunBtn'></uni-icons>
<!-- <image :src="require('@/static/ico/more.png')" v-else @tap='goshowFunBtn'></image> -->
</view>
<!-- 弹出拍照-->
<view class="fun-box" :class="{'show-fun-box':showFunBtn}">
<u-grid :col="4" hover-class="contentType2-hover-class" :border="false">
<u-grid-item v-for="(item, index) in funList" @tap.stop="tapGrid(index)" :index="index" :key="index"
bg-color="#f3f3f3">
<u-icon :name="item.icon" :size="52"></u-icon>
<uni-icons style="opacity: 0.7;width: 52rpx;height: 52rpx; " v-if="index==2"
:type="index==2?'folder-add-filled':''" size="26"></uni-icons>
<view class="grid-text">{{ item.title }}</view>
</u-grid-item>
</u-grid>
</view>
<!-- 弹出表情 -->
<view class="fun-box2" :class="{'show-fun-box':showExpre}">
<view class="emoji-box emoji-move-in">
<scroll-view scroll-y="true" style="height:200px">
<view class="list">
<text v-for="(item,index) in emojisList" :key="index" @tap.stop="expre(item)"
class="touch-active">{{item}}</text>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
sendMessage,
getChatRecord,
markRead
} from '@/api/seekadvicefrom/seekadvicefrom.js';
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: '',
title: '',
SOCKETURL: 'ws://8.131.93.145:54088/webSocket/',
socketOpen: false,
sendInfo: {},
currentItem: '',
userName: '',
mpInputMargin: true, //
//
formData: {
content: "",
limit: 15,
index: 1,
},
timeout: 180000,
timeoutObj: null,
newsList: [],
showFunBtn: false, //
showOften: false, //
showExpre: false, //
//
funList: [{
icon: "photo-fill",
title: "照片",
uploadType: ["album"]
},
{
icon: "camera-fill",
title: "拍摄",
uploadType: ["camera"]
},
{
icon: "",
title: "文件",
},
],
emojisList: [
'😄', '😃', '😀', '😊', '😉', '😍', '😘', '😚', '😗',
'😙', '😜', '😝', '😛', '😳', '😁', '😔', '😌', '😒',
'😞', '😣', '😢', '😂', '😭', '😪', '😥', '😰', '😅',
'😓', '😩', '😫', '😨', '😱', '😠', '😡', '😤', '😖',
'👦', '👧', '👨', '👩', '👴', '👵', '👱', '👼', '👸',
'👀', '👍', '👎', '👌', '👊', '✊', '✌', '👉', '👏',
'💗', '💛', '💙', '💜', '💚', '❤', '💔', '💓', '💕',
'🌟', '💢', '🏃', '🙅', '💁', '🙋', '💼', '💬', '💭',
], //
//
oftenTermList: [{
id: 0,
title: "你好,很高兴",
},
{
id: 0,
title: "在吗",
},
],
scrollTop: 999999,
inputboxtop: undefined,
};
},
onReady() { //
uni.setNavigationBarTitle({
title: this.title,
});
},
onLoad(options) {
this.baseurl = baseurl;
// uni.closeSocket()
this.currentItem = JSON.parse(options.item)
this.title = this.currentItem.doctorName //
this.userName = this.currentItem.patientName
this.SOCKETURL = this.SOCKETURL + this.currentItem.patientId
this.getPageHistory()
this.scoket()
},
mounted() {
// wx.pageScrollTo({
// scrollTop: 9999999
// })
},
methods: {
getPageHistory() {
let obj = {
consultationId: this.currentItem.id,
senderId: this.currentItem.patientId,
recipientId: this.currentItem.doctorId,
}
getChatRecord(obj).then(res => {
res.data.forEach(e => {
if (e.readStatus == 0) {
this.Read()
}
})
this.newsList = res.data
setTimeout(() => {
let query = uni.createSelectorQuery().in(this);
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
this.scrollTop = this.scrollTop + 1;
}).exec();
}, 100)
})
},
Read() {
let markReadData = {
consultationId: this.currentItem.id,
recipientId: this.currentItem.doctorId,
}
markRead(markReadData)
},
//
sendconfirm(value) {
this.sendout();
},
touchend() {
this.showFunBtn = false; //
this.showExpre = false; //
this.showOften = false; //
uni.hideKeyboard();
setTimeout(() => {
let query = uni.createSelectorQuery().in(this);
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
this.scrollTop = this.scrollTop + 1;
}).exec();
}, 200)
},
goshowFunBtn() {
this.showFunBtn = !this.showFunBtn; //
uni.hideKeyboard();
setTimeout(() => {
let query = uni.createSelectorQuery().in(this);
//iddemo
query.select('.input-box').boundingClientRect(data => {
console.log(data)
this.inputboxtop = data.height //
setTimeout(() => {
this.scrollTop = this.scrollTop + 1;
}, 200)
}).exec();
}, 300)
},
sendout() {
const that = this
if (this.socketOpen == false) {
return
}
this.newsList.push({
senderName: this.userName,
content: this.formData.content
})
let obj = {
consultationId: that.currentItem.id,
senderId: that.currentItem.patientId,
senderName: that.currentItem.patientName,
recipientId: that.currentItem.doctorId,
recipientName: that.currentItem.doctorName,
messageType: 1,
sendTime: new Date(),
content: this.formData.content
}
sendMessage(obj).then(res => {
that.formData.content = '' //
setTimeout(() => {
that.scrollTop = that.scrollTop + 1;
}, 100)
if (res.code != 200) {
}
})
// try {
// const that = this
// let message = this.formData.content
// uni.sendSocketMessage({
// data: message,
// success(res) {
// let obj = {
// consultationId: that.currentItem.id,
// senderId: that.currentItem.patientId,
// senderName: that.currentItem.patientName,
// recipientId: that.currentItem.doctorId,
// recipientName: that.currentItem.doctorName,
// messageType: 1,
// sendTime: new Date(),
// // messageType: (0 1 2 3 4 5 6 )
// content: message
// }
// sendMessage(obj).then(res => {
// setTimeout(() => {
// that.scrollTop = that.scrollTop + 1;
// }, 100)
// })
// }
// })
// } catch (e) {
// console.log(e, '线')
// // uni.closeSocket();
// }
},
//
oftenc(e) {
this.formData.content = e.title;
},
//
expre(e) {
this.formData.content = !this.formData.content ? e : this.formData.content + e;
},
//
// switchFun() {
// this.showOften = false; //
// this.showExpre = false; //
// this.showFunBtn = !this.showFunBtn; //
// uni.hideKeyboard();
// setTimeout(() => {
// let query = uni.createSelectorQuery().in(this);
// //iddemo
// query.select('.input-box').boundingClientRect(data => {
// this.inputboxtop = data.height //
// }).exec();
// this.scrollTop = this.scrollTop + 1;
// }, 200)
// },
//
// oftenx() {
// this.showFunBtn = false; //
// this.showExpre = false; //
// this.showOften = !this.showOften; //
// uni.hideKeyboard();
// setTimeout(() => {
// let query = uni.createSelectorQuery().in(this);
// //iddemo
// query.select('.input-box').boundingClientRect(data => {
// this.inputboxtop = data.height //
// }).exec();
// this.scrollTop = this.scrollTop + 1;
// }, 100)
// },
//
// exprec() {
// this.showFunBtn = false; //
// this.showOften = false; //
// this.showExpre = !this.showExpre; //
// uni.hideKeyboard();
// setTimeout(() => {
// let query = uni.createSelectorQuery().in(this);
// //iddemo
// query.select('.input-box').boundingClientRect(data => {
// this.inputboxtop = data.height //
// }).exec();
// this.scrollTop = this.scrollTop + 1;
// }, 100)
// },
//
tapGrid(index) {
if (index == 0) {
this.chooseImage(["album"]);
} else if (index == 1) {
this.chooseImage(["camera"]);
} else if (index == 2) {
uni.chooseMessageFile({
count: 6, //100
extension: ['.zip', '.doc'],
success: function(res) {
console.log(res)
// console.log(JSON.stringify(res.tempFilePaths));
}
});
}
},
//
chooseImage(sourceType) {
var that = this
if (this.socketOpen == false) {
return
}
uni.chooseImage({
sourceType,
sizeType: ["compressed"],
success: (res) => {
that.showFunBtn = false;
setTimeout(() => {
let query = uni.createSelectorQuery().in(this);
//iddemo
query.select('.input-box').boundingClientRect(data => {
console.log(data)
this.inputboxtop = data.height //
setTimeout(() => {
this.scrollTop = this.scrollTop + 1;
}, 200)
}).exec();
}, 300)
res.tempFilePaths.forEach(e => {
that.newsList.push({
imgurl: e,
senderName: that.userName,
})
uni.uploadFile({
url: baseurl +
'/nurseApplet/consultationInfo/uploadConsultationFile',
filePath: e,
name: 'file',
timeout: 5000,
success(resp) {
console.log(resp)
var fileurls = JSON.parse(resp.data)
let obj = {
consultationId: that.currentItem.id,
senderId: that.currentItem.patientId,
senderName: that.currentItem.patientName,
recipientId: that.currentItem.doctorId,
recipientName: that.currentItem.doctorName,
messageType: 2,
sendTime: new Date(),
content: fileurls.fileUrl
}
sendMessage(obj).then(respp => {
console.log(respp)
})
}
})
})
},
});
},
//
touchstart() {
uni.hideKeyboard();
setTimeout(() => {
let query = uni.createSelectorQuery().in(this);
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
this.scrollTop = this.scrollTop + 1;
}).exec();
}, 200)
},
scoket() {
const that = this
this.socketOpen = false
try {
uni.connectSocket({
url: that.SOCKETURL
})
uni.onSocketOpen(res => {
console.log('webScoket连接已打开', res);
that.socketOpen = true
that.reset()
})
uni.onSocketError(err => {
console.log('webScoket连接打开失败', err);
if (err && err.code != 1000) {
setTimeout(() => {
that.socketOpen = true
uni.connectSocket({
url: that.SOCKETURL
})
}, 3 * 1000)
}
})
uni.onSocketClose(err => {
console.log('webScoket连接关闭', err);
if (err && err.code !== 1000) {
setTimeout(() => {
that.socketOpen = true
uni.connectSocket({
url: that.SOCKETURL
})
}, 3 * 1000)
}
})
uni.onSocketMessage(res => {
console.log("webScoket监听收到的信息", res);
that.newsList.push({
senderName: that.currentItem.patientName,
content: JSON.parse(res.data).message
})
that.Read()
})
} catch (e) {
console.log(e);
}
},
//
reset() {
let that = this
clearInterval(that.timeoutObj);
that.timeoutObj = setInterval(() => {
uni.sendSocketMessage({
data: 'ping',
success(res) {
console.log('正在发送心跳');
},
fail(err) {
console.log('心跳发送失败,重新连接...');
that.socketOpen = true
uni.connectSocket({
url: that.SOCKETURL
})
}
})
}, that.timeout)
},
back() {
uni.navigateBack({
delta: 1
})
}
},
onUnload() {
clearInterval(this.timeoutObj);
if (this.socketOpen == true) {
uni.closeSocket();
}
}
};
</script>
<style lang="scss" scoped>
page {
background-color: #f3f3f3;
}
#demo {
transition: all 0.3s ease;
}
.content {
.input-box {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: content-box;
z-index: 999;
background-color: #f3f3f3;
/* #ifdef APP-PLUS */
margin-bottom: 0rpx;
margin-bottom: constant(safe-area-inset-bottom);
margin-bottom: env(safe-area-inset-bottom);
/* #endif */
/* #ifdef MP-WEIXIN */
padding-bottom: 0rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
.input-box-flex {
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
padding: 20rpx;
box-sizing: border-box;
image {
width: 63rpx;
height: 63rpx;
}
.icon_img {
margin-right: 20rpx;
}
.icon_btn_add {
margin-left: 20rpx;
}
// .send-out {
// font-size: 65rpx;
// margin-left: 15rpx;
// color: #16c694;
// width: 100rpx;
// height: 100rpx;
// }
.input-box-flex-grow {
flex: 1;
}
.contenxxt {
box-sizing: border-box;
background-color: #fff;
height: 80rpx;
padding: 0 20rpx;
border-radius: 12rpx;
font-size: 28rpx;
caret-color: $uni-color-success;
}
}
.fun-box {
opacity: 0;
height: 0;
transition: all 0.3s ease;
transform: translateY(100%);
.grid-text {
padding-top: 10rpx;
color: $uni-text-color-grey;
}
}
.fun-box1 {
opacity: 0;
transition: all 0.1s ease-in-out;
height: 0;
.often-super {
padding: 30rpx;
height: 240rpx;
background-color: #f3f3f3;
width: auto;
.flex-row {
padding: 10rpx 0;
border-bottom: 1rpx #e8e8e8 solid;
.often-text-size {
color: #5a5a5a;
font-size: 26rpx;
margin-top: 6rpx;
margin-bottom: 6rpx;
}
}
}
}
.fun-box2 {
opacity: 0;
transition: all 0.1s ease-in-out;
height: 0;
.emoji-box {
position: relative;
height: 200rpx;
padding: 5rpx 0;
box-sizing: border-box;
margin-bottom: -200rpx;
background-color: #f3f3f3;
.list {
display: flex;
flex-wrap: wrap;
padding: 0 0 0 14rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.touch-active {
width: 65rpx;
height: 60rpx;
text-align: center;
border-radius: 3rpx;
line-height: 60rpx;
font-size: 38rpx;
}
}
}
.emoji-move-in {
-webkit-animation: emoji-move-in 0.3s forwards;
animation: emoji-move-in 0.3s forwards;
}
}
.show-fun-box {
opacity: 1;
height: 300rpx;
transition: all 0.3s ease;
transform: translateY(0%) !important;
}
}
.input-box-mpInputMargin {
/* #ifdef MP-WEIXIN */
padding-bottom: 0rpx;
/* #endif */
}
}
.snedItem {
padding: 0rpx 30rpx 40rpx 30rpx;
.snedItemimage {
width: 200rpx;
height: 200rpx;
border-radius: 3rpx;
}
}
.ifSend {
display: flex;
justify-content: flex-end;
.head {
width: 80rpx;
height: 80rpx;
margin-left: 20rpx;
}
.sendBox {
background-color: #55d0df7d;
padding: 18rpx 20rpx;
border-radius: 0 0 10rpx 10rpx;
font-size: 34rpx;
flex: none;
max-width: 550rpx;
word-break: break-all;
}
}
.doctorSend {
display: flex;
justify-content: flex-start;
align-items: center;
.head {
width: 90rpx;
height: 90rpx;
margin-right: 20rpx;
}
text {
color: #b2b2b2;
font-size: 24rpx;
}
.sendBox {
background-color: #d7d7d77d;
padding: 18rpx 20rpx;
border-radius: 0 0 10rpx 10rpx;
font-size: 34rpx;
flex: none;
max-width: 550rpx;
word-break: break-all;
}
}
.placeholder {
height: 200rpx;
transition: all 0.3s ease;
transform: translateY(0%) !important;
}
.title {
font-size: 20px;
text-align: center;
height: 80rpx;
border-bottom: 1rpx solid #f6f6f6;
padding-top: 100rpx;
position: fixed;
width: 100%;
background: white;
z-index: 10;
image {
width: 20rpx;
height: 30rpx;
transform: rotate(180deg);
position: absolute;
left: 40rpx;
bottom: 38rpx;
}
}
</style>

View File

@ -0,0 +1,163 @@
<template>
<view class="app" v-if="list">
<view class="top">
<view class="title">
患者信息
</view>
<view class="text">
姓名{{list.patientName}}
</view>
<view class="text">
性别{{list.sex}}
</view>
<view class="text">
身份证号{{list.cardNo}}
</view>
<view class="text">
手机号码{{list.phone}}
</view>
<view class="text">
家庭住址{{list.address}}
</view>
</view>
<view class="center top">
<view class="title">
预约时间
</view>
<view class="time">
{{list.appointmentDate}}{{' '+list.appointmentStartTime+'-'+list.appointmentEndTime}}
</view>
</view>
<view class="bottom top">
<view class="title">
咨询内容
</view>
<view class="text-area">
{{list.problemStatement}}
</view>
</view>
<view class="fileimage top">
<view class="title">
检查单/患处照片
</view>
<view class="images" v-for='(item,index) in fileUrls'>
<image :src="item" mode="" @click.stop='previewImage(index)'></image>
</view>
</view>
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
import {
consultationInfo
} from '@/api/taskDetails/index.js'
import {
getSex
} from '@/utils/conversion.js'
export default {
data() {
return {
list: null,
baseurl: null,
fileUrls: [],
};
},
onLoad(options) {
this.baseurl = baseurl
this.info(options.id)
},
methods: {
previewImage(index) {
uni.previewImage({
urls: this.fileUrls,
current: index,
indicator: "default",
loop: true
})
},
info(id) {
consultationInfo(id).then(res => {
res.data.fileUrls.forEach(e => {
e = this.baseurl + e
this.fileUrls.push(e)
})
res.data.sex = getSex(res.data.cardNo)
this.list = res.data
})
}
}
}
</script>
<style lang="scss">
.app {
.fileimage {
.images {
width: 90%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
image {
width: 100%;
}
}
}
.bottom {
.text-area {
width: 90%;
margin: 30rpx auto;
font-weight: 500;
word-break: break-all;
}
}
.center {
.time {
width: 90%;
margin: 0 auto;
height: 80rpx;
line-height: 80rpx;
background: #F7F9F8;
margin-top: 20rpx;
border-radius: 14rpx;
font-size: 28rpx;
font-weight: 500;
color: #333333;
padding-left: 20rpx;
}
}
.title {
width: 90%;
height: 80rpx;
line-height: 80rpx;
margin: 0 auto;
font-size: 28rpx;
font-weight: 500;
color: #333333;
border-bottom: 2rpx solid #E6E6E6;
}
.top {
width: 94%;
margin: 0 auto;
background-color: #fff;
border-radius: 10rpx;
margin-top: 20rpx;
padding-bottom: 20rpx;
.text {
font-size: 24rpx;
font-weight: 500;
color: #333333;
line-height: 60rpx;
width: 90%;
margin: 0 auto;
}
}
}
</style>

View File

@ -1,51 +0,0 @@
<template>
<view class="content">
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>

BIN
static/docHead.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/homepages.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/ico/emoji.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/ico/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/ico/more.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/ico/send.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/ico/success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/jinbi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/my.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

BIN
static/mys.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

29
utils/conversion.js Normal file
View File

@ -0,0 +1,29 @@
export function getSex(idCard) {
if (idCard.length === 15) {
return ['女', '男'][idCard.substr(14, 1) % 2]
} else if (idCard.length === 18) {
return ['女', '男'][idCard.substr(16, 1) % 2]
}
return ''
}
export function getBirthday(idCard) {
var birthday = "";
if (idCard != null && idCard != "") {
if (idCard.length == 15) {
birthday = "19" + idCard.substr(6, 6);
} else if (idCard.length == 18) {
birthday = idCard.substr(6, 8);
}
birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
}
return birthday;
};
// 出生日期转年龄
export function getAgeFun(value) {
var birthdays = new Date(value.replace(/-/g, "/")); //value 是传入的值
var time = new Date(); //当前时间
var age = time.getFullYear() - birthdays.getFullYear() - (time.getMonth() < birthdays.getMonth() || (time.getMonth() == birthdays.getMonth() &&
time.getDate() < birthdays.getDate()) ? 1 : 0);
return age;
}