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
biao
9 years ago
Commit
3be59a6779585233f6b2205156bb593073a43911
2 parents
78f52a80
8d6278f0
resolve conflict
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
41 additions
and
19 deletions
static/js/cart/cart.js
static/js/cart/good.js
static/js/cart/order-ensure.js
static/js/common.js
static/js/index/footer.js
static/js/product/suspend-cart.js
static/sass/me/_ihelp.scss
template/m.yohobuy.com/actions/cart/index/index.phtml
template/m.yohobuy.com/partials/cart/good.phtml
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
static/js/cart/cart.js
View file @
3be59a6
...
...
@@ -69,6 +69,8 @@ lazyLoad($('img.lazy'));
if
(
'advance'
===
cartType
)
{
$cartContent
.
toggleClass
(
'hide'
);
$
(
'presell-cart-nav'
).
addClass
(
'active'
);
$
(
'common-cart-nav'
).
removeClass
(
'active'
);
}
if
(
$
(
'.cart-nav'
).
length
>
0
)
{
...
...
@@ -82,8 +84,10 @@ if ($('.cart-nav').length > 0) {
if
(
cartType
===
'ordinary'
)
{
cartType
=
'advance'
;
$
(
'#cartType'
).
val
(
'advance'
);
}
else
{
cartType
=
'ordinary'
;
$
(
'#cartType'
).
val
(
'ordinary'
);
}
$this
.
siblings
(
'.active'
).
removeClass
(
'active'
);
...
...
static/js/cart/good.js
View file @
3be59a6
...
...
@@ -14,7 +14,6 @@ var dialog = require('../me/dialog'),
orderInfo
=
require
(
'./order-info'
).
orderInfo
;
var
$selectAllBtn
=
$
(
'.balance .checkbox'
),
cartType
=
$
(
'#cartType'
).
val
(),
requesting
=
false
;
ellipsis
.
init
();
...
...
@@ -48,7 +47,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
return
false
;
}
goodInfo
.
goods_type
=
cartType
;
goodInfo
.
goods_type
=
$
(
'#cartType'
).
val
()
;
goodInfo
.
selected
=
$this
.
hasClass
(
'icon-cb-checked'
)
?
'N'
:
'Y'
;
goodInfo
.
product_sku
=
id
;
goodInfo
.
buy_number
=
$good
.
find
(
'.count'
).
eq
(
0
).
text
().
trim
().
replace
(
'×'
,
''
);
...
...
@@ -67,7 +66,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
}
else
{
$this
.
removeClass
(
'icon-checkbox'
).
addClass
(
'icon-cb-checked'
);
}
window
.
history
.
go
(
0
);
window
.
location
.
href
=
'/cart/index/index?cartType='
+
$
(
'#cartType'
).
val
(
);
}
else
if
(
data
.
code
===
400
)
{
tip
.
show
(
'网络异常'
);
}
...
...
@@ -191,7 +190,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
//全选按钮点击事件
$selectAllBtn
.
on
(
'touchend'
,
function
()
{
bottomCheckBoxHandeler
(
$
(
this
).
hasClass
(
'icon-cb-checked'
),
cartType
,
didUpdateAllGoodsCheckStatus
);
bottomCheckBoxHandeler
(
$
(
this
).
hasClass
(
'icon-cb-checked'
),
$
(
'#cartType'
).
val
()
,
didUpdateAllGoodsCheckStatus
);
});
$
(
'.down'
).
on
(
'touchend'
,
function
()
{
...
...
static/js/cart/order-ensure.js
View file @
3be59a6
...
...
@@ -97,12 +97,6 @@ function orderCompute() {
if
(
$
.
type
(
res
)
!==
'object'
)
{
window
.
location
.
reload
();
}
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
);
}
...
...
@@ -128,6 +122,10 @@ function submitOrder() {
var
invoiceText
=
$invoice
.
find
(
'[name="invoice-title"]'
).
val
()
||
orderInfo
(
'invoiceText'
),
msg
=
$
(
'#msg'
).
find
(
'input'
).
val
()
||
orderInfo
(
'msg'
);
if
(
orderInfo
(
'deliveryId'
)
===
2
&&
!
$addressWrap
.
data
(
'support'
))
{
tip
.
show
(
'当前地址不支持顺丰快递'
);
return
;
}
if
(
isSubmiting
)
{
return
false
;
}
...
...
static/js/common.js
View file @
3be59a6
...
...
@@ -3,7 +3,8 @@
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/21
*/
var
$
=
require
(
'jquery'
);
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
);
var
$footer
=
$
(
'#yoho-footer'
),
$yohoPage
=
$
(
'.yoho-page'
),
...
...
@@ -131,6 +132,8 @@ function reMarginFooter(fixedElement) {
var
user
=
getUser
();
var
backToTopHammer
;
rePosFooter
();
//计算底部位置
if
(
user
===
0
)
{
...
...
@@ -151,10 +154,15 @@ function reMarginFooter(fixedElement) {
);
}
$op
.
find
(
'.back-to-top'
).
on
(
'touchend'
,
function
()
{
$
(
window
).
scrollTop
(
0
);
return
false
;
});
if
(
$op
.
find
(
'.back-to-top'
).
length
>
0
)
{
backToTopHammer
=
new
Hammer
(
$op
.
find
(
'.back-to-top'
)[
0
]);
backToTopHammer
.
on
(
'tap'
,
function
(
e
)
{
$
(
window
).
scrollTop
(
0
);
e
.
srcEvent
.
preventDefault
();
return
false
;
});
}
$footer
.
removeClass
(
'hide'
);
}());
...
...
static/js/index/footer.js
View file @
3be59a6
...
...
@@ -15,7 +15,7 @@ function downLoadApp() {
var
appUrl
=
'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'
;
var
clickedAt
=
new
Date
();
setTimeout
(
function
()
{
setTimeout
(
function
()
{
if
((
new
Date
())
-
clickedAt
<
2000
)
{
window
.
location
=
appUrl
;
}
...
...
static/js/product/suspend-cart.js
View file @
3be59a6
...
...
@@ -19,6 +19,9 @@ $.ajax({
if
(
count
>
99
)
{
count
=
'99+'
;
}
if
(
count
===
0
)
{
$
(
'.cart-count'
).
remove
();
}
$cart
.
find
(
'.cart-count'
).
html
(
count
).
removeClass
(
'hide'
);
}
}
...
...
static/sass/me/_ihelp.scss
View file @
3be59a6
...
...
@@ -32,4 +32,10 @@
}
}
}
}
.deal_main
{
margin
:
.5rem
3%
;
font-size
:
1
.2em
;
widows
:
94%
;
overflow
:
hidden
;
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/cart/index/index.phtml
View file @
3be59a6
...
...
@@ -20,12 +20,12 @@
{
{#if
cartNav
}
}
<ul
class=
"cart-nav clearfix"
>
<li
class=
"active"
>
<span>
<span
id=
"common-cart-nav"
>
普通商品(
{
{commonGoodsCount
}
})
</span>
</li>
<li>
<span>
<span
id=
"presell-cart-nav"
>
预售商品(
{
{presellGoodsCount
}
})
</span>
<div
id=
"presell-tip"
class=
"presell-tip"
>
...
...
template/m.yohobuy.com/partials/cart/good.phtml
View file @
3be59a6
...
...
@@ -46,6 +46,9 @@
{{#if isAdvanceBuy}}
<span class="sale-price">¥{{salesPrice}}</span>
{{/if}}
{{#if isGift}}
<span class="sale-price">¥{{salesPrice}}</span>
{{/if}}
</p>
{{#if isVipPrice}}
<span class="vip">
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
3be59a6
...
...
@@ -346,7 +346,8 @@ class CartModel
$result
[
'phoneNum'
]
=
isset
(
$address
[
'mobile'
])
?
$address
[
'mobile'
]
:
$payReturn
[
'delivery_address'
][
'mobile'
];
$result
[
'area'
]
=
isset
(
$address
[
'area'
])
?
$address
[
'area'
]
:
$payReturn
[
'delivery_address'
][
'area'
];
$result
[
'address'
]
=
isset
(
$address
[
'address'
])
?
$address
[
'address'
]
:
$payReturn
[
'delivery_address'
][
'address'
];
$result
[
'isSupport'
]
=
(
$payReturn
[
'delivery_address'
][
'is_support'
]
===
'Y'
);
$isSupport
=
isset
(
$address
[
'is_support'
])
?
$address
[
'is_support'
]
:
$payReturn
[
'delivery_address'
][
'is_support'
];
$result
[
'isSupport'
]
=
$isSupport
===
'Y'
;
}
// 配送方式
...
...
Please
register
or
login
to post a comment