发送消息的回执请求完善
This commit is contained in:
@@ -132,7 +132,8 @@
|
|||||||
break;
|
break;
|
||||||
case 'location':
|
case 'location':
|
||||||
uni.chooseLocation({
|
uni.chooseLocation({
|
||||||
success: (location) => {
|
success: (location) => {
|
||||||
|
console.log(location);
|
||||||
im.sentLocation(this.conversationType, this.targetId, location).then(() => {
|
im.sentLocation(this.conversationType, this.targetId, location).then(() => {
|
||||||
this.success()
|
this.success()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
<view class="">
|
<view class="">
|
||||||
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
||||||
<view class="location" :class="isRemote ? 'left': 'right'" @click="showLocation">
|
<view class="location" :class="isRemote ? 'left': 'right'" @click="showLocation">
|
||||||
{{ content.customFields.name }}
|
<view class="location--name">
|
||||||
{{ content.customFields.thumbnail }}
|
{{ content.customFields.name }}
|
||||||
<!-- 缩略图,在考虑是否要通过截图后自动截屏来操作 -->
|
{{ content.customFields.address }}
|
||||||
|
</view>
|
||||||
|
<image class="map" :src="content.customFields.thumbnail" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -48,8 +50,16 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showLocation() {
|
showLocation() {
|
||||||
console.log(this.content.customFields.longitude, this.content.customFields.latitude)
|
uni.openLocation({
|
||||||
|
latitude: Number(this.content.customFields.latitude),
|
||||||
|
longitude: Number(this.content.customFields.longitude),
|
||||||
|
fail: (err) => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '打开地图失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,20 +76,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.location {
|
.location {
|
||||||
.image {
|
position: relative;
|
||||||
width: 180rpx;
|
width: 400rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
padding: 10rpx;
|
||||||
|
|
||||||
|
.location--name {
|
||||||
|
overflow: hidden;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map {
|
||||||
|
width: 400rpx;
|
||||||
|
height: 200rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.left {
|
&.left {
|
||||||
.image {
|
border-radius: 0 10rpx 10rpx 10rpx;
|
||||||
border-radius: 0 10rpx 10rpx 10rpx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.right {
|
&.right {
|
||||||
.image {
|
border-radius: 10rpx 0 10rpx 10rpx;
|
||||||
border-radius: 10rpx 0 10rpx 10rpx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,13 +136,18 @@ const sentVoice = (conversationType, targetId, voiceUrl, time) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
RongIMLib.sendMediaMessage(msg, {
|
RongIMLib.sendMediaMessage(msg, {
|
||||||
success: (messageId) => {
|
success: (messageId) => {
|
||||||
resolve(messageId);
|
if (conversationType == 3) {
|
||||||
|
RongIMLib.sendReadReceiptRequest(messageId, (res) => {
|
||||||
|
console.log('发送回执请求', res);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
resolve(messageId)
|
||||||
},
|
},
|
||||||
progress: (progress, messageId) => {},
|
progress: (progress, messageId) => {},
|
||||||
cancel: (messageId) => {},
|
cancel: (messageId) => {},
|
||||||
error: (errorCode, messageId) => {
|
error: (errorCode, messageId) => {
|
||||||
reject(errorCode);
|
reject(errorCode)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -164,7 +169,12 @@ const sentImage = (conversationType, targetId, imageUrl) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
RongIMLib.sendMediaMessage(msg, {
|
RongIMLib.sendMediaMessage(msg, {
|
||||||
success: (messageId) => {
|
success: (messageId) => {
|
||||||
|
if (conversationType == 3) {
|
||||||
|
RongIMLib.sendReadReceiptRequest(messageId, (res) => {
|
||||||
|
console.log('发送回执请求', res);
|
||||||
|
})
|
||||||
|
}
|
||||||
resolve(messageId)
|
resolve(messageId)
|
||||||
},
|
},
|
||||||
progress: (progress, messageId) => {},
|
progress: (progress, messageId) => {},
|
||||||
@@ -190,10 +200,13 @@ const sentFile = (conversationType, targetId, fileUrl) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('发送文件', msg);
|
|
||||||
|
|
||||||
RongIMLib.sendMediaMessage(msg, {
|
RongIMLib.sendMediaMessage(msg, {
|
||||||
success: (messageId) => {
|
success: (messageId) => {
|
||||||
|
if (conversationType == 3) {
|
||||||
|
RongIMLib.sendReadReceiptRequest(messageId, (res) => {
|
||||||
|
console.log('发送回执请求', res);
|
||||||
|
})
|
||||||
|
}
|
||||||
resolve(messageId)
|
resolve(messageId)
|
||||||
},
|
},
|
||||||
progress: (progress, messageId) => {},
|
progress: (progress, messageId) => {},
|
||||||
@@ -216,7 +229,8 @@ const sentLocation = (conversationType, targetId, location) => {
|
|||||||
customType: 2,
|
customType: 2,
|
||||||
objectName: 'RC:LBSMsg',
|
objectName: 'RC:LBSMsg',
|
||||||
customFields: {
|
customFields: {
|
||||||
name: location.name,
|
name: location.name,
|
||||||
|
address: location.address,
|
||||||
latitude: Number(location.latitude),
|
latitude: Number(location.latitude),
|
||||||
longitude: Number(location.longitude),
|
longitude: Number(location.longitude),
|
||||||
thumbnail: ''
|
thumbnail: ''
|
||||||
|
|||||||
Reference in New Issue
Block a user