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
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
9 years ago
Commit
f0297234356f9e80f9750ee0c9d56ae3596000d8
1 parent
11583c37
合并部分代码
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
33 deletions
library/LibModels/Wap/Product/ListData.php
static/js/product/shop.js
yohobuy/m.yohobuy.com/application/controllers/Home.php
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/Product/controllers/Detail.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
library/LibModels/Wap/Product/ListData.php
View file @
f029723
...
...
@@ -87,7 +87,7 @@ class ListData
$param
[
'shop_id'
]
=
$shopId
;
$param
[
'uid'
]
=
$uid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
//TODO
return
Yohobuy
::
get
(
API_URL
,
$param
);
}
...
...
@@ -104,7 +104,7 @@ class ListData
$param
[
'method'
]
=
'app.shops.getShopsBrands'
;
$param
[
'shop_id'
]
=
$shopId
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
//TODO
return
Yohobuy
::
get
(
API_URL
,
$param
);
// return Yohobuy::get('http://devapi.yoho.cn:58078/', $param, $cache);
}
...
...
static/js/product/shop.js
View file @
f029723
...
...
@@ -176,7 +176,6 @@ function getParam(req) {
function
newData
(
callback
)
{
var
req
=
{};
req
.
url
=
location
.
protocol
+
'//m.yohobuy.com/index/search/search'
;
req
.
data
=
{
type
:
'newest'
,
...
...
@@ -201,7 +200,6 @@ function newData(callback) {
function
hotData
(
callback
)
{
var
req
=
{};
req
.
url
=
location
.
protocol
+
'//m.yohobuy.com/index/search/search'
;
req
.
data
=
{
type
:
'hot'
,
...
...
@@ -566,24 +564,42 @@ function search(opt) {
/**
* 获取url参数
*/
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
// function getQueryString(name) {
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
// var r = window.location.search.substr(1).match(reg);
//
// if (r != null) {
// return window.unescape(r[2]);
// }
// return null;
// }
if
(
r
!=
null
)
{
return
window
.
unescape
(
r
[
2
]);
/**
* 获取url参数
* @returns {Array}
*/
function
queryString
()
{
var
vars
=
[],
hash
,
i
;
var
hashes
=
window
.
location
.
search
.
slice
(
1
).
split
(
'&'
);
for
(
i
=
0
;
i
<
hashes
.
length
;
i
++
)
{
hash
=
hashes
[
i
].
split
(
'='
);
vars
.
push
(
hash
[
0
]);
vars
[
hash
[
0
]]
=
hash
[
1
];
}
return
null
;
return
vars
;
}
$
.
ajax
({
type
:
'GET'
,
url
:
location
.
protocol
+
'//m.yohobuy.com/search/filter'
,
data
:
{
shop_id
:
brand
?
''
:
shopI
d
,
shop_id
:
queryString
().
shop_i
d
,
brand
:
brand
,
gender
:
getQueryString
(
'gender'
),
channel
:
getQueryString
(
'channel'
)
gender
:
queryString
().
gender
,
channel
:
queryString
().
channel
},
success
:
function
(
data
)
{
$goodsContainer
.
append
(
data
);
...
...
@@ -860,7 +876,7 @@ function postCollect(info) {
function
collectShop
()
{
var
qew
=
{};
qew
.
url
=
'
/product/index/shopFav'
;
qew
.
url
=
location
.
protocol
+
'//m.yohobuy.com
/product/index/shopFav'
;
qew
.
data
=
{
shop_id
:
favId
?
favId
:
shopId
,
app_version
:
appVersion
...
...
@@ -871,7 +887,7 @@ function collectShop() {
function
cancelShop
()
{
var
qew
=
{};
qew
.
url
=
'
/product/index/cancelShopFav'
;
qew
.
url
=
location
.
protocol
+
'//m.yohobuy.com
/product/index/cancelShopFav'
;
qew
.
data
=
{
shop_id
:
favId
?
favId
:
shopId
,
app_version
:
appVersion
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
f029723
...
...
@@ -531,7 +531,7 @@ class HomeController extends AbstractAction
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
(
true
);
$id
=
$this
->
post
(
'id'
,
''
);
// TODO
$id
=
$this
->
post
(
'id'
,
''
);
if
(
$id
)
{
$id
=
Encryption
::
decrypt
(
$id
);
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
f029723
...
...
@@ -485,7 +485,7 @@ class CartModel
foreach
(
$payReturn
[
'goods_list'
]
as
$single
)
{
$oneGoods
=
array
();
$oneGoods
[
'id'
]
=
$single
[
'product_sku'
];
// TODO 未确定用哪个
$oneGoods
[
'id'
]
=
$single
[
'product_sku'
];
$oneGoods
[
'thumb'
]
=
Images
::
getImageUrl
(
$single
[
'goods_images'
],
120
,
160
);
$oneGoods
[
'name'
]
=
$single
[
'product_name'
];
$oneGoods
[
'color'
]
=
$single
[
'color_name'
];
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
f029723
...
...
@@ -789,7 +789,7 @@ class IndexController extends AbstractAction
if
(
empty
(
$uid
)
||
empty
(
$productSku
)
||
empty
(
$buyNumber
)
||
empty
(
$mobile
))
{
break
;
}
//联盟参数
TODO
//联盟参数
$data
=
CartData
::
submitTicket
(
$uid
,
$productSku
,
$buyNumber
,
$mobile
,
$useYohoCoin
);
if
(
isset
(
$data
[
'code'
]))
{
$result
=
$data
;
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
View file @
f029723
...
...
@@ -51,7 +51,7 @@ class DetailController extends AbstractAction
if
(
!
$this
->
isApp
()){
$this
->
setNavHeader
(
'商品详情'
);
}
// 渲染模板
TODO
// 渲染模板
$this
->
_view
->
display
(
'index'
,
$data
);
}
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
f029723
...
...
@@ -16,13 +16,13 @@ class IndexController extends AbstractAction
/**
* 品类商品列表页
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @internal param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @internal param int $brand 品牌Id
* @internal param int $sort 品类查询sort参数
* @internal param int $color 颜色Id
* @internal param int $size 尺码Id
* @internal param string $price 价格
* @internal param string $p_d 折扣
*/
public
function
indexAction
()
{
...
...
@@ -118,12 +118,12 @@ class IndexController extends AbstractAction
/**
* 品牌商品列表页
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @internal param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @internal param int $sort 品类查询sort参数
* @internal param int $color 颜色Id
* @internal param int $size 尺码Id
* @internal param string $price 价格
* @internal param string $p_d 折扣
*/
public
function
brandAction
()
{
...
...
@@ -608,7 +608,6 @@ class IndexController extends AbstractAction
}
if
(
empty
(
$uid
))
{
$data
[
'code'
]
=
401
;
//TODO app登陆地址
$refer
=
$_SERVER
[
'HTTP_REFERER'
];
$toUrl
=
Helpers
::
url
(
'/signin.html'
)
.
"?refer="
.
$refer
;
if
(
!
empty
(
$appVersion
)){
...
...
Please
register
or
login
to post a comment