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
57833dbf5aac13133094e02aa0b18ed2fbedc2a4
2 parents
e54acd26
289e1aef
合并代码
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
48 additions
and
39 deletions
library/Plugin/Helpers.php
static/js/cart/cart.js
static/js/cart/good.js
static/js/common.js
template/m.yohobuy.com/partials/cart/good.phtml
template/m.yohobuy.com/partials/layout/page_header.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
library/Plugin/Helpers.php
View file @
57833db
...
...
@@ -443,13 +443,13 @@ class Helpers
* @param string $areaMobile
* @return boolean
*/
public
static
function
verifyAreaMobile
(
$areaMobile
)
public
static
function
verifyAreaMobile
(
$areaMobile
,
$area
)
{
if
(
empty
(
$areaMobile
))
{
return
false
;
}
if
(
!
strpos
(
$areaMobile
,
'-'
))
{
return
self
::
areaMobielVerify
(
$areaMobile
);
return
self
::
areaMobielVerify
(
$areaMobile
,
$area
);
}
else
{
$mobileData
=
explode
(
'-'
,
$areaMobile
);
if
(
count
(
$mobileData
)
!=
2
)
{
...
...
static/js/cart/cart.js
View file @
57833db
...
...
@@ -8,13 +8,13 @@ var $ = require('jquery'),
lazyLoad
=
require
(
'yoho.lazyload'
),
Hammer
=
require
(
'yoho.hammer'
);
var
chosePanel
=
require
(
'./chose-panel'
),
cartInfo
=
require
(
'./cart-info'
).
cartInfo
;
var
chosePanel
=
require
(
'./chose-panel'
);
var
$cartContent
=
$
(
'.cart-content'
);
var
navHammer
,
cartType
=
'ordinary'
;
cartType
=
'ordinary'
,
cartInfo
;
require
(
'./good'
);
...
...
@@ -28,6 +28,12 @@ navHammer.on('tap', function(e) {
return
;
}
if
(
cartType
===
'ordinary'
)
{
cartType
=
'advance'
;
}
else
{
cartType
=
'ordinary'
;
}
$this
.
siblings
(
'.active'
).
removeClass
(
'active'
);
$this
.
addClass
(
'active'
);
...
...
@@ -41,7 +47,7 @@ navHammer.on('tap', function(e) {
$
(
'.btn-balance'
).
on
(
'touchend'
,
function
()
{
window
.
location
.
href
=
'/
shoppingCart
/orderEnsure?cartType='
+
cartType
;
window
.
location
.
href
=
'/
cart/index
/orderEnsure?cartType='
+
cartType
;
});
//$('.advance-buy').on('touchend', function() {
...
...
@@ -66,4 +72,4 @@ $('.chose').on('touchend', function() {
cartInfo
=
0
;
\ No newline at end of file
cartInfo
=
0
;
...
...
static/js/cart/good.js
View file @
57833db
...
...
@@ -44,7 +44,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
$
.
ajax
({
type
:
'GET'
,
url
:
'/
shoppingCart
/select'
,
url
:
'/
cart/index
/select'
,
data
:
{
id
:
id
}
...
...
@@ -58,7 +58,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
}
$
.
ajax
({
type
:
'GET'
,
url
:
'/
shoppingCart
/getCartData'
,
url
:
'/
cart/index
/getCartData'
,
data
:
{
id
:
id
},
...
...
@@ -79,18 +79,22 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
});
}).
on
(
'touchstart'
,
'.icon-edit'
,
function
()
{
var
$this
=
$
(
this
),
$cartgood
=
$this
.
closest
(
'.shopping-cart-good'
),
$viewGood
=
$cartgood
.
find
(
'.deps'
),
$editGoot
=
$cartgood
.
find
(
'.calculate-num'
);
if
(
$viewGood
.
hasClass
(
'show'
))
{
$viewGood
.
removeClass
(
'show'
).
addClass
(
'hide'
);
$editGoot
.
removeClass
(
'hide'
).
addClass
(
'show'
);
}
else
{
$viewGood
.
removeClass
(
'hide'
).
addClass
(
'show'
);
$editGoot
.
removeClass
(
'show'
).
addClass
(
'hide'
);
}
//var $this = $(this);
//
//var $cartgood = $this.closest('.shopping-cart-good');
//
////var id = $this.closest('.shopping-cart-good').data('id');
//
//var $viewGood = $cartgood.find('.deps');
// $editGoot = $cartgood.find('.calculate-num');
//
//if ($viewGood.hasClass('show')) {
// $viewGood.removeClass('show').addClass('hide');
// $editGoot.removeClass('hide').addClass('show');
//} else {
// $viewGood.removeClass('hide').addClass('show');
// $editGoot.removeClass('show').addClass('hide');
//}
}).
on
(
'touchstart'
,
'.icon-del'
,
function
(
e
)
{
...
...
@@ -116,7 +120,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
$
.
ajax
({
method
:
'post'
,
url
:
'/
shoppingCart
/del'
,
url
:
'/
cart/index
/del'
,
data
:
{
id
:
id
}
...
...
@@ -163,11 +167,6 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
// });
//})
$
(
'.btn-balance'
).
on
(
'touchend'
,
function
()
{
window
.
location
.
href
=
'/shoppingCart/orderEnsure?cartType='
+
'ordinary'
;
});
$
(
'.down'
).
on
(
'touchend'
,
function
()
{
chosePanel
.
show
();
});
...
...
@@ -176,7 +175,7 @@ $('.cut').on('touchend', function() {
$
.
ajax
({
type
:
'GET'
,
url
:
'/
shoppingCart
/modify'
,
url
:
'/
cart/index
/modify'
,
data
:
{
old_product_sku
:
id
,
new_product_sku
:
id
,
...
...
static/js/common.js
View file @
57833db
...
...
@@ -199,9 +199,9 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() {
$
(
this
).
removeClass
(
'highlight'
);
});
$
(
'.nav-home'
).
on
(
'touchstart'
,
function
()
{
$
(
'.homebuttom'
).
toggleClass
(
'none'
);
});
// $('.nav-home').on('touchstart', function() {
// $('.homebuttom').toggleClass('none');
// });
(
function
()
{
var
lastTime
=
0
,
...
...
template/m.yohobuy.com/partials/cart/good.phtml
View file @
57833db
...
...
@@ -47,7 +47,7 @@
{{/if}}
<span class="iconfont icon-edit"></span>
<span class="iconfont icon-del"></span>
</p>
<p class="row">
...
...
template/m.yohobuy.com/partials/layout/page_header.phtml
View file @
57833db
...
...
@@ -4,14 +4,14 @@
<a
href=
"{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}"
class=
"iconfont nav-back"
>
610
;</a>
{
{/navBack
}
}
{
{#navHome
}
}
<a
class=
"iconfont nav-home"
>
611
;</a>
<a
href=
"{{.}}"
class=
"iconfont nav-home"
>
611
;</a>
{
{/navHome
}
}
{
{#navTitle
}
}
<p
class=
"nav-title"
>
{
{.
}
}</p>
{
{/navTitle
}
}
{
{#
navBtn
}
}
<!--
<span
class=
"nav-btn"
>
{
{.
}
}</span>
-->
<
i
class=
"iconfont nav-home"
>
638
;</i
>
<
!--
<i
class=
"iconfont nav-home"
>
638
;</i>
--
>
{
{/
navBtn
}
}
</header>
<div
class=
"homebuttom none"
>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
57833db
...
...
@@ -41,11 +41,12 @@ class HomeController extends AbstractAction
{
// 设置网站标题
$this
->
setTitle
(
'个人中心'
);
$this
->
setNavHeader
(
'个人中心'
,
SITE_MAIN
.
'/?go=1'
,
''
,
true
);
$this
->
setNavHeader
(
'个人中心'
,
SITE_MAIN
.
'/?go=1'
);
$data
=
array
(
'myIndexPage'
=>
true
,
'showDownloadApp'
=>
true
,
'navHome'
=>
true
,
'pageFooter'
=>
true
,
'cartUrl'
=>
Helpers
::
url
(
'/cart/index/index'
,
null
),
'signinUrl'
=>
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
Helpers
::
url
(
'/home'
))),
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
57833db
...
...
@@ -385,7 +385,11 @@ class UserModel
// 处理YOHO币数据
if
(
isset
(
$yohoCoin
[
'data'
])
&&
!
empty
(
$yohoCoin
[
'data'
])){
$coinList
=
$yohoCoin
[
'data'
][
'coinlist'
];
$data
[
'money'
]
=
$yohoCoin
[
'data'
][
'total'
];
// 获取有货币总数
$total
=
self
::
getYohoCoinData
(
$uid
);
$data
[
'money'
]
=
!
empty
(
$total
)
?
$total
[
'yohoCoin'
][
'coinNum'
]
:
0
;
foreach
(
$coinList
as
$key
=>
$val
){
$result
[
$key
][
'title'
]
=
$val
[
'message'
];
$result
[
$key
][
'time'
]
=
$val
[
'date'
];
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
57833db
...
...
@@ -167,7 +167,6 @@ class DetailModel
$colorStorageNum
=
0
;
$totalStorageNum
=
0
;
// 总库存数
foreach
(
$baseInfo
[
'goodsList'
]
as
$value
)
{
$sizeList
=
array
();
$colorStorageNum
=
0
;
$sizeStorageStr
=
''
;
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
57833db
...
...
@@ -286,7 +286,7 @@ class IndexController extends AbstractAction
$uid
=
$this
->
getUid
(
true
);
$cartGoods
=
CartModel
::
getCartData
(
$uid
,
$shoppingKey
);
if
(
empty
(
$cartGoods
)
||
isset
(
$cartGoods
[
'isEmptyCart'
]))
{
$this
->
go
(
Helpers
::
url
(
'/
shoppingcart
'
));
$this
->
go
(
Helpers
::
url
(
'/
cart/index/index
'
));
}
$cartType
=
$this
->
get
(
'cartType'
,
'ordinary'
);
...
...
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
View file @
57833db
...
...
@@ -113,7 +113,7 @@ class LoginController extends AbstractAction
/* 判断参数是否有效 */
$verifyEmail
=
Helpers
::
verifyEmail
(
$profile
);
$verifyMobile
=
(
$area
===
'86'
)
?
Helpers
::
verifyMobile
(
$profile
)
:
Helpers
::
verifyAreaMobile
(
$profile
);
$verifyMobile
=
(
$area
===
'86'
)
?
Helpers
::
verifyMobile
(
$profile
)
:
Helpers
::
verifyAreaMobile
(
$profile
,
$area
);
if
(
!
$verifyEmail
&&
!
$verifyMobile
)
{
break
;
}
...
...
Please
register
or
login
to post a comment