update 个人信息修改
This commit is contained in:
parent
67fa5bbcca
commit
0e41ae5428
@ -96,8 +96,7 @@ export default {
|
|||||||
resolve({statusCode, ...data})
|
resolve({statusCode, ...data})
|
||||||
} else if (data.code === 1) {
|
} else if (data.code === 1) {
|
||||||
// resolve({statusCode, ...data})
|
// resolve({statusCode, ...data})
|
||||||
console.error(data.message)
|
reject(new Error(`error ${data.message}`))
|
||||||
// console.log(this.$app.$options.globalData)
|
|
||||||
if (this.$is == 'pages/service/GroupChatPage' && data.message.includes('已断开连接')) {
|
if (this.$is == 'pages/service/GroupChatPage' && data.message.includes('已断开连接')) {
|
||||||
let vm = this
|
let vm = this
|
||||||
wx.showModal({ // 使用模态框提示用户进行操作
|
wx.showModal({ // 使用模态框提示用户进行操作
|
||||||
|
|||||||
@ -327,7 +327,7 @@ wepy.page({
|
|||||||
mixins: [https, base],
|
mixins: [https, base],
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
id: '',
|
id: 0,
|
||||||
title: '',
|
title: '',
|
||||||
hot: 0,
|
hot: 0,
|
||||||
value: '',
|
value: '',
|
||||||
@ -345,11 +345,11 @@ wepy.page({
|
|||||||
saveIssue() {
|
saveIssue() {
|
||||||
let vm = this
|
let vm = this
|
||||||
let data = {
|
let data = {
|
||||||
topic_id: vm.id,
|
topic_id: vm.id * 1,
|
||||||
content: vm.value,
|
content: vm.value,
|
||||||
photos: vm.imgList,
|
photos: vm.imgList,
|
||||||
address: vm.address,
|
address: vm.address,
|
||||||
is_hot: vm.hot
|
is_hot: vm.hot * 1
|
||||||
}
|
}
|
||||||
if (vm.throttle) {
|
if (vm.throttle) {
|
||||||
vm.throttle = false
|
vm.throttle = false
|
||||||
|
|||||||
@ -612,7 +612,7 @@ page {
|
|||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="userInfo.base_profile.type == 'single' && userInfo.base_profile.id && userInfo.base_profile.self != 1">
|
<block v-if="userInfo.base_profile.type == 'single' && userInfo.base_profile.id && userInfo.other_info.is_self != 1">
|
||||||
<!-- 隐身访问 -->
|
<!-- 隐身访问 -->
|
||||||
<view class="boxStyleList f-fcc f-fdc ui-pt-30 ui-pb-30" @tap="hiddenChange">
|
<view class="boxStyleList f-fcc f-fdc ui-pt-30 ui-pb-30" @tap="hiddenChange">
|
||||||
<view class="font_32 color-theme">想要隐身访问Ta?</view>
|
<view class="font_32 color-theme">想要隐身访问Ta?</view>
|
||||||
@ -620,9 +620,9 @@ page {
|
|||||||
<view class="u_box_bu font_28">开启隐身访问</view>
|
<view class="u_box_bu font_28">开启隐身访问</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block v-if="userInfo.base_profile.id && userInfo.base_profile.self != 1">
|
<block v-if="userInfo.base_profile.id && userInfo.other_info.is_self != 1">
|
||||||
<view class="boxStyleList">
|
<view class="boxStyleList">
|
||||||
<view class="_item border text-center recommend" v-if="userInfo.base_profile.is_friend == 1" @tap="deletefriend">
|
<view class="_item border text-center recommend" v-if="userInfo.other_info.is_friend == 1" @tap="deletefriend">
|
||||||
<image src="https://images.ufutx.com/202103/11/0f148a7763958c65dac1a5ce929163dc.png" mode="aspectFit" class="icon"></image>
|
<image src="https://images.ufutx.com/202103/11/0f148a7763958c65dac1a5ce929163dc.png" mode="aspectFit" class="icon"></image>
|
||||||
取消{{userInfo.base_profile.sex == 1?'他':'她'}}为好友
|
取消{{userInfo.base_profile.sex == 1?'他':'她'}}为好友
|
||||||
</view>
|
</view>
|
||||||
@ -638,7 +638,7 @@ page {
|
|||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="userInfo.base_profile.self != 1">
|
<block v-if="userInfo.other_info.is_self != 1">
|
||||||
<view class="ui-bottom-operation">
|
<view class="ui-bottom-operation">
|
||||||
<image class="ui-mask-icon" src="https://image.fulllinkai.com/202407/30/dca7024d347433e1aa893ce15a056b10.png" mode="widthFix"></image>
|
<image class="ui-mask-icon" src="https://image.fulllinkai.com/202407/30/dca7024d347433e1aa893ce15a056b10.png" mode="widthFix"></image>
|
||||||
<view class="f-fbc ui-operation">
|
<view class="f-fbc ui-operation">
|
||||||
@ -649,7 +649,7 @@ page {
|
|||||||
<image class="ui-operation-btn-v2" src="https://image.fulllinkai.com/202409/25/104374082c9e2bd160ee963b4f29c98f.png" mode="widthFix" @tap="modalName = 'praise'"></image>
|
<image class="ui-operation-btn-v2" src="https://image.fulllinkai.com/202409/25/104374082c9e2bd160ee963b4f29c98f.png" mode="widthFix" @tap="modalName = 'praise'"></image>
|
||||||
<image v-if="userInfo.base_profile.is_followed" class="ui-operation-btn-v2" src="https://image.fulllinkai.com/202407/30/48c1254fc413725432cc8d1c22be7440.png" mode="widthFix" @tap="attention"></image>
|
<image v-if="userInfo.base_profile.is_followed" class="ui-operation-btn-v2" src="https://image.fulllinkai.com/202407/30/48c1254fc413725432cc8d1c22be7440.png" mode="widthFix" @tap="attention"></image>
|
||||||
<image v-else class="ui-operation-btn-v2" src="https://image.fulllinkai.com/202407/30/c7aa12666362515181a8f237a3ea48ff.png" mode="widthFix" @tap="attention"></image>
|
<image v-else class="ui-operation-btn-v2" src="https://image.fulllinkai.com/202407/30/c7aa12666362515181a8f237a3ea48ff.png" mode="widthFix" @tap="attention"></image>
|
||||||
<image v-if="userInfo.base_profile.is_friend == 0" class="ui-operation-btn" src="https://image.fulllinkai.com/202407/30/58d9ec020a61a2d5370f2adb77489c18.png" mode="widthFix" @tap="contactFriendFn"></image>
|
<image v-if="userInfo.other_info.is_friend == 0" class="ui-operation-btn" src="https://image.fulllinkai.com/202407/30/58d9ec020a61a2d5370f2adb77489c18.png" mode="widthFix" @tap="contactFriendFn"></image>
|
||||||
<image v-else class="ui-operation-btn" src="https://image.fulllinkai.com/202407/30/0bfb0220f4b120dc0b0e9b4fb7a70a7b.png" mode="widthFix" @tap="jumpPath('chitchat')"></image>
|
<image v-else class="ui-operation-btn" src="https://image.fulllinkai.com/202407/30/0bfb0220f4b120dc0b0e9b4fb7a70a7b.png" mode="widthFix" @tap="jumpPath('chitchat')"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -328,7 +328,6 @@ wepy.page({
|
|||||||
if (vm.list.length < 15 || data.data.length < 15) {
|
if (vm.list.length < 15 || data.data.length < 15) {
|
||||||
vm.no_more = true
|
vm.no_more = true
|
||||||
}
|
}
|
||||||
vm.record(data.data)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
vm.loading = true
|
vm.loading = true
|
||||||
}, 500)
|
}, 500)
|
||||||
@ -340,20 +339,6 @@ wepy.page({
|
|||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 记录用户浏览过的数据
|
|
||||||
record(e) {
|
|
||||||
let vm = this
|
|
||||||
let list = []
|
|
||||||
e.forEach((item) => {
|
|
||||||
list.push(item.id)
|
|
||||||
})
|
|
||||||
let data = {
|
|
||||||
user_ids: list.toString()
|
|
||||||
}
|
|
||||||
vm.$post({url: `${service.host}/users/browse`, data}).then(() => {
|
|
||||||
}).catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 初始化列表数据
|
// 初始化列表数据
|
||||||
initData() {
|
initData() {
|
||||||
let vm = this
|
let vm = this
|
||||||
|
|||||||
@ -169,7 +169,6 @@ wepy.page({
|
|||||||
if (vm.list.length < 15 || data.data.length < 15) {
|
if (vm.list.length < 15 || data.data.length < 15) {
|
||||||
vm.no_more = true
|
vm.no_more = true
|
||||||
}
|
}
|
||||||
vm.record(data.data)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
vm.loading = true
|
vm.loading = true
|
||||||
}, 500)
|
}, 500)
|
||||||
@ -181,20 +180,6 @@ wepy.page({
|
|||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 记录用户浏览过的数据
|
|
||||||
record(e) {
|
|
||||||
let vm = this
|
|
||||||
let list = []
|
|
||||||
e.forEach((item) => {
|
|
||||||
list.push(item.id)
|
|
||||||
})
|
|
||||||
let data = {
|
|
||||||
user_ids: list.toString()
|
|
||||||
}
|
|
||||||
vm.$post({url: `${service.host}/users/browse`, data}).then(() => {
|
|
||||||
}).catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 去申请上专区推荐
|
// 去申请上专区推荐
|
||||||
getRecommend() {
|
getRecommend() {
|
||||||
let vm = this
|
let vm = this
|
||||||
|
|||||||
@ -589,16 +589,16 @@ page {
|
|||||||
<rich-text nodes="{{item.text}}"></rich-text>
|
<rich-text nodes="{{item.text}}"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
<!--图片信息-->
|
<!--图片信息-->
|
||||||
<image v-if="item.msgType == 'image'" class="ui-msg-left-pic" :style="{maxWidth: item.attach.w + 'rpx', maxHeight: item.attach.h + 'rpx'}" :src="item.attach.url" mode="aspectFill" @tap.stop="previewImage(item.attach.url)"></image>
|
<image v-if="item.msgType == 'image' || item.msgType == 'PICTURE'" class="ui-msg-left-pic" :style="{maxWidth: item.attach.w + 'rpx', maxHeight: item.attach.h + 'rpx'}" :src="item.attach.url" mode="aspectFill" @tap.stop="previewImage(item.attach.url)"></image>
|
||||||
<!--音频信息-->
|
<!--音频信息-->
|
||||||
<view v-if="item.msgType == 'audio'" class="{{!item.isSelf ? 'ui-left-msg-radius ui-left-audio' : 'ui-right-msg-radius ui-right-audio white' }} ui-audio-box font_36 f-fc" :style="{width: item.audioDur < 20 ? '120rpx' :item.audioDur < 40 ? '180rpx' : '320rpx', maxWidth: '320rpx!important', minWidth: '120rpx!important'}" @tap.stop="playAudio(item.attach, index)">
|
<view v-if="item.msgType == 'audio' || item.msgType == 'AUDIO'" class="{{!item.isSelf ? 'ui-left-msg-radius ui-left-audio' : 'ui-right-msg-radius ui-right-audio white' }} ui-audio-box font_36 f-fc" :style="{width: item.audioDur < 20 ? '120rpx' :item.audioDur < 40 ? '180rpx' : '320rpx', maxWidth: '320rpx!important', minWidth: '120rpx!important'}" @tap.stop="playAudio(item.attach, index)">
|
||||||
<image v-if="!item.isSelf" class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-l-play'}}" src="https://image.fulllinkai.com/202308/09/a0e320ef4f498309745d35f6798e970f.png" mode="aspectFit" lazy-load="false"></image>
|
<image v-if="!item.isSelf" class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-l-play'}}" src="https://image.fulllinkai.com/202308/09/a0e320ef4f498309745d35f6798e970f.png" mode="aspectFit" lazy-load="false"></image>
|
||||||
<image v-else class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-r-play'}}" src="https://image.fulllinkai.com/202308/09/5514071f2d388102b5672e46ea1922f4.png" mode="aspectFit" lazy-load="false"></image>
|
<image v-else class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-r-play'}}" src="https://image.fulllinkai.com/202308/09/5514071f2d388102b5672e46ea1922f4.png" mode="aspectFit" lazy-load="false"></image>
|
||||||
<view v-if="!audioState || playAudioIndex != index">{{item.audioDur+ '"'}}</view>
|
<view v-if="!audioState || playAudioIndex != index">{{item.audioDur+ '"'}}</view>
|
||||||
<view v-else>{{audioTime + '"'}}</view>
|
<view v-else>{{audioTime + '"'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<!--视频信息-->
|
<!--视频信息-->
|
||||||
<view v-if="item.msgType == 'video'" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx', display: videoIndex == index ? 'none' : 'block'}" class="liveImg" mode="widthFix" @tap.stop="playVideo(index, item.id)">
|
<view v-if="item.msgType == 'video' || item.msgType == 'VIDEO'" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx', display: videoIndex == index ? 'none' : 'block'}" class="liveImg" mode="widthFix" @tap.stop="playVideo(index, item.id)">
|
||||||
<image v-if="videoIndex != index" class="ui-video-box" :src="item.attach.poster" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx'}">
|
<image v-if="videoIndex != index" class="ui-video-box" :src="item.attach.poster" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx'}">
|
||||||
<view class="ui-vide-poster">
|
<view class="ui-vide-poster">
|
||||||
<image class="ui-video_play_icon" src="https://image.fulllinkai.com/202308/17/42c88bf039bb56f85cfcb9af0392ffb6.png"></image>
|
<image class="ui-video_play_icon" src="https://image.fulllinkai.com/202308/17/42c88bf039bb56f85cfcb9af0392ffb6.png"></image>
|
||||||
@ -1062,11 +1062,7 @@ wepy.page({
|
|||||||
vm.$showLoading('')
|
vm.$showLoading('')
|
||||||
vm.$get({url: `${service.host}/chat/user/${vm.otherUserId}/message/list`, data}).then(({code, data}) => {
|
vm.$get({url: `${service.host}/chat/user/${vm.otherUserId}/message/list`, data}).then(({code, data}) => {
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
console.log(data, '-------------------')
|
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
// if (vm.msgList && vm.msgList.length == 0) {
|
|
||||||
// vm.sendMsgReceipt(data[0])
|
|
||||||
// }
|
|
||||||
data.forEach((item, index) => {
|
data.forEach((item, index) => {
|
||||||
item.time = new Date(item.create_time.replace(/[-]/g, '/').replace(/[-]/, '')).getTime()
|
item.time = new Date(item.create_time.replace(/[-]/g, '/').replace(/[-]/, '')).getTime()
|
||||||
item.attach = item.attach ? JSON.parse(item.attach) : ''
|
item.attach = item.attach ? JSON.parse(item.attach) : ''
|
||||||
@ -1076,7 +1072,7 @@ wepy.page({
|
|||||||
data[index].showTime = false
|
data[index].showTime = false
|
||||||
data[index - 1].showTime = true
|
data[index - 1].showTime = true
|
||||||
}
|
}
|
||||||
if (item.content_type == 'text' && /\[[^\]]+\]/.test(item.content)) {
|
if ((item.content_type == 'text' || item.content_type == 'TEXT') && /\[[^\]]+\]/.test(item.content)) {
|
||||||
item.body = vm.transitionMsg(item.content)
|
item.body = vm.transitionMsg(item.content)
|
||||||
} else {
|
} else {
|
||||||
item.body = item.content
|
item.body = item.content
|
||||||
@ -1098,15 +1094,15 @@ wepy.page({
|
|||||||
avatar: item.is_mine == 0 ? vm.otherAvatar : vm.myAvatar,
|
avatar: item.is_mine == 0 ? vm.otherAvatar : vm.myAvatar,
|
||||||
time: item.timing,
|
time: item.timing,
|
||||||
showTime: item.showTime,
|
showTime: item.showTime,
|
||||||
videoDur: item.content_type == 'video' ? getVideoTime(item.attach.dur) : '',
|
videoDur: item.content_type == 'video' || item.content_type == 'VIDEO' ? getVideoTime(item.attach.dur) : '',
|
||||||
audioDur: item.content_type == 'audio' ? (item.attach.dur / 1000).toFixed(0) : '',
|
audioDur: item.content_type == 'audio' || item.content_type == 'AUDIO' ? (item.attach.dur / 1000).toFixed(0) : '',
|
||||||
name: item.fromNick,
|
name: item.fromNick,
|
||||||
isSend: 1,
|
isSend: 1,
|
||||||
userId: item.from,
|
userId: item.from,
|
||||||
msgType: item.content_type
|
msgType: item.content_type
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
console.log(vm.msgList, data[0].time, '88888888888888888')
|
console.log(vm.msgList)
|
||||||
vm.$nextTick(() => {
|
vm.$nextTick(() => {
|
||||||
vm.toView = `id_${data[0].time}`
|
vm.toView = `id_${data[0].time}`
|
||||||
if (vm.msgList.length > 15) {
|
if (vm.msgList.length > 15) {
|
||||||
@ -1133,83 +1129,6 @@ wepy.page({
|
|||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
// let data = {}
|
|
||||||
// if (vm.uploadState || vm.videoState) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if (!vm.lastMsgId) {
|
|
||||||
// data = {
|
|
||||||
// scene: 'p2p',
|
|
||||||
// to: vm.otherUserId,
|
|
||||||
// limit: 15
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// data = {
|
|
||||||
// scene: 'p2p',
|
|
||||||
// to: vm.otherUserId,
|
|
||||||
// limit: 15,
|
|
||||||
// reverse: false,
|
|
||||||
// endTime: vm.beginTime,
|
|
||||||
// lastMsgId: vm.lastMsgId
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (vm.finished) {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// vm.$showLoading('')
|
|
||||||
// app.globalData.nim.msgLog.getHistoryMsgs(data).then((object) => {
|
|
||||||
// console.log(object, '222222222222222222')
|
|
||||||
// if (object && object.length > 0) {
|
|
||||||
// if (vm.msgList && vm.msgList.length == 0) {
|
|
||||||
// vm.sendMsgReceipt(object[0])
|
|
||||||
// }
|
|
||||||
// object.forEach((item, index) => {
|
|
||||||
// item.showTime = timeContrast(format(item.time), vm.lastTime)
|
|
||||||
// item.timing = getTime(format(item.time))
|
|
||||||
// if (item.showTime && index > 0) {
|
|
||||||
// object[index].showTime = false
|
|
||||||
// object[index - 1].showTime = true
|
|
||||||
// }
|
|
||||||
// if (item.type == 'text' && /\[[^\]]+\]/.test(item.body)) {
|
|
||||||
// item.body = vm.transitionMsg(item.body)
|
|
||||||
// }
|
|
||||||
// vm.lastTime = format(item.time)
|
|
||||||
// })
|
|
||||||
//
|
|
||||||
// vm.lastMsgId = object[object.length - 1].idServer
|
|
||||||
// vm.beginTime = object[object.length - 1].time
|
|
||||||
//
|
|
||||||
// setTimeout(() => {
|
|
||||||
// object.forEach((item) => {
|
|
||||||
// vm.msgList.unshift({
|
|
||||||
// text: item.body,
|
|
||||||
// attach: vm.calculatePic(item.attach, item.type),
|
|
||||||
// id: `id_${item.time}`,
|
|
||||||
// timestamp: item.time,
|
|
||||||
// isSelf: item.flow == 'in' ? false : true,
|
|
||||||
// avatar: item.flow == 'in' ? vm.otherAvatar : vm.myAvatar,
|
|
||||||
// time: item.timing,
|
|
||||||
// showTime: item.showTime,
|
|
||||||
// videoDur: item.type == 'video' ? getVideoTime(item.attach.dur) : '',
|
|
||||||
// audioDur: item.type == 'audio' ? (item.attach.dur / 1000).toFixed(0) : '',
|
|
||||||
// name: item.fromNick,
|
|
||||||
// isSend: 1,
|
|
||||||
// userId: item.from,
|
|
||||||
// msgType: item.type
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// console.log(vm.msgList, '88888888888888888')
|
|
||||||
// vm.toView = `id_${object[0].time}`
|
|
||||||
// vm.loading = true
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// vm.loading = true
|
|
||||||
// }
|
|
||||||
// if (object && object.length < 15) {
|
|
||||||
// vm.finished = true
|
|
||||||
// }
|
|
||||||
// wx.hideLoading()
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
// 删除好友
|
// 删除好友
|
||||||
deleteFriends() {
|
deleteFriends() {
|
||||||
@ -1471,9 +1390,9 @@ wepy.page({
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
let wRatio = 0
|
let wRatio = 0
|
||||||
if (type == 'video' && e.url && e.url.includes('?')) {
|
if ((type == 'video' || type == 'VIDEO') && e.url && e.url.includes('?')) {
|
||||||
e.poster = `${e.url}&vframe`
|
e.poster = `${e.url}&vframe`
|
||||||
} else if (type == 'video' && e.url) {
|
} else if ((type == 'video' || type == 'VIDEO') && e.url) {
|
||||||
e.poster = `${e.url}?vframe`
|
e.poster = `${e.url}?vframe`
|
||||||
}
|
}
|
||||||
if (e.w > e.h) {
|
if (e.w > e.h) {
|
||||||
@ -1485,6 +1404,7 @@ wepy.page({
|
|||||||
e.w = e.w / wRatio
|
e.w = e.w / wRatio
|
||||||
e.h = 200
|
e.h = 200
|
||||||
}
|
}
|
||||||
|
console.log(e, '8988888')
|
||||||
return e
|
return e
|
||||||
},
|
},
|
||||||
// 更多操作
|
// 更多操作
|
||||||
@ -1622,24 +1542,24 @@ wepy.page({
|
|||||||
})
|
})
|
||||||
// 底部输入框高度
|
// 底部输入框高度
|
||||||
vm.changeInputHeight(true)
|
vm.changeInputHeight(true)
|
||||||
vm.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
// 获取历史消息
|
|
||||||
vm.getHistoryMsg()
|
|
||||||
// 实时获取对方发送的消息
|
|
||||||
app.globalData.nim.on('msg', function (e) {
|
|
||||||
vm.reception(e)
|
|
||||||
})
|
|
||||||
}, 3000)
|
|
||||||
})
|
|
||||||
// vm.$nextTick(() => {
|
// vm.$nextTick(() => {
|
||||||
// // 获取历史消息
|
// setTimeout(() => {
|
||||||
// vm.getHistoryMsg()
|
// // 获取历史消息
|
||||||
// // 实时获取对方发送的消息
|
// vm.getHistoryMsg()
|
||||||
// app.globalData.nim.on('msg', function (e) {
|
// // 实时获取对方发送的消息
|
||||||
// vm.reception(e)
|
// app.globalData.nim.on('msg', function (e) {
|
||||||
// })
|
// vm.reception(e)
|
||||||
|
// })
|
||||||
|
// }, 3000)
|
||||||
// })
|
// })
|
||||||
|
vm.$nextTick(() => {
|
||||||
|
// 获取历史消息
|
||||||
|
vm.getHistoryMsg()
|
||||||
|
// 实时获取对方发送的消息
|
||||||
|
app.globalData.nim.on('msg', function (e) {
|
||||||
|
vm.reception(e)
|
||||||
|
})
|
||||||
|
})
|
||||||
wx.setNavigationBarTitle({
|
wx.setNavigationBarTitle({
|
||||||
title: vm.otherUserName,
|
title: vm.otherUserName,
|
||||||
success: function () {}
|
success: function () {}
|
||||||
|
|||||||
@ -541,9 +541,8 @@ page {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ui-msg-data-box" v-show="msgList.length > 0">
|
<view class="ui-msg-data-box" v-show="msgList.length > 0">
|
||||||
<!-- <view class="text-center font_2 ui-pb-24 color666" v-if="finished">没有更多消息了</view>-->
|
|
||||||
<view v-for="(item, index) in msgList" :key="index" class="ui-msg-data" id="{{item.id}}">
|
<view v-for="(item, index) in msgList" :key="index" class="ui-msg-data" id="{{item.id}}">
|
||||||
<block v-if="item.msgType == '7' && item.tips">
|
<block v-if="item.msgType == '7' || item.msgType == 'notification' && item.tips">
|
||||||
<!--群消息通知-->
|
<!--群消息通知-->
|
||||||
<view class="text-center color999 font_24">{{item.tips}}</view>
|
<view class="text-center color999 font_24">{{item.tips}}</view>
|
||||||
</block>
|
</block>
|
||||||
@ -553,22 +552,22 @@ page {
|
|||||||
<image v-if="!item.isSelf" class="ui-user-pic" :src="item.avatar" mode="aspectFill"></image>
|
<image v-if="!item.isSelf" class="ui-user-pic" :src="item.avatar" mode="aspectFill"></image>
|
||||||
<view class="{{!item.isSelf ? 'ui-pl-12' : 'ui-pr-12'}}">
|
<view class="{{!item.isSelf ? 'ui-pl-12' : 'ui-pr-12'}}">
|
||||||
<view class="ui-relative">
|
<view class="ui-relative">
|
||||||
<view v-if="!item.isSelf && membersData.user_team.show_other_nick" class="font_26 color999 ui-pb-8">{{item.name}}</view>
|
<view v-if="membersData.user_team.show_other_nick" class="font_26 color999 ui-pb-8 {{!item.isSelf ? 'text-left' : 'text-right'}}">{{item.name}}</view>
|
||||||
<!--文本加表情信息-->
|
<!--文本加表情信息-->
|
||||||
<view class="{{!item.isSelf ? 'ui-left-msg-radius ui-msg-left color3' : 'ui-right-msg-radius ui-msg-right white'}} font_28" v-if="item.msgType == '0'">
|
<view class="{{!item.isSelf ? 'ui-left-msg-radius ui-msg-left color3' : 'ui-right-msg-radius ui-msg-right white'}} font_28" v-if="item.msgType == '0' || item.msgType == 'text'">
|
||||||
<rich-text nodes="{{item.text}}"></rich-text>
|
<rich-text nodes="{{item.text}}"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
<!--图片信息-->
|
<!--图片信息-->
|
||||||
<image v-if="item.msgType == '1'" class="ui-msg-left-pic" :style="{maxWidth: item.attach.w + 'rpx', maxHeight: item.attach.h + 'rpx'}" :src="item.attach.url" mode="aspectFill" @tap.stop="previewImage(item.attach.url)"></image>
|
<image v-if="item.msgType == '1' || item.msgType == 'image'" class="ui-msg-left-pic" :style="{maxWidth: item.attach.w + 'rpx', maxHeight: item.attach.h + 'rpx'}" :src="item.attach.url" mode="aspectFill" @tap.stop="previewImage(item.attach.url)"></image>
|
||||||
<!--音频信息-->
|
<!--音频信息-->
|
||||||
<view v-if="item.msgType == '2'" class="{{!item.isSelf ? 'ui-left-msg-radius ui-left-audio' : 'ui-right-msg-radius ui-right-audio white' }} ui-audio-box font_36 f-fc" :style="{width: item.audioDur < 20 ? '120rpx' :item.audioDur < 40 ? '180rpx' : '320rpx', maxWidth: '320rpx!important', minWidth: '120rpx!important'}" @tap.stop="playAudio(item.attach, index)">
|
<view v-if="item.msgType == '2' || item.msgType == 'audio'" class="{{!item.isSelf ? 'ui-left-msg-radius ui-left-audio' : 'ui-right-msg-radius ui-right-audio white' }} ui-audio-box font_36 f-fc" :style="{width: item.audioDur < 20 ? '120rpx' :item.audioDur < 40 ? '180rpx' : '320rpx', maxWidth: '320rpx!important', minWidth: '120rpx!important'}" @tap.stop="playAudio(item.attach, index)">
|
||||||
<image v-if="!item.isSelf" class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-l-play'}}" src="https://image.fulllinkai.com/202308/09/a0e320ef4f498309745d35f6798e970f.png" mode="aspectFit" lazy-load="false"></image>
|
<image v-if="!item.isSelf" class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-l-play'}}" src="https://image.fulllinkai.com/202308/09/a0e320ef4f498309745d35f6798e970f.png" mode="aspectFit" lazy-load="false"></image>
|
||||||
<image v-else class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-r-play'}}" src="https://image.fulllinkai.com/202308/09/5514071f2d388102b5672e46ea1922f4.png" mode="aspectFit" lazy-load="false"></image>
|
<image v-else class="{{!audioState || playAudioIndex != index ? 'ui-audio-icon' : 'ui-audio-icon-r-play'}}" src="https://image.fulllinkai.com/202308/09/5514071f2d388102b5672e46ea1922f4.png" mode="aspectFit" lazy-load="false"></image>
|
||||||
<view v-if="!audioState || playAudioIndex != index">{{item.audioDur+ '"'}}</view>
|
<view v-if="!audioState || playAudioIndex != index">{{item.audioDur+ '"'}}</view>
|
||||||
<view v-else>{{audioTime + '"'}}</view>
|
<view v-else>{{audioTime + '"'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<!--视频信息-->
|
<!--视频信息-->
|
||||||
<view v-if="item.msgType == '3'" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx', display: videoIndex == index ? 'none' : 'block'}" class="liveImg" mode="widthFix" @tap.stop="playVideo(index, item.id)">
|
<view v-if="item.msgType == '3' || item.msgType == 'video'" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx', display: videoIndex == index ? 'none' : 'block'}" class="liveImg" mode="widthFix" @tap.stop="playVideo(index, item.id)">
|
||||||
<image v-if="videoIndex != index" class="ui-video-box" :src="item.attach.poster" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx'}">
|
<image v-if="videoIndex != index" class="ui-video-box" :src="item.attach.poster" :style="{width: item.attach.w + 'rpx', height: item.attach.h + 'rpx'}">
|
||||||
<view class="ui-vide-poster">
|
<view class="ui-vide-poster">
|
||||||
<image class="ui-video_play_icon" src="https://image.fulllinkai.com/202308/17/42c88bf039bb56f85cfcb9af0392ffb6.png"></image>
|
<image class="ui-video_play_icon" src="https://image.fulllinkai.com/202308/17/42c88bf039bb56f85cfcb9af0392ffb6.png"></image>
|
||||||
@ -802,8 +801,8 @@ wepy.page({
|
|||||||
isSend: 0,
|
isSend: 0,
|
||||||
onSendBefore: function (msg) {
|
onSendBefore: function (msg) {
|
||||||
console.log('get msg before', msg)
|
console.log('get msg before', msg)
|
||||||
if (/\[[^\]]+\]/.test(data.content)) {
|
if (/\[[^\]]+\]/.test(vm.msg)) {
|
||||||
data.content = vm.transitionMsg(data.content)
|
vm.msg = vm.transitionMsg(vm.msg)
|
||||||
}
|
}
|
||||||
msgNewObj = {
|
msgNewObj = {
|
||||||
text: vm.msg,
|
text: vm.msg,
|
||||||
@ -996,6 +995,7 @@ wepy.page({
|
|||||||
app.globalData.nim.user.getUsersNameCardFromServer({
|
app.globalData.nim.user.getUsersNameCardFromServer({
|
||||||
accounts: [e.from]
|
accounts: [e.from]
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
console.log(res, e, '777222')
|
||||||
vm.msgList.push({
|
vm.msgList.push({
|
||||||
text: e.body,
|
text: e.body,
|
||||||
attach: vm.calculatePic(e.attach, e.type),
|
attach: vm.calculatePic(e.attach, e.type),
|
||||||
@ -1071,13 +1071,13 @@ wepy.page({
|
|||||||
attach: vm.calculatePic(item.body_arr, item.type),
|
attach: vm.calculatePic(item.body_arr, item.type),
|
||||||
id: `id_${item.time}`,
|
id: `id_${item.time}`,
|
||||||
timestamp: item.time,
|
timestamp: item.time,
|
||||||
isSelf: item.is_mine == 'in' ? false : true,
|
isSelf: item.is_mine == 0 ? false : true,
|
||||||
avatar: item.is_mine == 'in' ? item.photo : vm.myAvatar,
|
avatar: item.is_mine == 0 ? item.photo : vm.myAvatar,
|
||||||
time: item.timing,
|
time: item.timing,
|
||||||
showTime: item.showTime,
|
showTime: item.showTime,
|
||||||
videoDur: item.type == '3' && item.body_arr.dur ? getVideoTime(item.body_arr.dur) : '',
|
videoDur: item.type == '3' && item.body_arr.dur ? getVideoTime(item.body_arr.dur) : '',
|
||||||
audioDur: item.type == '2' && item.body_arr.dur ? (item.body_arr.dur / 1000).toFixed(0) : '',
|
audioDur: item.type == '2' && item.body_arr.dur ? (item.body_arr.dur / 1000).toFixed(0) : '',
|
||||||
name: item.fromNick,
|
name: item.from_nick,
|
||||||
userId: item.from,
|
userId: item.from,
|
||||||
msgType: item.type,
|
msgType: item.type,
|
||||||
tips: vm.groupNotification(item)
|
tips: vm.groupNotification(item)
|
||||||
@ -1323,7 +1323,7 @@ wepy.page({
|
|||||||
},
|
},
|
||||||
// 图片大小计算
|
// 图片大小计算
|
||||||
calculatePic(e, type) {
|
calculatePic(e, type) {
|
||||||
if (!e.url) {
|
if (!e || !e.url) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
let wRatio = 0
|
let wRatio = 0
|
||||||
|
|||||||
@ -133,6 +133,10 @@ page {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-filter{
|
||||||
|
filter: blur(4px) contrast(.8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.m_fans_lst {
|
.m_fans_lst {
|
||||||
@ -284,29 +288,26 @@ page {
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<view class="m_vc_lst">
|
<view class="m_vc_lst">
|
||||||
<block v-for="(item,index) in list" :key="index">
|
<block v-for="(item,index) in list" :key="index">
|
||||||
<view v-if="item.other_user" class="u_vc_lst" :style="{'filter:blur(4px) contrast(.8)' : index >= 3 && userInfo.rank_id == 0}" @longpress="deleteRecord(item, index)" @tap="jumpPath(item, index)">
|
<view v-if="item.other_user" class="u_vc_lst {{index >= 3 && !userInfo.rank_id ? 'ui-filter' : ''}}" @longpress="deleteRecord(item, index)" @tap="jumpPath(item, index)">
|
||||||
<view class="f-fc u_box">
|
<view class="f-fc u_box">
|
||||||
<view class="f-fc">
|
<view class="f-fc">
|
||||||
<image class="u_vclst_img" :src="item.other_user.avatar || item.other_user.photo" mode="aspectFill" @tap.stop="gotofriends(item, index)"></image>
|
<image class="u_vclst_img" :src="item.photo" mode="aspectFill" @tap.stop="gotofriends(item, index)"></image>
|
||||||
<view class="u_vclst_t_box">
|
<view class="u_vclst_t_box">
|
||||||
<view class="f-fc">
|
<view class="f-fc">
|
||||||
<view class="u_vclst_name">{{item.other_user.nickname}}</view>
|
<view class="u_vclst_name">{{item.nickname}}</view>
|
||||||
<view class="u_vclst_a_box f-fc age_g font_22" v-if="item.other_user.sex === 2">
|
<view class="u_vclst_a_box f-fc {{ item.sex == 2 ? 'age_g' : 'age_b'}} font_22" v-if="item.sex == 2">
|
||||||
<image class="a_sex_img" src="https://image.fulllinkai.com/202208/09/dfed05b3e1e1880a3a6f81806d99e9de.png" mode="widthFix"></image>
|
<image v-if="item.sex == 2" class="a_sex_img" src="https://image.fulllinkai.com/202208/09/dfed05b3e1e1880a3a6f81806d99e9de.png" mode="widthFix"></image>
|
||||||
<view>{{item.other_user.year}}</view>
|
<image v-else class="a_sex_img" src="https://image.fulllinkai.com/202208/09/dfed05b3e1e1880a3a6f81806d99e9de.png" mode="widthFix"></image>
|
||||||
</view>
|
<view>{{item.year}}</view>
|
||||||
<view class="u_vclst_a_box f-fc age_b font_22" v-if="item.other_user.sex === 1">
|
|
||||||
<image class="a_sex_img" src="https://image.fulllinkai.com/202208/09/77cd63f40e622e54a859e751269eb920.png" mode="widthFix"></image>
|
|
||||||
<view>{{item.other_user.age}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="f-fc">
|
<view class="f-fc">
|
||||||
<view class="u_state">{{item.other_user.stature || ''}} {{item.other_user.city || ''}}</view>
|
<view class="u_state">{{item.stature || ''}} {{item.city || ''}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="color-999">{{item.created_at}}</view>
|
<view class="color-999">{{item.created_at}}</view>
|
||||||
<view class="ui-visitor-detail-btn font_26 color999" v-if="userInfo.rank_id == 9">来访{{item.count}}次</view>
|
<view class="ui-visitor-detail-btn font_26 color999" v-if="userInfo.rank_id">来访{{item.count}}次</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u_vertical"></view>
|
<view class="u_vertical"></view>
|
||||||
</view>
|
</view>
|
||||||
@ -319,7 +320,7 @@ page {
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<view class="m_fans_lst f-fc">
|
<view class="m_fans_lst f-fc">
|
||||||
<view class="u_fans_lst" v-for="(item,index) in fansList" :key="index" @tap="jumpPath(item, index)">
|
<view class="u_fans_lst" v-for="(item,index) in fansList" :key="index" @tap="jumpPath(item, index)">
|
||||||
<image class="u_fans_img {{index >= 3 && user.rank_id == 0 ? 'blur' : ''}}" :src="item.photo" mode="aspectFill"></image>
|
<image class="u_fans_img {{index >= 3 && !userInfo.rank_id ? 'blur' : ''}}" :src="item.photo" mode="aspectFill"></image>
|
||||||
<image class="ui-fans-icon" v-if="item.hidden_profile != 'NONE'" src="https://image.fulllinkai.com/202203/22/7a244fa7e39105c3f9cb9d951dcd5664.png" mode="aspectFit"></image>
|
<image class="ui-fans-icon" v-if="item.hidden_profile != 'NONE'" src="https://image.fulllinkai.com/202203/22/7a244fa7e39105c3f9cb9d951dcd5664.png" mode="aspectFit"></image>
|
||||||
<view class="u_vclst_ct">
|
<view class="u_vclst_ct">
|
||||||
<view class="u_vclst_name white bold font_24 ellipsis_1">{{item.nickname}}</view>
|
<view class="u_vclst_name white bold font_24 ellipsis_1">{{item.nickname}}</view>
|
||||||
@ -514,10 +515,10 @@ wepy.page({
|
|||||||
// 跳转用户详情,没有vip时点击第四个用户弹框提示
|
// 跳转用户详情,没有vip时点击第四个用户弹框提示
|
||||||
jumpPath(e, index) {
|
jumpPath(e, index) {
|
||||||
let vm = this
|
let vm = this
|
||||||
if (index >= 3 && vm.userInfo.rank_id == 0) {
|
if (index >= 3 && !vm.userInfo.rank_id) {
|
||||||
vm.pic = e.photo || e.avatar || e.other_user.photo || e.other_user.avatar
|
vm.pic = e.photo
|
||||||
vm.city = e.city || e.other_user.city
|
vm.city = e.city
|
||||||
vm.age = e.year || e.other_user.year
|
vm.age = e.year
|
||||||
vm.tipsShow = true
|
vm.tipsShow = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -296,7 +296,6 @@ wepy.page({
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
vm.loading = true
|
vm.loading = true
|
||||||
}, 500)
|
}, 500)
|
||||||
vm.page++
|
|
||||||
}
|
}
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@ -322,7 +321,7 @@ wepy.page({
|
|||||||
}
|
}
|
||||||
if ((notice_count + groupCount) > 0) {
|
if ((notice_count + groupCount) > 0) {
|
||||||
wx.setTabBarBadge({
|
wx.setTabBarBadge({
|
||||||
index: 0,
|
index: 2,
|
||||||
text: `${notice_count + groupCount}`
|
text: `${notice_count + groupCount}`
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -478,6 +477,7 @@ wepy.page({
|
|||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
let vm = this
|
let vm = this
|
||||||
if (!vm.no_more) {
|
if (!vm.no_more) {
|
||||||
|
vm.page++
|
||||||
vm.getList()
|
vm.getList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -491,11 +491,9 @@ wepy.page({
|
|||||||
onShow() {
|
onShow() {
|
||||||
let vm = this
|
let vm = this
|
||||||
vm.getNewCount()
|
vm.getNewCount()
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let vm = this
|
|
||||||
vm.getList()
|
vm.getList()
|
||||||
}
|
},
|
||||||
|
onLoad() {}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<config>
|
<config>
|
||||||
|
|||||||
@ -148,7 +148,7 @@ const IM = (account, token) => {
|
|||||||
}
|
}
|
||||||
if ((notice_count + groupCount) > 0) {
|
if ((notice_count + groupCount) > 0) {
|
||||||
wx.setTabBarBadge({
|
wx.setTabBarBadge({
|
||||||
index: 0,
|
index: 2,
|
||||||
text: `${notice_count + groupCount}`
|
text: `${notice_count + groupCount}`
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user