聊天完成

This commit is contained in:
luyuan 2020-08-07 16:54:54 +08:00
parent f4313dce9d
commit 57fcf69974
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
3 changed files with 20 additions and 8 deletions

View File

@ -134,8 +134,8 @@
});
setTimeout(() => {
uni.setNavigationBarColor({
backgroundColor : '#D02129',
frontColor : '#ffffff'
backgroundColor : '#FF780F',
frontColor : '#333333'
});
}, 10);
@ -567,7 +567,7 @@
}
.chatInterface .message-item.self .content span{
color: #ffffff;
background:#D02129;
background:#FF780F;
word-break: break-all;
text-align: left;
max-width: 520rpx;

View File

@ -23,6 +23,8 @@
<view class="title">{{item.name}}</view>
<view class="contentes u-line-1">{{item.text}}</view>
<view class="times">{{item.time}}</view>
<view class="tishi" v-if="item.unReadMessage"></view>
</view>
</view>
</view>
@ -180,6 +182,15 @@
</script>
<style lang="scss" scoped>
.tishi{
position: absolute;
bottom: 30rpx;
right: 30rpx;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: #FF0000;
}
.sousuo {
height: 113rpx;
border: 1px #f00 solid;
@ -222,6 +233,7 @@
padding-bottom: 23rpx;
border-bottom: 1px #ececec solid;
padding: 20rpx 5rpx 23rpx 5rpx;
position: relative;
image {
width: 84rpx;

View File

@ -8,12 +8,12 @@
import GoEasyIM from './goeasy-im-1.0.9';
import restApi from './restapi';
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.online = false;
this.unReadMessage = 0;
this.unReadMessage = parseInt(unReadMessage);
this.text = text;
this.time = time;
this.date = date
@ -106,7 +106,7 @@ IMService.prototype.initialContacts = function (friendList) {
},
success(res){
console.log(res)
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2]);
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2],i[3]);
console.log(that.friends)
let sorts = function (friends){
let paixu = function (a,b){
@ -299,7 +299,7 @@ IMService.prototype.initialIMListeners = function () {
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])
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
@ -323,7 +323,7 @@ IMService.prototype.initialIMListeners = function () {
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])
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))