Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
f3e2e9789c9e880d4373041f870aa6dcfe466f41
1 parent
efb142a1
商品详情页为你优化换接口 code review by bikai
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
107 deletions
static/js/product/detail/desc.js
static/js/product/detail/detail.js
static/js/product/detail/loadmore.js
static/js/product/entry.js
static/js/product/recommend-for-you-product-desc.js
template/m.yohobuy.com/actions/product/detail/index.phtml
static/js/product/detail/desc.js
View file @
f3e2e97
...
...
@@ -18,8 +18,6 @@ var introUrl = $('#introUrl').val(),
var
sizeSwiper
,
refSwiper
;
require
(
'../recommend-for-you.js'
);
//判断是否要显示向左滑动提示
function
hiddenTips
(
$ele
)
{
if
(
$ele
.
length
>
0
)
{
...
...
static/js/product/detail/detail.js
View file @
f3e2e97
...
...
@@ -17,6 +17,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
require
(
'./desc'
);
require
(
'./comments-consults'
);
require
(
'../recommend-for-you-product-desc'
);
//add extra marign-bottom for footer to show the yoho copyright
function
showFooter
()
{
...
...
static/js/product/detail/loadmore.js
deleted
100644 → 0
View file @
efb142a
/**
* 商品详情 --滚动页面加载
* @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"></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"></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
static/js/product/entry.js
View file @
f3e2e97
...
...
@@ -8,5 +8,4 @@ require('./newsale/newarrival');
require
(
'./newsale/discount'
);
require
(
'./list'
);
require
(
'./detail/detail'
);
require
(
'./detail/loadmore'
);
require
(
'./detail/consultform'
);
\ No newline at end of file
...
...
static/js/product/recommend-for-you-product-desc.js
0 → 100644
View file @
f3e2e97
/**
* 为您优选
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/11/16
*/
var
Swiper
=
require
(
'yoho.iswiper'
),
$
=
require
(
'jquery'
);
var
recommendSwiper
,
$recommendForYou
=
$
(
'.recommend-for-you'
),
productSkn
=
$
(
'#productSkn'
).
val
();
$
.
get
(
'/product/detail/preference'
,
{
productSkn
:
productSkn
}).
then
(
function
(
html
)
{
$recommendForYou
.
html
(
html
).
show
();
if
(
$
(
'#swiper-recommend'
).
length
)
{
recommendSwiper
=
new
Swiper
(
'#swiper-recommend'
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'a'
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
});
}
}).
fail
(
function
()
{
$recommendForYou
.
hide
();
});
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
f3e2e97
...
...
@@ -136,6 +136,9 @@
{
{#if
id
}
}
<input
id=
"productId"
type=
"hidden"
value=
"{{id}}"
>
{
{/if
}
}
{
{#if
productSkn
}
}
<input
id=
"productSkn"
type=
"hidden"
value=
"{{productSkn}}"
>
{
{/if
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment