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
hf
9 years ago
Commit
1f6e19d705f026e84ccac58935f50d164ba91883
2 parents
b55a691d
62515af2
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
25 deletions
static/js/cart/good.js
static/js/cart/order-ensure.js
static/js/cart/order-info.js
static/js/cart/select-coupon.js
static/js/product/detail/detail.js
static/sass/_lazy-failure.scss
static/sass/product/_detail.scss
template/m.yohobuy.com/partials/cart/good.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Home/Online.php
static/js/cart/good.js
View file @
1f6e19d
...
...
@@ -20,7 +20,7 @@ var requesting = false;
ellipsis
.
init
();
lazyLoad
({
try_again_css
:
'
order
-failure'
try_again_css
:
'
good
-failure'
});
...
...
static/js/cart/order-ensure.js
View file @
1f6e19d
...
...
@@ -10,7 +10,7 @@ var $ = require('jquery'),
Handlebars
=
require
(
'yoho.handlebars'
),
tip
=
require
(
'../plugin/tip'
),
loading
=
require
(
'../plugin/loading'
),
order
Info
=
require
(
'./order-info'
).
orderInfo
;
order
=
require
(
'./order-info'
)
;
var
dispatchModeHammer
,
dispatchTimeHammer
,
...
...
@@ -18,10 +18,15 @@ var dispatchModeHammer,
$price
=
$
(
'.price-cal'
),
payType
,
priceTmpl
=
Handlebars
.
compile
(
$
(
'#tmpl-price'
).
html
()),
queryString
=
$
.
queryString
();
queryString
=
$
.
queryString
(),
orderInfo
=
order
.
orderInfo
;
lazyLoad
();
if
(
window
.
getUid
()
!==
orderInfo
(
'uid'
))
{
order
.
init
();
}
function
dispacthTapEvt
(
e
)
{
var
$cur
=
$
(
e
.
target
).
closest
(
'li'
);
...
...
@@ -79,6 +84,12 @@ function orderCompute() {
if
(
!
res
)
{
tip
.
show
(
'网络出错'
);
}
else
{
if
(
res
.
order_amount
)
{
res
.
order_amount
=
(
+
res
.
order_amount
).
toFixed
(
2
);
}
if
(
res
.
discount_amount
)
{
res
.
discount_amount
=
(
+
res
.
discount_amount
).
toFixed
(
2
);
}
if
(
res
.
last_order_amount
)
{
res
.
last_order_amount
=
(
+
res
.
last_order_amount
).
toFixed
(
2
);
}
...
...
static/js/cart/order-info.js
View file @
1f6e19d
...
...
@@ -6,11 +6,9 @@
var
$
=
require
(
'jquery'
);
var
info
=
window
.
cookie
(
'order-info'
);
// info 必须是 JSON 字符串
try
{
info
=
JSON
.
parse
(
info
);
}
catch
(
e
)
{
function
init
()
{
info
=
{
uid
:
window
.
getUid
(),
deliveryId
:
1
,
deliveryTimeId
:
1
,
paymentTypeId
:
1
,
...
...
@@ -26,6 +24,15 @@ try {
window
.
setCookie
(
'order-info'
,
JSON
.
stringify
(
info
));
}
// info 必须是 JSON 字符串
try
{
info
=
JSON
.
parse
(
info
);
}
catch
(
e
)
{
init
();
}
exports
.
init
=
init
;
exports
.
orderInfo
=
function
(
key
,
value
)
{
if
(
value
===
undefined
)
{
return
info
[
key
];
...
...
static/js/cart/select-coupon.js
View file @
1f6e19d
...
...
@@ -22,18 +22,24 @@ var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
ellipsis
.
init
();
$newCoupon
.
on
(
'submit'
,
function
()
{
var
$this
=
$
(
this
);
if
(
!
$this
.
find
(
'[name="couponCode"]'
).
val
())
{
tip
.
show
(
'请输入优惠券码'
);
return
false
;
}
$
.
ajax
({
method
:
'POST'
,
url
:
'/cart/index/couponSearch'
,
data
:
$
(
this
)
.
serialize
()
data
:
$
this
.
serialize
()
}).
then
(
function
(
res
)
{
if
(
res
.
code
===
200
)
{
tip
.
show
(
'优惠券可用'
);
orderInfo
(
'couponCode'
,
res
.
data
.
coupon_code
);
orderInfo
(
'couponValue'
,
res
.
data
.
coupon_value
);
window
.
location
.
href
=
'/
shoppingCart/orderEnsure?coupon_code='
+
res
.
data
.
coupon_code
;
window
.
location
.
href
=
'/
cart/index/orderEnsure'
;
}
else
{
tip
.
show
(
res
.
message
);
tip
.
show
(
res
.
message
||
'网络错误'
);
}
}).
fail
(
function
()
{
tip
.
show
(
'网络错误'
);
...
...
static/js/product/detail/detail.js
View file @
1f6e19d
...
...
@@ -78,8 +78,14 @@ $.ajax({
type
:
'GET'
,
url
:
'/cart/index/count'
,
success
:
function
(
data
)
{
var
count
;
if
(
data
.
code
===
200
)
{
$cart
.
find
(
'.num-tag'
).
html
(
data
.
data
.
cart_goods_count
).
removeClass
(
'hide'
);
count
=
data
.
data
.
cart_goods_count
||
0
;
if
(
count
>
99
)
{
count
=
'99+'
;
}
$cart
.
find
(
'.num-tag'
).
html
(
count
).
removeClass
(
'hide'
);
}
}
});
...
...
static/sass/_lazy-failure.scss
View file @
1f6e19d
.order-failure
{
background-image
:
image-url
(
'lazy-failure/order-good.jpg'
);
background-size
:
100%
;
}
\ No newline at end of file
}
.good-failure
{
background-image
:
image-url
(
'lazy-failure/order-good.jpg'
);
background-size
:
132rem
/
$pxConvertRem
!
important
;
background-position-x
:
40%
;
}
...
...
static/sass/product/_detail.scss
View file @
1f6e19d
...
...
@@ -480,16 +480,19 @@ $basicBtnC:#eb0313;
}
}
.num-tag
{
position
:
absolute
;
left
:
pxToRem
(
66px
);
height
:
pxToRem
(
20px
);
display
:
block
;
width
:
pxToRem
(
36px
);
height
:
pxToRem
(
36px
);
background-color
:
$basicBtnC
;
border-radius
:
50%
;
position
:
absolute
;
top
:
0
;
left
:
pxToRem
(
48px
);
width
:
pxToRem
(
72px
);
height
:
pxToRem
(
72px
);
font-size
:
pxToRem
(
40px
);
line-height
:
pxToRem
(
72px
);
color
:
#fff
;
font-size
:
pxToRem
(
24px
);
background
:
$basicBtnC
;
text-align
:
center
;
border-radius
:
50%
;
@include
transform
(
scale
(
0
.5
));
&
.hide
{
display
:
none
;
}
...
...
template/m.yohobuy.com/partials/cart/good.phtml
View file @
1f6e19d
...
...
@@ -10,7 +10,7 @@
{{/if}}
<div class="info">
<img class="thumb lazy" data-original={{
url
}}>
<img class="thumb lazy" data-original={{
thumb
}}>
{{#if isAdvanceBuy}}
<p class="few-tag plus-tag">加价购</p>
{{^}}
...
...
@@ -51,7 +51,7 @@
{{/if}}
<span class="iconfont icon-del"></span>
</p>
<p class="row">
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
1f6e19d
...
...
@@ -466,8 +466,10 @@ class HomeController extends AbstractAction
*/
public
function
onlineServiceDetailAction
()
{
$cateId
=
$this
->
get
(
'cateId'
,
0
);
$cateName
=
$this
->
get
(
'cateName'
,
''
);
$cateInfo
=
$this
->
get
(
'cateInfo'
,
''
);
$cate
=
explode
(
"_"
,
$cateInfo
);
$cateId
=
intval
(
$cate
[
0
]);
$cateName
=
$cate
[
1
];
if
(
$cateId
>
0
)
{
$service
=
Home\OnlineModel
::
getOnlineServiceDetail
(
$cateId
);
}
...
...
yohobuy/m.yohobuy.com/application/models/Home/Online.php
View file @
1f6e19d
...
...
@@ -39,7 +39,7 @@ class OnlineModel
if
(
$sub
)
{
foreach
(
$sub
as
$sk
=>
$sv
)
{
$qTmp
[
$sk
][
'title'
]
=
$sv
[
'category_name'
];
$qTmp
[
$sk
][
'link'
]
=
Helpers
::
url
(
'/home/onlineservicedetail'
,
array
(
'cateI
d'
=>
$sv
[
'id'
],
'cateName'
=>
$sv
[
'category_name'
]));
$qTmp
[
$sk
][
'link'
]
=
Helpers
::
url
(
'/home/onlineservicedetail'
,
array
(
'cateI
nfo'
=>
$sv
[
'id'
]
.
'_'
.
$sv
[
'category_name'
]));
}
}
$question
[
$key
][
'list'
]
=
$qTmp
;
...
...
Please
register
or
login
to post a comment