Merge branch 'master' of https://git.yuzhankeji.cn/TmOct5/ZhHealth
This commit is contained in:
@@ -1,124 +1,114 @@
|
||||
<template>
|
||||
<view>
|
||||
<block v-if="friends.length > 0">
|
||||
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
||||
<view>
|
||||
<view class="friend-flex" @click="toPending">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_01.png')"></u-avatar>
|
||||
<view class="name">新的朋友</view>
|
||||
</view>
|
||||
<view class="friend-flex" @click="showToast">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_00.png')"></u-avatar>
|
||||
<view class="name">我的群聊</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-for="(item, friend) in friends">
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<u-index-anchor :text="indexs[friend]" bgColor="#F3F6FB" height="20" size="12" color="#666"></u-index-anchor>
|
||||
<!-- #endif -->
|
||||
<u-index-item>
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<u-index-anchor :text="indexs[friend]" bgColor="#F3F6FB" height="20" size="12" color="#666"></u-index-anchor>
|
||||
<!-- #endif -->
|
||||
<view v-for="(friendItem, index) in item" :key="friendItem.userId" class="friend-flex">
|
||||
<block v-if="friendItem.portraitUrl != ''">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="friendItem.portraitUrl || ''" :default-url="require('@/static/user/cover.png')"></u-avatar>
|
||||
</block>
|
||||
<block v-else>
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/user/cover.png')"></u-avatar>
|
||||
</block>
|
||||
<view class="name">{{friendItem.name}}</view>
|
||||
</view>
|
||||
</u-index-item>
|
||||
</template>
|
||||
</u-index-list>
|
||||
</block>
|
||||
<block v-else>
|
||||
<u-empty class="pages-null" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" text="暂无好友">
|
||||
</u-empty>
|
||||
</block>
|
||||
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
||||
<view>
|
||||
<view class="friend-flex" @click="toPending">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_01.png')"></u-avatar>
|
||||
<view class="name">新的朋友</view>
|
||||
</view>
|
||||
<view class="friend-flex" @click="showToast">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_00.png')"></u-avatar>
|
||||
<view class="name">我的群聊</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="friends.length > 0">
|
||||
<template v-for="(item, friend) in friends">
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<u-index-anchor :text="indexs[friend]" bgColor="#F3F6FB" height="20" size="12" color="#666"></u-index-anchor>
|
||||
<!-- #endif -->
|
||||
<u-index-item>
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<u-index-anchor :text="indexs[friend]" bgColor="#F3F6FB" height="20" size="12" color="#666"></u-index-anchor>
|
||||
<!-- #endif -->
|
||||
<view
|
||||
v-for="(friendItem, index) in item"
|
||||
:key="friendItem.userId"
|
||||
class="friend-flex"
|
||||
@click="$Router.push({ name: 'imFriendsInfo', params: { id: friendItem.userId } })"
|
||||
>
|
||||
<block v-if="friendItem.portraitUrl != ''">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="friendItem.portraitUrl || ''" :default-url="require('@/static/user/cover.png')"></u-avatar>
|
||||
</block>
|
||||
<block v-else><u-avatar class="cover" size="40" shape="square" :src="require('@/static/user/cover.png')"></u-avatar></block>
|
||||
<view class="name">{{ friendItem.name }}</view>
|
||||
</view>
|
||||
</u-index-item>
|
||||
</template>
|
||||
</block>
|
||||
<block v-else><u-empty class="pages-null" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" text="暂无好友"></u-empty></block>
|
||||
</u-index-list>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getFriends
|
||||
} from '@/apis/interfaces/im'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
indexs : [],
|
||||
friends: []
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
getFriends().then(res => {
|
||||
this.indexs = res.indexList
|
||||
this.friends = res.itemArr
|
||||
import { getFriends } from '@/apis/interfaces/im';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
indexs: [],
|
||||
friends: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
getFriends().then(res => {
|
||||
this.indexs = res.indexList;
|
||||
this.friends = res.itemArr;
|
||||
|
||||
console.log(res.itemArr)
|
||||
})
|
||||
console.log(res.itemArr);
|
||||
});
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
// 扫码提示
|
||||
showToast() {
|
||||
uni.showToast({
|
||||
title: '群聊功能暂未开放,敬请期待',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 扫码提示
|
||||
showToast() {
|
||||
uni.showToast({
|
||||
title: "群聊功能暂未开放,敬请期待",
|
||||
icon: "none"
|
||||
})
|
||||
},
|
||||
// 新朋友
|
||||
toPending() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/pending'
|
||||
})
|
||||
},
|
||||
// 用户资料
|
||||
toInfo(targetId) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/info?targetId=' + targetId
|
||||
})
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
this.toPending()
|
||||
// 新朋友
|
||||
toPending() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/pending'
|
||||
});
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
this.toPending();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 页面空
|
||||
.pages-null {
|
||||
height: 70vh;
|
||||
// 页面空
|
||||
.pages-null {
|
||||
height: 70vh;
|
||||
}
|
||||
// 好友列表
|
||||
.friend-flex {
|
||||
position: relative;
|
||||
padding: 20rpx $padding;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
// .cover
|
||||
.name {
|
||||
flex: 1;
|
||||
padding-left: $padding;
|
||||
font-size: $title-size;
|
||||
@extend .nowrap;
|
||||
}
|
||||
// 好友列表
|
||||
.friend-flex{
|
||||
position: relative;
|
||||
padding: 20rpx $padding;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
// .cover
|
||||
.name{
|
||||
flex: 1;
|
||||
padding-left: $padding;
|
||||
font-size: $title-size;
|
||||
@extend .nowrap;
|
||||
}
|
||||
&::after{
|
||||
position: absolute;
|
||||
height: 1rpx;
|
||||
background: $border-color;
|
||||
left: calc(40px + #{$padding * 2});
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
content: " ";
|
||||
}
|
||||
&:last-child::after{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
&::after {
|
||||
position: absolute;
|
||||
height: 1rpx;
|
||||
background: $border-color;
|
||||
left: calc(40px + #{$padding * 2});
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
content: ' ';
|
||||
}
|
||||
&:last-child::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -38,17 +38,14 @@
|
||||
userInfo: {}
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.targetId = e.targetId
|
||||
console.log('获取资料',e.targetId);
|
||||
getUserInfo(e.targetId).then(res => {
|
||||
this.userInfo = res
|
||||
console.log('获取资料', res);
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.name
|
||||
})
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
getUserInfo(this.$Route.query.id).then(res => {
|
||||
this.userInfo = res
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.name
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
toPrivate() {
|
||||
uni.redirectTo({
|
||||
|
||||
@@ -1,11 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
我的资料,也就展示个二维码吧
|
||||
获取一波资料吧
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserInfo } from '@/apis/interfaces/im'
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.$Route)
|
||||
// getUserInfo(this.$Route.query.id).then(res => {
|
||||
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
|
||||
@@ -12,10 +12,8 @@
|
||||
<view class="chat-status" :class="{'hide': item.sentStatus == 50}"
|
||||
v-if="item.messageDirection == 1">{{ item.sentStatus == 50 ? '已读': '未读'}}</view>
|
||||
<view class="chat-avatar">
|
||||
<u-avatar v-if="item.messageDirection == 2" bg-color="#ffffff" :src="userInfo.portraitUrl"
|
||||
@click="showFriend(targetId)"></u-avatar>
|
||||
<u-avatar v-else @click="showMine" bg-color="#ffffff"
|
||||
:src="$store.getters.sender.portraitUrl" />
|
||||
<u-avatar v-if="item.messageDirection == 2" bg-color="#ffffff" :src="userInfo.portraitUrl" @click="showFriend(targetId)"></u-avatar>
|
||||
<u-avatar v-else @click="showMine" bg-color="#ffffff" :src="$store.getters.sender.portraitUrl" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="chat-item-time" :id="'chatId_'+index">
|
||||
@@ -249,6 +247,7 @@
|
||||
.chat-avatar {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
background: white;
|
||||
}
|
||||
|
||||
&.left {
|
||||
|
||||
Reference in New Issue
Block a user