|
|
import 'home/family-coinMall.page.css';
|
|
|
import $ from 'yoho-jquery';
|
|
|
import Page from 'yoho-page';
|
|
|
import tip from 'plugin/tip';
|
|
|
import tabRender from 'home/coin-get-list.hbs';
|
|
|
import lazyLoad from 'yoho-jquery-lazyload';
|
|
|
import yoho from 'yoho-app';
|
...
|
...
|
@@ -17,8 +16,9 @@ class IconMall extends Page { |
|
|
$tabFixed: $('.tab-fixed'),
|
|
|
$yohonowTab: $('#yohonow-tab'),
|
|
|
$marsTab: $('#mars-tab'),
|
|
|
$acquiringHelp: $('.acquiring-help'),
|
|
|
$detail: $('.detail')
|
|
|
$detail: $('.detail'),
|
|
|
$tipApp: $('.tip-app'),
|
|
|
$closeTip: $('.close-tip')
|
|
|
};
|
|
|
|
|
|
this.view = {
|
...
|
...
|
@@ -135,10 +135,13 @@ class IconMall extends Page { |
|
|
|
|
|
bindEvents() {
|
|
|
this.selector.$tabItem.on('click', this.tabItem.bind(this));
|
|
|
this.selector.$acquiringHelp.on('click', this.openHelp.bind(this));
|
|
|
this.selector.$detail.on('click', this.openDetail.bind(this));
|
|
|
|
|
|
// this.selector.$acquiringHelp.on('click', this.openHelp.bind(this));
|
|
|
// this.selector.$detail.on('click', this.openDetail.bind(this));
|
|
|
$(window).on('scroll touchmove touchstart touchend', this.move.bind(this));
|
|
|
$(document).on('click', '.go-btn', this.goConversion.bind(this));
|
|
|
this.selector.$closeTip.on('click', this.closeTip.bind(this));
|
|
|
this.selector.$tipApp.on('mousewheel touchmove', this.banSliding(this));
|
|
|
}
|
|
|
|
|
|
move() {
|
...
|
...
|
@@ -170,32 +173,36 @@ class IconMall extends Page { |
|
|
$this.addClass('active').siblings('div').removeClass('active');
|
|
|
if ($this.attr('id') === 'yohonow') {
|
|
|
this.type = 'now';
|
|
|
|
|
|
this.selector.$detail.attr('href', `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=3&openby:yohobuy={"action":"go.h5","params":{"url":"${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=3"}}`); // eslint-disable-line
|
|
|
}
|
|
|
if ($this.attr('id') === 'mars') {
|
|
|
this.type = 'mars';
|
|
|
|
|
|
this.selector.$detail.attr('href', `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=2&openby:yohobuy={"action":"go.h5","params":{"url":"${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=2"}}`); // eslint-disable-line
|
|
|
}
|
|
|
this.page = 1;
|
|
|
this.beforeScroll = 0;
|
|
|
this.getList();
|
|
|
}
|
|
|
|
|
|
openHelp() {
|
|
|
if (yoho && yoho.isNowApp) {
|
|
|
yoho.invokeMethod('go.coins_help');
|
|
|
} else if (yoho && yoho.isMarsApp) {
|
|
|
yoho.invokeMethod('go.point_help');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
openDetail() {
|
|
|
yoho.ready(() => {
|
|
|
if (yoho && yoho.isNowApp) {
|
|
|
yoho.invokeMethod('go.coins_detail');
|
|
|
} else if (yoho && yoho.isMarsApp) {
|
|
|
yoho.invokeMethod('go.point_detail');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
// openHelp() {
|
|
|
// if (yoho && yoho.isNowApp) {
|
|
|
// yoho.invokeMethod('go.coins_help');
|
|
|
// } else if (yoho && yoho.isMarsApp) {
|
|
|
// yoho.invokeMethod('go.point_help');
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// openDetail() {
|
|
|
// yoho.ready(() => {
|
|
|
// if (yoho && yoho.isNowApp) {
|
|
|
// yoho.invokeMethod('go.coins_detail');
|
|
|
// } else if (yoho && yoho.isMarsApp) {
|
|
|
// yoho.invokeMethod('go.point_detail');
|
|
|
// }
|
|
|
// });
|
|
|
// }
|
|
|
|
|
|
goConversion(e) {
|
|
|
let $this = $(e.currentTarget);
|
...
|
...
|
@@ -218,12 +225,26 @@ class IconMall extends Page { |
|
|
}
|
|
|
} else {
|
|
|
if (type === 'yohonow-tab') {
|
|
|
tip.show('请到yohonowapp打开');
|
|
|
this.selector.$tipApp.removeClass('hide').addClass('now-tip');
|
|
|
} else if (type === 'mars-tab') {
|
|
|
tip.show('请到mars打开');
|
|
|
this.selector.$tipApp.removeClass('hide').addClass('mars-tip');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
closeTip(e) {
|
|
|
let $this = $(e.currentTarget);
|
|
|
|
|
|
if ($this.parent().hasClass('now-tip')) {
|
|
|
$this.parent().removeClass('now-tip').addClass('hide');
|
|
|
} else {
|
|
|
$this.parent().removeClass('mars-tip').addClass('hide');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
banSliding() {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$(() => {
|
...
|
...
|
|