...
|
...
|
@@ -38,15 +38,10 @@ meGift = { |
|
|
if (that.isBinMobile) {
|
|
|
that.activateGift();
|
|
|
} else {
|
|
|
that.getMobileCode();
|
|
|
that.verifyEmailCode();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 消费明细
|
|
|
$('.me-gift-table').on('click', '.info-list', function() {
|
|
|
that.infoList($(this).closest('.me-gift-tr').data('card-code'));
|
|
|
});
|
|
|
|
|
|
// 显示手机区号或类型下拉列表
|
|
|
$('body').on('click', '.mobile-area,.gift-filter', function() {
|
|
|
$(this).find('.ul-list').toggle();
|
...
|
...
|
@@ -59,11 +54,38 @@ meGift = { |
|
|
$('.mobile-area').find('em').text($li.data('cc'));
|
|
|
});
|
|
|
|
|
|
// 选择类型筛选
|
|
|
// 消费明细
|
|
|
$('.me-gift-table').on('click', '.info-list', function() {
|
|
|
|
|
|
new dialog.Dialog({
|
|
|
content: that.detailGiftTpl({}),
|
|
|
className: 'me-page me-gift-page me-gift-confirm'
|
|
|
}).show();
|
|
|
|
|
|
that.infoList('?' + $.param({
|
|
|
cardCode: $(this).closest('.me-gift-tr').data('card-code')
|
|
|
}));
|
|
|
});
|
|
|
|
|
|
// 消费明细-选择类型筛选
|
|
|
$('body').on('click', '.gift-filter ul', function(event) {
|
|
|
var $li = $(event.target).closest('li');
|
|
|
|
|
|
$('.gift-filter').find('em').text($li.text());
|
|
|
that.infoList('?' + $.param({
|
|
|
cardCode: $('.info-gift-header').data('card-code'),
|
|
|
type: $li.data('cc')
|
|
|
}));
|
|
|
});
|
|
|
|
|
|
// 消费明细翻页
|
|
|
$('body').on('click', '.detail-gift-content .pager a', function() {
|
|
|
if ($(this).hasClass('cur')) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
that.infoList($(this).attr('href'));
|
|
|
return false;
|
|
|
});
|
|
|
},
|
|
|
|
...
|
...
|
@@ -72,6 +94,8 @@ meGift = { |
|
|
var that = this;
|
|
|
var x;
|
|
|
|
|
|
captcha && captcha.hideTip();
|
|
|
|
|
|
if (that.isFlag) {
|
|
|
return deferred.resolve({
|
|
|
code: 401,
|
...
|
...
|
@@ -98,11 +122,9 @@ meGift = { |
|
|
type: 'post',
|
|
|
data: data
|
|
|
}).then(function(res) {
|
|
|
captcha && captcha.hideTip();
|
|
|
|
|
|
if (res.code === 405) {
|
|
|
captcha && captcha.showTip(res.message);
|
|
|
} else {
|
|
|
} else if (res.code !== 200) {
|
|
|
that.meAlert(res.message, false);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -113,11 +135,6 @@ meGift = { |
|
|
});
|
|
|
},
|
|
|
|
|
|
// 礼品卡详情列表
|
|
|
detailList: function() {
|
|
|
|
|
|
},
|
|
|
|
|
|
intTimer: function($dom) {
|
|
|
var intTime = 60;
|
|
|
var intval = setInterval(function() {
|
...
|
...
|
@@ -142,7 +159,7 @@ meGift = { |
|
|
this.postAjax('/home/megift/sendEmailCode', {
|
|
|
email: this.userEmail,
|
|
|
verifyCode: captcha.getResults()
|
|
|
}).then(function(res) {
|
|
|
}, {}, captcha).then(function(res) {
|
|
|
if (res.code === 200) {
|
|
|
that.intTimer($('.email-btn'));
|
|
|
}
|
...
|
...
|
@@ -167,7 +184,7 @@ meGift = { |
|
|
that.postAjax('/home/megift/verifyEmail', {
|
|
|
email: that.userEmail,
|
|
|
code: emailCode
|
|
|
}, verifyData, captcha).then(function(res) {
|
|
|
}, verifyData).then(function(res) {
|
|
|
if (res.code === 200) {
|
|
|
dg.close();
|
|
|
that.getMobileCode();
|
...
|
...
|
@@ -214,8 +231,8 @@ meGift = { |
|
|
|
|
|
that.postAjax('/home/megift/changeMobile', {
|
|
|
area: ($('.mobile-area').find('em').text() || '').replace(/^\+/, ''),
|
|
|
mobile: $('.mobile').val(),
|
|
|
code: $('.mobile-code').val()
|
|
|
mobile: $('input.mobile').val(),
|
|
|
code: $('input.mobile-code').val()
|
|
|
}, verifyData, captcha).then(function(res) {
|
|
|
if (res.code === 200) {
|
|
|
dg.close();
|
...
|
...
|
@@ -240,7 +257,7 @@ meGift = { |
|
|
smsBind: function(captcha) {
|
|
|
var that = this;
|
|
|
var area = ($('.mobile-area').find('em').text() || '').replace(/^\+/, '');
|
|
|
var mobile = $('.mobile').val();
|
|
|
var mobile = $('input.mobile').val();
|
|
|
var verifyData = {
|
|
|
area: '请选择手机区号',
|
|
|
mobile: '手机号不能为空'
|
...
|
...
|
@@ -252,7 +269,7 @@ meGift = { |
|
|
verifyCode: captcha.getResults()
|
|
|
}, verifyData, captcha).then(function(res) {
|
|
|
if (res.code === 200) {
|
|
|
that.intTimer($('.email-btn'));
|
|
|
that.intTimer($('.mobile-btn'));
|
|
|
}
|
|
|
});
|
|
|
},
|
...
|
...
|
@@ -300,21 +317,12 @@ meGift = { |
|
|
},
|
|
|
|
|
|
// 消费明细
|
|
|
infoList: function(cardCode) {
|
|
|
var that = this;
|
|
|
|
|
|
new dialog.Dialog({
|
|
|
content: that.detailGiftTpl({}),
|
|
|
className: 'me-page me-gift-page me-gift-confirm detail-gift-list'
|
|
|
}).show();
|
|
|
|
|
|
$.get('/home/megift/detail', {
|
|
|
cardCode: cardCode
|
|
|
}).then(function(res) {
|
|
|
infoList: function(url) {
|
|
|
url = url || '';
|
|
|
$.get('/home/megift/detail' + url).then(function(res) {
|
|
|
if (!res) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$('.detail-gift-content').html(res);
|
|
|
});
|
|
|
},
|
...
|
...
|
|