...
|
...
|
@@ -8,13 +8,14 @@ let timeCountDownTpl = require('hbs/activity/yoluck/time-countdown.hbs'); |
|
|
let formatCountDown = require('./yoluck/formatCountDown');
|
|
|
let yoSdk = require('yoho-activity-sdk');
|
|
|
let yoho = require('js/yoho-app');
|
|
|
require('js/plugin/modal.alert');
|
|
|
const tip = require('js/plugin/tip');
|
|
|
const shareData = require('./yoluck/share');
|
|
|
const makeShareData = require('./yoluck/share');
|
|
|
|
|
|
require('js/plugin/modal.alert');
|
|
|
|
|
|
var footerText = ['内容加载中...', '暂无更多内容'];
|
|
|
let footerText = ['内容加载中...', '暂无更多内容'];
|
|
|
|
|
|
var store = {
|
|
|
let store = {
|
|
|
list: [{
|
|
|
page: 0,
|
|
|
}, {
|
...
|
...
|
@@ -31,10 +32,10 @@ var store = { |
|
|
countDown: [],
|
|
|
};
|
|
|
|
|
|
var api = new Api();
|
|
|
var bus$ = $.Callbacks();
|
|
|
var $tabpanel = $('.js-tab-comp');
|
|
|
var tabpanelStore = {
|
|
|
let api = new Api();
|
|
|
let bus$ = $.Callbacks(); // eslint-disable-line
|
|
|
let $tabpanel = $('.js-tab-comp');
|
|
|
let tabpanelStore = {
|
|
|
tabs: [],
|
|
|
key: 0,
|
|
|
nodes: [],
|
...
|
...
|
@@ -45,6 +46,7 @@ var tabpanelStore = { |
|
|
function initStore() {
|
|
|
// 初始化为
|
|
|
let tabIndex = +$tabpanel.data('type');
|
|
|
|
|
|
store.list[tabIndex].page = 1;
|
|
|
store.tabIndex = tabIndex;
|
|
|
tabpanelStore.currentKey = tabIndex;
|
...
|
...
|
@@ -60,7 +62,7 @@ function updateFooter(msg) { |
|
|
}
|
|
|
|
|
|
function updateTabs() {
|
|
|
tabpanelStore.nodes.map(function(index) {
|
|
|
tabpanelStore.nodes.each(function(index) {
|
|
|
let $this = $(this);
|
|
|
|
|
|
let active = index === tabpanelStore.key;
|
...
|
...
|
@@ -72,7 +74,7 @@ function updateTabs() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
tabpanelStore.tabs.map(function() {
|
|
|
tabpanelStore.tabs.each(function() {
|
|
|
let $this = $(this);
|
|
|
let active = $this.data('index') === tabpanelStore.key;
|
|
|
|
...
|
...
|
@@ -166,8 +168,8 @@ function onReachBottom(type) { |
|
|
function fellow() {
|
|
|
$.yAlert({
|
|
|
content: `<div>微信搜索公众号</div>
|
|
|
<div><span style="font-weight: bolder;">“潮流有货”</span>并关注,发送</div>
|
|
|
<div>关键词<span style="font-weight: bolder;">“开奖”</span>查询中奖信息</div>`
|
|
|
<div><span style="font-weight: bolder;">“潮流有货”</span>并关注,发送</div>
|
|
|
<div>关键词<span style="font-weight: bolder;">“开奖”</span>查询中奖信息</div>`
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -178,7 +180,7 @@ function share($el) { |
|
|
let id = $el.data('id');
|
|
|
|
|
|
yoSdk.getUser().then(user => {
|
|
|
let share = shareData({
|
|
|
let shareData = makeShareData({
|
|
|
name,
|
|
|
imgUrl: img,
|
|
|
price: price,
|
...
|
...
|
@@ -187,16 +189,16 @@ function share($el) { |
|
|
});
|
|
|
|
|
|
if (yoho.isApp) {
|
|
|
yoho.invokeMethod('go.showshareaction', share.app);
|
|
|
yoho.invokeMethod('go.showshareaction', shareData.app);
|
|
|
} else {
|
|
|
yoSdk.wxShare({
|
|
|
...share.h5,
|
|
|
...shareData.h5,
|
|
|
success() {
|
|
|
tip.show('分享成功', 3500);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
|
|
|
bus$.add(onTabClick);
|
...
|
...
|
@@ -216,19 +218,19 @@ $tabpanel.on('click', '.js-tab', function() { |
|
|
});
|
|
|
|
|
|
$tabpanel
|
|
|
.find('.prize-item-comp')
|
|
|
.on('click', '.js-prizeitem', function() {
|
|
|
let id = $(this).data('id');
|
|
|
|
|
|
yoho.goH5(`/activity/yoluck/${id}.html`);
|
|
|
return true;
|
|
|
return false;
|
|
|
})
|
|
|
.on('click', '.js-share', function() {
|
|
|
share($(this));
|
|
|
return true;
|
|
|
return false;
|
|
|
})
|
|
|
.on('click', '.js-fellow', function() {
|
|
|
fellow();
|
|
|
return true;
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
$(window).on('scroll', function() {
|
...
|
...
|
|