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
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
7e460437bd33df43defae2cdd64c817924fc30f6
2 parents
f3cdc9ba
d9f7b16f
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
15 deletions
library/LibModels/Wap/Passport/BindData.php
static/js/product/detail/detail.js
template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
template/m.yohobuy.com/partials/cart/cart-content.phtml
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Bind.php
library/LibModels/Wap/Passport/BindData.php
View file @
7e46043
...
...
@@ -81,17 +81,21 @@ class BindData
* @param string $area 国别码
* @param string $password 密码
*/
public
static
function
bindMobile
(
$openId
,
$
nickname
,
$sourceType
,
$mobile
,
$area
,
$password
=
''
)
public
static
function
bindMobile
(
$openId
,
$
sourceType
,
$mobile
,
$area
,
$password
=
''
,
$nickname
=
''
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.passport.bind'
;
$param
[
'mobile'
]
=
$mobile
;
$param
[
'open_id'
]
=
$openId
;
$param
[
'nickname'
]
=
$nickname
;
$param
[
'source_type'
]
=
$sourceType
;
$param
[
'area'
]
=
$area
;
if
(
!
empty
(
$password
))
{
if
(
!
empty
(
$nickname
))
{
$param
[
'nickname'
]
=
$nickname
;
}
if
(
!
empty
(
$password
))
{
$param
[
'password'
]
=
$password
;
}
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
...
...
@@ -99,7 +103,6 @@ class BindData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 换绑手机检验
* @param string $mobile 手机号
...
...
@@ -116,7 +119,6 @@ class BindData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 换绑手机
* @param string $uid 用户Id
...
...
@@ -138,5 +140,4 @@ class BindData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
}
...
...
static/js/product/detail/detail.js
View file @
7e46043
...
...
@@ -32,6 +32,9 @@ function showFooter() {
},
200
);
}
if
(
$
(
'#goodsDiscount h1'
).
length
<
1
)
{
$
(
'.dropdown'
).
remove
();
}
showFooter
();
lazyLoad
(
$
(
'img.lazy'
));
...
...
template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
View file @
7e46043
...
...
@@ -12,7 +12,7 @@
{
{else
}
}
{
{#
freebie
}
}
<div
class=
"advance-block gift-block"
data-promotion-id=
"{{promotionId}}"
>
<p
class=
"title"
>
{
{
t
itle
}
}</p>
<p
class=
"title"
>
{
{
promotionT
itle
}
}</p>
{
{#goods
}
}
{
{>
cart/gift-advance-good
}
}
{
{/goods
}
}
...
...
template/m.yohobuy.com/partials/cart/cart-content.phtml
View file @
7e46043
...
...
@@ -20,7 +20,7 @@
<span class="iconfont"></span>
赠品
<span class="iconfont icon-right-arrow"></span>
<span class="count">{{
c
ount}}</span>
<span class="count">{{
giftC
ount}}</span>
</a>
</li>
{{/ freebie}}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
7e46043
...
...
@@ -46,7 +46,7 @@ class CartModel
*
* @param integer $uid 用户ID
* @param string $shoppingKey 未登录用户唯一识别码
* @param string $cartType 购物车类型
* @param string $cartType 购物车类型
,默认是是所有购物车,ordinary为普通购物车,advance为预售购物车
* @param bool $onlyGift 只获取赠品的商品数据
* @param bool $onlyAdvanceBuy 只获取加价购的商品数据
* @return array|mixed 处理之后的购物车数据
...
...
@@ -73,7 +73,7 @@ class CartModel
$cart
=
$cartData
[
'data'
];
if
(
$
cartType
!==
'all'
)
{
// 加价购或者赠品数据
if
(
$
onlyGift
||
$onlyAdvanceBuy
)
{
// 加价购或者赠品数据
$result
=
self
::
procCartData
(
$cart
[
'ordinary_cart_data'
],
$onlyGift
,
$onlyAdvanceBuy
);
break
;
}
...
...
@@ -99,7 +99,7 @@ class CartModel
// 以上两个购物车中都有数据, 默认显示普通购物车
else
{
$result
[
'cartNav'
]
=
true
;
$result
[
'cartType'
]
=
'ordinary'
;
$result
[
'cartType'
]
=
$cartType
!==
'all'
?
$cartType
:
'ordinary'
;
}
/* 普通购物车 */
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
7e46043
...
...
@@ -40,10 +40,11 @@ class IndexController extends AbstractAction
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$uid
=
$this
->
getUid
(
true
);
$cartType
=
$this
->
get
(
'cartType'
,
'all'
);
$data
=
array
(
'shoppingCartPage'
=>
true
,
'shoppingCart'
=>
CartModel
::
getCartData
(
$uid
,
$shoppingKey
)
'shoppingCart'
=>
CartModel
::
getCartData
(
$uid
,
$shoppingKey
,
$cartType
)
);
// 渲染模板
...
...
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Bind.php
View file @
7e46043
...
...
@@ -225,14 +225,14 @@ class BindController extends AbstractAction
$openId
=
$this
->
post
(
'openId'
);
$areaCode
=
$this
->
post
(
'areaCode'
,
'86'
);
$sourceType
=
$this
->
post
(
'sourceType'
);
$nickname
=
$this
->
post
(
'nickname'
);
$password
=
$this
->
post
(
'password'
);
// $nickname = $this->post('nickname');//nickname不同步信息
$password
=
!
empty
(
$this
->
post
(
'password'
))
?
$this
->
post
(
'password'
)
:
''
;
if
(
!
is_numeric
(
$phoneNum
)
||
!
$openId
||
!
$sourceType
||
!
$areaCode
)
{
break
;
}
$res
=
BindData
::
bindMobile
(
$openId
,
$nickname
,
$sourceType
,
$phoneNum
,
$areaCode
,
$password
);
$res
=
BindData
::
bindMobile
(
$openId
,
$sourceType
,
$phoneNum
,
$areaCode
,
$password
);
if
(
!
isset
(
$res
[
'code'
]))
{
break
;
}
...
...
Please
register
or
login
to post a comment