Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
ccbikai
9 years ago
Commit
2c83e5aa0ba10f81ab3180b453bf6821617e7b6a
2 parents
922f0e57
a6bb6c59
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
112 additions
and
92 deletions
docs/data-structure.md
library/Api/Yohobuy.php
static/js/guang/info.js
static/js/me/my-guang.js
static/js/me/order.js
static/js/product/newsale/hot-rank.js
static/sass/me/_coupons.scss
static/sass/me/_order.scss
template/m.yohobuy.com/actions/index/home/coupons.phtml
template/m.yohobuy.com/actions/index/home/order.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
docs/data-structure.md
View file @
2c83e5a
...
...
@@ -943,7 +943,8 @@
{
name: '',
active: true,
typeId: 1
typeId: 1,
url: ''
},
...
]
...
...
library/Api/Yohobuy.php
View file @
2c83e5a
...
...
@@ -18,17 +18,18 @@ class Yohobuy
{
// /* 正式环境 */
const
API_URL
=
'http://api2.open.yohobuy.com/'
;
const
API_URL2
=
'http://api.open.yohobuy.com/'
;
const
SERVICE_URL
=
'http://service.api.yohobuy.com/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
const
API_URL
=
'http://api2.open.yohobuy.com/'
;
const
API_URL2
=
'http://api.open.yohobuy.com/'
;
const
SERVICE_URL
=
'http://service.api.yohobuy.com/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
/* 测试环境 */
// const API_URL = 'http://test2.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
// const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
// const API_URL = 'http://test2.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
// const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
/**
* 私钥列表
...
...
static/js/guang/info.js
View file @
2c83e5a
...
...
@@ -5,16 +5,16 @@
*/
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
Hammer
=
require
(
'yoho.hammer'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
tip
=
require
(
'../plugin/tip'
);
var
loading
=
require
(
'../plugin/loading'
);
var
$loadMoreInfo
=
$
(
'#load-more-info'
);
var
$loading
=
$
(
''
),
$noMore
=
$
(
''
);
$noMore
=
$
(
''
);
var
searching
=
false
;
...
...
@@ -34,8 +34,8 @@ function setLazyLoadAndMellipsis($infos) {
$infos
.
each
(
function
()
{
var
$this
=
$
(
this
),
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$title
=
$this
.
find
(
'.info-title'
),
$text
=
$this
.
find
(
'.info-text'
);
$title
[
0
].
mlellipsis
(
2
);
$text
[
0
].
mlellipsis
(
2
);
...
...
@@ -57,10 +57,10 @@ function initInfosEvt($container) {
cHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$this
=
$
(
e
.
target
),
opt
=
'ok'
,
$likeBtn
,
$collectBtn
,
$info
;
opt
=
'ok'
,
$likeBtn
,
$collectBtn
,
$info
;
$likeBtn
=
$this
.
closest
(
'.like-btn'
);
if
(
$likeBtn
.
length
>
0
)
{
...
...
static/js/me/my-guang.js
0 → 100644
View file @
2c83e5a
/**
* 我的逛
* @author xuqi<qi.xu@yoho.cn>
* @date: 2015/11/17
*/
var
$
=
require
(
'jquery'
);
var
info
=
require
(
'../guang/info'
);
info
.
initInfoEvt
(
$
(
'#info-list'
));
\ No newline at end of file
...
...
static/js/me/order.js
View file @
2c83e5a
...
...
@@ -17,27 +17,32 @@ var winH = $(window).height();
var
activeType
=
$navLi
.
filter
(
'.active'
).
data
(
'type'
);
//当前active的项的index
var
orderPage
=
{};
var
order
=
{
page
:
0
,
end
:
false
};
var
inAjax
=
false
;
var
loading
=
require
(
'../plugin/loading'
);
var
navHammer
,
orderHammer
;
var
orderHammer
;
//加载订单
function
getOrders
()
{
function
getOrders
(
option
)
{
var
opt
=
{
type
:
activeType
,
page
:
order
Page
[
activeType
]
?
(
orderPage
[
activeType
]
+
1
)
:
1
page
:
order
.
page
+
1
};
var
show
=
option
&&
option
.
showLoadingMask
;
if
(
inAjax
)
{
return
;
}
inAjax
=
true
;
loading
.
showLoadingMask
();
show
&&
loading
.
showLoadingMask
();
$
.
ajax
({
type
:
'GET'
,
...
...
@@ -46,23 +51,27 @@ function getOrders() {
success
:
function
(
data
)
{
var
num
;
if
(
data
.
code
===
200
)
{
orderPage
[
opt
.
type
]
=
opt
.
page
;
if
(
data
!==
' '
)
{
order
.
page
=
opt
.
page
;
if
(
opt
.
page
===
1
)
{
$curContainer
.
html
(
data
.
data
);
$curContainer
.
html
(
data
);
lazyLoad
(
$curContainer
.
find
(
'.lazy'
));
}
else
{
num
=
$curContainer
.
children
(
'.order'
).
length
;
$curContainer
.
append
(
data
.
data
);
$curContainer
.
append
(
data
);
//lazyload
lazyLoad
(
$curContainer
.
children
(
'.order:gt('
+
(
num
-
1
)
+
')
.lazy'
));
lazyLoad
(
$curContainer
.
children
(
'.order:gt('
+
(
num
-
1
)
+
')
'
).
find
(
'
.lazy'
));
}
window
.
rePosFooter
();
//重新计算底部位置
}
else
{
order
.
end
=
true
;
}
inAjax
=
false
;
loading
.
hideLoadingMask
();
show
&&
loading
.
hideLoadingMask
();
}
});
}
...
...
@@ -83,33 +92,6 @@ lazyLoad();
loading
.
init
(
$
(
'body'
));
//满屏loading
//导航切换
navHammer
=
new
Hammer
(
document
.
getElementById
(
'order-nav'
));
navHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$cur
=
$
(
e
.
target
).
closest
(
'li'
),
index
;
if
(
$cur
.
length
===
0
||
$cur
.
hasClass
(
'active'
))
{
return
;
}
index
=
$cur
.
index
();
$navLi
.
filter
(
'.active'
).
removeClass
(
'active'
);
$cur
.
addClass
(
'active'
);
$curContainer
.
addClass
(
'hide'
);
$curContainer
=
$orderContainer
.
children
(
':eq('
+
index
+
')'
).
removeClass
(
'hide'
);
activeType
=
$cur
.
data
(
'type'
);
if
(
orderPage
[
activeType
])
{
return
;
}
else
{
getOrders
();
}
});
//点击订单区域跳转订单详情页
orderHammer
=
new
Hammer
(
document
.
getElementById
(
'order-container'
));
orderHammer
.
on
(
'tap'
,
function
(
e
)
{
...
...
@@ -168,9 +150,13 @@ orderHammer.on('tap', function(e) {
});
$
(
window
).
scroll
(
function
()
{
if
(
$
(
window
).
scrollTop
()
+
winH
>
if
(
order
.
end
===
false
&&
$
(
window
).
scrollTop
()
+
winH
>
$
(
document
).
height
()
-
0.25
*
$orderContainer
.
height
())
{
getOrders
();
//下拉请求时不显示mask
getOrders
({
noLoadingMask
:
true
});
}
});
...
...
static/js/product/newsale/hot-rank.js
View file @
2c83e5a
...
...
@@ -11,7 +11,8 @@ var page = 1,
navSwiper
,
notab
=
0
,
sort
=
''
,
id
=
''
;
id
=
''
,
noResult
=
'<p class="no-result">未找到相关搜索结果</p>'
;
function
hotrank
(
page
,
sort
,
tabId
,
notab
)
{
loading
.
showLoadingMask
();
...
...
@@ -28,7 +29,11 @@ function hotrank(page, sort, tabId, notab) {
if
(
page
===
1
)
{
$
(
'.rank-main'
).
remove
();
}
$
(
'#hotRank'
).
append
(
data
);
if
(
data
===
' '
)
{
$
(
'#hotRank'
).
html
(
noResult
);
}
else
{
$
(
'#hotRank'
).
append
(
data
);
}
lazyLoad
(
$
(
'img.lazy'
));
$
(
'.rank-main ul li:gt(2)'
).
find
(
'.item-content i'
).
removeClass
(
'top'
);
winH
=
$
(
window
).
height
();
...
...
static/sass/me/_coupons.scss
View file @
2c83e5a
...
...
@@ -45,9 +45,8 @@
p
{
width
:
55
.517241%
;
height
:
auto
;
padding
:
0
5%
1
0
em
/
$pxConvertRem
;;
padding
:
0
5%
1
8
em
/
$pxConvertRem
;;
float
:
left
;
font-size
:
44em
/
$pxConvertRem
;
&
:first-of-type
{
padding-top
:
30em
/
$pxConvertRem
;
font-size
:
60em
/
$pxConvertRem
;
...
...
static/sass/me/_order.scss
View file @
2c83e5a
...
...
@@ -106,7 +106,14 @@
border-bottom
:
1px
solid
#e0e0e0
;
background
:
#fff
;
>
li
{
a
{
display
:
block
;
height
:
100%
;
width
:
100%
;
color
:
#b0b0b0
;
}
>
li
{
float
:
left
;
height
:
90rem
/
$pxConvertRem
;
width
:
25%
;
...
...
@@ -115,7 +122,7 @@
font-size
:
26rem
/
$pxConvertRem
;
text-align
:
center
;
&
.active
{
&
.active
a
{
color
:
#000
;
}
}
...
...
template/m.yohobuy.com/actions/index/home/coupons.phtml
View file @
2c83e5a
...
...
@@ -3,18 +3,25 @@
<span
class=
"active"
>未使用</span>
<span>已使用</span>
</div>
{
{#
couponsUrl
}
}
<div
class=
"employ-list"
>
{
{#
unused
}
}
<div
class=
"employ-main"
>
<span>
50
</span>
<p>【summer
sale】下装满¥
399
减¥
50
券</p>
<p>有效期:
2014.07
.
28
-
2014.09
.
15
</p>
</div>
{
{/
unused
}
}
</div>
<div
class=
"employ-list not none"
>
{
{#
used
}
}
<div
class=
"employ-main"
>
<span>
60
</span>
<p>【summer
sale】下装满¥
399
减¥
60
券</p>
<p>有效期:
2014.07
.
28
-
2014.09
.
15
</p>
<span>
{
{
money
}
}</span>
<p>
{
{
coupon_name
}
}</p>
<p>
{
{
couponValidity
}
}</p>
</div>
{
{/
used
}
}
</div>
{
{/
couponsUrl
}
}
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/order.phtml
View file @
2c83e5a
...
...
@@ -4,7 +4,7 @@
<ul
id=
"order-nav"
class=
"order-nav clearfix"
>
{
{#each
navs
}
}
<li
{
{#if
active
}
}class=
"active"
{
{/if
}
}
data-type=
"{{typeId}}"
>
{
{name
}
}
<a
href=
"{{url}}"
>
{
{name
}
}</a>
</li>
{
{/each
}
}
</ul>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
2c83e5a
...
...
@@ -212,8 +212,6 @@ class HomeController extends AbstractAction
'couponsUrl'
=>
\Index\UserModel
::
getCouponData
(
$uid
,
$status
),
'couponsPage'
=>
true
);
print_r
(
$coupons
);
$this
->
_view
->
display
(
'coupons'
,
$coupons
);
}
...
...
@@ -361,26 +359,31 @@ class HomeController extends AbstractAction
}
/**
* 意见反馈-提交表单
* 意见反馈-提交表单
页面
*/
public
function
suggest_subAction
()
{
$udid
=
$this
->
getUdid
();
$page
=
$this
->
get
(
'page'
,
1
);
$limit
=
$this
->
get
(
'limit'
,
30
);
$suggest
=
\Index\UserModel
::
getSuggestData
(
$udid
,
$page
,
$limit
);
//print_r($suggest);
$this
->
_view
->
display
(
'suggest_sub'
,
array
(
'suggestPage'
=>
true
,
//加载js
'pageHeader'
=>
array
(
'navBack'
=>
true
,
'navTitle'
=>
'反馈问题'
,
'navBtn'
=>
'提交'
),
'suggestSub'
=>
true
,
'pageFooter'
=>
true
));
public
function
suggestSubAction
()
{
// 设置网站标题
$this
->
setTitle
(
'反馈问题'
);
$param
=
\Api\Yohobuy
::
param
();
unset
(
$param
[
'private_key'
]);
$param
[
'project'
]
=
'suggest'
;
$param
[
'client_secret'
]
=
'e7807a9522ab99af8b8fd926e1ebbd9a'
;
$data
=
array
(
'suggestPage'
=>
true
,
//加载js
'pageHeader'
=>
array
(
'navBack'
=>
true
,
'navTitle'
=>
'反馈问题'
,
'navBtn'
=>
'提交'
),
'param'
=>
$param
,
'suggestSub'
=>
true
,
'pageFooter'
=>
true
);
print_r
(
$data
);
$this
->
_view
->
display
(
'suggest_sub'
,
$data
);
}
/**
...
...
@@ -456,7 +459,7 @@ class HomeController extends AbstractAction
}
//ajax请求订单页面
public
function
getOrderAction
()
{
public
function
getOrder
s
Action
()
{
//判断是不是ajax请求
if
(
!
$this
->
isAjax
())
{
$this
->
error
();
...
...
Please
register
or
login
to post a comment