Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
王水玲
6 years ago
Commit
d705b17de8e0d65f5b954033d39289ea0f582c75
2 parents
9fac412a
242ded69
Merge branch 'feature/comment-reply' into 'release/6.8.4'
评论添加回复 See merge request
!409
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
32 deletions
apps/home/models/comment.js
apps/home/views/action/comment.hbs
apps/product/controllers/detail.js
public/hbs/product/comment-item.hbs
public/scss/home/_comment.css
public/scss/product/_detail.css
apps/home/models/comment.js
View file @
d705b17
...
...
@@ -107,7 +107,9 @@ function getCommentList(uid, isComment, page, limit) {
url
:
helpers
.
image
(
cm
.
url
,
100
,
100
),
sourceUrl
:
helpers
.
image
(
cm
.
url
,
400
,
400
),
height
:
cm
.
height
,
weight
:
cm
.
weight
weight
:
cm
.
weight
,
reply
:
cm
.
reply
,
replyTitle
:
cm
.
replyTitle
};
});
...
...
apps/home/views/action/comment.hbs
View file @
d705b17
...
...
@@ -136,6 +136,9 @@
</div>
</div>
{{/if}}
{{#
reply
}}
<p
class=
"comment-reply"
><b>
{{
..
/
replyTitle
}}
</b>
{{
.
}}
</p>
{{/
reply
}}
<p
class=
"color-gray"
>
评论时间:
{{
createTime
}}
</p>
</div>
{{/
each
}}
...
...
@@ -171,6 +174,9 @@
<i class="view view-only">查看</i>
</div>
</div>
\{{# reply}}
<p class="comment-reply"><b>\{{../replyTitle}}</b>\{{.}}</p>
\{{/ reply}}
<p class="color-gray">评论时间:\{{
createTime
}}
<
/p
>
<
/div
>
</script>
...
...
apps/product/controllers/detail.js
View file @
d705b17
...
...
@@ -160,7 +160,9 @@ const indexComment = (req, res, next) => {
star
:
_
.
get
(
item
,
'satisfied'
,
1
),
comfort
:
_
.
get
(
item
,
'size'
,
'MIDDLE'
),
height
:
_
.
get
(
item
,
'height'
,
''
),
weight
:
_
.
get
(
item
,
'weight'
,
''
)
weight
:
_
.
get
(
item
,
'weight'
,
''
),
reply
:
_
.
get
(
item
,
'reply'
),
replyTitle
:
_
.
get
(
item
,
'replyTitle'
)
};
})
});
...
...
public/hbs/product/comment-item.hbs
View file @
d705b17
...
...
@@ -6,40 +6,50 @@
<span
class=
"star-
{{
star
}}
active"
></span>
</span>
</div>
<dl
class=
"pull-right"
>
{{#if
color
}}
<dd>
颜色:
{{
color
}}
</dd>
{{/if}}
{{#if
size
}}
<dd>
{{
skuTitle
}}
:
{{
size
}}
</dd>
{{/if}}
{{#if
height
}}
<dd>
身高:
{{
height
}}
厘米
</dd>
{{/if}}
{{#if
weight
}}
<dd>
体重:
{{
weight
}}
公斤
</dd>
{{/if}}
<dd>
尺码符合度:
{{#
if_cond
comfort
"==="
"MIDDLE"
}}
合适
{{/
if_cond
}}
{{#
if_cond
comfort
"==="
"SMALL"
}}
偏小
{{/
if_cond
}}
{{#
if_cond
comfort
"==="
"BIG"
}}
偏大
{{/
if_cond
}}
</dd>
</dl>
<!-- <div style="clear:both"></div> -->
<div
class=
"comment-detail"
>
<p
class=
"comment"
>
{{
comment
}}
</p>
{{#if
url
}}
<div
class=
"img-preview"
>
<a
class=
"img-thumb"
href=
"javascript:void(0);"
>
<img
src=
"
{{
image2
url
w
=
70
h
=
100
mode
=
1
}}
"
/>
</a>
<div
class=
"img-detail"
>
<dl
class=
"toolbar"
>
<dd
data-role=
"preview-close"
><i
class=
"iconfont"
>

</i>
收起
</dd>
<dd
data-role=
"preview-left"
><i
class=
"iconfont"
>

</i>
向左旋转
</dd>
<dd
data-role=
"preview-right"
><i
class=
"iconfont"
>

</i>
向右旋转
</dd>
</dl>
<div
class=
"img-wrap"
>
<img
src=
"
{{
image2
url
w
=
345
h
=
345
}}
"
/>
<div
class=
"comment-cont"
>
<dl
class=
"pull-right"
>
{{#if
color
}}
<dd>
颜色:
{{
color
}}
</dd>
{{/if}}
{{#if
size
}}
<dd>
{{
skuTitle
}}
:
{{
size
}}
</dd>
{{/if}}
{{#if
height
}}
<dd>
身高:
{{
height
}}
厘米
</dd>
{{/if}}
{{#if
weight
}}
<dd>
体重:
{{
weight
}}
公斤
</dd>
{{/if}}
<dd>
尺码符合度:
{{#
if_cond
comfort
"==="
"MIDDLE"
}}
合适
{{/
if_cond
}}
{{#
if_cond
comfort
"==="
"SMALL"
}}
偏小
{{/
if_cond
}}
{{#
if_cond
comfort
"==="
"BIG"
}}
偏大
{{/
if_cond
}}
</dd>
</dl>
<!-- <div style="clear:both"></div> -->
<div
class=
"comment-detail"
>
<p
class=
"comment"
>
{{
comment
}}
</p>
{{#if
url
}}
<div
class=
"img-preview"
>
<a
class=
"img-thumb"
href=
"javascript:void(0);"
>
<img
src=
"
{{
image2
url
w
=
70
h
=
100
mode
=
1
}}
"
/>
</a>
<div
class=
"img-detail"
>
<dl
class=
"toolbar"
>
<dd
data-role=
"preview-close"
><i
class=
"iconfont"
>

</i>
收起
</dd>
<dd
data-role=
"preview-left"
><i
class=
"iconfont"
>

</i>
向左旋转
</dd>
<dd
data-role=
"preview-right"
><i
class=
"iconfont"
>

</i>
向右旋转
</dd>
</dl>
<div
class=
"img-wrap"
>
<img
src=
"
{{
image2
url
w
=
345
h
=
345
}}
"
/>
</div>
</div>
</div>
</div>
{{/if}}
<span
class=
"comment-date"
>
{{
date
}}
</span>
{{/if}}
{{#
unless
reply
}}
<p
class=
"comment-date"
>
{{
date
}}
</p>
{{/
unless
}}
</div>
</div>
{{#
reply
}}
<p
class=
"comment-reply"
><b>
{{
..
/
replyTitle
}}
</b>
{{
.
}}
</p>
<p
class=
"comment-date"
>
{{
..
/
date
}}
</p>
{{/
reply
}}
</li>
{{/
each
}}
...
...
public/scss/home/_comment.css
View file @
d705b17
...
...
@@ -336,6 +336,16 @@
margin-right
:
50px
;
}
}
.comment-reply
{
background
:
#f2f2f2
;
padding
:
15px
;
color
:
#999
;
b
{
font-weight
:
bold
;
}
}
}
.comment-star
{
...
...
public/scss/product/_detail.css
View file @
d705b17
...
...
@@ -1569,6 +1569,9 @@
}
.comment-detail
{
float
:
left
;
width
:
700px
;
.comment-date
{
font-size
:
14px
;
color
:
#b0b0b0
;
...
...
@@ -1631,6 +1634,26 @@
}
}
.comment-reply
{
width
:
850px
;
padding
:
15px
;
background
:
#f0f0f0
;
line-height
:
20px
;
margin-bottom
:
10px
;
font-size
:
14px
;
color
:
#999
;
b
{
font-weight
:
bold
;
}
}
.comment-cont
{
height
:
auto
;
overflow
:
hidden
;
word-break
:
break-word
;
}
dl
{
line-height
:
1.5
;
color
:
#999
;
...
...
Please
register
or
login
to post a comment