Authored by Lynnic

修改商品图片微信内置浏览器显示bug

... ... @@ -38,7 +38,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
}
//goods-discount下拉按钮点击事件
$('.goodsDiscount .dropdown').on('click', function() {
$('.goodsDiscount .dropdown').on('touchend', function() {
if ($discountFolder.is(':hidden')) {
$discountArrow.removeClass('icon-down').addClass('icon-up').html('');
$discountFolder.slideDown();
... ...
... ... @@ -3,100 +3,101 @@
* @author: Lynnic
* @date: 2015/11/25
*/
var $ = require('jquery'),
loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
var loadMoreUrl = $('#loadMoreUrl').val(),
$commentsDiv = $('#goods-comments'),
$consultsDiv = $('#goods-consults'),
winH = $(window).height(),
searching = false,
end = false;
var jsonObj;
//插入评论列表底部
function insertCommentsDiv(json) {
var html = '';
var i;
for (i = 0; i < json.length; i++) {
html += '<div class="comment-item">';
html += '<span class="user-name">' + json[i].userName + '</span>';
html += '<span class="goods-spec">' + json[i].desc + '</span>';
html += '<span class="goods-spec">' + json[i].content + '</span>';
html += '<span class="goods-spec">' + json[i].time + '</span>';
}
$commentsDiv.append(html);
}
//插入咨询列表底部
function insertConsultsDiv(json) {
var html = '';
var i;
for (i = 0; i < json.length; i++) {
html += '<div class="consult-item"> ';
html += '<div class="question"> ';
html += '<span class="iconfont">&#xe639;</span> ';
html += '<p> ';
html += json[i].question + '<br> ';
html += '<span class="time">' + json[i].time + '</span> ';
html += '</p> ';
html += '</div> ';
html += '<div class="answer"> ';
html += '<span class="iconfont">&#xe63c;</span> ';
html += '<p>' + json[i].answer + '</p> ';
html += '</div> ';
html += '</div> ';
}
$consultsDiv.append(html);
}
function search() {
if (searching || end) {
return;
}
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
url: loadMoreUrl,
success: function(data) {
if (data.length > 0) {
jsonObj = JSON.parse(data);
if ($commentsDiv.length > 0) {
insertCommentsDiv(jsonObj);
} else if ($consultsDiv.length > 0) {
insertConsultsDiv(jsonObj);
}
}
searching = false;
end = true;
loading.hideLoadingMask();
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
}
function scrollHandler() {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
search();
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
\ No newline at end of file
// var $ = require('jquery'),
// loading = require('../../plugin/loading'),
// tip = require('../../plugin/tip');
// var loadMoreUrl = $('#loadMoreUrl').val(),
// $commentsDiv = $('#goods-comments'),
// $consultsDiv = $('#goods-consults'),
// winH = $(window).height(),
// searching = false,
// end = false;
// var jsonObj;
// //插入评论列表底部
// function insertCommentsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="comment-item">';
// html += '<span class="user-name">' + json[i].userName + '</span>';
// html += '<span class="goods-spec">' + json[i].desc + '</span>';
// html += '<span class="goods-spec">' + json[i].content + '</span>';
// html += '<span class="goods-spec">' + json[i].time + '</span>';
// }
// $commentsDiv.append(html);
// }
// //插入咨询列表底部
// function insertConsultsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="consult-item"> ';
// html += '<div class="question"> ';
// html += '<span class="iconfont">&#xe639;</span> ';
// html += '<p> ';
// html += json[i].question + '<br> ';
// html += '<span class="time">' + json[i].time + '</span> ';
// html += '</p> ';
// html += '</div> ';
// html += '<div class="answer"> ';
// html += '<span class="iconfont">&#xe63c;</span> ';
// html += '<p>' + json[i].answer + '</p> ';
// html += '</div> ';
// html += '</div> ';
// }
// $consultsDiv.append(html);
// }
// function search() {
// if (searching || end) {
// return;
// }
// searching = true;
// loading.showLoadingMask();
// $.ajax({
// type: 'GET',
// url: loadMoreUrl,
// success: function(data) {
// if (data.length > 0) {
// jsonObj = JSON.parse(data);
// if ($commentsDiv.length > 0) {
// insertCommentsDiv(jsonObj);
// } else if ($consultsDiv.length > 0) {
// insertConsultsDiv(jsonObj);
// }
// }
// searching = false;
// end = true;
// loading.hideLoadingMask();
// },
// error: function() {
// tip.show('网络断开连接了~');
// searching = false;
// loading.hideLoadingMask();
// }
// });
// }
// function scrollHandler() {
// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
// search();
// }
// }
// //srcoll to load more
// $(window).scroll(function() {
// window.requestAnimationFrame(scrollHandler);
// });
\ No newline at end of file
... ...
... ... @@ -44,6 +44,7 @@
padding: 0 pxToRem(28px);
height: pxToRem(120px);
background-color: #ffffff;
border-bottom: 1px solid $borderC;
i,
span,
a {
... ... @@ -64,6 +65,8 @@
margin-top: pxToRem(30px);
padding: pxToRem(20px) pxToRem(28px);
background-color: #fff;
border-bottom: 1px solid $borderC;
border-top: 1px solid $borderC;
.question {
font-size: pxToRem(24px);
color: $mainFontC;
... ...
... ... @@ -169,7 +169,7 @@ $basicBtnC:#eb0313;
overflow: hidden;
ul {
position: relative;
height: 100%;
height: auto;
li {
float: left;
}
... ...
... ... @@ -3,7 +3,7 @@
<div class="goto-consult">
<i class="iconfont consult-logo">&#xe639;</i>
<span>我要咨询</span>
<a href="{{consultUrl}}" class="iconfont enter-consult-page">&#xe604;</a>
<a href="/product/detail/consultform" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults" id="goods-consults">
... ...
... ... @@ -26,9 +26,9 @@
<span class="iconfont">&#xe63c;</span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<!-- <div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
</div>
</div> -->
</div>
<div class="consult-content content hide ">
... ... @@ -50,7 +50,7 @@
{{/ consults}}
</div>
<div class="consult-content-footer">
<a href="{{link}}">
<a href="/product/detail/consults">
查看更多
<span class="iconfont">&#xe604;</span></a>
</div>
... ...