|
@@ -7,21 +7,28 @@
|
|
refresher-enabled="true" :refresher-triggered="triggered" @refresherrefresh="getFresh">
|
|
refresher-enabled="true" :refresher-triggered="triggered" @refresherrefresh="getFresh">
|
|
<view class="list-scroll-view">
|
|
<view class="list-scroll-view">
|
|
<view class="block" v-for="(item,index) in list" :key="index">
|
|
<view class="block" v-for="(item,index) in list" :key="index">
|
|
|
|
+ <!-- 显示时间 -->
|
|
<view class="time" v-if="index == 0 || item.time - list[index-1].time >= 300000">
|
|
<view class="time" v-if="index == 0 || item.time - list[index-1].time >= 300000">
|
|
<text>{{formatDate(item.time)}}</text>
|
|
<text>{{formatDate(item.time)}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 判断是再左边显示还是右边显示 -->
|
|
<view class="list" :id="item.speaker._id != user._id ? 'left' : 'right'">
|
|
<view class="list" :id="item.speaker._id != user._id ? 'left' : 'right'">
|
|
|
|
+ <!-- 用户身份并且数据发送类型是护士的显示医生信息 -->
|
|
<image class="avatar" v-if="user.role=='Patient'&&item.speaker_type=='Nurse'"
|
|
<image class="avatar" v-if="user.role=='Patient'&&item.speaker_type=='Nurse'"
|
|
@tap="toInfo(doctorInfo,'0')"
|
|
@tap="toInfo(doctorInfo,'0')"
|
|
:src="doctorInfo.icon&&doctorInfo.icon.length>0?doctorInfo.icon[0].url:config.user_url[0].url"
|
|
:src="doctorInfo.icon&&doctorInfo.icon.length>0?doctorInfo.icon[0].url:config.user_url[0].url"
|
|
mode=""></image>
|
|
mode=""></image>
|
|
|
|
+ <!-- 否则正常显示 -->
|
|
<image class="avatar" v-else @tap="toInfo(item,'1')"
|
|
<image class="avatar" v-else @tap="toInfo(item,'1')"
|
|
:src="item.speaker&&item.speaker.icon.length>0?item.speaker.icon[0].url:config.user_url[0].url"
|
|
:src="item.speaker&&item.speaker.icon.length>0?item.speaker.icon[0].url:config.user_url[0].url"
|
|
mode=""></image>
|
|
mode=""></image>
|
|
|
|
+ <!-- 信息类型是文字 -->
|
|
<text class="record" v-if="item.type == 'text'">{{item.content}}</text>
|
|
<text class="record" v-if="item.type == 'text'">{{item.content}}</text>
|
|
|
|
+ <!-- 信息类型是图片 -->
|
|
<image :src="item.content" v-if="item.type == 'image'" @tap="onPreview(item.content)"
|
|
<image :src="item.content" v-if="item.type == 'image'" @tap="onPreview(item.content)"
|
|
mode="widthFix">
|
|
mode="widthFix">
|
|
</image>
|
|
</image>
|
|
|
|
+ <!-- 信息类型是语音 -->
|
|
<view class="record" v-if="item.type == 'record'" @tap="onPlay(item.content,index)">
|
|
<view class="record" v-if="item.type == 'record'" @tap="onPlay(item.content,index)">
|
|
<uni-icons v-if="item.speaker._id != user._id" custom-prefix="iconfont"
|
|
<uni-icons v-if="item.speaker._id != user._id" custom-prefix="iconfont"
|
|
type="icon-zuobofang" size="15" color="#333333">
|
|
type="icon-zuobofang" size="15" color="#333333">
|
|
@@ -37,6 +44,7 @@
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- 底部 -->
|
|
<view class="bottom">
|
|
<view class="bottom">
|
|
<submit_1 :record="record" :inrecord="inrecord" :isRecorder="isRecorder" @toSend="toSend" @heights="heights"
|
|
<submit_1 :record="record" :inrecord="inrecord" :isRecorder="isRecorder" @toSend="toSend" @heights="heights"
|
|
@onRecorderchange="onRecorderchange" @onStart="onStart" @onEnd="onEnd"></submit_1>
|
|
@onRecorderchange="onRecorderchange" @onStart="onStart" @onEnd="onEnd"></submit_1>
|
|
@@ -160,6 +168,7 @@
|
|
}
|
|
}
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
},
|
|
},
|
|
|
|
+ // 基本信息
|
|
searchConfig() {
|
|
searchConfig() {
|
|
const that = this;
|
|
const that = this;
|
|
try {
|
|
try {
|
|
@@ -167,6 +176,7 @@
|
|
if (res) that.$set(that, `config`, res);
|
|
if (res) that.$set(that, `config`, res);
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
},
|
|
},
|
|
|
|
+ // 查询聊天记录
|
|
async search() {
|
|
async search() {
|
|
const that = this;
|
|
const that = this;
|
|
// 聊天记录
|
|
// 聊天记录
|