stash
This commit is contained in:
@@ -5,19 +5,24 @@
|
||||
<view class="custom-header">
|
||||
<view class="header-flex">
|
||||
<view class="tabs">
|
||||
<view class="item show">私聊</view>
|
||||
<view class="item" @click="onNav('', {})">群聊</view>
|
||||
<view class="item show">
|
||||
私聊
|
||||
<u-badge absolute max="99" shape="horn" :offset="[-7, -7]" :value="5" />
|
||||
</view>
|
||||
<view class="item" @click="onNav('', {})">
|
||||
群聊
|
||||
<u-badge absolute max="99" shape="horn" :offset="[-7, -7]" :value="10" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<view class="item" @click="scanQrCode">
|
||||
<uni-icons color="#555" type="scan" size="22"></uni-icons>
|
||||
|
||||
<view class="btns">
|
||||
<view class="item" @click="scanQrCode">
|
||||
<uni-icons color="#555" type="scan" size="22" />
|
||||
</view>
|
||||
<view class="item" @click="onNav('imFriends', {})">
|
||||
<uni-icons color="#555" custom-prefix="iconfont" type="icon-tuandui" size="22"></uni-icons>
|
||||
<u-badge absolute max="99" isDot :offset="[0, 0]" :show="hasNewFriends" />
|
||||
<uni-icons color="#555" custom-prefix="iconfont" type="icon-tuandui" size="22" />
|
||||
</view>
|
||||
<!-- <view class="item" @click="onNav('', {})">
|
||||
<uni-icons color="#555" custom-prefix="iconfont" type="icon-gengduo2" size="22"></uni-icons>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -46,7 +51,7 @@
|
||||
<message-preview class="preview" :msg="item.latestMessage" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- TODO 长按的弹出框,怎么点击隐藏,没搞明白 -->
|
||||
|
||||
<view class="shade" @click="hidePop" v-show="showPop">
|
||||
<view class="pop" :style="popStyle" :class="{'show':showPop}">
|
||||
<view v-for="(item, index) in popButton" :key="index" @click="pickerMenu" :data-index="index">
|
||||
@@ -89,7 +94,8 @@
|
||||
popButton: ['置顶聊天', '删除该聊天'],
|
||||
/* 弹窗定位样式 */
|
||||
popStyle: "",
|
||||
pickedItem: {}
|
||||
pickedItem: {},
|
||||
hasNewFriends: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -110,14 +116,14 @@
|
||||
onShow() {
|
||||
if (this.$store.state.token !== '') {
|
||||
this.getConversationList()
|
||||
}
|
||||
uni.$on('onReceiveMessage', (msg) => {
|
||||
console.log('收到消息,刷新列表');
|
||||
this.getConversationList()
|
||||
})
|
||||
}
|
||||
uni.$on('onReceiveMessage', (msg) => {
|
||||
console.log('收到消息,刷新列表');
|
||||
this.getConversationList()
|
||||
})
|
||||
this.isShown = true
|
||||
},
|
||||
onHide() {
|
||||
onHide() {
|
||||
uni.$off('onReceiveMessage')
|
||||
this.isShown = false
|
||||
},
|
||||
@@ -209,11 +215,11 @@
|
||||
url: '/pages/im/private/chat?targetId=' + item.targetId + '&conversationType=' + item
|
||||
.conversationType
|
||||
})
|
||||
},
|
||||
toFriend(targetId) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/info?targetId=' + targetId
|
||||
})
|
||||
},
|
||||
toFriend(targetId) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/info?targetId=' + targetId
|
||||
})
|
||||
},
|
||||
// 点击按钮
|
||||
onNav(name, params) {
|
||||
@@ -268,6 +274,7 @@
|
||||
|
||||
.tabs {
|
||||
.item {
|
||||
position: relative;
|
||||
margin-left: $margin;
|
||||
display: inline-block;
|
||||
font-size: $title-size-lg;
|
||||
@@ -289,6 +296,7 @@
|
||||
|
||||
.btns {
|
||||
.item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin-left: $margin;
|
||||
}
|
||||
@@ -379,10 +387,10 @@
|
||||
}
|
||||
|
||||
/* 遮罩 */
|
||||
.shade {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.shade {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.pop {
|
||||
position: fixed;
|
||||
|
||||
Reference in New Issue
Block a user