Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
Commits
Go to a project
GitLab
Go to group
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
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
8eca34b060942ef14b7e8d66d56de5861985a0f8
2 parents
acb89cc6
7ec3ab0f
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
150 additions
and
136 deletions
static/js/me/address-act.js
static/js/me/browse-record.js
static/js/me/suggest.js
static/js/product/detail/detail.js
static/js/product/detail/loadmore.js
static/sass/index.scss
static/sass/product/_comments-consults.scss
static/sass/product/_detail.scss
template/m.yohobuy.com/actions/index/home/coupon_list.phtml
template/m.yohobuy.com/actions/product/detail/consults.phtml
template/m.yohobuy.com/actions/product/newsale/hotrank.phtml
template/m.yohobuy.com/partials/product/feedback-tab.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Category/Brand.php
yohobuy/m.yohobuy.com/application/models/Index/Home.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/models/Product/Newsale.php
static/js/me/address-act.js
View file @
8eca34b
...
...
@@ -13,7 +13,6 @@ var $addressForm = $('.edit-address'),
$submit
=
$
(
'.submit'
),
$editAddressPage
=
$
(
'.my-edit-address-page'
),
$addressListPage
=
$
(
'.my-address-list-page'
),
$footer
=
$
(
'#yoho-footer'
),
$backBtn
=
$
(
'.nav-back'
),
$navTitle
=
$
(
'.nav-title'
),
$input
=
$
(
'input, textarea'
),
...
...
@@ -111,12 +110,6 @@ $submit.on('touchend', function() {
$
(
this
).
removeClass
(
'highlight'
);
});
$input
.
on
(
'focus'
,
function
()
{
$footer
.
hide
();
}).
on
(
'blur'
,
function
()
{
$footer
.
show
();
});
// 省市区列表异步加载
$
.
get
(
'/home/locationList'
).
then
(
function
(
html
)
{
$addressListPage
.
html
(
html
);
...
...
@@ -124,9 +117,7 @@ $.get('/home/locationList').then(function(html) {
// 省市区
$area
.
on
(
'touchend'
,
function
()
{
$editAddressPage
.
hide
();
$addressListPage
.
show
(
1
,
function
()
{
$footer
.
hide
();
});
$addressListPage
.
show
();
currentPage
=
'list'
;
$navTitle
.
html
(
'地区选择'
);
});
...
...
@@ -165,7 +156,6 @@ $.get('/home/locationList').then(function(html) {
$editAddressPage
.
show
();
currentPage
=
'edit'
;
$navTitle
.
html
(
navTitle
);
$footer
.
show
();
// 恢复默认的三级选择
$addressListPage
.
hide
();
...
...
static/js/me/browse-record.js
View file @
8eca34b
...
...
@@ -25,7 +25,6 @@ var end = false,
var
winH
=
$
(
window
).
height
();
load
.
init
();
function
moreRecord
(
cb
)
{
var
count
=
$page
.
children
(
'.browse-record-good'
).
length
;
...
...
@@ -61,7 +60,7 @@ function moreRecord(cb) {
lazyLoad
(
$page
.
find
(
'.browse-record-good:gt('
+
(
count
-
1
)
+
') .lazy'
));
}
window
.
rePosFooter
();
page
++
;
if
(
cb
)
{
...
...
@@ -99,6 +98,7 @@ $page.on('touchstart', '.del-icon', function() {
rightBtnText
:
'确定'
}
},
function
()
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/home/delRecord'
,
...
...
@@ -107,7 +107,12 @@ $page.on('touchstart', '.del-icon', function() {
},
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
window
.
history
.
go
(
0
);
dialog
.
showDialog
({
dialogText
:
'删除浏览记录成功'
,
autoHide
:
true
,
fast
:
true
});
setTimeout
(
function
(){
window
.
history
.
go
(
0
);},
1000
);
}
},
complete
:
function
()
{
...
...
static/js/me/suggest.js
View file @
8eca34b
...
...
@@ -119,7 +119,8 @@ $likeBtn.bind('click', function() {
method
:
'post'
,
url
:
'/home/upAndDown'
,
data
:
{
suggest_id
:
id
suggest_id
:
id
,
reliable
:
1
}
}).
then
(
function
(
data
)
{
if
(
data
.
code
===
200
)
{
...
...
@@ -146,7 +147,8 @@ $disLikeBtn.bind('click', function() {
method
:
'post'
,
url
:
'/home/upAndDown'
,
data
:
{
suggest_id
:
id
suggest_id
:
id
,
reliable
:
2
}
}).
then
(
function
(
data
)
{
if
(
data
.
code
===
200
)
{
...
...
static/js/product/detail/detail.js
View file @
8eca34b
...
...
@@ -38,7 +38,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
}
//goods-discount下拉按钮点击事件
$
(
'.goodsDiscount .dropdown'
).
on
(
'
click'
,
function
(
)
{
$
(
'.goodsDiscount .dropdown'
).
on
(
'
touchend'
,
function
(
e
)
{
if
(
$discountFolder
.
is
(
':hidden'
))
{
$discountArrow
.
removeClass
(
'icon-down'
).
addClass
(
'icon-up'
).
html
(
''
);
$discountFolder
.
slideDown
();
...
...
@@ -46,5 +46,7 @@ $('.goodsDiscount .dropdown').on('click', function() {
$discountArrow
.
removeClass
(
'icon-up'
).
addClass
(
'icon-down'
).
html
(
''
);
$discountFolder
.
slideUp
();
}
return
false
;
});
require
(
'./like'
);
...
...
static/js/product/detail/loadmore.js
View file @
8eca34b
...
...
@@ -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"></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
// 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/sass/index.scss
View file @
8eca34b
...
...
@@ -97,8 +97,7 @@ a {
left
:
50%
;
margin-left
:
-35%
;
margin-top
:
-45px
;
background-color
:
#000
;
opacity
:
0
.7
;
background-color
:
rgba
(
0
,
0
,
0
,.
7
);
color
:
#fff
;
font-size
:
18px
;
border
:
none
;
...
...
static/sass/product/_comments-consults.scss
View file @
8eca34b
...
...
@@ -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
;
...
...
static/sass/product/_detail.scss
View file @
8eca34b
...
...
@@ -169,7 +169,7 @@ $basicBtnC:#eb0313;
overflow
:
hidden
;
ul
{
position
:
relative
;
height
:
100%
;
height
:
auto
;
li
{
float
:
left
;
}
...
...
template/m.yohobuy.com/actions/index/home/coupon_list.phtml
View file @
8eca34b
...
...
@@ -11,6 +11,6 @@
<div
class=
"null"
>
<i></i>
<p>您还没有优惠券!</p>
<a
href=
"
{{topURL}}
"
>随便逛逛</a>
<a
href=
"
/product/new
"
>随便逛逛</a>
</div>
{
{/
noRecord
}
}
...
...
template/m.yohobuy.com/actions/product/detail/consults.phtml
View file @
8eca34b
...
...
@@ -3,7 +3,7 @@
<div
class=
"goto-consult"
>
<i
class=
"iconfont consult-logo"
>
639
;</i>
<span>我要咨询</span>
<a
href=
"
{{consultUrl}}
"
class=
"iconfont enter-consult-page"
>
604
;</a>
<a
href=
"
/product/detail/consultform
"
class=
"iconfont enter-consult-page"
>
604
;</a>
</div>
{
{#
consults
}
}
<div
class=
"goods-consults"
id=
"goods-consults"
>
...
...
template/m.yohobuy.com/actions/product/newsale/hotrank.phtml
View file @
8eca34b
{
{>
layout/header
}
}
<div
class=
"discount-page yoho-page"
>
{
{#
headerBanner
}
}
{
{>
product/banner
_swipe_and_
single
}
}
{
{>
product/banner
-swipe-and-
single
}
}
{
{/
headerBanner
}
}
<div
id=
"hotRank"
></div>
{
{#if
brand
}
}
...
...
template/m.yohobuy.com/partials/product/feedback-tab.phtml
View file @
8eca34b
...
...
@@ -26,9 +26,9 @@
<span class="iconfont"></span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<
!-- <
div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont"></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"></span></a>
</div>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
8eca34b
...
...
@@ -22,7 +22,7 @@ class HomeController extends AbstractAction
/**
* 通过当前用户审判是否跳到登录
*
*
* @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @return void
*/
...
...
@@ -181,7 +181,8 @@ class HomeController extends AbstractAction
$this
->
setNavHeader
(
'浏览记录'
,
true
,
SITE_MAIN
);
$this
->
_view
->
display
(
'browse-record'
,
array
(
'browseRecordPage'
=>
true
'browseRecordPage'
=>
true
,
'pageFooter'
=>
true
));
}
...
...
@@ -351,7 +352,6 @@ class HomeController extends AbstractAction
$id
=
$this
->
get
(
'id'
,
null
);
$data
=
array
(
'addressActionPage'
=>
true
,
'pageFooter'
=>
true
,
'addressList'
=>
UserModel
::
getAddressListData
(
$uid
)
);
...
...
@@ -627,7 +627,7 @@ class HomeController extends AbstractAction
/*
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
*
*
*/
public
function
orderAction
()
...
...
@@ -763,7 +763,7 @@ class HomeController extends AbstractAction
/*
* 我的订单-付款跳转页
*/
public
function
payAction
()
public
function
payAction
()
{
$this
->
_view
->
display
(
'pay'
,
array
(
'payAppInfo'
=>
array
(
...
...
@@ -774,7 +774,7 @@ class HomeController extends AbstractAction
'hint'
=>
'需下载微信客户端'
,
'subHint'
=>
'推荐使用'
,
),
),
));
}
...
...
yohobuy/m.yohobuy.com/application/models/Category/Brand.php
View file @
8eca34b
...
...
@@ -84,6 +84,18 @@ class BrandModel
$result
[
'bannerTop'
][
'list'
][]
=
$build
;
}
}
// 顶部的轮翻广告列表
elseif
(
!
empty
(
$brand
[
'brandTop'
][
'list'
][
0
][
'data'
]))
{
$build
=
array
();
foreach
(
$brand
[
'brandTop'
][
'list'
][
0
][
'data'
]
as
$value
)
{
if
(
isset
(
$value
[
'url'
]))
{
$build
[
'url'
]
=
Helpers
::
getFilterUrl
(
$value
[
'url'
]);
}
$build
[
'img'
]
=
Helpers
::
getImageUrl
(
$value
[
'src'
],
640
,
310
);
$build
[
'title'
]
=
$value
[
'title'
];
$result
[
'bannerTop'
][
'list'
][]
=
$build
;
}
}
/* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
if
(
!
empty
(
$brand
[
'brandTop'
][
1
][
'data'
][
'list'
]))
{
...
...
yohobuy/m.yohobuy.com/application/models/Index/Home.php
View file @
8eca34b
...
...
@@ -98,8 +98,8 @@ class HomeModel
// 调用接口获取数据
$banner
=
IndexData
::
getBannerStart
(
self
::
CODE_BG
);
if
(
isset
(
$banner
[
'data'
][
0
][
'data'
][
'list'
][
0
][
'src'
]))
{
$result
=
Helpers
::
getImageUrl
(
$banner
[
'data'
][
0
][
'data'
][
'list'
][
0
][
'src'
],
640
,
800
,
2
);
if
(
isset
(
$banner
[
'code'
])
&&
$banner
[
'code'
]
==
200
&&
$banner
[
'data'
][
'total'
]
>
0
)
{
$result
=
Helpers
::
getImageUrl
(
$banner
[
'data'
][
'list'
][
0
][
'data'
][
'list'
][
0
][
'src'
],
640
,
800
,
2
);
}
if
(
USE_CACHE
)
{
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
8eca34b
...
...
@@ -302,7 +302,7 @@ class UserModel
$data
=
$records
[
'data'
][
'product_list'
];
foreach
(
$data
as
&
$val
)
{
$val
[
'link'
]
=
isset
(
$val
[
'goodsId'
])
?
Helpers
::
url
(
'/product/pro_'
.
$val
[
'product_skn'
]
.
'_'
.
$val
[
'goodsId'
]
.
'/'
.
$val
[
'cnAlphabet'
]
.
'.html'
)
:
''
;
$val
[
'image'
]
=
!
empty
(
$val
[
'image'
])
?
Helpers
::
getImageUrl
(
$val
[
'image'
],
140
,
140
)
:
''
;
$val
[
'image'
]
=
!
empty
(
$val
[
'image'
])
?
Helpers
::
getImageUrl
(
$val
[
'image'
],
447
,
596
)
:
''
;
$val
[
'sales_price'
]
=
!
empty
(
$val
[
'sales_price'
])
?
$val
[
'sales_price'
]
.
'.00'
:
0
;
$val
[
'market_price'
]
=
(
$val
[
'market_price'
]
-
$val
[
'sales_price'
]
>
0
)
?
$val
[
'market_price'
]
.
'.00'
:
false
;
}
...
...
yohobuy/m.yohobuy.com/application/models/Product/Newsale.php
View file @
8eca34b
...
...
@@ -184,12 +184,12 @@ class NewsaleModel
$newsale
=
NewsaleData
::
getNewsaleFocus
(
$codeKey
);
// 调用接口获取数据并封装
if
(
isset
(
$newsale
[
'code'
])
&&
isset
(
$newsale
[
'data'
][
'list'
]))
{
if
(
count
(
$newsale
[
'data'
][
'list'
])
===
1
)
{
if
(
isset
(
$newsale
[
'code'
])
&&
isset
(
$newsale
[
'data'
][
'list'
])
&&
!
empty
(
$newsale
[
'data'
][
'list'
]))
{
if
(
count
(
$newsale
[
'data'
][
'list'
][
0
][
'data'
])
===
1
)
{
$result
=
Helpers
::
formatBanner
(
$newsale
[
'data'
][
'list'
][
0
][
'data'
][
0
],
640
,
240
);
}
else
{
foreach
(
$newsale
[
'data'
][
'list'
]
as
$one
)
{
$result
[
'list'
][]
=
Helpers
::
formatBanner
(
$one
[
'data'
],
640
,
240
);
foreach
(
$newsale
[
'data'
][
'list'
][
0
][
'data'
]
as
$one
)
{
$result
[
'list'
][]
=
Helpers
::
formatBanner
(
$one
,
640
,
240
);
}
}
}
...
...
Please
register
or
login
to post a comment