Authored by 陈峰

Merge branch 'feature/cart' of http://git.yoho.cn/fe/yohobuywap-node into feature/cart

... ... @@ -5,7 +5,6 @@
*/
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
ellipsis = require('yoho-mlellipsis'),
loading = require('../plugin/loading'),
tip = require('../plugin/tip'),
... ... @@ -125,34 +124,30 @@ function getCouponHandle(allCoupons) {
// 渲染可用的优惠券
$couponList.append(conponTmpl({
coupons: coupons
})).find('.employ-main').each(function(i, elem) {
var employHammer = new Hammer(elem);
employHammer.on('tap', function() {
var couponCode = $(elem).data('coupon-code');
$.ajax({
method: 'POST',
url: '/cart/index/new/couponSearch',
data: {
couponCode: couponCode
}
}).then(function(res) {
if (res.code === 200) {
// tip.show('优惠券可用');
orderInfo('couponCode', res.data.coupon_code);
orderInfo('couponName', res.data.coupon_title);
// 实付金额发生变化,使用有货币为0
orderInfo('yohoCoin', 0);
window.location.href = '/cart/index/new/orderEnsure';
} else if (res.message) {
tip.show(res.message);
}
}).fail(function() {
tip.show('网络错误');
});
})).find('.employ-main').on('touchstart', function() {
var couponCode = $(this).data('coupon-code');
$.ajax({
method: 'POST',
url: '/cart/index/new/couponSearch',
data: {
couponCode: couponCode
}
}).then(function(res) {
if (res.code === 200) {
// tip.show('优惠券可用');
orderInfo('couponCode', res.data.coupon_code);
orderInfo('couponName', res.data.coupon_title);
// 实付金额发生变化,使用有货币为0
orderInfo('yohoCoin', 0);
window.location.href = '/cart/index/new/orderEnsure';
} else if (res.message) {
tip.show(res.message);
}
}).fail(function() {
tip.show('网络错误');
});
});
... ...
... ... @@ -87,7 +87,7 @@
height: auto;
overflow: hidden;
padding-left: 10%;
padding-bottom: 12px;
padding-bottom: 32px;
position: relative;
span {
... ...