You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/pages/account/message/group.vue

90 lines
2.0 KiB

3 years ago
<!--
* @Author: ch
* @Date: 2022-03-22 16:13:00
* @LastEditors: ch
3 years ago
* @LastEditTime: 2022-04-25 19:34:58
3 years ago
* @Description: file content
-->
<template>
<view>
3 years ago
<BsEmpty tips="暂时还没有消息哦~" v-if="!$store.state.sessionData.length"
:icon="require('@/static/message/empty.png')" />
<view class="msgItem" v-for="item in $store.state.sessionData" :key="item.id"
@click="$Router.push(`/messageList?id=${item.id}`)">
<image class="msgItem--headImg" src="@/static/account/tx.png"></image>
<view class="msgItem--con">
<view>
3 years ago
<text class="msgItem--title">{{item.fromNickname}}</text>
<text class="msgItem--text">{{item.lastMessage.payload.content}}</text>
</view>
<view class="msgItem--right">
3 years ago
<text class="msgItem--time">{{item.lastMessage.createTimeStamp}}</text>
<u-badge class="msgItem--badge" :value="item.unreadCount"></u-badge>
</view>
</view>
</view>
3 years ago
</view>
</template>
<script>
import BsEmpty from '../../../components/BsEmpty.vue';
3 years ago
export default {
3 years ago
components: { BsEmpty },
data (){
return {
sessionData : this.$store.state.sessionData
}
}
3 years ago
}
</script>
<style lang="scss" scoped>
.msgItem{
display: flex;
padding: 40rpx 0 0 40rpx;
&--headImg{
width: 106rpx;
height: 106rpx;
margin-right: 30rpx;
}
&--con{
flex: 1;
display: flex;
justify-content: space-between;
border-bottom: 1px solid $color-grey2;
padding: 0 40rpx 40rpx 0;
}
&--title{
width: 350rpx;
display: block;
font-size: $font-size-lg;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
margin-bottom: 20rpx;
}
&--text{
width: 350rpx;
font-size: $font-size-base;
line-height: 36rpx;
color: $color-grey4;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
&--right{
text-align: right;
}
&--time{
font-size: $font-size-sm;
color: $color-grey4;
display: block;
height: 36rpx;
line-height: 36rpx;
margin-bottom: 20rpx;
}
&--badge{
display: inline-block;
}
}
3 years ago
</style>