Authored by mark

add like useful

... ... @@ -191,6 +191,8 @@ const indexConsult = (req, res, next) => {
let size = req.query.size || 10;
return service.indexConsultAsync(uid, pid, page, size).then(result => {
console.log("result=================");
console.log(result);
return res.json({
code: 200,
data: result
... ... @@ -260,5 +262,3 @@ module.exports = {
detailReturn,
recommend
};
... ...
... ... @@ -372,9 +372,14 @@
我要咨询&nbsp;&gt;</a></span></p>
</div>
<div class="common-question buy-consults">
<p>购买咨询&nbsp;&nbsp;<em class="consult-num">0</em></p>
<div class="buy-consults">
<p class="block-title">
<span class="title-head">
<span class="title cur">购买咨询(<em class="consult-num">0</em>)</span>
</span>
</p>
</div>
<div id="consults-ul"></div>
<div class="common-question">
<p>
... ... @@ -392,7 +397,7 @@
</div>
<div class="common-question">
<textarea id="textbox"></textarea>
<textarea id="textbox" placeholder="请输入您的问题"></textarea>
<span id="submit-consult" class="btn">提交咨询</span>
</div>
... ...
... ... @@ -22,13 +22,6 @@
</dl>
<!-- <div style="clear:both"></div> -->
<div class="comment-detail">
<!-- <div class="tag-list clearfix">
<span class="comment-star pull-left">
<span class="star-{{star}} active"></span>
</span>
</div> -->
<p class="comment">{{comment}}</p>
{{#if url}}
... ...
<!-- {{# consults}}
<li>
<div class="user-info clearfix">
<img class="user-avatar" src="{{avatar}}">
<p>
<span class="question">{{question}}</span>
<br>
<span class="date">{{date}}</span>
</p>
</div>
<p class="consult">{{answer}}</p>
</li>
{{/ consults}} -->
{{# consults}}
<div class="common-question">
<p>
<span class="top-question">
<i class="iconfont">&#xe695;</i>
<small>183****3432&nbsp;&nbsp;&nbsp;{{question}}</small>
<small>{{question}}</small>
<small class="right-time">{{date}}</small>
</span>
<span>
... ... @@ -26,8 +14,8 @@
</p>
<div class="common-zan">
<div class="zan-content">
<span class="icon-border"><i class="iconfont getzan">&#xe626;</i>赞(5)</span>
<span><i class="iconfont">&#xe611;</i>有用(5)</span>
<span class="icon-border"><i class="iconfont{{#if isLike}} getzan{{/if}}">&#xe626;</i>赞({{like}}</span>
<span><i class="iconfont{{#if isUseful}} getzan{{/if}}">&#xe611;</i>有用({{useful}}</span>
</div>
</div>
</div>
... ...
... ... @@ -814,56 +814,6 @@ $('#brand-favour').click(function() {
});
});
// 商品详情/材质洗涤切换
// $('.description-material').on('click', '.title', function() {
// var $this = $(this),
// index = $this.index();
//
// var $description = $('.description-content'),
// $material = $('.material-content');
//
// if ($this.hasClass('cur')) {
// return;
// }
//
// $this.addClass('cur');
// $this.siblings('.cur').removeClass('cur');
//
// if (index === 0) {
//
// // 商品信息
// $description.slideDown(SLIDETIME);
// $material.slideUp(SLIDETIME);
// } else {
// $description.slideUp(SLIDETIME);
// $material.slideDown(SLIDETIME);
// }
// });
// $('.description-material-tab').on('click', '.title', function() {
// var $this = $(this),
// index = $this.index();
//
// var $sizeContent = $('.size-content'),
// $modelContent = $('.model-content');
//
// if ($this.hasClass('cur')) {
// return;
// }
//
// $this.addClass('cur');
// $this.siblings('.cur').removeClass('cur');
//
// if (index === 0) {
//
// // 商品信息
// $sizeContent.slideDown(SLIDETIME);
// $modelContent.slideUp(SLIDETIME);
// } else {
// $sizeContent.slideUp(SLIDETIME);
// $modelContent.slideDown(SLIDETIME);
// }
// });
// 详情页套餐区
$('.good-info .good-detail-text > a').dotdotdot({
wrap: 'letter'
... ... @@ -1053,6 +1003,12 @@ function fetchComment() {
consults: res
}));
$('#consults-ul .zan-content').on('click', '.iconfont', function(){
var $this = $(this);
$this.addClass('getzan');
});
baseUrl = '/product/detail/consult?productId=' + id + '&filterId=7';
$('.consults-devide').empty().append(
... ... @@ -1074,8 +1030,6 @@ function fetchComment() {
loadConsults(result[2]);
});
$('.consult-comment').on('click', '.load-more', function() {
var $this = $(this);
... ... @@ -1086,6 +1040,8 @@ function fetchComment() {
}
});
// 我要咨询
$('#consults-btn').click(function() {
... ...
... ... @@ -1464,6 +1464,7 @@
height: 32px;
line-height: 32px;
margin: 8px 0 0;
}
.error {
... ... @@ -1951,21 +1952,24 @@
padding: 5px;
outline: #e0e0e0;
resize: none;
background-color: #f5f5f5;
background-color: #fff;
border: 1px solid #e0e0e0;
}
.btn{
display: block;
width: 140px;
display: block;
width: 100%;
height: 32px;
line-height: 32px;
color: #fff;
background: #222;
color: #000;
background: #f5f5f5;
text-align: center;
font-size: 12px;
margin: 0 auto;
cursor: pointer;
margin-top: 20px;
margin-top: -2px;
border: 1px solid #e0e0e0;
padding: 5px;
}
... ... @@ -2055,14 +2059,35 @@
}
.buy-consults{
height: 40px;
background-color: #f5f5f5;
border-top: 2px solid #eaeceb;
p{
display: inline-block;
margin-top: 13px;
margin-left: 30px;
color: #000;
.block-title {
margin-bottom: 46px;
margin-top: -18px;
text-align: center;
.title-head{
border-left: 20px solid #fff;
border-right: 20px solid #fff;
.title {
display: inline-block;
font-weight: bold;
cursor: pointer;
font-size: 18px;
margin-left: auto;
margin-right: auto;
&.cur {
color: #fff;
border: 1px solid #000;
padding: 8px 26px;
text-align: center;
background-color: #444;
font-weight: bold;
}
}
}
}
}
... ...