From 22a67d23c43c46791d7c41e353068a767f0ee315 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 10 Aug 2020 08:52:33 +0800 Subject: [PATCH 1/5] out --- pageB/search/out.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pageB/search/out.vue b/pageB/search/out.vue index bb497ac..41494bb 100644 --- a/pageB/search/out.vue +++ b/pageB/search/out.vue @@ -80,6 +80,7 @@ export default { this.value = option.value this.setViewHeight(); this.ShopSearch() + // this.plus.webview.currentWebview().setTitleNViewSearchInputText(option.value); }, onNavigationBarSearchInputConfirmed(value) { this.value = value.text From 55297a65879eb6765f439289ec0b3bf20ea04854 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 10 Aug 2020 10:41:13 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/imservice.js | 87 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/static/imservice.js b/static/imservice.js index d7b3871..f2d1e6f 100644 --- a/static/imservice.js +++ b/static/imservice.js @@ -458,6 +458,8 @@ IMService.prototype.sendPrivateTextMessage = function (friendId, text) { text: text }); this.sendPrivateMessage(friendId, textMessage); + this.sendMessagesSetStorage(friendId, text) + }; //私聊图片消息 @@ -469,6 +471,7 @@ IMService.prototype.sendPrivateImageMessage = function (friendId, imageFile) { } }); this.sendPrivateMessage(friendId, imageMessage); + this.sendMessagesSetStorage(friendId, '其他消息') }; //私聊视频消息 @@ -480,6 +483,8 @@ IMService.prototype.sendPrivateVideoMessage = function (friendId, videoFile) { } }); this.sendPrivateMessage(friendId, videoMessage); + this.sendMessagesSetStorage(friendId, '其他消息') + }; IMService.prototype.sendPrivateAudioMessage = function (friendId, audiofile) { @@ -491,8 +496,88 @@ IMService.prototype.sendPrivateAudioMessage = function (friendId, audiofile) { }); this.sendPrivateMessage(friendId, audioMessage); -}; + this.sendMessagesSetStorage(friendId, '其他消息') +}; +IMService.prototype.sendMessagesSetStorage = function (friendId,message){ + let friend = this.friends[friendId]; + console.log(friend) + // return ; + let sorts = function (friends){ + let paixu = function (a,b){ + if(a.date > b.date){ + return 0; + }else{ + return 1; + } + + } + friends.sort(paixu) + + } + + let that = this + if(!friend && friend == undefined){ + const token = uni.getStorageSync('token'); + console.log(token) + uni.request({ + url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo", + data:{ + userId:friendId + }, + method:"POST", + header:{ + "Authorization" : 'Bearer' + " " + token + }, + success(res){ + console.log(res) + that.friends[friendId] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar); + friend = that.friends[friendId]; + console.log(friend) + friend.text = message + let time = new Date() + friend.date = time.getTime() + friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + console.log(that.friends) + that.friendsarr = [] + for(let i in that.friends){ + console.log(i) + that.friendsarr.push(that.friends[i]) + } + sorts(that.friendsarr) + let arr = [] + for(let i in that.friends){ + arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,0]) + } + console.log(arr) + uni.setStorageSync('imlist',JSON.stringify(arr)) + + that.onFriendListChange(that.friends); + + } + }) + }else{ + console.log(friend) + friend.text = message + let time = new Date() + friend.date = time.getTime() + friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + console.log(this.friends) + that.friendsarr = [] + for(let i in this.friends){ + that.friendsarr.push(this.friends[i]) + } + sorts(that.friendsarr) + let arr = [] + for(let i in that.friends){ + arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,0]) + } + console.log(arr) + uni.setStorageSync('imlist',JSON.stringify(arr)) + this.onFriendListChange(this.friends); + + } +} //发送私聊消息 IMService.prototype.sendPrivateMessage = function (friendId, message) { From e3407b1046553dff2542b79497e4abeb0264ed4a Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 10 Aug 2020 16:55:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pageD/attention/attention.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pageD/attention/attention.vue b/pageD/attention/attention.vue index addab7d..f7dfe12 100644 --- a/pageD/attention/attention.vue +++ b/pageD/attention/attention.vue @@ -1,6 +1,6 @@