未读消息状态处理

This commit is contained in:
2022-01-14 14:15:40 +08:00
parent e7d4e15459
commit 6c39e3484e

View File

@@ -13,7 +13,7 @@
<view class="search"> <view class="search">
<!-- 头像 --> <!-- 头像 -->
<view class="user"> <view class="user">
<u-icon name="arrow-left" color="#525252" size="20" class="downIcon" :bold="true" @click='$Router.back()'/> <u-icon name="arrow-left" color="#525252" size="22" class="downIcon" :bold="true" @click='$Router.back()'/>
<!-- <u-image class="avatar" width="90rpx" height="90rpx" :src="user.avatar ? user.avatar : require('../../static/imgs/avatar.png')" :lazy-load="true" shape="circle" /> <!-- <u-image class="avatar" width="90rpx" height="90rpx" :src="user.avatar ? user.avatar : require('../../static/imgs/avatar.png')" :lazy-load="true" shape="circle" />
<view class="nickname">{{user.nickname}}</view> --> <view class="nickname">{{user.nickname}}</view> -->
<!-- <u-icon name="arrow-down-fill" color="#525252" size="10" class="downIcon" :bold="true" space="1"/> --> <!-- <u-icon name="arrow-down-fill" color="#525252" size="10" class="downIcon" :bold="true" space="1"/> -->
@@ -36,7 +36,7 @@
<!-- 消息中心 --> <!-- 消息中心 -->
<view class="news" @click="$Router.push({name:'noticeIndex'})"> <view class="news" @click="$Router.push({name:'noticeIndex'})">
<u-icon name="bell-fill" color="#525252" size="24" :bold="true" space="1"/> <u-icon name="bell-fill" color="#525252" size="24" :bold="true" space="1"/>
<u-badge class="dian" :isDot="false" bgColor="#e6576b"></u-badge> <u-badge class="dian" :isDot="notifications_count > 0" bgColor="#e6576b"></u-badge>
</view> </view>
</view> </view>
<!-- 体重管理模块 --> <!-- 体重管理模块 -->
@@ -144,14 +144,14 @@
</view> </view>
</template> </template>
<!-- 未登录 --> <!-- 未登录 -->
<template v-if="!is_login"> <template v-else-if="!is_login">
<!-- 搜索顶部 --> <!-- 搜索顶部 -->
<view class="search" @click="Login"> <view class="search" @click="Login">
<!-- 头像 --> <!-- 头像 -->
<view class="user"> <view class="user">
<!-- <u-image class="avatar" width="90rpx" height="90rpx" :src="require('../../static/imgs/avatar.png')" :lazy-load="true" shape="circle" /> <!-- <u-image class="avatar" width="90rpx" height="90rpx" :src="require('../../static/imgs/avatar.png')" :lazy-load="true" shape="circle" />
<u-icon name="arrow-down-fill" color="#525252" size="10" class="downIcon" :bold="true" space="1" /> --> <u-icon name="arrow-down-fill" color="#525252" size="10" class="downIcon" :bold="true" space="1" /> -->
<u-icon name="arrow-left" color="#525252" size="20" class="downIcon" :bold="true" @click='$Router.back()'/> <u-icon name="arrow-left" color="#525252" size="22" class="downIcon" :bold="true" @click='$Router.back()'/>
</view> </view>
<!-- 搜索框 --> <!-- 搜索框 -->
<u-search <u-search
@@ -168,7 +168,7 @@
<!-- 消息中心 --> <!-- 消息中心 -->
<view class="news"> <view class="news">
<u-icon name="bell-fill" color="#525252" size="24" :bold="true" space="1" /> <u-icon name="bell-fill" color="#525252" size="24" :bold="true" space="1" />
<u-badge class="dian" :isDot="true" bgColor="#e6576b"></u-badge> <u-badge class="dian" :isDot="notifications_count > 0" bgColor="#e6576b"></u-badge>
</view> </view>
</view> </view>
<!-- 体重管理模块 --> <!-- 体重管理模块 -->
@@ -242,14 +242,14 @@
</view> </view>
</template> </template>
<!-- 登录 (未建立档案) --> <!-- 登录 (未建立档案) -->
<template v-if="is_login && !is_record"> <template v-eles-if="is_login && !is_record">
<!-- 搜索顶部 --> <!-- 搜索顶部 -->
<view class="search" @click="toCreateInfo"> <view class="search" @click="toCreateInfo">
<!-- 头像 --> <!-- 头像 -->
<view class="user"> <view class="user">
<!-- <u-image class="avatar" width="90rpx" height="90rpx" :src="require('../../static/imgs/avatar.png')" :lazy-load="true" shape="circle" /> <!-- <u-image class="avatar" width="90rpx" height="90rpx" :src="require('../../static/imgs/avatar.png')" :lazy-load="true" shape="circle" />
<u-icon name="arrow-down-fill" color="#525252" size="10" class="downIcon" :bold="true" space="1" /> --> <u-icon name="arrow-down-fill" color="#525252" size="10" class="downIcon" :bold="true" space="1" /> -->
<u-icon name="arrow-left" color="#525252" size="20" class="downIcon" :bold="true" @click='$Router.back()'/> <u-icon name="arrow-left" color="#525252" size="22" class="downIcon" :bold="true" @click='$Router.back()'/>
</view> </view>
<!-- 搜索框 --> <!-- 搜索框 -->
<u-search <u-search
@@ -266,7 +266,7 @@
<!-- 消息中心 --> <!-- 消息中心 -->
<view class="news"> <view class="news">
<u-icon name="bell-fill" color="#525252" size="24" :bold="true" space="1" /> <u-icon name="bell-fill" color="#525252" size="24" :bold="true" space="1" />
<u-badge class="dian" :isDot="true" bgColor="#e6576b"></u-badge> <u-badge class="dian" :isDot="notifications_count > 0" bgColor="#e6576b"></u-badge>
</view> </view>
</view> </view>
<!-- 体重管理模块 --> <!-- 体重管理模块 -->
@@ -363,7 +363,8 @@ export default {
is_record: false, // - boolean - 当前是否完善信息 (创建档案) is_record: false, // - boolean - 当前是否完善信息 (创建档案)
notices: [], // -- array -- 公告 notices: [], // -- array -- 公告
banner: {}, // -- object -- 轮播图 banner: {}, // -- object -- 轮播图
user: {} user: {},
notifications_count:0,// 消息数量
}; };
}, },
onShow() { onShow() {
@@ -401,6 +402,7 @@ export default {
this.notices = res.notices; this.notices = res.notices;
this.banner = res.banner; this.banner = res.banner;
this.user = res.user; this.user = res.user;
this.notifications_count = res.notifications_count;
}); });
}, },
/** /**
@@ -449,7 +451,7 @@ export default {
flex-direction: row; flex-direction: row;
position: relative; position: relative;
.downIcon { .downIcon {
margin: 0 0 0 $margin * 0.4; // margin: 0 0 0 $margin * 0.4;
} }
.nickname{ .nickname{
background-color: rgba($color: #fa8168, $alpha:1 ); background-color: rgba($color: #fa8168, $alpha:1 );