...
|
...
|
@@ -35,7 +35,8 @@ var orderHammer, |
|
|
reasonSwiper;
|
|
|
|
|
|
var userId = '',
|
|
|
orderCode = '';
|
|
|
orderCode = '',
|
|
|
pageId = 0;
|
|
|
|
|
|
var orderContent = require('activity/raffle/order-content.hbs');
|
|
|
|
...
|
...
|
@@ -401,6 +402,69 @@ $(function() { |
|
|
$(slides[activeIndex]).css('transform', '');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 中奖记录
|
|
|
if ($('.record').length > 0) {
|
|
|
var pageCount = 6;
|
|
|
recordInit();
|
|
|
goScroll();
|
|
|
}
|
|
|
|
|
|
// 初始化
|
|
|
function recordInit() {
|
|
|
var recordResult = getRecord();
|
|
|
var $recordList = recordResult.data.lotteryPrize;
|
|
|
var $recordSpan = '';
|
|
|
for (var i = 0; i < $recordList.length; i++) {
|
|
|
$recordSpan = $recordSpan + '<span>' + $recordList[i].userName + '中了' + $recordList[i].prizeName + ':' + $recordList[i].prizeRemark + '; </span>';
|
|
|
}
|
|
|
$('.record-list').append($recordSpan);
|
|
|
}
|
|
|
|
|
|
// 获取中奖记录
|
|
|
function getRecord() {
|
|
|
pageId ++;
|
|
|
var recordResult = '';
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/activity/raffle/getRecord',
|
|
|
data: {
|
|
|
pageId: pageId,
|
|
|
pageCount: pageCount
|
|
|
},
|
|
|
async: false,
|
|
|
success: function(res) {
|
|
|
if (res.code === 200) {
|
|
|
if (res.data.lotteryPrize.length < pageCount) {
|
|
|
pageId = 0;
|
|
|
}
|
|
|
recordResult = res;
|
|
|
} else {
|
|
|
tip.show('网络断开了~~');
|
|
|
}
|
|
|
},
|
|
|
error: function(res) {
|
|
|
tip.show('网络断开了~~');
|
|
|
}
|
|
|
});
|
|
|
return recordResult;
|
|
|
}
|
|
|
|
|
|
// 滚动
|
|
|
function goScroll() {
|
|
|
var $firstSpan = $('.record-list span:first');
|
|
|
var $recordList = $('.record-list');
|
|
|
$recordList.animate({marginLeft: '-' + $firstSpan.width() + 'px'}, 10000, 'linear',
|
|
|
function() {
|
|
|
$firstSpan.remove();
|
|
|
$recordList.css('margin-left', '0');
|
|
|
if ($recordList.find('span').length < 5) {
|
|
|
recordInit();
|
|
|
}
|
|
|
goScroll();
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$reaMask.find('.box-cmp').on('touchend', function(e) {
|
...
|
...
|
|