Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
7da365d1
Commit
7da365d1
authored
Nov 15, 2019
by
Junling Bu
Browse files
fix[litemall-wx]: 评论列表不能正确显示
parent
bdd497e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
litemall-wx/pages/topicComment/topicComment.js
View file @
7da365d1
...
...
@@ -45,15 +45,15 @@ Page({
if
(
that
.
data
.
showType
==
0
)
{
that
.
setData
({
allCommentList
:
that
.
data
.
allCommentList
.
concat
(
res
.
data
.
data
),
allPage
:
res
.
data
.
currentP
age
,
comments
:
that
.
data
.
allCommentList
.
concat
(
res
.
data
.
data
)
allCommentList
:
that
.
data
.
allCommentList
.
concat
(
res
.
data
.
list
),
allPage
:
res
.
data
.
p
age
,
comments
:
that
.
data
.
allCommentList
.
concat
(
res
.
data
.
list
)
});
}
else
{
that
.
setData
({
picCommentList
:
that
.
data
.
picCommentList
.
concat
(
res
.
data
.
data
),
picPage
:
res
.
data
.
currentP
age
,
comments
:
that
.
data
.
picCommentList
.
concat
(
res
.
data
.
data
)
picCommentList
:
that
.
data
.
picCommentList
.
concat
(
res
.
data
.
list
),
picPage
:
res
.
data
.
p
age
,
comments
:
that
.
data
.
picCommentList
.
concat
(
res
.
data
.
list
)
});
}
}
...
...
@@ -84,21 +84,30 @@ Page({
// 页面关闭
},
switchTab
:
function
()
{
this
.
setData
({
showType
:
this
.
data
.
showType
==
1
?
0
:
1
});
switchTab
:
function
()
{
let
that
=
this
;
if
(
that
.
data
.
showType
==
0
)
{
that
.
setData
({
allCommentList
:
[],
allPage
:
1
,
comments
:
[],
showType
:
1
});
}
else
{
that
.
setData
({
picCommentList
:
[],
picPage
:
1
,
comments
:
[],
showType
:
0
});
}
this
.
getCommentList
();
},
onReachBottom
:
function
()
{
console
.
log
(
'
onPullDownRefresh
'
);
if
(
this
.
data
.
showType
==
0
)
{
if
(
this
.
data
.
allCount
/
this
.
data
.
limit
<
this
.
data
.
allPage
)
{
return
false
;
}
this
.
setData
({
allPage
:
this
.
data
.
allPage
+
1
});
...
...
@@ -106,14 +115,10 @@ Page({
if
(
this
.
data
.
hasPicCount
/
this
.
data
.
limit
<
this
.
data
.
picPage
)
{
return
false
;
}
this
.
setData
({
picPage
:
this
.
data
.
picPage
+
1
});
}
this
.
getCommentList
();
}
})
\ No newline at end of file
litemall-wx/pages/topicComment/topicComment.wxml
View file @
7da365d1
<view class="comments">
<view class="h">
<view class="item {{ showType == 0 ? 'active' : ''}}" bindtap="switchTab">
<view class="txt">全部({{allCount}})</view>
</view>
<view class="item {{ showType == 0 ? '' : 'active'}}" bindtap="switchTab">
<view class="txt">有图({{hasPicCount}})</view>
</view>
</view>
<view class="b">
<view class="item" wx:for="{{comments}}" wx:key="id">
<view class="info">
...
...
@@ -10,7 +18,7 @@
</view>
<view class="comment">{{item.content}}</view>
<view class="imgs" wx:if="{{item.picList.length > 0}}">
<image class="img" wx:for="{{item.picList}}" wx:key="
id
" wx:for-item="pitem" src="{{pitem
.picUrl
}}"></image>
<image class="img" wx:for="{{item.picList}}" wx:key="
*this
" wx:for-item="pitem" src="{{pitem}}"></image>
</view>
</view>
...
...
litemall-wx/pages/topicComment/topicComment.wxss
View file @
7da365d1
...
...
@@ -6,7 +6,44 @@
margin: 20rpx 0;
}
.comments .h {
position: fixed;
left: 0;
top: 0;
z-index: 1000;
width: 100%;
display: flex;
background: #fff;
height: 84rpx;
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.comments .h .item {
display: inline-block;
height: 82rpx;
width: 50%;
padding: 0 15rpx;
text-align: center;
}
.comments .h .item .txt {
display: inline-block;
height: 82rpx;
padding: 0 20rpx;
line-height: 82rpx;
color: #333;
font-size: 30rpx;
width: 170rpx;
}
.comments .h .item.active .txt {
color: #ab2b2b;
border-bottom: 4rpx solid #ab2b2b;
}
.comments .b {
margin-top: 85rpx;
height: auto;
width: 720rpx;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment