...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
import 'scss/activity/have-gain-promodetail.page.scss';
|
|
|
import $ from 'yoho-jquery';
|
|
|
const tip = require('js/plugin/tip');
|
|
|
const yoho = require('../yoho-app');
|
|
|
|
|
|
const $promoStatus = $('.promo-status.js-submit');
|
|
|
|
...
|
...
|
@@ -9,6 +10,14 @@ function joinActivity(id) { |
|
|
return $.post(`/activity/have-gain/promo/${id}`);
|
|
|
}
|
|
|
|
|
|
function click(url) {
|
|
|
let a = document.createElement('a');
|
|
|
|
|
|
a.href = url;
|
|
|
document.body.appendChild(a);
|
|
|
a.click();
|
|
|
}
|
|
|
|
|
|
$promoStatus.on('click', function() {
|
|
|
const $this = $(this);
|
|
|
const url = $this.data('url');
|
...
|
...
|
@@ -24,7 +33,11 @@ $promoStatus.on('click', function() { |
|
|
if (pid) {
|
|
|
joinActivity(pid).then(result => {
|
|
|
if (result.code === 400) {
|
|
|
window.location.href = result.redirect;
|
|
|
if (yoho.isApp) {
|
|
|
yoho.goLogin(window.location.href);
|
|
|
} else {
|
|
|
window.location.href = result.redirect;
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -52,7 +65,7 @@ $promoStatus.on('click', function() { |
|
|
break;
|
|
|
}
|
|
|
case 3: {
|
|
|
window.location.href = url;
|
|
|
click(url);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
...
|
...
|
|