|
@@ -9,7 +9,7 @@
|
|
|
</swiper>
|
|
|
</view>
|
|
|
<view class="two" v-if="user.role!='Patient'">
|
|
|
- <uni-collapse accordion>
|
|
|
+ <uni-collapse>
|
|
|
<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
|
|
|
<view class="content" v-if="groupList.length>0">
|
|
|
<view class="two_1">
|
|
@@ -51,13 +51,13 @@
|
|
|
</view>
|
|
|
<view class="list" v-for="(item, index) in groupList" :key="index">
|
|
|
<uni-list-chat v-if="item.notRead==0" :title="item.name||''"
|
|
|
- :avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''" :time="item.doctor.name||''"
|
|
|
- link="navigateTo" @click="toInfo(item,'group')">
|
|
|
+ :avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''"
|
|
|
+ :time="item.doctor.name||''" link="navigateTo" @click="toInfo(item,'group')">
|
|
|
</uni-list-chat>
|
|
|
<uni-list-chat v-else :title="item.name||''"
|
|
|
- :avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''" :time="item.doctor.name||''"
|
|
|
- link="navigateTo" badge-positon="left" :badge-text="item.notRead||''"
|
|
|
- @click="toInfo(item,'group')">
|
|
|
+ :avatar="item.doctor.icon[0].url||config.logo_url[0].url" :note="item.content||''"
|
|
|
+ :time="item.doctor.name||''" link="navigateTo" badge-positon="left"
|
|
|
+ :badge-text="item.notRead||''" @click="toInfo(item,'group')">
|
|
|
</uni-list-chat>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -78,9 +78,7 @@
|
|
|
// 群组
|
|
|
groupList: [],
|
|
|
// 好友
|
|
|
- friendList: [{
|
|
|
- id: '1'
|
|
|
- }]
|
|
|
+ friendList: []
|
|
|
}
|
|
|
},
|
|
|
onShow: async function() {
|
|
@@ -141,10 +139,11 @@
|
|
|
if (res.errcode == '0') {
|
|
|
// 处理显示数据
|
|
|
for (let val of res.data) {
|
|
|
- if (val.chat.type == 'image') val.content = '[图片]'
|
|
|
- if (val.chat.type == 'record') val.content = '[语音]'
|
|
|
- else val.content = val.chat.content
|
|
|
- val.time = that.formatDate(val.time)
|
|
|
+ if (val.chat) {
|
|
|
+ if (val.chat.type == 'image') val.content = '[图片]'
|
|
|
+ if (val.chat.type == 'record') val.content = '[语音]'
|
|
|
+ else val.content = val.chat.content
|
|
|
+ }
|
|
|
}
|
|
|
that.$set(that, `groupList`, res.data)
|
|
|
} else {
|
|
@@ -217,13 +216,6 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // // 病人直接聊天
|
|
|
- // toChat(item) {
|
|
|
- // const that = this;
|
|
|
- // uni.navigateTo({
|
|
|
- // url: `/pagesHome/friend/index?patientId=${that.user._id}&doctorId=${item.doctor._id}&groupId=${item._id}&title=${item.doctor.name}`
|
|
|
- // })
|
|
|
- // },
|
|
|
// 详情
|
|
|
toInfo(item, type) {
|
|
|
if (type == 'group') {
|