Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
Sign in / Register
Toggle navigation
S
site-uniapp
概览
Overview
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
王柯
site-uniapp
Commits
a68aa2a5
提交
a68aa2a5
authored
2月 18, 2023
作者:
wk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
消息一键已读
父级
a091e99e
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
51 行增加
和
2 行删除
+51
-2
pages/gallery/message/message.vue
+51
-2
没有找到文件。
pages/gallery/message/message.vue
View file @
a68aa2a5
<
template
>
<view
class=
"content"
>
<titleBar
title=
"消息中心"
></titleBar>
<v-tabs
:tabs=
"tabs"
:scroll=
"true"
:value=
"current"
@
change=
"tabChange"
></v-tabs>
<view
class=
"tab-content"
>
<v-tabs
:tabs=
"tabs"
:scroll=
"true"
:value=
"current"
@
change=
"tabChange"
></v-tabs>
<view
class=
"t-allRead"
@
click=
"clickAllRead"
>
<image
src=
"../../../static/brush-ic.png"
class=
"image"
></image>
<text
class=
"text"
>
一键已读
</text>
</view>
</view>
<view
class=
"list-content"
v-if=
"list.length>0"
>
<view
v-for=
"(item,index) in list"
:key=
"index"
class=
"list-item"
@
click=
"itemClick(index,item)"
>
<view
class=
"red-dot"
v-if=
"!item.readStatus"
></view>
...
...
@@ -56,14 +63,25 @@
// })
},
setRead
(
item
)
{
var
list
=
[]
list
.
push
(
item
)
Api
.
setMessageRead
({
data
:
item
data
:
list
}).
then
((
result
)
=>
{
uni
.
navigateTo
({
url
:
"/pages/gallery/messageDetail/messageDetail?message="
+
JSON
.
stringify
(
item
)
})
})
},
clickAllRead
()
{
var
array
=
this
.
list
.
filter
(
item
=>
!
item
.
readStatus
).
map
(
item
=>
item
.
readStatus
=
true
)
console
.
log
(
"处理完数组"
,
array
);
Api
.
setMessageRead
({
data
:
array
}).
then
((
result
)
=>
{
this
.
getMessages
()
})
},
tabChange
(
e
)
{
console
.
log
(
"tab切换"
,
e
);
this
.
current
=
e
...
...
@@ -100,6 +118,37 @@
display
:
flex
;
flex-direction
:
column
;
.tab-content
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
.t-allRead
{
display
:
flex
;
background-color
:
#FFFFFF
;
flex-direction
:
row
;
padding
:
10
rpx
20
rpx
;
margin-right
:
30
rpx
;
border-radius
:
24
rpx
;
align-items
:
center
;
image
{
width
:
26
rpx
;
height
:
26
rpx
;
}
text
{
font-family
:
"PingFang SC"
;
font-weight
:
400
;
font-size
:
12px
;
margin-left
:
10
rpx
;
text-align
:
center
;
color
:
#666
;
}
}
}
.list-content
{
display
:
flex
;
flex-direction
:
column
;
...
...
Write
Preview
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
Please
register
or
sign in
to comment