Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_milo
Great Teamwork
提交
c2101c10
Great Teamwork
项目概览
_milo
/
Great Teamwork
通知
13
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Great Teamwork
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c2101c10
编写于
5月 08, 2023
作者:
赵十四
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改连续点击的bug
上级
55070d5a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
15 deletion
+60
-15
teamwork/pages/post/add-post.vue
teamwork/pages/post/add-post.vue
+10
-2
teamwork/pages/post/post-detail.vue
teamwork/pages/post/post-detail.vue
+31
-7
teamwork/pages/post/post.vue
teamwork/pages/post/post.vue
+19
-6
未找到文件。
teamwork/pages/post/add-post.vue
浏览文件 @
c2101c10
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<view
class=
"content"
>
<view
class=
"content"
>
<!-- 页头 -->
<!-- 页头 -->
<view
class=
"top"
>
<view
class=
"top"
>
<image
@
click=
"back"
class=
"back"
:src=
"'../../static/icon/返回.png'"
></image>
<image
@
click=
"back"
:disabled=
"btnDisabled"
class=
"back"
:src=
"'../../static/icon/返回.png'"
></image>
<view
class=
"title"
>
发布帖子
</view>
<view
class=
"title"
>
发布帖子
</view>
<image
class=
"add"
:src=
"'../../static/post/发送.png'"
@
click=
"addPost"
></image>
<image
class=
"add"
:src=
"'../../static/post/发送.png'"
@
click=
"addPost"
></image>
</view>
</view>
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
btnDisabled
:
false
,
value1
:
''
,
value1
:
''
,
imageValue
:
[],
imageValue
:
[],
img
:
[]
img
:
[]
...
@@ -59,6 +60,13 @@
...
@@ -59,6 +60,13 @@
})
})
},
},
addPost
()
{
addPost
()
{
if
(
this
.
btnDisabled
)
{
return
}
this
.
btnDisabled
=
true
setTimeout
(()
=>
{
this
.
btnDisabled
=
false
},
1000
)
var
length
=
this
.
imageValue
.
length
;
var
length
=
this
.
imageValue
.
length
;
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
this
.
img
.
push
(
this
.
imageValue
[
i
].
path
);
this
.
img
.
push
(
this
.
imageValue
[
i
].
path
);
...
@@ -67,7 +75,7 @@
...
@@ -67,7 +75,7 @@
uni
.
showToast
({
uni
.
showToast
({
title
:
'
空内容不能发布呦
'
,
title
:
'
空内容不能发布呦
'
,
duration
:
2000
,
duration
:
2000
,
icon
:
'
error
'
icon
:
'
error
'
})
})
}
else
{
}
else
{
...
...
teamwork/pages/post/post-detail.vue
浏览文件 @
c2101c10
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<text
class=
"del"
@
click=
"delPost"
v-if=
"userId==postDetail.ownerId"
>
删除
</text>
<text
class=
"del"
@
click=
"delPost"
v-if=
"userId==postDetail.ownerId"
>
删除
</text>
<view
class=
"icon-and-num"
>
<view
class=
"icon-and-num"
>
<image
class=
"like-icon"
<image
class=
"like-icon"
:src=
"postDetail.islike==1?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
:src=
"postDetail.islike==1?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
:disabled=
"btnDisabled"
style=
"width: 20px;height:20px;float: left;"
@
click=
"changeLike"
/>
style=
"width: 20px;height:20px;float: left;"
@
click=
"changeLike"
/>
<text
style=
"font-size: 15px;float: left;"
>
{{
postDetail
.
likes
}}
</text>
<text
style=
"font-size: 15px;float: left;"
>
{{
postDetail
.
likes
}}
</text>
<image
class=
"comment-icon"
:src=
"'../../static/post/评论.png'"
<image
class=
"comment-icon"
:src=
"'../../static/post/评论.png'"
...
@@ -67,8 +67,8 @@
...
@@ -67,8 +67,8 @@
<view
class=
"like-and-time"
>
<view
class=
"like-and-time"
>
<text
class=
"add-time"
>
{{
item
.
commentDatetime
}}
</text>
<text
class=
"add-time"
>
{{
item
.
commentDatetime
}}
</text>
<view
class=
"icon-and-num"
>
<view
class=
"icon-and-num"
>
<image
class=
"like-icon"
<image
class=
"like-icon"
:disabled=
"btnDisabled"
:src=
"item.islike==1?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
:src=
"item.islike==1?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
style=
"width: 16px;height:16px;"
@
click=
"changeCommentLike(index)"
/>
style=
"width: 16px;height:16px;"
@
click=
"changeCommentLike(index)"
/>
<text
style=
"font-size: 12px;"
>
{{
item
.
commentLikes
}}
</text>
<text
style=
"font-size: 12px;"
>
{{
item
.
commentLikes
}}
</text>
</view>
</view>
...
@@ -100,6 +100,7 @@
...
@@ -100,6 +100,7 @@
data
()
{
data
()
{
return
{
return
{
btnDisabled
:
false
,
current
:
1
,
current
:
1
,
show
:
false
,
show
:
false
,
value1
:
""
,
value1
:
""
,
...
@@ -188,7 +189,15 @@
...
@@ -188,7 +189,15 @@
confirm
(
value
)
{
confirm
(
value
)
{
// 输入框的值
// 输入框的值
console
.
log
(
value
)
console
.
log
(
value
)
uniCloud
.
callFunction
({
if
(
value
==
''
){
uni
.
showToast
({
title
:
'
空内容不能发布呦
'
,
duration
:
1000
,
icon
:
'
error
'
})
}
else
{
uniCloud
.
callFunction
({
name
:
'
fe-college-commentPost
'
,
name
:
'
fe-college-commentPost
'
,
data
:
{
//向云函数中传入的数据
data
:
{
//向云函数中传入的数据
userId
:
getApp
().
globalData
.
userId
,
userId
:
getApp
().
globalData
.
userId
,
...
@@ -201,7 +210,10 @@
...
@@ -201,7 +210,10 @@
this
.
getData
();
this
.
getData
();
console
.
log
(
res
.
result
.
data
);
console
.
log
(
res
.
result
.
data
);
});
});
this
.
$refs
.
popup
.
close
();
this
.
$refs
.
popup
.
close
();
}
},
},
//评论窗口
//评论窗口
addComment
()
{
addComment
()
{
...
@@ -237,7 +249,13 @@
...
@@ -237,7 +249,13 @@
//点赞状态改变
//点赞状态改变
changeLike
()
{
changeLike
()
{
if
(
this
.
btnDisabled
)
{
return
}
this
.
btnDisabled
=
true
setTimeout
(()
=>
{
this
.
btnDisabled
=
false
},
1000
)
//已经点赞
//已经点赞
if
(
this
.
postDetail
.
islike
==
1
)
{
if
(
this
.
postDetail
.
islike
==
1
)
{
// console.log(this.allPost[index].postId);
// console.log(this.allPost[index].postId);
...
@@ -283,7 +301,13 @@
...
@@ -283,7 +301,13 @@
//改变评论的点赞状态
//改变评论的点赞状态
changeCommentLike
(
index
)
{
changeCommentLike
(
index
)
{
if
(
this
.
btnDisabled
)
{
return
}
this
.
btnDisabled
=
true
setTimeout
(()
=>
{
this
.
btnDisabled
=
false
},
1000
)
//已经点赞
//已经点赞
if
(
this
.
postDetail
.
commentList
[
index
].
islike
==
1
)
{
if
(
this
.
postDetail
.
commentList
[
index
].
islike
==
1
)
{
// console.log(this.allPost[index].postId);
// console.log(this.allPost[index].postId);
...
...
teamwork/pages/post/post.vue
浏览文件 @
c2101c10
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<view
class=
"icon-and-num"
>
<view
class=
"icon-and-num"
>
<image
class=
"like-icon"
<image
class=
"like-icon"
:src=
"item.islike=='1'?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
:src=
"item.islike=='1'?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
style=
"width: 20px;height:20px;float: left;"
@
click.stop=
"changeAllPostLike(index)"
/>
style=
"width: 20px;height:20px;float: left;"
@
click.stop=
"changeAllPostLike(index)"
:disabled=
"btnDisabled"
/>
<text
style=
"font-size: 15px;float: left;"
>
{{
item
.
likes
}}
</text>
<text
style=
"font-size: 15px;float: left;"
>
{{
item
.
likes
}}
</text>
<image
class=
"comment-icon"
:src=
"'../../static/post/评论.png'"
<image
class=
"comment-icon"
:src=
"'../../static/post/评论.png'"
style=
"width: 20px;height: 20px;margin-left: 10px;float: left;"
/>
style=
"width: 20px;height: 20px;margin-left: 10px;float: left;"
/>
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
<view
class=
"icon-and-num"
>
<view
class=
"icon-and-num"
>
<image
class=
"like-icon"
<image
class=
"like-icon"
:src=
"item.islike=='1'?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
:src=
"item.islike=='1'?'../../static/post/喜欢2.png':'../../static/post/喜欢.png'"
style=
"width: 20px;height:20px;float: left;"
@
click.stop=
"changeAllPostLike(index)"
/>
style=
"width: 20px;height:20px;float: left;"
@
click.stop=
"changeAllPostLike(index)"
:disabled=
"btnDisabled"
/>
<text
style=
"font-size: 15px;float: left;"
>
{{
item
.
likes
}}
</text>
<text
style=
"font-size: 15px;float: left;"
>
{{
item
.
likes
}}
</text>
<image
class=
"comment-icon"
:src=
"'../../static/post/评论.png'"
<image
class=
"comment-icon"
:src=
"'../../static/post/评论.png'"
style=
"width: 20px;height: 20px;margin-left: 10px;float: left;"
/>
style=
"width: 20px;height: 20px;margin-left: 10px;float: left;"
/>
...
@@ -127,6 +127,7 @@
...
@@ -127,6 +127,7 @@
},
},
data
()
{
data
()
{
return
{
return
{
btnDisabled
:
false
,
current
:
1
,
current
:
1
,
show
:
false
,
show
:
false
,
value1
:
""
,
value1
:
""
,
...
@@ -167,12 +168,12 @@
...
@@ -167,12 +168,12 @@
if
(
index
.
index
==
0
)
{
if
(
index
.
index
==
0
)
{
this
.
getMyPost
();
this
.
getMyPost
();
console
.
log
(
"
000
"
)
}
}
if
(
index
.
index
==
1
)
{
if
(
index
.
index
==
1
)
{
this
.
getAllPost
();
this
.
getAllPost
();
console
.
log
(
"
111
"
)
}
}
},
},
...
@@ -219,7 +220,13 @@
...
@@ -219,7 +220,13 @@
//点赞状态改变
//点赞状态改变
changeAllPostLike
(
index
)
{
changeAllPostLike
(
index
)
{
if
(
this
.
btnDisabled
)
{
return
}
this
.
btnDisabled
=
true
setTimeout
(()
=>
{
this
.
btnDisabled
=
false
},
1000
)
//已经点赞
//已经点赞
if
(
this
.
allPost
[
index
].
islike
==
1
)
{
if
(
this
.
allPost
[
index
].
islike
==
1
)
{
// console.log(this.allPost[index].postId);
// console.log(this.allPost[index].postId);
...
@@ -264,7 +271,13 @@
...
@@ -264,7 +271,13 @@
//点赞状态改变
//点赞状态改变
changeMyPostLike
(
index
)
{
changeMyPostLike
(
index
)
{
if
(
this
.
btnDisabled
)
{
return
}
this
.
btnDisabled
=
true
setTimeout
(()
=>
{
this
.
btnDisabled
=
false
},
1000
)
//已经点赞
//已经点赞
if
(
this
.
myPost
[
index
].
islike
==
1
)
{
if
(
this
.
myPost
[
index
].
islike
==
1
)
{
// console.log(this.allPost[index].postId);
// console.log(this.allPost[index].postId);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录