fix: 修复了一些东西,新增了方法
This commit is contained in:
5
.idea/inspectionProfiles/Project_Default.xml
generated
5
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -14,7 +14,7 @@
|
||||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="7">
|
||||
<list size="10">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
@@ -22,6 +22,9 @@
|
||||
<item index="4" class="java.lang.String" itemvalue="embed" />
|
||||
<item index="5" class="java.lang.String" itemvalue="script" />
|
||||
<item index="6" class="java.lang.String" itemvalue="u-swiper" />
|
||||
<item index="7" class="java.lang.String" itemvalue="u-radio-group" />
|
||||
<item index="8" class="java.lang.String" itemvalue="u-radio" />
|
||||
<item index="9" class="java.lang.String" itemvalue="u-icon" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
|
||||
@@ -77,18 +77,18 @@
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
},
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于获取附近服务"
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "你的位置信息将用于获取附近服务"
|
||||
},
|
||||
"scope.record": {
|
||||
"desc": "需要录音功能发送语音消息"
|
||||
"scope.record" : {
|
||||
"desc" : "需要录音功能发送语音消息"
|
||||
},
|
||||
"scope.camera": {
|
||||
"desc": "需要摄像头拍照和视频通话"
|
||||
"scope.camera" : {
|
||||
"desc" : "需要摄像头拍照和视频通话"
|
||||
},
|
||||
"scope.writePhotosAlbum": {
|
||||
"desc": "需要访问您的相册以选择图片"
|
||||
"scope.writePhotosAlbum" : {
|
||||
"desc" : "需要访问您的相册以选择图片"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -105,5 +105,5 @@
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "2",
|
||||
"sassImplementationName": "node-sass"
|
||||
"sassImplementationName" : "node-sass"
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<image src="../../static/home/bg1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="nav_service_title">
|
||||
到店挂号
|
||||
挂号咨询
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -64,55 +64,49 @@
|
||||
</view>
|
||||
|
||||
<!-- 医生列表 -->
|
||||
<view class="">
|
||||
<view class="list" @click="goLookDoctor(item.id)" v-for="(item,index) in doctorList" :key="item.id">
|
||||
<!-- 图片部分 -->
|
||||
<view class="list_info">
|
||||
<view class="list_left">
|
||||
<image :src="item.avatar || '/static/mine/avatar_1.png'" mode="医生头像"></image>
|
||||
<!-- 医生 -->
|
||||
<view class="list_title">
|
||||
<view class="titles_name">
|
||||
<text class="doctor_name">{{item.name}}</text>
|
||||
<text class="doctors">{{item.title}}</text>
|
||||
</view>
|
||||
<!-- 职称 -->
|
||||
<view class="list_yard">
|
||||
{{item.store}} {{item.depart}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="doctor-card" @click="goLookDoctor(item.id)" v-for="(item,index) in doctorList" :key="item.id">
|
||||
<view class="card-content">
|
||||
<!-- 医生头像 -->
|
||||
<image :src="item.avatar || '/static/mine/avatar_1.png'" mode="aspectFill" class="doctor-avatar"></image>
|
||||
|
||||
<!-- <view class="list_right" @click="goLookDoctor(item.id)">咨询</view> -->
|
||||
</view>
|
||||
<!-- 文字部分 -->
|
||||
<view class="card">
|
||||
<!-- 擅长 -->
|
||||
<view class="list_going">
|
||||
擅长:{{item.good_at}}
|
||||
</view>
|
||||
<!-- 医生信息 -->
|
||||
<view class="doctor-info">
|
||||
<!-- 姓名和职称 -->
|
||||
<view class="name-section">
|
||||
<text class="doctor-name">{{item.name}}</text>
|
||||
<view class="title-badge">{{item.title}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 接诊率 -->
|
||||
<view class="list_nums">
|
||||
<view class="txt">问诊量 <text>{{item.inquiry_num }}</text></view>
|
||||
<view class="txt">接诊率 <text>{{item.accept_percent}}</text></view>
|
||||
<!-- <view class="txt">综合评分 <text>{{item.overall_score}}</text></view> -->
|
||||
</view>
|
||||
<!-- 科室和医院 -->
|
||||
<view class="department-section">
|
||||
<text class="iconfont icon-location"></text>
|
||||
<text class="department">{{item.depart}} | {{item.store}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 擅长领域 -->
|
||||
<view class="expertise">
|
||||
<text class="expertise-label">擅长:</text>
|
||||
<text class="expertise-content">{{item.good_at}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 价格 -->
|
||||
<!-- <view class="list_price">
|
||||
<view class="picture">
|
||||
<text>{{item.service.image_price || '图文¥20'}}</text>
|
||||
</view>
|
||||
<view class="picture">
|
||||
<text>{{item.service.video_price || '视频¥95'}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 统计信息 -->
|
||||
<view class="stats">
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{item.inquiry_num}}</text>
|
||||
<text class="stat-label">问诊量</text>
|
||||
</view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{item.accept_percent}}</text>
|
||||
<text class="stat-label">接诊率</text>
|
||||
</view>
|
||||
<view class="consult-btn">
|
||||
<text class="iconfont icon-consult"></text>
|
||||
咨询
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 遮罩层 -->
|
||||
@@ -165,9 +159,11 @@
|
||||
}
|
||||
this.isShow_envVersion = uni.getStorageSync('isShow_envVersion')
|
||||
if (this.isShow_envVersion === false) {
|
||||
if (this.doctorList.length === 0) {
|
||||
this.getList();
|
||||
}
|
||||
|
||||
this.getList();
|
||||
// if (this.doctorList.length === 0) {
|
||||
// this.getList();
|
||||
// }
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -418,19 +414,18 @@
|
||||
|
||||
// 医生列表
|
||||
getList() {
|
||||
if (this.doctorList?.length <= 0) {
|
||||
doctorList({
|
||||
method: "post",
|
||||
data: {
|
||||
store_id: uni.getStorageSync('stores_id') || uni.getStorageSync('store_id') || '11001',
|
||||
}
|
||||
}).then((res) => {
|
||||
// console.log(res, 'list');
|
||||
if (res.data.errcode === 0) {
|
||||
this.doctorList = (res.data.data.list).slice(0, 3)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.doctorList = [];
|
||||
doctorList({
|
||||
method: "post",
|
||||
data: {
|
||||
store_id: uni.getStorageSync('stores_id') || uni.getStorageSync('store_id') || '11001',
|
||||
}
|
||||
}).then((res) => {
|
||||
// console.log(res, 'list');
|
||||
if (res.data.errcode === 0) {
|
||||
this.doctorList = (res.data.data.list).slice(0, 3)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 切换门店
|
||||
@@ -444,6 +439,7 @@
|
||||
}).then((res) => {
|
||||
if (res.data.errcode == 0) {
|
||||
this.getStore()
|
||||
this.getList();
|
||||
uni.showToast({
|
||||
title: '切换成功',
|
||||
duration: 2000,
|
||||
@@ -510,6 +506,7 @@
|
||||
onShow() {
|
||||
this.infoList = ""
|
||||
this.goNewlist()
|
||||
this.getList();
|
||||
},
|
||||
// onUnload() {
|
||||
|
||||
@@ -668,195 +665,153 @@
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 710rpx;
|
||||
background: linear-gradient(180deg, #E2F1FF 0%, #FBFDFF 54%, #FFFFFF 100%);
|
||||
border-radius: 24rpx;
|
||||
padding: 12rpx 30rpx 22rpx;
|
||||
margin: 32rpx auto 52rpx;
|
||||
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.08);
|
||||
/* 医生卡片样式 */
|
||||
.doctor-card {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(65, 117, 238, 0.08);
|
||||
margin-bottom: 24rpx;
|
||||
overflow: hidden;
|
||||
transition: all 0.25s ease;
|
||||
|
||||
.list_info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
&:active {
|
||||
transform: translateY(2rpx);
|
||||
box-shadow: 0 2rpx 6rpx rgba(65, 117, 238, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.list_left {
|
||||
height: 96rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
.card-content {
|
||||
display: flex;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
margin: 0 16rpx 0 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.doctor-avatar {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #f0f5ff;
|
||||
flex-shrink: 0;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.list_title {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.doctor-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.titles_name {
|
||||
margin: 16rpx 0;
|
||||
.name-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.doctor_name {
|
||||
height: 40rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #232323;
|
||||
line-height: 40rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.doctor-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #232323;
|
||||
margin-right: 16rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.doctors {
|
||||
height: 40rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #232323;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
.title-badge {
|
||||
font-size: 22rpx;
|
||||
color: #4175EE;
|
||||
background: #eef4ff;
|
||||
border-radius: 8rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.list_yard {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
.department-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.list_right {
|
||||
width: 88rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
text-align: center;
|
||||
background: #4175EE;
|
||||
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
.iconfont {
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.department {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
.expertise {
|
||||
display: flex;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.list_nums {
|
||||
height: 34rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
margin: 18rpx 0 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.expertise-label {
|
||||
color: #666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.txt {
|
||||
margin-right: 30rpx;
|
||||
.expertise-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #FEA54C;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.stats {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 12rpx;
|
||||
border-top: 1rpx dashed #e0e7ff;
|
||||
}
|
||||
|
||||
.list_going {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #232323;
|
||||
line-height: 44rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
margin: 16rpx auto;
|
||||
}
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.list_price {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.stat-value {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #4175EE;
|
||||
display: block;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.picture {
|
||||
width: 140rpx;
|
||||
height: 60rpx;
|
||||
line-height: 58rpx;
|
||||
text-align: center;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
border: 2rpx solid #4175EE;
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #4175EE;
|
||||
margin: 0 30rpx 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.stat-label {
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.list_lefts {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin: 32rpx 12rpx;
|
||||
.consult-btn {
|
||||
background: #4175EE;
|
||||
color: white;
|
||||
border-radius: 40rpx;
|
||||
padding: 10rpx 24rpx;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.iconfont {
|
||||
font-size: 24rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.its {
|
||||
width: 450rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
|
||||
.it_names {
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #232323;
|
||||
}
|
||||
|
||||
.it_infos {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
margin: 12rpx 0 34rpx 0;
|
||||
}
|
||||
|
||||
.it_prices {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #232323;
|
||||
}
|
||||
|
||||
.nums {
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #232323;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&:active {
|
||||
background: #3366d1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.lists {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<image src="../../static/home/bg1.png" mode=""></image>
|
||||
</view>
|
||||
<view class="nav_service_title">
|
||||
到店挂号
|
||||
挂号咨询
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -82,31 +82,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 在线问诊-->
|
||||
<view class="list" @click="goChat">
|
||||
<!-- 头像 -->
|
||||
<view class="avator">
|
||||
<view class="img">
|
||||
<image src="/static/xx/ysxx.png" mode=""></image>
|
||||
</view>
|
||||
<u-badge size="default" v-if="doctor.num>=0" :count="doctor.num" :is-dot="doctor.num==0?true:false"
|
||||
type="error" :offset="doctor.num>0?[-4,-8]:[0,0]"></u-badge>
|
||||
</view>
|
||||
<!-- 描述 -->
|
||||
<view class="info">
|
||||
<view class="infos_title">
|
||||
<text class="infos">在线问诊</text>
|
||||
<text class="time">{{ doctor.time }}</text>
|
||||
</view>
|
||||
<view class="preview" v-if="doctor.num>0">
|
||||
您有{{ doctor.num }}条新的消息
|
||||
</view>
|
||||
<view class="preview" v-if="doctor.num==undefined">
|
||||
暂无新消息
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 模拟<u-divider>在线问诊</u-divider>效果-->
|
||||
|
||||
<!-- 标题 -->
|
||||
|
||||
@@ -26,6 +26,15 @@ export async function getMessagesByRoomIdApi(params) {
|
||||
return await post('/chat-friends/messages-by-room-id', params, 3)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建房间 - 根据医生id
|
||||
* @param params
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function createRoomByDoctorIdApi(params) {
|
||||
return await post('/chat-friends/create-room-by-doctor-id', params, 3)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取聊天好友列表
|
||||
* @param params
|
||||
@@ -34,6 +43,14 @@ export async function getMessagesByRoomIdApi(params) {
|
||||
export async function getChatFriendsListApi(params) {
|
||||
return await get('/chat-friends/list', params, 3)
|
||||
}
|
||||
/**
|
||||
* 获取聊天注册信息
|
||||
* @param params
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getChatRegisterInfoApi(params) {
|
||||
return await get('/chat-friends/chat-register-info', params, 3)
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传聊天文件
|
||||
|
||||
@@ -18,18 +18,20 @@ const sensitiveData = [
|
||||
'idcard'
|
||||
]
|
||||
|
||||
const isDev = true;
|
||||
|
||||
function request(url, params, method = 0) {
|
||||
// let baseURL = "https://app.xiaokang88.com/member"
|
||||
let baseURL = "http://127.0.0.1:18000/member"
|
||||
let baseURL = isDev === true? 'http://127.0.0.1:18000/member': "https://app.xiaokang88.com/member"
|
||||
// let baseURL = "http://127.0.0.1:18000/member"
|
||||
if (url.split('/').indexOf('imApi') !== -1) {
|
||||
baseURL = "http://127.0.0.1:12080/api"
|
||||
}
|
||||
if (url.split('/').indexOf('newApi') !== -1) {
|
||||
baseURL = "https://shop.xiaokang88.com/member"
|
||||
baseURL = isDev === true? 'https://shop.xiaokang88.com/member': "https://shop.xiaokang88.com/member"
|
||||
}
|
||||
if (url.split('/').indexOf('xkApi') !== -1) {
|
||||
// baseURL = "https://api.xiaokang88.com/member"
|
||||
baseURL = "http://127.0.0.1:18001/api/mobile"
|
||||
baseURL = isDev === true? 'http://127.0.0.1:18001/api/mobile': "https://api.xiaokang88.com/api/mobile"
|
||||
// baseURL = "http://127.0.0.1:18001/api/mobile"
|
||||
}
|
||||
url = url.replace('/oldApi', '');
|
||||
url = url.replace('/newApi', '');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {getMessagesByRoomIdApi} from "@/request/api/im";
|
||||
import {getChatRegisterInfoApi, getMessagesByRoomIdApi} from "@/request/api/im";
|
||||
|
||||
/**
|
||||
* 聊天消息管理器
|
||||
@@ -112,21 +112,28 @@ const ChatManager = {
|
||||
sender: message.sender_user_id,
|
||||
type: this.getMessageType(message.message_type),
|
||||
// type: message.type,
|
||||
content: message.message_type === 4 ? JSON.parse(message.content) : message.content,
|
||||
content:
|
||||
item.message_type === 4 || item.message_type === 10
|
||||
? JSON.parse(item.message_content)
|
||||
: item.message_content,
|
||||
duration: message.duration,
|
||||
time: this.formatTime(message.send_time),
|
||||
timestamp: message.send_time
|
||||
};
|
||||
}
|
||||
return message.map(item => {
|
||||
return message.map((item, index) => {
|
||||
let msg = item.message_type === 4 || item.message_type === 10
|
||||
? JSON.parse(item.message_content)
|
||||
: item.message_content;
|
||||
|
||||
if (item.message_type === 10) {
|
||||
this.getChatRegisterInfo(msg, index)
|
||||
}
|
||||
return {
|
||||
id: item.id,
|
||||
sender: item.sender_user_id,
|
||||
type: this.getMessageType(item.message_type),
|
||||
content:
|
||||
item.message_type === 4
|
||||
? JSON.parse(item.message_content)
|
||||
: item.message_content,
|
||||
content: msg,
|
||||
duration: item.duration,
|
||||
time: item?.created_at_text || item.send_time,
|
||||
timestamp: item?.created_at || item.send_time
|
||||
@@ -142,11 +149,33 @@ const ChatManager = {
|
||||
2: 'audio',
|
||||
3: 'video',
|
||||
4: 'prescription',
|
||||
5: 'file'
|
||||
5: 'file',
|
||||
10: 'register',
|
||||
};
|
||||
return types[typeId];
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取挂号信息卡片
|
||||
* @param item
|
||||
* @param index
|
||||
* @returns {*}
|
||||
*/
|
||||
getChatRegisterInfo(item, index) {
|
||||
let that = this;
|
||||
getChatRegisterInfoApi({
|
||||
id: item.id
|
||||
}).then((res) => {
|
||||
console.log(that.roomMessages, 'ssssssssssss1')
|
||||
console.log(that.currentRoomId, 'ssssssssssss2')
|
||||
console.log(index, 'ssssssssssss3')
|
||||
console.log(that.roomMessages[that.currentRoomId][index], 'ssssssssssss4')
|
||||
that.roomMessages[that.currentRoomId][index].content = res.data.result;
|
||||
console.log('getChatRegisterInfo', that.roomMessages[that.currentRoomId][index].content)
|
||||
// return res.data.result
|
||||
})
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
formatTime(timestamp) {
|
||||
let date;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -155,26 +155,26 @@
|
||||
<view class="info">
|
||||
<text>医师</text>
|
||||
<!-- <text class="name">{{infoList.doctor.name || ''}}</text> -->
|
||||
<image :src="'data:image/jpeg;base64,'+data.doctor_sign_image" mode="aspectFit"></image>
|
||||
<image v-if="data.doctor_second_sign == 1" :src="'data:image/jpeg;base64,'+data.doctor_sign_image" mode="aspectFit"></image>
|
||||
<image :src="checkImageUrl(data.doctor_sign_image)" mode="aspectFit"></image>
|
||||
<image v-if="data.doctor_second_sign == 1" :src="checkImageUrl(data.doctor_sign_image)" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>审核药师</text>
|
||||
<image :src="'data:image/jpeg;base64,'+data.Pharmacist_sign_image" mode="aspectFit"></image>
|
||||
<image :src="checkImageUrl(data.Pharmacist_sign_image)" mode="aspectFit"></image>
|
||||
<!-- <text class="name">{{rpList.name || ' '}}</text> -->
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>发药人</text>
|
||||
<!-- <text class="name">{{rpList.name || ' '}}</text> -->
|
||||
<image :src="'data:image/jpeg;base64,'+data.Pharmacist_sign_image" mode="aspectFit"></image>
|
||||
<image :src="checkImageUrl(data.Pharmacist_sign_image)" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>核对人</text>
|
||||
<image :src="'data:image/jpeg;base64,'+data.Pharmacist_sign_image" mode="aspectFit"></image>
|
||||
<image :src="checkImageUrl(data.Pharmacist_sign_image)" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>调配人</text>
|
||||
<image :src="'data:image/jpeg;base64,'+data.Pharmacist_sign_image" mode="aspectFit"></image>
|
||||
<image :src="checkImageUrl(data.Pharmacist_sign_image)" mode="aspectFit"></image>
|
||||
</view>
|
||||
<!-- <view class="info">
|
||||
<text>复审药师</text>
|
||||
@@ -292,6 +292,7 @@
|
||||
getPrescriptInfo,
|
||||
getUseWay
|
||||
} from '../../request/api/api'
|
||||
import { checkImageUrl } from '../../utils/utils'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -328,6 +329,7 @@
|
||||
this.no = e.no
|
||||
},
|
||||
methods: {
|
||||
checkImageUrl,
|
||||
// 数量
|
||||
getnum(obj) {
|
||||
let list = obj
|
||||
|
||||
@@ -103,7 +103,8 @@
|
||||
duration: 2000,
|
||||
icon: "success"
|
||||
});
|
||||
uni.removeStorageSync('stores_id')
|
||||
uni.setStorageSync('store_id', e)
|
||||
// uni.removeStorageSync('stores_id')
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/home/home'
|
||||
|
||||
@@ -54,6 +54,14 @@
|
||||
{{registList.price}}元
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="aapoint">
|
||||
挂号类型
|
||||
</view>
|
||||
<view class="detail">
|
||||
{{registerType}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 就诊人 -->
|
||||
@@ -127,6 +135,7 @@
|
||||
registePay,
|
||||
service
|
||||
} from '../../request/api/api';
|
||||
import {createRoomByDoctorIdApi, sendToUserApi} from "@/request/api/im";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -136,29 +145,43 @@
|
||||
check: false
|
||||
},
|
||||
register_id: "",
|
||||
currentUserId: "",
|
||||
currentDoctorId: "",
|
||||
registList: [],
|
||||
content: `预约挂号须知`,
|
||||
flag: true
|
||||
flag: true,
|
||||
registerType: '线下就诊',
|
||||
registerMap: {
|
||||
0: '线下就诊',
|
||||
1: '线上咨询'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
// console.log(e, 'role');
|
||||
this.register_id = e.id
|
||||
this.currentUserId = 'user-' + uni.getStorageSync('user_id') || 'user-2512';
|
||||
this.currentDoctorId = 'doctor-' + e.doctor_id;
|
||||
// if (this.currentDoctorId == null) {
|
||||
//
|
||||
// }
|
||||
uni.setStorageSync('register_id', this.register_id)
|
||||
},
|
||||
methods: {
|
||||
// 挂号信息
|
||||
getInfo() {
|
||||
let that = this;
|
||||
registeInfo({
|
||||
method: "post",
|
||||
data: {
|
||||
store_id: uni.getStorageSync('store_id') || '11001',
|
||||
register_id: this.register_id
|
||||
register_id: that.register_id
|
||||
}
|
||||
}).then((res) => {
|
||||
// console.log(res, 'gh');
|
||||
if (res.data.errcode == 0) {
|
||||
this.registList = res.data.data.list[0]
|
||||
that.registList = res.data.data.list[0]
|
||||
that.registerType = that.registerMap[that.registList.register_type];
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -180,6 +203,22 @@
|
||||
title: "加载中"
|
||||
});
|
||||
|
||||
|
||||
createRoomByDoctorIdApi({
|
||||
doctor_id: that.currentDoctorId
|
||||
}).then(result => {
|
||||
sendToUserApi({
|
||||
room_id: result.data.result.room_id,
|
||||
sender_user_id: that.currentUserId,
|
||||
receiver_user_id: that.currentDoctorId,
|
||||
message_type: 10,
|
||||
message_content: JSON.stringify({
|
||||
id: that.register_id,
|
||||
}),
|
||||
duration: 0
|
||||
})
|
||||
})
|
||||
|
||||
if (res.data.data.is_paid == 1) {
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
@@ -203,6 +242,7 @@
|
||||
// console.log('success:' + JSON.stringify(res));
|
||||
setTimeout(() => {
|
||||
that.flag = false
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/subPackages/register/register-success?id=' +
|
||||
this.register_id
|
||||
|
||||
4
utils/utils.js
Normal file
4
utils/utils.js
Normal file
@@ -0,0 +1,4 @@
|
||||
export function checkImageUrl(url) {
|
||||
// 如果url包含http,则返回url,反之加上 data:image/jpeg;base64,
|
||||
return url.includes('http') ? url : 'data:image/jpeg;base64,' + url
|
||||
};
|
||||
@@ -104,10 +104,14 @@ export class WebSocketManager {
|
||||
}
|
||||
}
|
||||
|
||||
handleMessage(data) {
|
||||
// 如果对象中有clientId则给websocket发送
|
||||
if (data.clientId) {
|
||||
const userId = uni.getStorageSync('user_id'); // 实际项目中从存储获取
|
||||
getUserIdAndBindClientId() {
|
||||
const userId = uni.getStorageSync('user_id'); // 实际项目中从存储获取
|
||||
if (userId == null || userId === 'user-' || userId === '') {
|
||||
// 等待10秒后获取
|
||||
setTimeout(() => {
|
||||
this.getUserIdAndBindClientId();
|
||||
}, 10000)
|
||||
} else {
|
||||
const bindMessage = {
|
||||
request_type: 'bind',
|
||||
user_type: 'user',
|
||||
@@ -115,6 +119,28 @@ export class WebSocketManager {
|
||||
};
|
||||
this.send(bindMessage);
|
||||
}
|
||||
return userId;
|
||||
}
|
||||
|
||||
handleMessage(data) {
|
||||
// 如果对象中有clientId则给websocket发送
|
||||
if (data.clientId) {
|
||||
|
||||
this.getUserIdAndBindClientId(data.clientId);
|
||||
// const userId = uni.getStorageSync('user_id'); // 实际项目中从存储获取
|
||||
// if (userId == null) {
|
||||
// setTimeout(() => {
|
||||
// }, 10000)
|
||||
// } else {
|
||||
// const bindMessage = {
|
||||
// request_type: 'bind',
|
||||
// user_type: 'user',
|
||||
// sender_user_id: `user-${userId}`,
|
||||
// };
|
||||
// this.send(bindMessage);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// 处理聊天消息
|
||||
if (data.message_type !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user