作者 韩昌

问诊记录

... ... @@ -6,11 +6,13 @@
<view class="flexA">
<image :src="proxy.$h.downFile(detailData?.doctor?.avatar)" @click="proxy.$h.previewImage(proxy.$h.downFile(detailData?.doctor?.avatar))" class="imtopinfo-avatar" mode="aspectFill" />
<view class="imtopinfo-username">{{ detailData?.doctor?.nickname }}</view>
<u-count-down :time="countdownTime * 1000" format="HH:mm:ss" @finish="finishCountDownHandler"></u-count-down>
<view class="graytext">后结束问诊</view>
<template v-if="history === 'err'">
<u-count-down :time="countdownTime * 1000" format="HH:mm:ss" @finish="finishCountDownHandler"></u-count-down>
<view class="graytext">后结束问诊</view>
</template>
</view>
<!-- <view class="righttext">已结束</view> -->
<up-button type="info" shape="circle" text="结束问诊" throttleTime="1500" @click="getEndInformationHandler" :customStyle="{ width: '146rpx', height: '66rpx', marginRight: '0rpx' }"></up-button>
<up-button v-if="history === 'err'" type="info" shape="circle" text="结束问诊" throttleTime="1500" @click="getEndInformationHandler" :customStyle="{ width: '146rpx', height: '66rpx', marginRight: '0rpx' }"></up-button>
</view>
<view class="infocard" style="padding: 0; width: 100%">
<view class="flexJ">
... ... @@ -35,51 +37,70 @@
<view class="TUIChat" v-if="conversationType === 'chat'">
<view class="more-btn" v-if="conversation?.type === 'GROUP'" @click="handleGetProfile">更多</view>
<!-- <view class="more-btn" style="margin-top: 180rpx" @click="handleGetProfile">更多</view> -->
<view class="TUIChat-container">
<scroll-view class="TUIChat-main" scroll-y="true" :scroll-with-animation="true" :refresher-triggered="triggered" :refresher-enabled="true" @refresherrefresh="handleRefresher" :scroll-top="scrollTop">
<view class="TUI-message-list" @touchstart="handleTouchStart" @click="dialogID = ''">
<!-- 用户信息卡片 -->
<!-- <UserInfoCard :detailData="detailData" /> -->
<view style="height: 280rpx"></view>
<view class="loading-text" v-if="isCompleted">没有更多</view>
<view v-for="(item, index) in messages" :key="item.ID" :id="'view' + item.ID">
<view class="time-container" v-if="item.showTime">{{ caculateTimeago(item.time * 1000) }}</view>
<MessageTip v-if="!item.isRevoked && item.type === types.MSG_GRP_TIP" :data="handleTipMessageShowContext(item)" />
<!-- <MessageTip v-if="item.type === types.MSG_GRP_SYS_NOTICE" /> -->
<MessageBubble v-if="!item.isRevoked && item.type !== types.MSG_GRP_TIP" :data="item">
<Message-Operate
v-if="dialogID === item.ID"
:data="item"
class="dialog dialog-item"
:style="{
top: dialogPosition.top + 'px',
right: dialogPosition.right + 'px',
left: dialogPosition.left + 'px'
}"
></Message-Operate>
<MessageText :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_TEXT" :data="handleTextMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)"></MessageText>
<MessageImage :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_IMAGE" :data="handleImageMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)"></MessageImage>
<MessageVideo :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_VIDEO" :data="handleVideoMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
<MessageAudio :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_AUDIO" :data="handleAudioMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
<MessageFace :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_FACE" :data="handleFaceMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
<MessageCustom :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_CUSTOM" :data="handleCustomMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
</MessageBubble>
<MessageRevoked v-if="item.isRevoked" :data="item" @edit="handleEdit(item)" />
</view>
<template v-if="history === 'err'">
<view class="loading-text" v-if="isCompleted">没有更多</view>
<view v-for="(item, index) in messages" :key="item.ID" :id="'view' + item.ID">
<view class="time-container" v-if="item.showTime">{{ caculateTimeago(item.time * 1000) }}</view>
<MessageTip v-if="!item.isRevoked && item.type === types.MSG_GRP_TIP" :data="handleTipMessageShowContext(item)" />
<!-- <MessageTip v-if="item.type === types.MSG_GRP_SYS_NOTICE" /> -->
<MessageBubble v-if="!item.isRevoked && item.type !== types.MSG_GRP_TIP" :data="item">
<Message-Operate
v-if="dialogID === item.ID"
:data="item"
class="dialog dialog-item"
:style="{
top: dialogPosition.top + 'px',
right: dialogPosition.right + 'px',
left: dialogPosition.left + 'px'
}"
></Message-Operate>
<MessageText :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_TEXT" :data="handleTextMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)"></MessageText>
<MessageImage :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_IMAGE" :data="handleImageMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)"></MessageImage>
<MessageVideo :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_VIDEO" :data="handleVideoMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
<MessageAudio :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_AUDIO" :data="handleAudioMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
<MessageFace :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_FACE" :data="handleFaceMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
<MessageCustom :id="item.flow + '-' + item.ID" v-if="item.type === types.MSG_CUSTOM" :data="handleCustomMessageShowContext(item)" :messageData="item" @longpress="handleItem($event, item)" />
</MessageBubble>
<MessageRevoked v-if="item.isRevoked" :data="item" @edit="handleEdit(item)" />
</view>
</template>
<template v-else>
<view v-for="(item, index) in historyList" :key="item.ID" :id="'view' + item.ID">
<!-- <view class="time-container" v-if="item.showTime">{{ caculateTimeago(item.time * 1000) }}</view> -->
<!-- <MessageTip v-if="!item.isRevoked && item.type === types.MSG_GRP_TIP" :data="handleTipMessageShowContext(item)" /> -->
<!-- <MessageTip v-if="item.type === types.MSG_GRP_SYS_NOTICE" /> -->
<MessageBubble :data="item">
<MessageText :id="item.flow + '-' + item.ID" v-if="item.chatType === 1" :data="item" :messageData="item" @longpress="handleItem($event, item)"></MessageText>
<MessageImage :id="item.flow + '-' + item.ID" v-if="item.chatType === 2" :data="item.payload" :messageData="item" @longpress="handleItem($event, item)"></MessageImage>
<MessageVideo :id="item.flow + '-' + item.ID" v-if="item.chatType === 3" :data="item.payload" :messageData="item" @longpress="handleItem($event, item)" />
</MessageBubble>
<MessageRevoked v-if="item.isRevoked" :data="item" @edit="handleEdit(item)" />
</view>
</template>
<!-- 对话结束显示 -->
<ConversationEnd v-if="end" />
<ConversationEnd v-if="history === 'success'" />
</view>
</scroll-view>
</view>
<view class="flexA imBtn">
<view @click="sendPrescriptionState = true" v-if="[null, undefined, ''].includes(detailData?.drugId)">发送处方单</view>
<view @click="showPrescriptionDetailState = true">查看处方单</view>
</view>
<TUIChatInput :text="text" :conversationData="conversation" :detailData="detailData"></TUIChatInput>
<template v-if="history === 'err'">
<view class="flexA imBtn">
<view @click="sendPrescriptionState = true" v-if="[null, undefined, ''].includes(detailData?.drugId)">发送处方单</view>
<view @click="showPrescriptionDetailState = true">查看处方单</view>
</view>
<TUIChatInput :text="text" :conversationData="conversation" :detailData="detailData"></TUIChatInput>
</template>
</view>
<view class="TUIChat" v-if="conversationType === 'system'">
<!-- <view class="TUIChat" v-if="conversationType === 'system'">
<MessageSystem :data="messages" :types="types" />
</view>
</view> -->
<u-popup :show="sendPrescriptionState" @close="sendPrescriptionState = false" mode="bottom" closeIconPos="top-right" closeable round="20">
<SendPrescription
:orderId="Event.orderId"
... ... @@ -127,7 +148,7 @@
<script lang="ts">
import { defineComponent, reactive, toRefs, computed, nextTick, watch, onMounted, shallowRef, getCurrentInstance, ComponentPublicInstance, ref, onUnmounted, onBeforeUnmount } from 'vue'
import { onReady, onLoad, onNavigationBarButtonTap, onUnload } from '@dcloudio/uni-app'
import { updateSend_prescription_form, getConsultation_information_detail, getEndInformation, getReceive_diagnosis } from '@/api'
import { updateSend_prescription_form, getConsultation_information_detail, getEndInformation, getReceive_diagnosis, getOrder_chat } from '@/api'
// 消息元素组件
import MessageBubble from './components/message-elements/message-bubble.vue'
import MessageText from './components/message-elements/message-text.vue'
... ... @@ -148,6 +169,7 @@ import SendPrescription from '@/components/SendPrescription'
import ViewPrescription from '@/components/ViewPrescription'
import store from '../../TUICore/store'
import type { DiaLogEventType, Consultation_information_detailType } from '../../../types'
import { emojiMap } from '../../utils/emojiMap'
import {
handleAvatar,
handleTextMessageShowContext,
... ... @@ -203,7 +225,14 @@ export default defineComponent({
detailData: {} as Consultation_information_detailType,
countdownTime: 300,
end: false,
showUserCardDetailState: false
showUserCardDetailState: false,
history: 'err',
page: {
pageNo: 1,
pageSize: 15
},
imUserId: '',
historyList: [] as any
})
// 判断当前会话类型:无/系统会话/正常C2C、群聊
... ... @@ -229,10 +258,14 @@ export default defineComponent({
})
// 获取页面参数
onLoad((options: DiaLogEventType) => {
onLoad(async (options: DiaLogEventType) => {
data.history = uni.getStorageSync('history')
data.imUserId = uni.getStorageSync('ImUserId')
console.log(uni.getStorageSync('history'), '聊天界面onload获取是否为历史记录')
console.log(options, '聊天界面onload参数')
data.Event = options
getDetailHandler()
// uni.setNavigationBarTitle({
// // title: options && options.conversationName
// title: '自定义用户名'
... ... @@ -312,19 +345,93 @@ export default defineComponent({
})
}
})
const imageFormatMap = new Map([
['jpg', 1],
['gif', 2],
['png', 3],
['bmp', 4]
])
let stateInterval = setInterval(async () => {
const { result }: { result: Consultation_information_detailType } = await getConsultation_information_detail({ id: data.Event.orderId })
if (result?.orderState !== 30) proxy.$h.timeCallBack('对方已结束问诊即将返回', 2000)
// const { result }: { result: Consultation_information_detailType } = await getConsultation_information_detail({ id: data.Event.orderId })
// if (result?.orderState !== 30) proxy.$h.timeCallBack('对方已结束问诊即将返回', 2000)
}, 3000)
const getDetailHandler = async () => {
const { result: timeData }: { result: { countdownTime: number } } = await getReceive_diagnosis({ id: data.Event.orderId })
data.countdownTime = timeData.countdownTime
const { result }: { result: Consultation_information_detailType } = await getConsultation_information_detail({ id: data.Event.orderId })
data.detailData = result
if (data.history === 'success') getOrder_chatHandler(true)
}
const getOrder_chatHandler = async refresh => {
refresh ? ((data.page.pageNo = 1), data.historyList.splice(0)) : data.page.pageNo++
const { result } = await getOrder_chat({ ...data.page, id: data.detailData.userId })
const regex = /(\[[^\[\]]+\])|([^\[\]]+)/g
result.records = result.records
.map(item => ({
...item,
imContent: JSON.parse(item.imContent)
}))
.map(item => {
let msgContent = item.imContent?.msgBody?.[0]?.msgContent
const text = msgContent?.text?.match(regex).map(item => ({
text: item,
name: /^\[.+?\]$/.test(item) ? '' : 'text',
src: `https://web.sdk.qcloud.com/im/assets/emoji/${emojiMap[item]}`
}))
let url = ''
let snapshotUrl = ''
let src = ''
let imageFormat: string | number = ''
let flow = ''
{
if (item.chatType == 1) {
flow = item.imContent.from_Account == data.imUserId ? 'out' : 'in'
} else if (item.chatType == 2) {
url = msgContent?.imageInfoArray?.[0]?.uRL
const match = url.match(/\.(\w+)(\?.*)?$/)
imageFormat = match ? imageFormatMap.get(match[1])! : ''
} else if (item.chatType == 3) {
url = msgContent?.videoUrl
snapshotUrl = msgContent?.thumbUrl
}
}
return {
...item,
flow,
url,
text,
snapshotUrl,
src,
payload: {
info: msgContent?.imageInfoArray?.map(item => ({
...item,
url: item.uRL
})),
imageFormat
},
ID: item.id
}
})
.reverse()
if (result.records.length) {
result.records.map((_: any) => data.historyList.push(_))
data.historyList = result.records
console.log(data.historyList, '历史记录')
return
}
uni.$u.toast('没有更多数据了')
}
const finishCountDownHandler = async () => {
... ... @@ -404,11 +511,16 @@ export default defineComponent({
const handleRefresher = () => {
data.triggered = true
if (!data.isCompleted) {
TUIServer.getHistoryMessageList().then(res => {
data.triggered = false
data.isCompleted = res.isCompleted
})
if (data.history === 'err') {
if (!data.isCompleted) {
TUIServer.getHistoryMessageList().then(res => {
data.triggered = false
data.isCompleted = res.isCompleted
})
}
} else if (data.history === 'success') {
console.log('下拉刷洗执行了')
getOrder_chatHandler(false)
}
setTimeout(() => {
data.triggered = false
... ... @@ -507,7 +619,8 @@ export default defineComponent({
getDetailHandler,
getEndInformationHandler,
computedTotalHandler,
finishCountDownHandler
finishCountDownHandler,
getOrder_chatHandler
}
}
})
... ...
... ... @@ -352,9 +352,9 @@
.fileimage:nth-child(3n) {
margin-right: 0 !important;
}
.close {
.closeimg {
position: absolute;
top: 12rpx;
top: 0rpx;
right: 12rpx;
width: 40rpx;
height: 40rpx;
... ...
{
"version" : "1",
"prompt" : "none",
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意",
"hrefLoader" : "system|default",
"backToExit" : "false",
"second" : {
"title" : "确认提示",
"message" : "  进入应用前,你需先同意<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>,否则将退出应用。",
"buttonAccept" : "同意并继续",
"buttonRefuse" : "退出应用"
"version": "1",
"prompt": "template",
"title": "服务协议和隐私政策",
"message": "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept": "同意并接受",
"buttonRefuse": "暂不同意",
"hrefLoader": "system|default",
"backToExit": "false",
"second": {
"title": "确认提示",
"message": "  进入应用前,你需先同意<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>,否则将退出应用。",
"buttonAccept": "同意并继续",
"buttonRefuse": "退出应用"
},
"disagreeMode" : {
"support" : false,
"loadNativePlugins" : false,
"visitorEntry" : true,
"showAlways" : false
"disagreeMode": {
"support": false,
"loadNativePlugins": false,
"visitorEntry": true,
"showAlways": false
},
"styles" : {
"backgroundColor" : "#00FF00",
"borderRadius" : "5px",
"title" : {
"color" : "#ff00ff"
"styles": {
"backgroundColor": "#ffffff",
"borderRadius": "5px",
"title": {
"color": "#333"
},
"buttonAccept" : {
"color" : "#ffff00"
"buttonAccept": {
"color": "#000"
},
"buttonRefuse" : {
"color" : "#00ffff"
"buttonRefuse": {
"color": "##c6cdd4"
},
"buttonVisitor" : {
"color" : "#00ffff"
"buttonVisitor": {
"color": "##c6cdd4"
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -13,6 +13,7 @@ export const getRandomImage = (data: number | string) => request({ url: `/sys/ra
export const doctorLoginWithPwd = (data: doctorLoginWithPwdType) => request({ url: '/pet/login/doctorLoginWithPwd', method: 'POST', data }) // 兽医端账号密码登录
export const doctorPhoneEasyLogin = (data: doctorPhoneEasyLoginType) => request({ url: '/pet/login/doctorPhoneEasyLogin', method: 'POST', data }) // 兽医端一键登录
export const outLogin = () => request({ url: '/doctor/outLogin', method: 'GET' }) // 退出登录
export const getOrder_chat = (data: { id: string | number }) => request({ url: '/consultation/order_chat', method: 'GET', data }) // im聊天记录
// 首页
export const getStart = () => request({ url: '/veterinary/start', method: 'GET' }) // 开屏页
... ...
... ... @@ -9,8 +9,18 @@
</template>
<template #right>
<view v-if="props.isShowRight" class="flexA">
<image src="/static/images/xin.png" class="navbar-icon" mode="aspectFill" @click="proxy.$h.jumpUrl(`/pages2/message/index`)" />
<image v-if="props.isShowQrCode" src="/static/images/mineqr.png" class="navbar-icon" mode="aspectFill" style="margin-right: 0" @click="[20,'20'].includes(props.examineState) ? proxy.$h.jumpUrl(`/pages2/mineinfo/qrcode`) : $u.toast('请先完成认证')" />
<view class="pobox">
<image src="/static/images/xin.png" class="navbar-icon" mode="aspectFill" @click="proxy.$h.jumpUrl(`/pages2/message/index`)" />
<view class="dot" v-if="props.showDot"></view>
</view>
<image
v-if="props.isShowQrCode"
src="/static/images/mineqr.png"
class="navbar-icon"
mode="aspectFill"
style="margin-right: 0"
@click=";[20, '20'].includes(props.examineState) ? proxy.$h.jumpUrl(`/pages2/mineinfo/qrcode`) : $u.toast('请先完成认证')"
/>
</view>
<view v-else></view>
</template>
... ... @@ -31,6 +41,7 @@ interface IProps {
isShowBgColor: boolean
isplaceholder: boolean
examineState?: string | number
showDot?: boolean
}
const props = withDefaults(defineProps<IProps>(), {
... ... @@ -39,7 +50,8 @@ const props = withDefaults(defineProps<IProps>(), {
isShowRight: false,
title: '',
isShowBgColor: true,
isplaceholder: true
isplaceholder: true,
showDot: false
})
</script>
... ... @@ -51,4 +63,16 @@ const props = withDefaults(defineProps<IProps>(), {
margin-right: 32rpx;
}
}
.pobox {
position: relative;
.dot {
position: absolute;
top: 6rpx;
right: 32rpx;
width: 12rpx;
height: 12rpx;
background-color: red;
border-radius: 50%;
}
}
</style>
... ...
... ... @@ -60,7 +60,7 @@
<view class="flexA">
<view class="flexA fileImg" v-for="(_, index) in form.file">
<image :src="proxy.$h.downFile(_)" class="fileimage" mode="aspectFill" />
<image src="/static/images/close.png" class="close" mode="aspectFill" @click="form.file.splice(index, 1)" />
<image src="/static/images/close.png" class="closeimg" mode="scaleToFill" @click="form.file.splice(index, 1)" />
</view>
<view v-if="form.file.length < 3" class="uploadImg">
<view class="flexCCol" @click="uploadFormImgHandler">
... ...
... ... @@ -103,7 +103,7 @@
}
},
"splashscreen" : {
"useOriginalMsgbox" : false
"useOriginalMsgbox" : true
},
"icons" : {
"android" : {
... ...
<template>
<u-sticky zIndex="99999999999999999">
<NavBar :isShowQrCode="false" :isShowBgColor="navbarColor" :isShowLeft="false" :isShowRight="true" :isplaceholder="false" />
<NavBar :isShowQrCode="false" :isShowBgColor="navbarColor" :isShowLeft="false" :isShowRight="true" :isplaceholder="false" :showDot="[0, '0', null, undefined].includes(messageNumber) ? false : true" />
</u-sticky>
<view class="index">
... ... @@ -46,7 +46,7 @@
</up-col>
<up-col span="6">
<view class="flexCCol">
<view class="flexACol wzNum bluetext" @click="proxy.$h.jumpUrl(`/pages2/order/index?orderState=0&subOrderState=2`)">
<view class="flexACol wzNum bluetext" @click="proxy.$h.jumpUrl(`/pages2/order/index?orderState=0&subOrderState=2&isJump=success`)">
<view>{{ IndexData?.consultationNum || 0 }}</view>
<view>问诊中</view>
</view>
... ... @@ -277,7 +277,7 @@ const getMessageDataHandler = async () => {
messageNumber.value = result.sysCount + result.userCount + result.xufangCount
if (messageNumber.value === 0) return
if (messageNumber.value === 0 || ![20].includes(authState.value)) return
showMessageState.value = true
}
... ...
... ... @@ -14,6 +14,7 @@
<up-input placeholder="请输入验证码" border="bottom" placeholderClass="placeholderClass" v-model="params.code"></up-input>
</view>
<view class="bluetext" style="margin-top: 28rpx" @click="emit('editLoginStateHandler', 3)">账号密码登录</view>
<view style="font-size: 18rpx; color: red">*未注册用户在登录后自动注册</view>
</view>
</template>
... ...
... ... @@ -6,8 +6,9 @@
<u-icon name="close" size="22" color="#000"></u-icon>
</view>
<image class="login-avatar flexC" src="/static/images/bg.png" mode="aspectFill"></image>
<view class="login-phone flexC">187****5857</view>
<view class="login-remark flexC">认证服务由中国联通服务</view>
<image class="login-logo flexC" src="/static/images/logo.png" mode="aspectFill"></image>
<!-- <view class="login-phone flexC">187****5857</view>
<view class="login-remark flexC">认证服务由中国联通服务</view> -->
</template>
<template v-if="loginState === 2">
<PhoneLogin @editLoginStateHandler="(state: number) => loginState = state" ref="phoneLoginRef" />
... ... @@ -78,6 +79,11 @@ const loginHandler = (state: number) => {
border-radius: 32rpx;
margin: 236rpx auto 0;
}
&-logo {
margin: 0 auto;
width: 320rpx;
height: 320rpx;
}
&-phone {
color: #323233;
font-size: 60rpx;
... ...
<template>
<view class="mine">
<NavBar :isShowQrCode="true" :isShowBgColor="navbarColor" :isShowLeft="true" :isShowRight="true" :isplaceholder="false" :examineState="IndexData?.examineState" />
<NavBar :isShowQrCode="true" :isShowBgColor="navbarColor" :isShowLeft="true" :isShowRight="true" :isplaceholder="false" :examineState="IndexData?.examineState" :showDot="[0, '0', null, undefined].includes(messageNumber) ? false : true" />
<view class="mine-topBg"></view>
<image src="/static/images/mineTopIcon.png" class="mine-topicon" mode="aspectFill" />
<view class="mine-infobox flexA" @click="token ? proxy.$h.jumpUrl(`/pages2/mineinfo/info`) : proxy.$h.relaunchUrl('/pages/login/login')">
... ... @@ -32,7 +32,7 @@
<view class="flexA" style="margin-right: 68rpx">
<u-icon name="thumb-up" color="#484848" size="22"></u-icon>
<view class="graytext mine-centertext">用户评价</view>
<view class="mine-righttext">{{ UserInfo?.star || 0 }}</view>
<view class="mine-righttext">{{ UserInfo?.star || 0 }}{{ ![0, '0', '', null, undefined].includes(UserInfo?.star) && '.0' }}</view>
</view>
<view class="flexA">
<u-icon name="clock" color="#484848" size="18"></u-icon>
... ... @@ -93,8 +93,8 @@ import { onLoad, onShow, onPageScroll } from '@dcloudio/uni-app'
import Tabbar from '@/components/Tabbar'
import NavBar from '@/components/NavBar'
import TurnDown from '@/components/TurnDown'
import { getMy, getCareer, getDepartment, getIndex } from '@/api'
import type { Result, UserInfoType, IndexListType, IndexType, MineJumpListType } from '../../types'
import { getMy, getCareer, getDepartment, getIndex, getMsg_count } from '@/api'
import type { Result, UserInfoType, IndexListType, IndexType, MineJumpListType, MessageCountType } from '../../types'
const { proxy } = getCurrentInstance() as { proxy: ComponentPublicInstance }
... ... @@ -104,6 +104,8 @@ const isShowMoney = ref<boolean>(false)
const navbarColor = ref<boolean>(false)
const messageNumber = ref<number>(0)
const toOrderList = [
{ title: '问诊订单', text: '查看订单', bgurl: '/static/images/mineorbg1.png', url: '/pages2/order/index', orderState: 0 },
{ title: '处方订单', text: '查看订单', bgurl: '/static/images/mineorbg2.png', url: '/pages2/order/index', orderState: 1 }
... ... @@ -145,8 +147,17 @@ const jumpHandler = (_: MineJumpListType) => {
proxy.$h.jumpUrl(_.url)
}
const getMessageDataHandler = async () => {
const { result }: { result: MessageCountType } = await getMsg_count()
messageNumber.value = result.sysCount + result.userCount + result.xufangCount
}
onShow(async () => {
if (!token) return
getMessageDataHandler()
const { result }: { result: UserInfoType } = await getMy()
const { result: departmentList }: { result: { records: IndexListType[] } } = await getDepartment({ keyword: '' })
... ...
... ... @@ -34,6 +34,15 @@
</template>
</u-form-item>
<view class="grayLine"></view>
<u-form-item labelWidth="160rpx" label="选择种类" prop="category" borderBottom @click="!formDisabled && proxy.$h.jumpUrl(`/pages2/mineinfo/hospitalList?flag=KESHI`)" ref="selectDepartment">
<view class="flexD" style="width: 100%">
<u-checkbox-group v-model="form.category" placement="row" shape="circle">
<u-checkbox activeColor="#05b8d2" name="1" label="猫猫"></u-checkbox>
<u-checkbox activeColor="#05b8d2" name="2" label="狗狗"></u-checkbox>
<u-checkbox activeColor="#05b8d2" name="3" label="异宠"></u-checkbox>
</u-checkbox-group>
</view>
</u-form-item>
<u-form-item labelWidth="160rpx" label="选择科室" prop="selectDepartment" borderBottom @click="!formDisabled && proxy.$h.jumpUrl(`/pages2/mineinfo/hospitalList?flag=KESHI`)" ref="selectDepartment">
<u-input v-model="form.selectDepartment" disabled disabledColor="#ffffff" placeholder="请选择科室" border="none" inputAlign="right"></u-input>
<template #right>
... ... @@ -48,7 +57,7 @@
</template>
</u-form-item>
<u-form-item labelWidth="160rpx" label="坐诊医院" prop="selectHospital" borderBottom @click="!formDisabled && proxy.$h.jumpUrl(`/pages2/mineinfo/hospitalList?flag=ZUOZHENYIYUAN`)" ref="career">
<u-input v-model="form.selectHospital" disabled disabledColor="#ffffff" placeholder="请选择职称" border="none" inputAlign="right"></u-input>
<u-input v-model="form.selectHospital" disabled disabledColor="#ffffff" placeholder="请选择医院" border="none" inputAlign="right"></u-input>
<template #right>
<u-icon name="arrow-right"></u-icon>
</template>
... ... @@ -140,6 +149,8 @@ interface EventType {
reapply?: string
}
const category = ref(['1', '2'])
const { proxy } = getCurrentInstance() as { proxy: ComponentPublicInstance }
const Event = ref<EventType>()
... ... @@ -169,7 +180,8 @@ const form = ref<ApplyAuthType>({
file: [],
selectDepartment: '',
selectCareer: '',
selectHospital: ''
selectHospital: '',
category: []
})
const actions = ref()
... ... @@ -185,7 +197,8 @@ const rules = ref({
sex: { type: 'number', required: true, message: '请选择男或女', trigger: ['blur', 'change'] },
selectDepartment: { type: 'string', required: true, message: '请选择科室', trigger: ['blur', 'change'] },
selectCareer: { type: 'string', required: true, message: '请选择职称', trigger: ['blur', 'change'] },
selectHospital: { type: 'string', required: true, message: '请选坐诊医院', trigger: ['blur', 'change'] }
selectHospital: { type: 'string', required: true, message: '请选坐诊医院', trigger: ['blur', 'change'] },
category: { type: 'array', min: 1, required: true, message: '请选择种类', trigger: ['blur', 'change'] }
})
const formDisabled = ref<boolean>(false) // true 禁用代表回显数据 false 可以填写可以提交
... ...
... ... @@ -22,7 +22,7 @@
</view>
<view class="income-moneylist Zindex">
<view class="graytitle">{{ ['withdraw'].includes(Event?.flag as string) ? '提现明细':'收入明细' }}</view>
<view class="graytitle">{{ ['withdraw'].includes(Event?.flag as string) ? '提现明细' : '收入明细' }}</view>
<scroll-view scroll-y="true" class="moneyscroll" @scrolltolower="getListHandler(false)">
<view v-for="_ in incomeList?.records" :key="_.id" style="margin-bottom: 44rpx">
<view class="flexJ">
... ... @@ -30,7 +30,7 @@
<view class="itemtitle">{{ proxy.$h.optObjectValue('incomeTypeList', _.incomeType) }}</view>
<view class="timetext">{{ _.createTime }}</view>
</view>
<view class="moneytext" :class="{ incomemoney: _.incomeType === 1 }">{{ [1, 3, undefined].includes(_.incomeType) ? '+' : '-' }}{{ _.amount }}</view>
<view class="moneytext" :class="{ incomemoney: [1, 3, undefined].includes(_.incomeType) }">{{ [1, 3, undefined].includes(_.incomeType) ? '+' : '-' }}{{ _.amount }}</view>
</view>
</view>
</scroll-view>
... ...
... ... @@ -42,7 +42,8 @@
<view class="flexW" v-if="!props.isPrescriptionDrug">
<up-button type="info" v-if="props.item?.orderId !== null" shape="circle" text="处方单" throttleTime="1500" :customStyle="{ width: '170rpx', marginRight: '20rpx' }" @click="showPrescriptionDetailState = true"></up-button>
<up-button type="info" @click="clickOrderItemHandler" shape="circle" text="查看症状" throttleTime="1500" :customStyle="{ width: '170rpx', marginRight: '20rpx' }"></up-button>
<up-button color="#05B8D2" v-if="[20, '20'].includes(props.item?.orderState)" @click="AcceptHandler" shape="circle" text="接诊" throttleTime="1500" :customStyle="{ width: '170rpx', marginRight: '20rpx' }"></up-button>
<up-button type="info" v-if="props.isRecords === 'success'" @click="AcceptHandler('success')" shape="circle" text="问诊记录" throttleTime="1500" :customStyle="{ width: '170rpx', marginRight: '20rpx' }"></up-button>
<up-button color="#05B8D2" v-if="[20, '20'].includes(props.item?.orderState)" @click="AcceptHandler('err')" shape="circle" text="接诊" throttleTime="1500" :customStyle="{ width: '170rpx', marginRight: '20rpx' }"></up-button>
<up-button
color="#05B8D2"
v-if="[30, '30'].includes(props.item?.orderState) && [null, undefined, ''].includes(props.item?.orderId)"
... ... @@ -50,6 +51,7 @@
() => {
sendPrescriptionState = true
isOneP = 1
emit('editIsJumpHandler', 'err')
}
"
shape="circle"
... ... @@ -110,7 +112,7 @@
import { ref, getCurrentInstance, ComponentPublicInstance, onMounted } from 'vue'
import { storeToRefs } from 'pinia'
import { useOrderStore } from '@/store/order'
import { getPrescription_detail_information, getEndInformation, getReceive_diagnosis, getPrescription_detail, getPrescription_detail_information_renew } from '../../../api'
import { getPrescription_detail_information, getEndInformation, getReceive_diagnosis, getPrescription_detail, getPrescription_detail_information_renew, getOrder_chat } from '../../../api'
import { PrescriptionDetailType } from '../../../types'
import SendPrescription from '@/components/SendPrescription'
import ViewPrescription from '@/components/ViewPrescription'
... ... @@ -119,7 +121,7 @@ import { imlogin } from '../../../hooks/imLogin'
const { proxy } = getCurrentInstance() as { proxy: ComponentPublicInstance }
const emit = defineEmits(['showPrescription', 'fetchOrderListHandler'])
const emit = defineEmits(['showPrescription', 'fetchOrderListHandler', 'editIsJumpHandler'])
const orderStore = useOrderStore()
... ... @@ -132,13 +134,15 @@ interface IProps {
isRecord: boolean
bg: string
item: any
isRecords?: string
}
const props = withDefaults(defineProps<IProps>(), {
isPrescriptionDrug: false,
isRecord: false,
bg: '#fff',
item: {}
item: {},
isRecords: 'err'
})
const isOneP = ref<number>(0)
... ... @@ -157,6 +161,12 @@ onMounted(() => {
uapDiv.style.zIndex = (currentZIndex + 99999999).toString()
})
const getOrder_chatHandler = async () => {
// const { result } = await getOrder_chat({ id: props.item.userId })
// const data = result.records.map(item => ({ ...item, imContent: JSON.parse(item.imContent) }))
// console.log(data)
}
const showPrescriptionDetailHandler = async () => {
if (props.item?.isAgain == 1) {
getRenewDetailHandler()
... ... @@ -173,7 +183,9 @@ const closeSendPrescriptionHandler = () => {
emit('fetchOrderListHandler')
}
const AcceptHandler = async () => {
const AcceptHandler = async (historyFlag: string) => {
uni.setStorageSync('history', historyFlag)
await getReceive_diagnosis({ id: props.item.id })
uni.setStorageSync('inUserInfo', props.item?.user)
... ...
... ... @@ -10,7 +10,7 @@
<view class="text mb24">{{ PrescriptionDetail?.supplement || '病情描述' }}</view>
</template>
<template v-if="![null, undefined, ''].includes(PrescriptionDetail?.renewRemark) && ['success'].includes(props.isRenew)">
<view class="text mb24">问诊病情</view>
<view class="text mb24">续方原因</view>
<view class="text mb24">{{ PrescriptionDetail?.renewRemark }}</view>
</template>
<view class="text mb24">处方药:</view>
... ... @@ -45,7 +45,7 @@
<view class="text">运费</view>
<view class="blacktext">¥0</view>
</view> -->
<view class="flexJ mb24">
<view class="flexJ mb24" v-if="![null, undefined, '0', ''].includes(PrescriptionDetail?.pid)">
<view class="text">复诊时间</view>
<view class="graytext">{{ PrescriptionDetail?.createTime }}</view>
</view>
... ...
... ... @@ -20,9 +20,11 @@
<template v-for="_ in orderList">
<OrderCard
:isPrescriptionDrug="Boolean(orderState)"
:isRecords="Event?.isRecords"
:bg="Event?.isRecords === 'success' ? 'linear-gradient(188deg, #E0FFF4 5.54%, #FFF 24.89%)' : '#fff'"
:isRecord="false"
:item="_"
@editIsJumpHandler="e => (isJump = e)"
@fetchOrderListHandler="orderStore.getOrderListHandler(true, orderState, subOrderState)"
/>
</template>
... ... @@ -42,6 +44,7 @@ interface EventType {
orderState: string
subOrderState?: string
isRecords?: string
isJump?: string
}
const Event = ref<EventType>()
... ... @@ -52,6 +55,8 @@ const orderStore = useOrderStore()
const { orderStateList, orderState, subOrderState, page, orderList } = storeToRefs(orderStore)
const isJump = ref<string | undefined>('err')
const toggleOrderHandler = (item: any, index: number) => {
console.log(item, index)
... ... @@ -74,6 +79,8 @@ onLoad((e: EventType) => {
console.log(e)
Event.value = e
isJump.value = e.isJump
orderState.value = Number(e.orderState)
subOrderState.value = Number(e.subOrderState) || 0
... ... @@ -86,7 +93,7 @@ onShow(() => {
uni.$TUIKit.getUserStatus({ userIDList: [uni.getStorageSync('ImUserId')] }).catch(err => imlogin())
}, 800)
if (subOrderState.value == 2 && orderState.value == 0) return
if (subOrderState.value == 2 && orderState.value == 0 && isJump.value === 'err') return
orderStore.getOrderListHandler(true, orderState.value, subOrderState.value)
})
... ...
... ... @@ -91,6 +91,8 @@ const form = ref({
})
const AcceptHandler = async () => {
uni.setStorageSync('history', 'err')
await getReceive_diagnosis({ id: detailData.value?.id as string })
uni.setStorageSync('inUserInfo', detailData.value?.user)
... ...