|
|
/**
|
|
|
* 优惠券选择
|
|
|
* @author: bikai<kai.bi@yoho.cn>
|
|
|
* @date: 2015/12/10
|
|
|
*/
|
|
|
|
|
|
var $ = require('jquery'),
|
|
|
Handlebars = require('yoho.handlebars'),
|
|
|
ellipsis = require('mlellipsis'),
|
|
|
loading = require('../plugin/loading'),
|
|
|
tip = require('../plugin/tip');
|
|
|
tip = require('../plugin/tip'),
|
|
|
orderInfo = require('./order-info');
|
|
|
|
|
|
var page = 1,
|
|
|
canGetCoupon = true,
|
...
|
...
|
@@ -21,9 +28,10 @@ $('#search-coupon').on('submit', function() { |
|
|
}).then(function(res) {
|
|
|
if (res.code === 200) {
|
|
|
tip.show('优惠券可用');
|
|
|
orderInfo('couponCode', res.data.coupon_code);
|
|
|
window.location.href = '/shoppingCart/orderEnsure?coupon_code=' + res.data.coupon_code;
|
|
|
} else {
|
|
|
tip.show(res.msg);
|
|
|
tip.show(res.message);
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络错误');
|
...
|
...
|
@@ -31,6 +39,10 @@ $('#search-coupon').on('submit', function() { |
|
|
return false;
|
|
|
});
|
|
|
|
|
|
$('#coupon-list').on('touchend', 'employ-main', function() {
|
|
|
orderInfo('couponCode', $(this).data('coupon-code'));
|
|
|
});
|
|
|
|
|
|
function getCouponHandle(coupons) {
|
|
|
var notAvailableCoupons = [];
|
|
|
|
...
|
...
|
|