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.
200 lines
4.4 KiB
200 lines
4.4 KiB
<template>
|
|
<view class="xiaoxi">
|
|
<view class="xiaoxi-navbar">
|
|
<u-navbar :is-back="false" title="消息">
|
|
<view slot="right">
|
|
<view class="search" @click="clearInfo()">
|
|
<image src="@/static/icon-clear.png"></image>
|
|
</view>
|
|
</view>
|
|
</u-navbar>
|
|
</view>
|
|
<view class="xiaoxi-tab">
|
|
<view class="tab">
|
|
<u-tabs :list="list" bg-color="transparent" :is-scroll="false" active-color="#222222" inactive-color="#666666" font-size="30" :active-item-style="activeStyle" bar-height="10" bar-width="60" v-model="current" @change="changeTabs"></u-tabs>
|
|
</view>
|
|
</view>
|
|
<view class="xiaoxi-select" v-if="current == 1">
|
|
<view class="select">
|
|
<view class="item" @click="selectItem(0)" :class="tabIndex == 0?'item-on':''">好友</view>
|
|
<view class="item" @click="selectItem(1)" :class="tabIndex == 1?'item-on':''">关注</view>
|
|
<view class="item" @click="selectItem(2)" :class="tabIndex == 2?'item-on':''">粉丝</view>
|
|
</view>
|
|
</view>
|
|
<view class="xiaoxi-list">
|
|
<view class="item" v-if="current == 0">
|
|
<view class="pic"><image src="@/static/dashan.png"></image></view>
|
|
<view class="info">
|
|
<view class="name">搭讪消息<text>晚上9:50</text></view>
|
|
<view class="desc">上学和工作,哪个更快来呢?上学的...</view>
|
|
</view>
|
|
</view>
|
|
<view class="item" v-if="current == 0">
|
|
<view class="pic"><image src="@/static/xitong.png"></image></view>
|
|
<view class="info">
|
|
<view class="name">系统消息<text>晚上9:50</text></view>
|
|
<view class="desc">明天再见喽!</view>
|
|
</view>
|
|
</view>
|
|
<view class="item">
|
|
<view class="pic"><image src="@/static/kan.png"></image></view>
|
|
<view class="info">
|
|
<view class="name">谁看过我<text>晚上9:50</text></view>
|
|
<view class="desc">对你感兴趣的人一直默默关注你</view>
|
|
</view>
|
|
</view>
|
|
<view class="item">
|
|
<view class="pic"><image src="@/static/nan.png"></image><view class="num">30</view></view>
|
|
<view class="info">
|
|
<view class="name">李同学<text>晚上9:50</text></view>
|
|
<view class="desc">在么?</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
tabIndex: 0,
|
|
current: 0,
|
|
list:[{'name': '消息'},{'name': '好友'}],
|
|
activeStyle:{'fontSize': '35rpx'}
|
|
}
|
|
},
|
|
onLoad() {
|
|
|
|
},
|
|
methods: {
|
|
clearInfo() {
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定要清空所有未读消息吗?",
|
|
confirmColor: "#000",
|
|
success(res){
|
|
if(res.confirm){
|
|
uni.showToast({
|
|
title: "清除成功"
|
|
})
|
|
}
|
|
}
|
|
})
|
|
},
|
|
selectItem(index) {
|
|
this.tabIndex = index
|
|
},
|
|
changeTabs(index){
|
|
this.current = index
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
page{
|
|
background-color: #fff;
|
|
}
|
|
.xiaoxi{
|
|
overflow: hidden;
|
|
&-navbar{
|
|
image{
|
|
width: 45rpx;
|
|
height: 45rpx;
|
|
margin-right: 30rpx;
|
|
}
|
|
}
|
|
&-tab{
|
|
display: flex;
|
|
margin-top: 10rpx;
|
|
overflow: hidden;
|
|
.tab{
|
|
width: 250rpx;
|
|
}
|
|
}
|
|
&-select{
|
|
padding: 20rpx 25rpx;
|
|
overflow: hidden;
|
|
.select{
|
|
display: flex;
|
|
justify-content: center;
|
|
border-radius: 20rpx;
|
|
border: 1px solid #CCCCCC;
|
|
overflow: hidden;
|
|
.item{
|
|
flex: 1;
|
|
text-align: center;
|
|
line-height: 80rpx;
|
|
border-left: 1px solid #CCCCCC;
|
|
&:first-child{
|
|
border-left-color: #fff;
|
|
}
|
|
&-on{
|
|
&:first-child{
|
|
border-left-color: #000000;
|
|
}
|
|
background-color: #000000;
|
|
color: #FFFFFF;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
&-list{
|
|
padding: 0 25rpx 25rpx;
|
|
overflow: hidden;
|
|
.item{
|
|
display: flex;
|
|
align-items: center;
|
|
.pic{
|
|
width: 90rpx;
|
|
height: 90rpx;
|
|
margin-right: 20rpx;
|
|
position: relative;
|
|
.num{
|
|
width: 30rpx;
|
|
height: 30rpx;
|
|
line-height: 30rpx;
|
|
background: #FC2C2C;
|
|
border-radius: 50%;
|
|
font-weight: 500;
|
|
font-size: 18rpx;
|
|
color: #FFFFFF;
|
|
text-align: center;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
z-index: 2;
|
|
}
|
|
image{
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: 50%;
|
|
}
|
|
}
|
|
.info{
|
|
padding: 30rpx 0;
|
|
flex: 1;
|
|
border-bottom: 1px solid #EAEAEA;
|
|
.name{
|
|
font-weight: 400;
|
|
font-size: 30rpx;
|
|
color: #222222;
|
|
text{
|
|
float: right;
|
|
font-weight: 400;
|
|
font-size: 24rpx;
|
|
color: #AAAAAA;
|
|
}
|
|
}
|
|
.desc{
|
|
font-weight: 400;
|
|
font-size: 24rpx;
|
|
color: #AAAAAA;
|
|
margin-top: 15rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|