Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
uedxwg
9 years ago
Commit
a215519cd02b8f3d6e574a25064ee3f0284316e1
2 parents
e2a7339f
542e7537
'购物判断条件修改'
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
29 deletions
library/Plugin/Helpers.php
static/js/cart/cart.js
static/js/cart/chose-panel.js
static/js/cart/gift-advance.js
static/js/cart/good.js
static/sass/cart/_order-ensure.scss
template/m.yohobuy.com/partials/cart/gift-advance-good.phtml
library/Plugin/Helpers.php
View file @
a215519
...
...
@@ -583,8 +583,11 @@ class Helpers
$oneGoods
[
'isVipPrice'
]
=
$value
[
'sales_price'
]
!==
$value
[
'last_vip_price'
];
$oneGoods
[
'count'
]
=
$value
[
'buy_number'
];
if
(
$isValid
)
{
// 库存不足
if
(
$isValid
)
{
// 库存不足
$oneGoods
[
'lowStocks'
]
=
(
$value
[
'buy_number'
]
>
$value
[
'storage_number'
]);
}
else
{
// 失效商品
$oneGoods
[
'inValid'
]
=
true
;
}
//gift=>是否赠品,advanceBuy=>是否加价购,soldOut=>失效商品;
...
...
static/js/cart/cart.js
View file @
a215519
...
...
@@ -66,7 +66,7 @@ $('.freebie').on('touchend', function() {
$
(
'.btn-balance'
).
on
(
'touchend'
,
function
()
{
if
(
$
(
'.low-stocks'
).
length
>
0
)
{
tip
.
show
(
'
请先删除库存不足商品
'
);
tip
.
show
(
'
库存不足无法结算
'
);
return
false
;
}
...
...
static/js/cart/chose-panel.js
View file @
a215519
...
...
@@ -311,7 +311,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
promotionId
,
isEdit
=
0
,
numInCart
=
$
(
'.num-tag'
).
html
()
-
0
,
num
=
parseInt
(
$num
.
val
(),
10
);
//颜色尺码没有选择
...
...
@@ -356,9 +355,15 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
cartType
:
queryString
.
cartType
}
}).
done
(
function
(
res
)
{
var
cartNum
;
loading
.
hideLoadingMask
();
if
(
res
.
code
===
200
)
{
$
(
'.num-tag'
).
html
(
numInCart
+
buyNumber
).
removeClass
(
'hide'
);
cartNum
=
res
.
data
.
goods_count
;
if
(
cartNum
>
99
)
{
cartNum
=
'99+'
;
}
$
(
'.num-tag'
).
html
(
cartNum
).
removeClass
(
'hide'
);
confirming
=
false
;
if
(
cbFn
)
{
...
...
static/js/cart/gift-advance.js
View file @
a215519
...
...
@@ -6,6 +6,7 @@
var
$
=
require
(
'jquery'
),
lazyLoad
=
require
(
'yoho.lazyload'
),
Hammer
=
require
(
'yoho.hammer'
),
tip
=
require
(
'../plugin/tip'
),
loading
=
require
(
'../plugin/loading'
),
chosePanel
=
require
(
'./chose-panel'
);
...
...
@@ -35,10 +36,22 @@ function getProductInfo(skn, promotionId) {
});
}
$page
.
on
(
'touchend'
,
'.chose'
,
function
()
{
var
$this
=
$
(
this
),
id
=
$this
.
closest
(
'.gift-advance-good'
).
data
(
'id'
),
promotionId
=
$this
.
closest
(
'.advance-block'
).
data
(
'promotion-id'
);
$page
.
find
(
'.chose'
).
each
(
function
(
i
,
elem
)
{
var
choseHammer
=
new
Hammer
(
elem
);
getProductInfo
(
id
,
promotionId
);
choseHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$this
=
$
(
e
.
target
),
id
=
$this
.
closest
(
'.gift-advance-good'
).
data
(
'id'
),
promotionId
=
$this
.
closest
(
'.advance-block'
).
data
(
'promotion-id'
);
getProductInfo
(
id
,
promotionId
);
});
});
// $page.on('touchend', '.chose', function() {
// var $this = $(this),
// id = $this.closest('.gift-advance-good').data('id'),
// promotionId = $this.closest('.advance-block').data('promotion-id');
//
// getProductInfo(id, promotionId);
// });
...
...
static/js/cart/good.js
View file @
a215519
...
...
@@ -27,6 +27,13 @@ $('.shopping-cart-good .name').each(function() {
this
.
mlellipsis
(
2
);
});
function
GoodInfo
(
properties
)
{
this
.
goods_type
=
properties
.
goods_type
;
this
.
buy_number
=
properties
.
buy_number
;
this
.
product_sku
=
properties
.
product_sku
;
this
.
selected
=
properties
.
selected
;
}
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$
(
'.cart-goods'
).
on
(
'touchstart'
,
'.checkbox'
,
function
()
{
var
$this
=
$
(
this
),
...
...
@@ -43,12 +50,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
isSelected
=
false
;
}
function
GoodInfo
(
properties
)
{
this
.
goods_type
=
properties
.
goods_type
;
this
.
buy_number
=
properties
.
buy_number
;
this
.
product_sku
=
properties
.
product_sku
;
this
.
selected
=
properties
.
selected
;
}
goodInfo
.
goods_type
=
cartType
;
goodInfo
.
selected
=
isSelected
?
'N'
:
'Y'
;
...
...
@@ -174,17 +176,10 @@ function didUpdateAllGoodsCheckStatus() {
}
function
bottomCheckBoxHandeler
(
isSelected
,
type
,
handlerAfterTouch
)
{
var
goodInfo
=
{};
var
$goods
=
$
(
'.cart-content:not(.hide) .shopping-cart-good'
);
var
$good
=
null
;
var
goodsList
=
[];
function
GoodInfo
(
properties
)
{
this
.
goods_type
=
properties
.
goods_type
;
this
.
buy_number
=
properties
.
buy_number
;
this
.
product_sku
=
properties
.
product_sku
;
this
.
selected
=
properties
.
selected
;
}
var
goodInfo
=
{},
$goods
=
$
(
'.cart-content:not(.hide) .shopping-cart-good'
),
$good
=
null
,
goodsList
=
[];
goodInfo
.
goods_type
=
type
;
goodInfo
.
selected
=
isSelected
?
'N'
:
'Y'
;
...
...
static/sass/cart/_order-ensure.scss
View file @
a215519
...
...
@@ -119,7 +119,10 @@
}
.coupon-use
{
box-sizing
:
border-box
;
position
:
relative
;
float
:
right
;
padding-right
:
30rem
/
$pxConvertRem
;
color
:
#999
;
text-align
:
right
;
width
:
360rem
/
$pxConvertRem
;
...
...
@@ -128,6 +131,9 @@
overflow
:
hidden
;
.iconfont
{
position
:
absolute
;
top
:
0
;
right
:
0
;
color
:
#999
;
}
}
...
...
template/m.yohobuy.com/partials/cart/gift-advance-good.phtml
View file @
a215519
...
...
@@ -10,9 +10,6 @@
{{#if price}}
<span class="price market-price">¥{{marketPrice}}</span>
{{/if}}
<span class="count">
×{{count}}
</span>
</p>
<button class="chose">选择</button>
</div>
...
...
Please
register
or
login
to post a comment