|
|
import 'scss/activity/yoluck/yoluck-detail.page.scss';
|
|
|
|
|
|
const cookie = require('yoho-cookie');
|
|
|
let Swiper = require('yoho-swiper');
|
|
|
const loading = require('js/plugin/loading');
|
|
|
let timeCountDownTpl = require('hbs/activity/yoluck/time-countdown.hbs');
|
|
|
let luckAlertTpl = require('hbs/activity/yoluck/luck-alert.hbs');
|
|
|
let formatCountDown = require('./yoluck/formatCountDown');
|
...
|
...
|
@@ -13,6 +15,7 @@ let yoho = require('js/yoho-app'); |
|
|
let Clipboard = require('clipboard');
|
|
|
let makeShareData = require('./yoluck/share');
|
|
|
let Lottery = require('./yoluck/lottery');
|
|
|
let versionCompare = require('./yoluck/version');
|
|
|
|
|
|
function reload() {
|
|
|
location = location; //eslint-disable-line
|
...
|
...
|
@@ -23,7 +26,9 @@ require('js/common'); |
|
|
|
|
|
let store = {
|
|
|
running: false,
|
|
|
shareUid: window.queryString.shareUid || ''
|
|
|
shareUid: window.queryString.shareUid || '',
|
|
|
currentVersion: cookie.get('app_version'),
|
|
|
targetVersion: '6.8.3',
|
|
|
};
|
|
|
|
|
|
let $product = $('.product_name');
|
...
|
...
|
@@ -37,6 +42,7 @@ let shareData; |
|
|
let lottery = new Lottery('#lottery-list');
|
|
|
let sharePlugin = require('js/common/share');
|
|
|
|
|
|
loading.init($(document.body), {timeout: 20000});
|
|
|
new Swiper('.swiper-container', {
|
|
|
direction: 'vertical',
|
|
|
lazyLoading: true,
|
...
|
...
|
@@ -45,7 +51,6 @@ new Swiper('.swiper-container', { |
|
|
autoplay: 4000
|
|
|
});
|
|
|
|
|
|
|
|
|
function fellow() {
|
|
|
$.yAlert({
|
|
|
content: `<div>公众号
|
...
|
...
|
@@ -54,6 +59,10 @@ function fellow() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
function alertVersion() {
|
|
|
$.yAlert({content: '您的版本较低,请更新最新版本体验'});
|
|
|
}
|
|
|
|
|
|
function getUser() {
|
|
|
try {
|
|
|
if (user) {
|
...
|
...
|
@@ -91,7 +100,25 @@ getUser(); |
|
|
|
|
|
function share() {
|
|
|
if (yoSdk.env === 'app') {
|
|
|
yoho.invokeMethod('go.showshareaction', shareData && shareData.app);
|
|
|
// 由于app版本兼容性问题
|
|
|
if (versionCompare(store.currentVersion, store.targetVersion) < 0) {
|
|
|
alertVersion();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
loading.showLoading();
|
|
|
|
|
|
if (store.running) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
store.running = true;
|
|
|
|
|
|
getUser().then(() => {
|
|
|
yoho.invokeMethod('go.showshareaction', shareData && shareData.app);
|
|
|
loading.hideLoading();
|
|
|
store.running = false;
|
|
|
});
|
|
|
} else if (/QQ/i.test(navigator.userAgent) ||
|
|
|
/MicroMessenger/i.test(navigator.userAgent)) {
|
|
|
yoSdk.tip({tipClassName: 'yoluck-guide-mask'});
|
...
|
...
|
|