聊天完成
This commit is contained in:
		
							parent
							
								
									4453742f3c
								
							
						
					
					
						commit
						ceb2b8084d
					
				@ -152,7 +152,7 @@ export default {
 | 
				
			|||||||
		this.getcarlist();
 | 
							this.getcarlist();
 | 
				
			||||||
		const user = uni.getStorageSync('userinfo');
 | 
							const user = uni.getStorageSync('userinfo');
 | 
				
			||||||
		console.log(user)
 | 
							console.log(user)
 | 
				
			||||||
		this.imService.login(user.userId,"","")
 | 
							this.imService.login(user.userId,user.member_avatar,"")
 | 
				
			||||||
		this.imService.connectIM()
 | 
							this.imService.connectIM()
 | 
				
			||||||
		// 订单状态: 0:全部 1已付款未发货 2已发货 3已完成 4申请退款/退货 5已退款/退货 6拒绝退款/退货
 | 
							// 订单状态: 0:全部 1已付款未发货 2已发货 3已完成 4申请退款/退货 5已退款/退货 6拒绝退款/退货
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
				
			|||||||
@ -14,6 +14,7 @@
 | 
				
			|||||||
			<view class="names">{{item.name}}</view>
 | 
								<view class="names">{{item.name}}</view>
 | 
				
			||||||
			<view class="content u-line-1">{{item.text}}</view>
 | 
								<view class="content u-line-1">{{item.text}}</view>
 | 
				
			||||||
			<view class="times">{{item.time}}</view>
 | 
								<view class="times">{{item.time}}</view>
 | 
				
			||||||
 | 
								<view class="tishi" v-if="item.unReadMessage"></view>
 | 
				
			||||||
		</view>
 | 
							</view>
 | 
				
			||||||
		<u-toast ref="uToast" />
 | 
							<u-toast ref="uToast" />
 | 
				
			||||||
	</view>
 | 
						</view>
 | 
				
			||||||
@ -60,6 +61,15 @@
 | 
				
			|||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style lang="scss" scoped>
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
						.tishi{
 | 
				
			||||||
 | 
							position: absolute;
 | 
				
			||||||
 | 
							bottom: 30rpx;
 | 
				
			||||||
 | 
							right: 30rpx;
 | 
				
			||||||
 | 
							width: 12rpx;
 | 
				
			||||||
 | 
							height: 12rpx;
 | 
				
			||||||
 | 
							border-radius: 50%;
 | 
				
			||||||
 | 
							background-color: #FF0000;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	.u-search{
 | 
						.u-search{
 | 
				
			||||||
		width: 690rpx;
 | 
							width: 690rpx;
 | 
				
			||||||
		margin: 0 auto;
 | 
							margin: 0 auto;
 | 
				
			||||||
@ -73,6 +83,7 @@
 | 
				
			|||||||
		position: relative;
 | 
							position: relative;
 | 
				
			||||||
		border-bottom: 1px #ECECEC solid;
 | 
							border-bottom: 1px #ECECEC solid;
 | 
				
			||||||
		overflow: hidden;
 | 
							overflow: hidden;
 | 
				
			||||||
 | 
							position: relative;
 | 
				
			||||||
		zoom: 1;
 | 
							zoom: 1;
 | 
				
			||||||
		.images{
 | 
							.images{
 | 
				
			||||||
			width: 84rpx;
 | 
								width: 84rpx;
 | 
				
			||||||
 | 
				
			|||||||
@ -134,8 +134,8 @@
 | 
				
			|||||||
			});
 | 
								});
 | 
				
			||||||
			setTimeout(() => {
 | 
								setTimeout(() => {
 | 
				
			||||||
				uni.setNavigationBarColor({
 | 
									uni.setNavigationBarColor({
 | 
				
			||||||
					backgroundColor : '#D02129',
 | 
										backgroundColor : '#FF780F',
 | 
				
			||||||
					frontColor : '#ffffff'
 | 
										frontColor : '#333333'
 | 
				
			||||||
				});
 | 
									});
 | 
				
			||||||
			}, 10);
 | 
								}, 10);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -567,7 +567,7 @@
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    .chatInterface .message-item.self .content span{
 | 
					    .chatInterface .message-item.self .content span{
 | 
				
			||||||
        color: #ffffff;
 | 
					        color: #ffffff;
 | 
				
			||||||
        background:#D02129;
 | 
					        background:#FF780F;
 | 
				
			||||||
        word-break: break-all;
 | 
					        word-break: break-all;
 | 
				
			||||||
        text-align: left;
 | 
					        text-align: left;
 | 
				
			||||||
		max-width: 520rpx;
 | 
							max-width: 520rpx;
 | 
				
			||||||
 | 
				
			|||||||
@ -8,12 +8,12 @@
 | 
				
			|||||||
import GoEasyIM from './goeasy-im-1.0.9';
 | 
					import GoEasyIM from './goeasy-im-1.0.9';
 | 
				
			||||||
import restApi from './restapi';
 | 
					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.uuid = uuid;
 | 
				
			||||||
    this.name = name;
 | 
					    this.name = name;
 | 
				
			||||||
    this.avatar = avatar;
 | 
					    this.avatar = avatar;
 | 
				
			||||||
    this.online = false;
 | 
					    this.online = false;
 | 
				
			||||||
    this.unReadMessage = 0;
 | 
					    this.unReadMessage = parseInt(unReadMessage);
 | 
				
			||||||
    this.text = text;
 | 
					    this.text = text;
 | 
				
			||||||
    this.time = time;
 | 
					    this.time = time;
 | 
				
			||||||
    this.date = date
 | 
					    this.date = date
 | 
				
			||||||
@ -107,7 +107,7 @@ IMService.prototype.initialContacts = function (friendList) {
 | 
				
			|||||||
            },
 | 
					            },
 | 
				
			||||||
            success(res){
 | 
					            success(res){
 | 
				
			||||||
                console.log(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)
 | 
					                console.log(that.friends)
 | 
				
			||||||
                let sorts = function (friends){
 | 
					                let sorts = function (friends){
 | 
				
			||||||
                    let paixu = function (a,b){
 | 
					                    let paixu = function (a,b){
 | 
				
			||||||
@ -301,7 +301,7 @@ IMService.prototype.initialIMListeners = function () {
 | 
				
			|||||||
                        sorts(that.friendsarr)
 | 
					                        sorts(that.friendsarr)
 | 
				
			||||||
                        let arr = []
 | 
					                        let arr = []
 | 
				
			||||||
                        for(let i in that.friends){
 | 
					                        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)
 | 
					                        console.log(arr)
 | 
				
			||||||
                        uni.setStorageSync('imlist',JSON.stringify(arr))
 | 
					                        uni.setStorageSync('imlist',JSON.stringify(arr))
 | 
				
			||||||
@ -326,7 +326,7 @@ IMService.prototype.initialIMListeners = function () {
 | 
				
			|||||||
                sorts(that.friendsarr)
 | 
					                sorts(that.friendsarr)
 | 
				
			||||||
                let arr = []
 | 
					                let arr = []
 | 
				
			||||||
                for(let i in that.friends){
 | 
					                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)
 | 
					                console.log(arr)
 | 
				
			||||||
                uni.setStorageSync('imlist',JSON.stringify(arr))
 | 
					                uni.setStorageSync('imlist',JSON.stringify(arr))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user