消息类型
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
</u-tabs>
|
||||
<div class="top-search">
|
||||
<div class="left">
|
||||
<u-search v-model="keyword" :clearabled="true" placeholder="请输入昵称" :show-action="false" bg-color="#F5F5F5"
|
||||
<u-search v-model="keyword" :clearabled="true" :placeholder="currentTabs != 1 ? '请输入群名称' : '请输入昵称'" :show-action="false" bg-color="#F5F5F5"
|
||||
search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="getListInit">
|
||||
</u-search>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
<div class="conversation-list" v-if="list.length">
|
||||
<div v-for="(item, index) in list" :key="index">
|
||||
<div class="item" :class="item.userId == user.wxUserId ? 'item-right' : 'item-left'">
|
||||
|
||||
<!-- <img src="./img/fail-icon.png" alt="" class="fail-img" v-if="item.userId == user.wxUserId"> -->
|
||||
|
||||
<img :src="item.userAvatar" alt="" class="user-img" v-if="item.userId != user.wxUserId && item.userAvatar">
|
||||
<img src="./img/user-img.png" alt="" class="user-img" v-if="item.userId != user.wxUserId && !item.userAvatar">
|
||||
|
||||
@@ -71,8 +73,17 @@
|
||||
|
||||
<img :src="item.sdkFileUrl" alt="" v-if="item.msgType == 'emotion'" :style="[{width: item.width/2+'px'}, {height: item.height/2+'px'}]">
|
||||
|
||||
<div class="map-info" v-if="item.msgType == 'location'">
|
||||
<map style="width: 100%; height: 100%;" :latitude="item.lat" :longitude="item.lng" :scale="item.zoom"></map>
|
||||
<div class="address-text">
|
||||
<p>{{item.title}}</p>
|
||||
<p>{{item.address}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<img :src="item.userAvatar" alt="" class="user-img" v-if="item.userId == user.wxUserId">
|
||||
|
||||
<!-- <img src="./img/fail-icon.png" alt="" class="fail-img" v-if="item.userId != user.wxUserId"> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -202,6 +213,20 @@ export default {
|
||||
// item.amr = amr; //将初始化好的amr赋值到当前消息对象data中
|
||||
// }
|
||||
// })
|
||||
res.data.records.map((item) => {
|
||||
if(item.msgType == 'location') {
|
||||
item.covers = [{
|
||||
latitude: item.lat,
|
||||
longitude: item.lng,
|
||||
label: {
|
||||
content: item.address
|
||||
},
|
||||
callout: {
|
||||
content: item.title
|
||||
}
|
||||
}]
|
||||
}
|
||||
})
|
||||
this.list = this.current > 1 ? [ ...res.data.records, ...this.list]: res.data.records
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
@@ -437,6 +462,24 @@ export default {
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
.map-info {
|
||||
width: 560px;
|
||||
height: 400px;
|
||||
.address-text {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 560px;
|
||||
background-color: rgba(0, 0, 0, .7);
|
||||
p {
|
||||
color: #fff;
|
||||
line-height: 44px;
|
||||
font-size: 24px;
|
||||
padding-left: 32px;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.item-left {
|
||||
.content {
|
||||
|
||||
Reference in New Issue
Block a user