Authored by uedxwg

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -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/';
/**
* 私钥列表
... ...
... ... @@ -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'];
... ...
... ... @@ -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);
... ...
... ... @@ -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('touchstart', 'li', function() {
$('.dispatch-mode').on('touchend', '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();
});
... ...
... ... @@ -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() {
... ...
... ... @@ -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>
... ...
... ... @@ -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">&#xe620;</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">&#xe61b;</span>
加价购
<span class="count">{{advanceBuyCount}}</span>
... ...
... ... @@ -222,7 +222,6 @@
{{#if shoppingCartPage}}
<script>
seajs.use('js/cart/cart');
seajs.use('js/product/recommend-for-you');
</script>
{{/if}}
{{#if giftPage}}
... ...