Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
c6f96ced5b17486e0d94317796c1421d41ca96dc
1 parent
297ab46a
do fixes bug to partner login bugs
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
189 additions
and
2 deletions
static/dist/myohobuy/1.2.0/index-debug.js
static/dist/myohobuy/1.2.0/index.js
static/dist/myohobuy/1.2.0/index-debug.js
View file @
c6f96ce
...
...
@@ -3228,6 +3228,7 @@ require("js/product/list");
require
(
"js/product/detail/detail"
);
require
(
"js/product/detail/loadmore"
);
require
(
"js/product/detail/consultform"
);
require
(
"js/product/newsale/hot-rank"
);
});
define
(
"js/product/newsale/newarrival"
,
[
"jquery"
,
"swiper"
,
"lazyload"
,
"hammer"
,
"index"
],
function
(
require
,
exports
,
module
){
/**
...
...
@@ -4759,7 +4760,8 @@ goodsSwiper = new Swiper('.banner-swiper', {
paginationClickable
:
true
,
pagination
:
'.banner-top .pagination-inner'
,
nextButton
:
'.my-swiper-button-next'
,
prevButton
:
'.my-swiper-button-prev'
prevButton
:
'.my-swiper-button-prev'
,
spaceBetween
:
3
});
...
...
@@ -4786,7 +4788,6 @@ if (goodsDiscountHammer) {
require
(
"js/product/detail/like"
);
});
define
(
"js/product/detail/desc"
,
[
"jquery"
,
"lazyload"
,
"swiper"
,
"index"
],
function
(
require
,
exports
,
module
){
/**
...
...
@@ -5231,6 +5232,172 @@ $consultForm.on('submit', function() {
});
});
define
(
"js/product/newsale/hot-rank"
,
[
"jquery"
,
"hammer"
,
"swiper"
,
"lazyload"
,
"index"
],
function
(
require
,
exports
,
module
){
var
$
=
require
(
"jquery"
),
Hammer
=
require
(
"hammer"
),
Swiper
=
require
(
"swiper"
),
lazyLoad
=
require
(
"lazyload"
),
loading
=
require
(
"js/plugin/loading"
);
var
page
=
1
,
winH
,
hotnav
,
listTop
,
navSwiper
,
notab
=
0
,
sort
=
''
,
id
=
''
,
hotrankNav
,
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
// var renderRank = {
// errMsg: '<p class="no-result">未找到相关搜索结果</p>',
// navSelector: '.goods-nav',
// rankSelector: '#hotRank',
// navHTML: null,
// data: null,
// inited: 0,
// setData: function(data) {
// this.data = data;
// },
// showDataEmptyMsg: function() {
// $(this.rankSelector).append(this.errMsg);
// },
// isDataEmpty: function() {
// if (this.data.indexOf('>') === -1) {
// return true;
// } else {
// return false;
// }
// },
// appendData: function() {
// if (!this.inited) {
// this.inited = 1;
// }
// $(this.rankSelector).append(this.data);
// },
// render: function(data) {
// this.setData(data);
// if (!this.isDataEmpty()) {
// this.appendData();
// } else {
// this.showDataEmptyMsg();
// }
// }
// };
function
hotrank
(
page
,
sort
,
tabId
,
notab
)
{
loading
.
showLoadingMask
();
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/newsale/selectHotrank?'
+
sort
,
dataType
:
'html'
,
data
:
{
page
:
page
,
tab_id
:
tabId
,
notab
:
notab
},
success
:
function
(
data
)
{
// if (page === 1) {
// $('.no-result').remove();
// $('.rank-main').remove();
// }
// if (notab === 1) {
// if (data === ' ' && $('.rank-main').length < 1) {
// var hotrankNav = $('.goods-nav').prop("outerHTML");
// $('#hotRank').html(hotrankNav + noResult);
// } else {
// $('#hotRank').append(data);
// }
// } else {
// if (data === ' ') {
// $('#hotRank').html(noResult);
// } else {
// $('#hotRank').append(data);
// }
// }
if
(
data
===
' '
)
{
if
(
$
(
'.rank-main'
).
length
<
1
&&
$
(
'.goods-nav'
).
length
<
1
)
{
$
(
'#hotRank'
).
html
(
noResult
);
}
else
{
if
(
page
===
1
)
{
hotrankNav
=
$
(
'.goods-nav'
).
prop
(
'outerHTML'
);
$
(
'#hotRank'
).
html
(
hotrankNav
+
noResult
);
}
}
}
else
{
$
(
'.no-result'
).
remove
();
$
(
'.rank-main'
).
remove
();
$
(
'#hotRank'
).
append
(
data
);
}
// renderRank.render(data);
lazyLoad
(
$
(
'img.lazy'
));
$
(
'.rank-main ul li:gt(2)'
).
find
(
'.item-content i'
).
removeClass
(
'top'
);
winH
=
$
(
window
).
height
();
if
(
$
(
'.rank-main'
).
length
!==
0
)
{
$
(
'#yoho-footer'
).
css
(
'position'
,
'static'
);
listTop
=
$
(
'.rank-main'
).
find
(
'ul'
).
offset
().
top
;
}
else
{
$
(
'#yoho-footer'
).
css
(
'position'
,
'fixed'
);
}
navSwiper
=
new
Swiper
(
'.s-goods-nav'
,
{
grabCursor
:
true
,
slidesPerView
:
'auto'
,
slideElement
:
'li'
});
loading
.
hideLoadingMask
();
}
});
}
function
scrollHandler
()
{
if
(
page
===
2
)
{
return
;
}
if
(
$
(
window
).
scrollTop
()
+
winH
<
listTop
+
$
(
'#hotRank'
).
height
()
-
100
)
{
return
;
}
page
=
2
;
notab
=
1
;
hotrank
(
page
,
sort
,
id
,
notab
);
}
//srcoll to load more
$
(
window
).
scroll
(
function
()
{
window
.
requestAnimationFrame
(
scrollHandler
);
});
hotrank
(
page
,
sort
,
id
,
notab
);
hotnav
=
new
Hammer
(
document
.
getElementById
(
'hotRank'
));
hotnav
.
on
(
'tap'
,
function
(
e
)
{
var
ev
=
ev
||
window
.
event
;
var
target
=
ev
.
target
||
ev
.
srcElement
;
if
(
target
.
nodeName
.
toLowerCase
()
===
'span'
)
{
$
(
'.s-goods-nav .nav-item'
).
removeClass
(
'active'
);
target
.
parentNode
.
className
=
'active '
+
target
.
parentNode
.
className
;
id
=
target
.
getAttribute
(
'data-id'
)
?
target
.
getAttribute
(
'data-id'
)
:
''
;
sort
=
target
.
getAttribute
(
'data-sort'
)
?
target
.
getAttribute
(
'data-sort'
)
:
''
;
page
=
1
;
// notab = renderRank.inited;
notab
=
1
;
hotrank
(
page
,
sort
,
id
,
notab
);
}
});
});
define
(
"js/me/entry"
,
[
"jquery"
,
"hammer"
,
"lazyload"
,
"handlebars"
,
"source-map"
,
"swiper"
,
"mlellipsis"
,
"index"
],
function
(
require
,
exports
,
module
){
/**
* 个人中心js打包入口文件
...
...
@@ -5251,6 +5418,7 @@ require("js/me/browse-record");
require
(
"js/me/address-act"
);
require
(
"js/me/logistic"
);
require
(
"js/me/pay"
);
require
(
"js/me/personal-details"
);
});
define
(
"js/me/order"
,
[
"jquery"
,
"hammer"
,
"lazyload"
,
"handlebars"
,
"source-map"
],
function
(
require
,
exports
,
module
){
...
...
@@ -7524,3 +7692,22 @@ loading.showLoadingMask();
window
.
onload
=
main
;
});
define
(
"js/me/personal-details"
,
[
"jquery"
],
function
(
require
,
exports
,
module
){
/**
* 个人信息
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/19
*/
var
$
=
require
(
"jquery"
);
var
$userAvatar
=
$
(
'.user-avatar'
);
var
myImage
=
new
Image
(),
avatar
;
// 部分老用户没有头像,显示默认头像
avatar
=
$userAvatar
.
data
(
'avatar'
);
myImage
.
src
=
avatar
;
myImage
.
onload
=
function
()
{
$userAvatar
.
css
(
'background-image'
,
'url('
+
avatar
+
')'
);
};
});
...
...
static/dist/myohobuy/1.2.0/index.js
View file @
c6f96ce
This diff could not be displayed because it is too large.
Please
register
or
login
to post a comment