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
Rock Zhang
9 years ago
Commit
60c294aa2a87a8d23eafddc0984f694ac37e067d
2 parents
0dac8b49
a23629df
Merge branch 'develop' into test
Conflicts: library/Api/Yohobuy.php
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
13 deletions
library/Plugin/Helpers.php
static/js/cart/chose-panel.js
static/js/cart/order-ensure.js
static/sass/cart/_chose-panel.scss
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
template/m.yohobuy.com/partials/cart/cart-content.phtml
template/m.yohobuy.com/partials/cart/chose-panel.phtml
library/Plugin/Helpers.php
View file @
60c294a
...
...
@@ -592,6 +592,7 @@ class Helpers
}
elseif
(
$value
[
'goods_type'
]
==
'gift'
&&
!
isset
(
$value
[
'isAdvanceBuy'
]))
{
$oneGoods
[
'isGift'
]
=
true
;
}
elseif
(
$value
[
'goods_type'
]
==
'price_gift'
)
{
$oneGoods
[
'showCheckbox'
]
=
true
;
$oneGoods
[
'isAdvanceBuy'
]
=
true
;
}
else
{
$oneGoods
[
'showCheckbox'
]
=
true
;
...
...
@@ -632,7 +633,7 @@ class Helpers
$oneGoods
[
'id'
]
=
$single
[
'product_skn'
];
$oneGoods
[
'name'
]
=
$single
[
'product_name'
];
$oneGoods
[
'thumb'
]
=
!
empty
(
$single
[
'goods_images'
])
?
Images
::
getImageUrl
(
$single
[
'goods_images'
],
120
,
160
)
:
''
;
$oneGoods
[
'price'
]
=
self
::
transPrice
(
$single
[
'
sales
_price'
]);
$oneGoods
[
'price'
]
=
self
::
transPrice
(
$single
[
'
last
_price'
]);
$oneGoods
[
'marketPrice'
]
=
self
::
transPrice
(
$single
[
'market_price'
]);
$oneGoods
[
'count'
]
=
$single
[
'storage_number'
];
...
...
static/js/cart/chose-panel.js
View file @
60c294a
...
...
@@ -61,6 +61,10 @@ function checkColorSizeNum() {
function
show
(
html
,
cb
)
{
if
(
html
)
{
$chosePanel
.
html
(
html
);
if
(
$
(
'#promotionId'
).
val
()
!==
''
)
{
$yohoPage
.
off
(
'touchstart'
,
'.btn-minus'
);
$yohoPage
.
off
(
'touchstart'
,
'.btn-plus'
);
}
init
();
}
$
(
'.chose-panel'
).
show
();
...
...
@@ -92,9 +96,10 @@ function resetColorZeroStock($siblingBlock) {
if
(
!
hasChooseSize
)
{
$siblingBlock
.
find
(
'ul>li'
).
each
(
function
()
{
$
(
this
).
removeClass
(
'zero-stock'
);
if
(
0
===
$
(
this
).
data
(
'num'
))
{
$
(
this
).
addClass
(
'zero-stock'
);
}
else
{
$
(
this
).
removeClass
(
'zero-stock'
);
}
});
...
...
@@ -103,6 +108,8 @@ function resetColorZeroStock($siblingBlock) {
for
(
i
=
0
;
i
<
numArray
.
length
;
i
++
)
{
if
(
'0'
===
numArray
[
i
])
{
$siblingBlock
.
find
(
'.block'
).
eq
(
i
).
addClass
(
'zero-stock'
);
}
else
{
$siblingBlock
.
find
(
'.block'
).
eq
(
i
).
removeClass
(
'zero-stock'
);
}
}
}
...
...
@@ -285,6 +292,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
}
//TODO:库存数验证
if
(
num
>
leftNum
)
{
$num
.
val
(
leftNum
);
return
;
}
$num
.
val
(
num
+
1
);
}).
on
(
'touchstart'
,
'#chose-btn-sure'
,
function
()
{
...
...
@@ -300,6 +311,10 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
if
(
!
checkColorSizeNum
())
{
return
;
}
if
(
isNaN
(
num
))
{
tip
.
show
(
'您选择的数量不是一个数字~'
);
return
;
}
//TODO status change
if
(
$
(
'#chose-btn-sure'
).
html
()
===
'已售罄'
)
{
...
...
static/js/cart/order-ensure.js
View file @
60c294a
...
...
@@ -18,6 +18,8 @@ var dispatchModeHammer,
$price
=
$
(
'.price-cal'
),
$couponUse
=
$
(
'.coupon-use.used'
),
$addressWrap
=
$
(
'.address-wrap'
),
$coinCheck
=
$
(
'.coin-check'
),
$coinUsed
=
$
(
'.coin .used'
),
payType
,
priceTmpl
=
Handlebars
.
compile
(
$
(
'#tmpl-price'
).
html
()),
queryString
=
$
.
queryString
(),
...
...
@@ -104,6 +106,8 @@ function orderCompute() {
if
(
res
.
last_order_amount
)
{
res
.
last_order_amount
=
(
+
res
.
last_order_amount
).
toFixed
(
2
);
}
$coinCheck
.
find
(
'em'
).
html
(
'- ¥ '
+
res
.
use_yoho_coin
);
$coinUsed
.
html
(
'已抵¥'
+
res
.
use_yoho_coin
);
priceHtml
=
priceTmpl
({
cartPayData
:
res
.
promotion_formula_list
,
price
:
res
.
last_order_amount
...
...
@@ -188,7 +192,7 @@ if (!orderInfo('addressId')) {
orderInfo
(
'addressId'
,
$addressWrap
.
data
(
'id'
));
}
$
(
'.dispatch-mode'
).
on
(
'touch
start
'
,
'li'
,
function
()
{
$
(
'.dispatch-mode'
).
on
(
'touch
end
'
,
'li'
,
function
()
{
var
$defaultMode
=
$
(
'.dispatch-mode [data-id="1"]'
);
if
(
!
$addressWrap
.
data
(
'support'
)
&&
$
(
this
).
data
(
'id'
)
===
2
)
{
...
...
@@ -212,9 +216,13 @@ $('.coin').on('touchend', function() {
if
(
$this
.
find
(
'.checkbox'
).
hasClass
(
'icon-cb-checked'
))
{
orderInfo
(
'yohoCoin'
,
$this
.
data
(
'yoho-coin'
));
$this
.
find
(
'.coin-check em'
).
show
();
$this
.
find
(
'.can-use'
).
hide
();
$this
.
find
(
'.used'
).
show
();
}
else
{
orderInfo
(
'yohoCoin'
,
0
);
$this
.
find
(
'.coin-check em'
).
hide
();
$this
.
find
(
'.can-use'
).
show
();
$this
.
find
(
'.used'
).
hide
();
}
orderCompute
();
});
...
...
static/sass/cart/_chose-panel.scss
View file @
60c294a
...
...
@@ -73,7 +73,10 @@
position
:
relative
;
font-size
:
28rem
/
$pxConvertRem
;
padding-left
:
80rem
/
$pxConvertRem
;
input
.disabled
{
background-color
:
#fff
;
color
:
#000
;
}
>
span
{
position
:
absolute
;
left
:
0
;
...
...
@@ -84,6 +87,9 @@
left
:
pxToRem
(
380px
);
top
:
20rem
/
$pxConvertRem
;
}
span
.disabled
{
color
:
#e6e6e6
;
}
}
.size-list
li
.hide
{
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
60c294a
...
...
@@ -69,7 +69,9 @@
<span
class=
"title"
>YOHO币</span>
{
{#if
yohoCoin
}
}
<span
class=
"desc"
>可抵¥
{
{yohoCoin
}
}</span>
<span
class=
"desc used {{#unless useYohoCoin}}hide{{/if}}"
>已抵¥
{
{yohoCoin
}
}</span>
<span
class=
"desc can-use {{#if useYohoCoin}}hide{{/if}}"
>可抵¥
{
{yohoCoin
}
}</span>
{
{#if
useYohoCoin
}
}
<span
class=
"coin-check"
>
<em>-
¥
{
{yohoCoin
}
}</em>
...
...
template/m.yohobuy.com/partials/cart/cart-content.phtml
View file @
60c294a
...
...
@@ -13,9 +13,9 @@
<ul class="freebie-and-advance-buy">
{{# freebie}}
<li class="freebie">
<a href="/cart/index/gift?cartType={{cartType}}">
<span class="iconfont"></span>
赠品
<a href=":;">
<span class="count">{{count}}</span>
<span class="iconfont icon-right-arrow"></span>
</a>
...
...
@@ -23,9 +23,9 @@
{{/ freebie}}
{{#if advanceBuy}}
<li class="advance-buy">
<a href="/cart/index/advanceBuy?cartType={{cartType}}">
<span class="iconfont"></span>
加价购
<a href=":;">
<span class="count">{{advanceBuyCount}}</span>
<span class="iconfont icon-right-arrow"></span>
</a>
...
...
@@ -66,13 +66,13 @@
{{^}}
<span class="checkbox icon-checkbox iconfont"></span>
{{/if}}
<a class="btn-balance">
结算
</a>
<p>
<span id="good-total">
总计:¥{{sumPrice}} ({{count}}件)
</span>
<span class="tip">(不含运费)</span>
</p>
<a class="btn-balance">
结算
</a>
</div>
...
...
template/m.yohobuy.com/partials/cart/chose-panel.phtml
View file @
60c294a
...
...
@@ -50,11 +50,11 @@
<span>数量</span>
<div
class=
"clearfix"
>
<a
class=
"btn btn-minus"
href=
"javascript:void(0);"
>
<span
class=
"iconfont"
>
625
;</span>
<span
class=
"iconfont
{{#if promotionId}}disabled{{/if}}
"
>
625
;</span>
</a>
<input
id=
"good-num"
class=
"good-num
"
type=
"text"
value=
"1"
>
<input
id=
"good-num"
class=
"good-num
{{#if promotionId}}disabled{{/if}}"
type=
"text"
value=
"1"
{
{#if
promotionId
}
}disabled=
"true"
{
{/if
}
}
>
<a
class=
"btn btn-plus"
href=
"javascript:void(0);"
>
<span
class=
"iconfont"
>
624
;</span>
<span
class=
"iconfont
{{#if promotionId}}disabled{{/if}}
"
>
624
;</span>
</a>
</div>
<span
class=
"left-num"
></span>
...
...
Please
register
or
login
to post a comment