Authored by 王水玲

活动模版秒杀

... ... @@ -5,8 +5,9 @@
<img class="lazy" data-original="{{image2 defaultImages w=160 h=216}}" alt="{{productName}}">
<div class="product-brand" style="
{{#if ../productStyle.brandBgColor}}background:{{../productStyle.brandBgColor}};{{/if}}
{{#if ../productStyle.brandFontColor}}color:{{../productStyle.brandFontColor}};{{/if}}
">{{productName}}</div>
{{#if ../productStyle.brandFontColor}}color:{{../productStyle.brandFontColor}};{{/if}}">
{{productName}}
</div>
</div>
<div class="product-info">
<div class="seckill-status {{#if over}}status-over{{else if wait}}status-wait{{else}}status-go{{/if}}">
... ...
... ... @@ -2,7 +2,7 @@
<div class="tab-item {{#if focus}}actived{{/if}}"
data-time="{{startTime}}"
data-id="{{activityId}}"
style="{{#if tabFontColor}}color: {{tabFontColor}};{{/if}}{{#if focus}}{{#if tabSelectColor}}background: {{tabSelectColor}};{{/if}}{{else}}{{#if tabColor}}background: {{tabColor}};{{/if}}{{/if}}">
style="{{#if @root.tabParams.tabFontColor}}color: {{@root.tabParams.tabFontColor}};{{/if}}{{#if focus}}{{#if @root.tabParams.tabSelectColor}}background: {{@root.tabParams.tabSelectColor}};{{/if}}{{else}}{{#if @root.tabParams.tabColor}}background: {{@root.tabParams.tabColor}};{{/if}}{{/if}}">
<span class="date">{{date}}</span><span class="time">{{time}}</span>
</div>
{{/ dateList}}
\ No newline at end of file
... ...
... ... @@ -739,11 +739,6 @@ function viewSeckillProduct(products) {
function loadSeckillList() {
let $tab = $('.seckill-tab');
let tabParams = {
tabColor: $tab.data('tabColor'),
tabFontColor: $tab.data('tabFontColor'),
tabSelectColor: $tab.data('tabSelectColor')
};
$.ajax({
url: '/product/seckill/list'
... ... @@ -752,18 +747,27 @@ function loadSeckillList() {
if (result && result.activitys) {
result.activitys.forEach(item => {
dateList.push(Object.assign({
dateList.push({
startTime: item.startTime,
date: formatTime(item.startTime),
time: item.time,
focus: item.focus,
activityId: item.activityId
}, tabParams));
});
});
$('.seckill .seckill-tab').html(seckillTabTpl({
dateList: dateList
}));
$('.seckill .seckill-tab').each((key, item) => {
let $curTab = $($tab[key]);
$(item).html(seckillTabTpl({
dateList: dateList,
tabParams: {
tabColor: $curTab.data('tabColor'),
tabFontColor: $curTab.data('tabFontColor'),
tabSelectColor: $curTab.data('tabSelectColor')
}
}));
});
}
if (result && result.products) {
... ...