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
e85ccf1a3341665a9e0a6e1f75ef45e0d28ce431
2 parents
38fe669d
08580b2e
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
21 deletions
library/Api/Yohobuy.php
library/Plugin/Helpers.php
static/js/cart/cart.js
static/js/cart/order-ensure.js
static/js/cart/select-coupon.js
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
template/m.yohobuy.com/partials/cart/cart-content.phtml
template/m.yohobuy.com/partials/layout/use.phtml
library/Api/Yohobuy.php
View file @
e85ccf1
...
...
@@ -23,15 +23,15 @@ class Yohobuy
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
const
API_URL
=
'http://apih5.yoho.cn/'
;
const
API_URL2
=
'http://apih5.yoho.cn/'
;
const
SERVICE_URL
=
'http://serviceh5.yoho.cn/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
// const API_URL = 'http://apih5.yoho.cn/';
// const API_URL2 = 'http://apih5.yoho.cn/';
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// /* 测试环境 */
// const API_URL = 'http://testapi.yoho.cn:28078/';
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
const
API_URL
=
'http://testapi.yoho.cn:28078/'
;
const
SERVICE_URL
=
'http://testservice.yoho.cn:28077/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
/**
* 私钥列表
...
...
library/Plugin/Helpers.php
View file @
e85ccf1
...
...
@@ -591,6 +591,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
;
...
...
@@ -631,7 +632,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/cart.js
View file @
e85ccf1
...
...
@@ -78,5 +78,20 @@ $('.chose').on('touchend', function() {
chosePanel
.
show
();
});
if
(
$
(
'.cart-zero'
).
length
>
0
)
{
require
(
'../product/recommend-for-you'
);
}
function
notAllowScroll
()
{
var
docH
=
$
(
document
).
height
(),
winH
=
$
(
window
).
height
();
if
(
docH
-
winH
<=
10
)
{
$
(
'body'
).
css
(
'overflow'
,
'hidden'
);
}
}
notAllowScroll
();
//提前触发lazyload
$
(
window
).
scrollTop
(
1
).
scrollTop
(
0
);
\ No newline at end of file
$
(
window
).
scrollTop
(
1
).
scrollTop
(
0
);
...
...
static/js/cart/order-ensure.js
View file @
e85ccf1
...
...
@@ -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/js/cart/select-coupon.js
View file @
e85ccf1
...
...
@@ -16,10 +16,27 @@ var page = 1,
isGetData
;
var
conponTmpl
=
Handlebars
.
compile
(
$
(
'#tmpl-coupon'
).
html
()),
conponNotAvaliableTmpl
=
Handlebars
.
compile
(
$
(
'#tmpl-coupon-not-avaliable'
).
html
()),
$newCoupon
=
$
(
'#new-coupon'
);
var
winH
=
$
(
window
).
height
();
// conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
function
fixedLayOut
()
{
var
$null
=
$
(
'.null'
),
navH
=
$
(
'.nav-title'
).
height
(),
nullH
=
$null
.
height
();
if
(
$null
.
length
===
0
)
{
return
false
;
}
$null
.
css
({
top
:
winH
/
2
-
nullH
/
2
+
navH
});
}
ellipsis
.
init
();
$newCoupon
.
on
(
'submit'
,
function
()
{
...
...
@@ -106,6 +123,7 @@ function getCouponHandle(coupons) {
// 第一页张数为 0 ,显示优惠券为空
if
(
!
coupons
.
length
&&
page
===
2
)
{
$
(
'.coupin-wrap'
).
html
(
$
(
'#tmpl-no-coupon'
).
html
());
fixedLayOut
();
return
;
}
...
...
@@ -120,14 +138,15 @@ function getCouponHandle(coupons) {
coupons
:
coupons
}));
// 产品说,暂时不做不可使用的优惠券
// if (notAvailableCoupons.length) {
// $('.not-avaliable-coupon-line').show();
// }
// $('#coupon-list-not').append(conponNotAvaliableTmpl({
// notAvailableCoupons: notAvailableCoupons
// }));
if
(
notAvailableCoupons
.
length
)
{
$
(
'.not-avaliable-coupon-line'
).
show
();
}
$
(
'#coupon-list-not'
).
append
(
conponNotAvaliableTmpl
({
notAvailableCoupons
:
notAvailableCoupons
}));
window
.
rePosFooter
();
}
function
getCouponDate
()
{
...
...
@@ -159,6 +178,7 @@ function getCouponDate() {
});
}
getCouponDate
();
$
(
window
).
scroll
(
function
()
{
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
e85ccf1
...
...
@@ -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 @
e85ccf1
...
...
@@ -13,7 +13,7 @@
<ul class="freebie-and-advance-buy">
{{# freebie}}
<li class="freebie">
<a href="/cart/index/gift?cartType=">
<a href="/cart/index/gift?cartType=
{{cartType}}
">
<span class="iconfont"></span>
赠品
<span class="count">{{count}}</span>
...
...
@@ -23,7 +23,7 @@
{{/ freebie}}
{{#if advanceBuy}}
<li class="advance-buy">
<a href="/cart/index/advanceBuy?cartType=">
<a href="/cart/index/advanceBuy?cartType=
{{cartType}}
">
<span class="iconfont"></span>
加价购
<span class="count">{{advanceBuyCount}}</span>
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
e85ccf1
...
...
@@ -222,7 +222,6 @@
{{#if shoppingCartPage}}
<script>
seajs.use('js/cart/cart');
seajs.use('js/product/recommend-for-you');
</script>
{{/if}}
{{#if giftPage}}
...
...
Please
register
or
login
to post a comment