Authored by yyq

fix list type 3

... ... @@ -17,7 +17,7 @@
{{/ifcond}}
{{#ifcond status '===' 4}}
<div class="btn more js-fellow" data-id="{{act_prize_id}}">查看中奖信息</div>
<div class="btn more js-fellow" data-id="{{act_prize_id}}" data-lottery="{{lottery_info}}">查看中奖信息</div>
{{/ifcond}}
{{#ifcond status '===' 5}}
... ...
... ... @@ -64,7 +64,7 @@ let prizeListStore = {
});
},
get(id) {
return this.list[id];
return this.list && this.list[id];
}
};
... ... @@ -195,16 +195,18 @@ function onReachBottom(type) {
fetchPage(page, store.tabIndex);
}
function fellow(id) {
function fellow(id, lottery) {
let info = prizeListStore.get(id);
let lotteryInfo;
if (info.lottery_info) {
if (info && info.lottery_info) {
try {
lotteryInfo = $.parseJSON(info.lottery_info);
} catch(e) {} // eslint-disable-line
}
lotteryInfo = lotteryInfo || lottery;
if (lotteryInfo) {
if (yoSdk.env === 'app' && lotteryInfo.app) {
$.yAlert({
... ... @@ -217,8 +219,10 @@ function fellow(id) {
content: `<div class="modal-view-lottery">${lotteryInfo.h5Tip}</div>` // eslint-disable-line
});
publicCopyInfo = lotteryInfo.h5Copy;
$('.js-clipbroad').trigger('click');
if (lotteryInfo.h5Copy) {
publicCopyInfo = lotteryInfo.h5Copy;
$('.js-clipbroad').trigger('click');
}
} else if (lotteryInfo.h5Link) {
window.location.href = lotteryInfo.h5Link;
}
... ... @@ -304,7 +308,7 @@ $tabpanel
return false;
})
.on('click', '.js-fellow', function() {
fellow($(this).data('id'));
fellow($(this).data('id'), $(this).data('lottery'));
return false;
});
... ...