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
Rock Zhang
9 years ago
Commit
0d2749235e0a673b4c0ef979246e113d6ecad86b
2 parents
82435a40
14e617b0
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
22 deletions
library/Api/Yohobuy.php
library/LibModels/Wap/Passport/LoginData.php
static/js/cart/cart.js
static/js/cart/good.js
static/sass/cart/_chose-panel.scss
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
library/Api/Yohobuy.php
View file @
0d27492
...
...
@@ -23,18 +23,17 @@ class Yohobuy
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL = 'http://apih5.yoho.cn/';
// const API_URL2 = 'http://apih5.yoho.cn/';
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://api2.open.yohobuy.com/';
/* 测试环境 */
const
API_URL
=
'http://testapi.yoho.cn:28078/'
;
const
SERVICE_URL
=
'http://testservice.yoho.cn:28077/'
;
const
API_URL
=
'http://apih5.yoho.cn/'
;
const
API_URL2
=
'http://apih5.yoho.cn/'
;
const
SERVICE_URL
=
'http://serviceh5.yoho.cn/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
const
API_OLD
=
'http://
test
2.open.yohobuy.com/'
;
const
API_OLD
=
'http://
api
2.open.yohobuy.com/'
;
// /* 测试环境 */
// const API_URL = 'http://testapi.yoho.cn:28078/';
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://test2.open.yohobuy.com/';
/**
* 私钥列表
...
...
library/LibModels/Wap/Passport/LoginData.php
View file @
0d27492
...
...
@@ -34,7 +34,6 @@ class LoginData
$param
[
'area'
]
=
$area
;
$param
[
'profile'
]
=
$profile
;
$param
[
'password'
]
=
$password
;
if
(
!
empty
(
$shoppingKey
))
{
$param
[
'shopping_key'
]
=
$shoppingKey
;
}
...
...
@@ -65,9 +64,10 @@ class LoginData
* @param string $nickname 姓名
* @param string $openId 第三方唯一识别码
* @param string $sourceType 登录方式
* @param string $shoppingKey 未登录用户唯一识别码, 默认为空
* @return array 登录返回结果
*/
public
static
function
signinByOpenID
(
$nickname
,
$openId
,
$sourceType
)
public
static
function
signinByOpenID
(
$nickname
,
$openId
,
$sourceType
,
$shoppingKey
=
null
)
{
// 构建必传参数
$param
=
Yohobuy
::
param
();
...
...
@@ -77,6 +77,9 @@ class LoginData
$param
[
'source_type'
]
=
$sourceType
;
$param
[
'nickname'
]
=
$nickname
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
if
(
!
empty
(
$shoppingKey
))
{
$param
[
'shopping_key'
]
=
$shoppingKey
;
}
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
...
...
static/js/cart/cart.js
View file @
0d27492
...
...
@@ -79,6 +79,9 @@ if ('advance' === cartType) {
$cartContent
.
toggleClass
(
'hide'
);
$
(
'#common-cart-nav'
).
removeClass
(
'active'
);
$
(
'#presell-cart-nav'
).
addClass
(
'active'
);
$
(
'.shopping-cart-good .name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
}
if
(
$
(
'.cart-nav'
).
length
>
0
)
{
...
...
@@ -90,6 +93,10 @@ if ($('.cart-nav').length > 0) {
return
;
}
$
(
'.shopping-cart-good .name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
if
(
cartType
===
'ordinary'
)
{
cartType
=
'advance'
;
$
(
'#cartType'
).
val
(
'advance'
);
...
...
static/js/cart/good.js
View file @
0d27492
...
...
@@ -22,9 +22,11 @@ lazyLoad({
try_again_css
:
'good-failure'
});
$
(
'.shopping-cart-good .name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
setTimeout
(
function
()
{
$
(
'.shopping-cart-good .name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
},
0
);
function
GoodInfo
(
properties
)
{
this
.
goods_type
=
properties
.
goods_type
;
...
...
@@ -104,7 +106,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
});
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'couponName'
,
null
);
history
.
go
(
0
);
window
.
location
.
href
=
'/cart/index/index?cartType='
+
$
(
'#cartType'
).
val
(
);
}
else
{
tip
.
show
(
data
.
message
);
}
...
...
@@ -190,11 +192,13 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
//全选按钮点击事件
$selectAllBtn
.
on
(
'touchend'
,
function
()
{
if
(
$
(
'.low-stocks'
).
length
>
0
)
{
var
isSelect
=
$
(
this
).
hasClass
(
'icon-cb-checked'
);
if
(
!
isSelect
&&
$
(
'.low-stocks'
).
length
>
0
)
{
tip
.
show
(
'所选商品中含有库存不足的商品'
);
return
false
;
}
bottomCheckBoxHandeler
(
$
(
this
).
hasClass
(
'icon-cb-checked'
)
,
$
(
'#cartType'
).
val
(),
didUpdateAllGoodsCheckStatus
);
bottomCheckBoxHandeler
(
isSelect
,
$
(
'#cartType'
).
val
(),
didUpdateAllGoodsCheckStatus
);
});
$
(
'.down'
).
on
(
'touchend'
,
function
()
{
...
...
static/sass/cart/_chose-panel.scss
View file @
0d27492
...
...
@@ -58,6 +58,7 @@
}
.sale-price
{
color
:
#e10
;
margin-right
:
pxToRem
(
15px
);
&
.no-price
{
color
:
#000
;
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
0d27492
...
...
@@ -782,7 +782,7 @@ class HomeController extends AbstractAction
$this
->
auditJumpLogin
();
$this
->
setTitle
(
'支付中心'
);
$this
->
setNavHeader
(
'支付中心'
,
Helpers
::
url
(
'/
cart/index/index'
)
);
$this
->
setNavHeader
(
'支付中心'
,
Helpers
::
url
(
'/
home/orders'
),
''
);
$orderCode
=
$this
->
get
(
'order_code'
);
if
(
empty
(
$orderCode
))
{
...
...
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
View file @
0d27492
...
...
@@ -193,7 +193,8 @@ class LoginController extends AbstractAction
$result
=
array
();
if
(
isset
(
$realName
,
$email
,
$userId
))
{
$result
=
LoginData
::
signinByOpenID
(
$realName
,
$userId
,
'alipay'
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
LoginData
::
signinByOpenID
(
$realName
,
$userId
,
'alipay'
,
$shoppingKey
);
}
//判定是否需要绑定手机号
...
...
@@ -229,7 +230,8 @@ class LoginController extends AbstractAction
$partnerInfo
=
$qqconnect
->
getUserInfo
(
$access
);
$result
=
array
();
if
(
!
empty
(
$partnerInfo
)
&&
isset
(
$partnerInfo
[
'nickname'
]))
{
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'nickname'
],
$access
[
'openid'
],
'qq'
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'nickname'
],
$access
[
'openid'
],
'qq'
,
$shoppingKey
);
}
//判定是否需要绑定手机号
...
...
@@ -266,7 +268,8 @@ class LoginController extends AbstractAction
$result
=
array
();
if
(
$partnerInfo
&&
is_array
(
$partnerInfo
))
{
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'screen_name'
],
$access
[
'uid'
],
'sina'
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'screen_name'
],
$access
[
'uid'
],
'sina'
,
$shoppingKey
);
}
//判定是否需要绑定手机号
if
(
isset
(
$result
[
'data'
][
'is_bind'
])
&&
$result
[
'data'
][
'is_bind'
]
==
'N'
)
{
...
...
Please
register
or
login
to post a comment