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
刘传洋
8 years ago
Commit
f5562fd0aa014154cacb66112f44cdc705ad1e13
2 parents
282ac807
0ab60315
m
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
75 additions
and
49 deletions
library/WebPlugin/Helpers.php
template/www.yohobuy.com/actions/cart/index/cart.phtml
template/www.yohobuy.com/partials/layout/page-header.phtml
web-static/js/header.js
web-static/js/home/order-block.js
web-static/js/order/address.js
web-static/package.json
web-static/sass/_header.css
yohobuy/www.yohobuy.com/application/models/Product/Item.php
yohobuy/www.yohobuy.com/application/models/Shopping/Cart.php
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/www.yohobuy.com/configs/application.developer.ini
yohobuy/www.yohobuy.com/configs/application.preview.ini
yohobuy/www.yohobuy.com/configs/application.production.ini
yohobuy/www.yohobuy.com/configs/application.testing.ini
library/WebPlugin/Helpers.php
View file @
f5562fd
...
...
@@ -269,9 +269,7 @@ class Helpers
$result
[
'salePrice'
]
&&
$result
[
'salePrice'
]
.=
'.00'
;
}
$result
[
'is_soon_sold_out'
]
=
(
$productData
[
'is_soon_sold_out'
]
===
'Y'
);
$result
[
'url'
]
=
self
::
url
(
'/product/pro_'
.
$productData
[
'product_id'
]
.
'_'
.
$productData
[
'goods_list'
][
0
][
'goods_id'
]
.
'/'
.
$productData
[
'cn_alphabet'
]
.
'.html'
,
array
(),
'item'
);
$result
[
'url'
]
=
self
::
getUrlBySkc
(
$productData
[
'product_id'
],
$productData
[
'goods_list'
][
0
][
'goods_id'
],
$productData
[
'cn_alphabet'
]);
// APP访问需要加附加的参数
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
if
(
$isApp
)
{
...
...
@@ -790,7 +788,7 @@ class Helpers
// 商品链接
$cnAlphaBet
=
isset
(
$value
[
'cn_alphabet'
])
?
$value
[
'cn_alphabet'
]
:
md5
(
$value
[
'product_name'
]);
$oneGoods
[
'link'
]
=
self
::
url
(
'/product/pro_'
.
$value
[
'product_id'
]
.
'_'
.
$value
[
'goods_id'
]
.
'/'
.
$cnAlphaBet
.
'.html'
,
null
,
'item'
);
$oneGoods
[
'link'
]
=
self
::
getUrlBySkc
(
$value
[
'product_id'
],
$value
[
'goods_id'
],
$cnAlphaBet
);
$result
[]
=
$oneGoods
;
}
...
...
@@ -839,7 +837,7 @@ class Helpers
// 商品链接
if
(
isset
(
$single
[
'goods_id'
]))
{
$cnAlphaBet
=
isset
(
$single
[
'cn_alphabet'
])
?
$single
[
'cn_alphabet'
]
:
md5
(
$single
[
'product_name'
]);
$oneGoods
[
'subjoinLink'
]
=
self
::
url
(
'/product/pro_'
.
$single
[
'product_id'
]
.
'_'
.
$single
[
'goods_id'
]
.
'/'
.
$cnAlphaBet
.
'.html'
,
null
,
'item'
);
$oneGoods
[
'subjoinLink'
]
=
self
::
getUrlBySkc
(
$single
[
'product_id'
],
$single
[
'goods_id'
],
$cnAlphaBet
);
}
else
{
$oneGoods
[
'subjoinLink'
]
=
self
::
url
(
'/product/show_'
.
$single
[
'product_id'
]
.
'_'
.
$single
[
'product_skn'
]
.
'/'
.
Helpers
::
makeToken
(
$single
[
'product_skn'
])
.
'.html'
,
null
,
'item'
);
}
...
...
@@ -1004,10 +1002,7 @@ class Helpers
*/
public
static
function
getUrlBySkc
(
$product_id
,
$goods_id
,
$cn_alphabet
=
''
)
{
if
(
empty
(
$cn_alphabet
))
{
$cn_alphabet
=
'goods.html'
;
}
return
'//item.yohobuy.com/product/pro_'
.
$product_id
.
'_'
.
$goods_id
.
'/'
.
$cn_alphabet
.
'.html'
;
return
'//item.yohobuy.com/p'
.
$product_id
.
'.html'
;
}
/**
...
...
@@ -1064,14 +1059,7 @@ class Helpers
*/
public
static
function
getProductUrl
(
$productId
,
$productSkn
,
$productName
=
''
,
$cnAlphaBet
=
''
)
{
$cnAlphaBet
=
empty
(
$cnAlphaBet
)
?
$cnAlphaBet
:
md5
(
$productName
);
return
self
::
url
(
'/product/pro_'
.
$productId
.
'_'
.
$productSkn
.
'/'
.
$cnAlphaBet
.
'.html'
,
null
,
'item'
);
return
self
::
getUrlBySkc
(
$productId
,
$productSkn
,
$cnAlphaBet
);
}
/**
...
...
template/www.yohobuy.com/actions/cart/index/cart.phtml
View file @
f5562fd
...
...
@@ -377,4 +377,24 @@ _mvq.push(['$logConversion']);
_mvq.push(
[
'$addItem'
,
''
,
/*商品id*/
'
{
{cartEnsure.ids
}
}'
,
''
,
''
]
);
_mvq.push(
[
'$logData'
]
);
</script>
<script
type='text/javascript'>
setTimeout(function()
{
if
(typeof
(py)
!=
'undefined')
{
py('event','viewCart'
,{
'money':'{{cartEnsure.productAmmount
}
}',
'items':
[
{
{#cartEnsure.commonSell.productItem
}
}
{
'id':'{{skn
}
}'
,
'count':'
{
{productNum
}
}'
,
'price':'
{
{productPrice
}
}'}
,
{
{/cartEnsure.commonSell.productItem
}
}
{
{#cartEnsure.preSell.productItem
}
}
{
'id':'{{skn
}
}'
,
'count':'
{
{productNum
}
}'
,
'price':'
{
{productPrice
}
}'}
,
{
{/cartEnsure.preSell.productItem
}
}
]
}).track('MC.Ok.
7
NFMIlCH_F_LE
2
riRlF
2
r_');
}
},
3000
)
</script>
{
{>
layout/footer
}
}
...
...
template/www.yohobuy.com/partials/layout/page-header.phtml
View file @
f5562fd
...
...
@@ -215,9 +215,11 @@
</ul>
</div>
<div
class=
"gobuy-notempty-footer"
>
<h
3
>
<a
href=
"//www.yohobuy.com/
shopping/cart"
>去购物车结算
</a>
<a
href=
"//www.yohobuy.com/
cart/cart"
>查看我的购物车
</a>
</h
3
>
</div>
\
{
\{/carData\
}
\}
</script>
...
...
web-static/js/header.js
View file @
f5562fd
...
...
@@ -1207,7 +1207,7 @@ function actionListenCartMore() {
*/
function
actionClickMiniCartBox
()
{
var
$target
;
var
shopcarurl
=
'//www.yohobuy.com/
shopping
/cart'
;
var
shopcarurl
=
'//www.yohobuy.com/
cart
/cart'
;
$
(
'#miniCartBox'
).
on
(
'click'
,
function
(
e
)
{
$target
=
$
(
e
.
target
);
...
...
web-static/js/home/order-block.js
View file @
f5562fd
...
...
@@ -193,7 +193,7 @@ function buyAgain(id){
data
:
{
orderCode
:
id
}
}).
then
(
function
(
d
)
{
if
(
d
.
code
===
200
)
{
location
.
href
=
'/
shopping
/cart'
;
location
.
href
=
'/
cart
/cart'
;
}
else
{
new
dialog
.
Alert
(
d
.
message
).
show
();
}
...
...
web-static/js/order/address.js
View file @
f5562fd
...
...
@@ -781,6 +781,7 @@ $('.to-play input.submit').click(function() {
juanCode
=
!!
codeVal
?
codeVal
:
$juangroupInput
.
closest
(
'li'
).
find
(
'#juancode'
).
val
(),
subTip
=
''
,
productSkn
=
[],
pinyouItems
=
[],
productSku
=
[];
if
(
$invoiceCheck
.
hasClass
(
'active'
))
{
...
...
@@ -846,7 +847,7 @@ $('.to-play input.submit').click(function() {
btnClass
:
[
'confirm-sure'
,
'w110'
],
name
:
'重新选择商品'
,
cb
:
function
()
{
window
.
location
.
href
=
'//www.yohobuy.com/
shopping
/cart'
;
window
.
location
.
href
=
'//www.yohobuy.com/
cart
/cart'
;
}
},
{
id
:
'confirm-sure'
,
...
...
@@ -865,8 +866,17 @@ $('.to-play input.submit').click(function() {
productNum
+=
parseInt
(
$
(
this
).
html
());
productSkn
.
push
(
$
(
this
).
attr
(
'data-skn'
));
productSku
.
push
(
$
(
this
).
attr
(
'data-sku'
));
pinyouItems
.
push
({
id
:
$
(
this
).
attr
(
'data-skn'
),
count
:
parseInt
(
$
(
this
).
html
()),
price
:
$
(
this
).
next
(
'.cart-sub-total '
).
html
()})
});
// 埋点
window
.
addPoint
(
'YB_SC_TOPAY_CLICK'
,
{
ORDER_CODE
:
d
.
data
.
order_code
,
PRD_NUM
:
productNum
,
ORDER_AMOUNT
:
d
.
data
.
order_amount
,
PRO_SKN
:
productSkn
.
join
(
','
),
PRO_SKU
:
productSku
.
join
(
','
),
UNIONCOOKIE
:
encodeURIComponent
(
d
.
data
.
unionKey
+
''
)
||
''
});
// 品友
if
(
typeof
(
py
)
!=
'undefined'
)
{
py
(
'event'
,
'order'
,{
'id'
:
d
.
data
.
order_code
,
'money'
:
d
.
data
.
order_amount
,
'items'
:
pinyouItems
}).
track
(
'MC.2z.Rg-AQqSqQi2GykX12LUxI0'
);
}
window
.
location
.
href
=
d
.
data
.
payUrl
;
}
}
else
{
...
...
web-static/package.json
View file @
f5562fd
{
"name"
:
"web-yohobuy"
,
"version"
:
"5.4.
2
"
,
"version"
:
"5.4.
3
"
,
"description"
:
"web yohobuy static"
,
"keywords"
:
[],
"homepage"
:
""
,
...
...
web-static/sass/_header.css
View file @
f5562fd
...
...
@@ -944,10 +944,8 @@
.goods-list-wrapper
{
width
:
100%
;
max-height
:
444px
;
margin-bottom
:
19px
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
overflow
:
hidden
;
}
.goods-list
{
...
...
@@ -1049,22 +1047,30 @@
}
.gobuy-notempty-footer
{
width
:
100%
;
height
:
61px
;
text-align
:
center
;
padding
:
0
25px
;
h3
{
box-sizing
:
border-box
;
width
:
349px
;
margin
:
0
auto
;
height
:
61px
;
line-height
:
61px
;
border-top
:
1px
solid
#dcdcdc
;
}
>
h3
{
padding-top
:
14px
;
padding-bottom
:
16px
;
border-top
:
1px
solid
#dcdcdc
;
text-align
:
right
;
}
a
{
font-size
:
18px
;
p
{
font-size
:
13px
;
color
:
#444
;
text-align
:
right
;
padding-top
:
0
;
padding-bottom
:
8px
;
}
a
{
display
:
inline-block
;
color
:
#fff
;
background-color
:
#d0021b
;
padding
:
10px
11px
;
border-radius
:
0
;
-webkit-border-radius
:
0
;
-moz-border-radius
:
0
;
}
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Item.php
View file @
f5562fd
...
...
@@ -47,7 +47,7 @@ class ItemModel
$goodsInfo
[
'maxSortId'
]
=
$baseInfo
[
'maxSortId'
];
$goodsInfo
[
'smallSortId'
]
=
$baseInfo
[
'smallSortId'
];
$goodsInfo
[
'promotionId'
]
=
$baseInfo
[
'isPromotion'
];
$goodsInfo
[
'goCartUrl'
]
=
Helpers
::
url
(
'/
shopping
/cart'
);
$goodsInfo
[
'goCartUrl'
]
=
Helpers
::
url
(
'/
cart
/cart'
);
$brandId
=
0
;
//设置并发请求数据
self
::
setMultiResourceByProductBaseInfo
(
$baseInfo
);
...
...
yohobuy/www.yohobuy.com/application/models/Shopping/Cart.php
View file @
f5562fd
...
...
@@ -49,7 +49,7 @@ class CartModel
// 未登录
if
(
!
$uid
)
{
$result
[
'loginUrl'
]
=
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
Helpers
::
url
(
'/
shopping
/cart'
)));
$result
[
'loginUrl'
]
=
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
Helpers
::
url
(
'/
cart
/cart'
)));
}
// 调用接口,获取购物车数据
...
...
@@ -318,7 +318,7 @@ class CartModel
if
(
empty
(
$uid
))
{
$result
[
'code'
]
=
403
;
$result
[
'message'
]
=
'请先登录!'
;
$result
[
'data'
][
'url'
]
=
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
Helpers
::
url
(
'/
shopping
/cart'
)));
$result
[
'data'
][
'url'
]
=
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
Helpers
::
url
(
'/
cart
/cart'
)));
break
;
}
...
...
@@ -399,7 +399,7 @@ class CartModel
$build
=
array
();
$build
[
'id'
]
=
$value
[
'id'
];
$build
[
'skn'
]
=
$value
[
'product_skn'
];
$build
[
'href'
]
=
Helpers
::
getUrl
Safe
(
$value
[
'url'
]
);
$build
[
'href'
]
=
Helpers
::
getUrl
BySkc
(
$value
[
'id'
],
0
);
$build
[
'title'
]
=
$value
[
'product_name'
];
$build
[
'img'
]
=
Helpers
::
getImageUrl
(
$value
[
'default_pic'
],
100
,
100
);
$build
[
'alt'
]
=
$value
[
'product_name'
];
...
...
@@ -662,7 +662,7 @@ class CartModel
break
;
}
$build
[
'img'
]
.=
'?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/90'
;
$build
[
'href'
]
=
Helpers
::
url
(
'/product/pro_'
.
$value
[
'product_id'
]
.
'_'
.
$goodsId
.
'/'
.
$value
[
'cn_alphabet'
]
.
'.html'
,
null
,
'item'
);
$build
[
'href'
]
=
Helpers
::
getUrlBySkc
(
$value
[
'product_id'
],
$goodsId
,
$value
[
'cn_alphabet'
]
);
$result
[
'data'
][
'item'
][]
=
$build
;
...
...
@@ -892,7 +892,7 @@ class CartModel
// 购物车类型, 调接口需要的
$result
[
'cartType'
]
=
$cartType
;
// 购物车链接
$result
[
'cartUrl'
]
=
Helpers
::
url
(
'/
shopping
/cart'
);
$result
[
'cartUrl'
]
=
Helpers
::
url
(
'/
cart
/cart'
);
// 是否要显示优惠券支付
$result
[
'showCouponPay'
]
=
$isAdvanceCart
?
false
:
true
;
// 是否是预售
...
...
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
f5562fd
...
...
@@ -254,7 +254,7 @@ class IndexController extends WebAction
$orderEnsure
=
CartModel
::
cartPay
(
$uid
,
$cartType
,
$isAdvanceCart
);
if
(
empty
(
$orderEnsure
))
{
$this
->
go
(
Helpers
::
url
(
'/
shopping
/cart'
));
$this
->
go
(
Helpers
::
url
(
'/
cart
/cart'
));
}
$this
->
_view
->
display
(
'order-ensure'
,
array
(
...
...
yohobuy/www.yohobuy.com/configs/application.developer.ini
View file @
f5562fd
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version
=
"5.4.
2
"
application.version
=
"5.4.
3
"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
...
...
yohobuy/www.yohobuy.com/configs/application.preview.ini
View file @
f5562fd
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version
=
"5.4.
2
"
application.version
=
"5.4.
3
"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
...
...
yohobuy/www.yohobuy.com/configs/application.production.ini
View file @
f5562fd
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version
=
"5.4.
2
"
application.version
=
"5.4.
3
"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
...
...
yohobuy/www.yohobuy.com/configs/application.testing.ini
View file @
f5562fd
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version
=
"5.4.
2
"
application.version
=
"5.4.
3
"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
...
...
Please
register
or
login
to post a comment