Commit dcb77cf6 authored by wildfirecode13's avatar wildfirecode13

11

parent 620d8dce
...@@ -18,21 +18,25 @@ ...@@ -18,21 +18,25 @@
requestType: "mock" requestType: "mock"
} }
} }
var CFG = CFG || {}; var CFG = CFG || {};
CFG.projectId = location.pathname.split('/')[2] || '1'; CFG.projectId = location.pathname.split('/')[2] || '1';
function getUrlParam(name) { function getUrlParam(name) {
const search = window.location.search; const search = window.location.search;
const matched = search const matched = search
.slice(1) .slice(1)
.match(new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')); .match(new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'));
return search.length ? matched && matched[2] : null; return search.length ? matched && matched[2] : null;
} }
CFG.appID = '${APPID}'; CFG.appID = '${APPID}';
if (!getUrlParam("appID")) { if (!getUrlParam("appID")) {
alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。") alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
} }
window.shareUrl = 'https://duiba'+CFG.appID + CFG.projectId + Math.floor(Math.random () * 90000) +'.activity-1.m.duiba.com.cn/customShare/share?id=4609'
// window.shareUrl = 'https://activity.m-1.duiba.com.cn/customShare/share?id=4609';
</script> </script>
</head> </head>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { appID } from 'duiba-utils'; import { appID } from 'duiba-utils';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Timer } from 'teddi'; // import { Timer } from 'teddi';
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import API from '../../api'; import API from '../../api';
...@@ -24,11 +24,12 @@ class Loading extends Component { ...@@ -24,11 +24,12 @@ class Loading extends Component {
getCountdown() { getCountdown() {
return new Promise((r) => { return new Promise((r) => {
const delta = 30; // const delta = 30;
const timer = new Timer(1 * 30, 1000 / 30); // const timer = new Timer(1 * 30, 1000 / 30);
timer.on('timer', this.onupdate, this); // timer.on('timer', this.onupdate, this);
timer.on('complete', r, this); // timer.on('complete', r, this);
timer.start(); // timer.start();
r();
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment