提交 00cecb2a authored 作者: ling's avatar ling

fix timer

上级 7385e987
...@@ -141,8 +141,6 @@ ...@@ -141,8 +141,6 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "H5Index", name: "H5Index",
...@@ -151,7 +149,6 @@ export default { ...@@ -151,7 +149,6 @@ export default {
isiOS: null, isiOS: null,
code: "", code: "",
url: "https://www.yibovip613.com:34225/entry/login", url: "https://www.yibovip613.com:34225/entry/login",
timer: null,
}; };
}, },
head() { head() {
...@@ -164,32 +161,32 @@ export default { ...@@ -164,32 +161,32 @@ export default {
}; };
}, },
mounted() { mounted() {
this.timer = setInterval(function () { const u = navigator.userAgent;
const isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
this.isiOS = isiOS;
this.code =
location.href.split("?")[1] && location.href.split("?")[1].split("=")[1];
if (this.code) {
this.url =
"https://www.yibovip613.com:34225/entry/login?code=" + this.code;
}
const timer = setInterval(function () {
if (ShareTrace) { if (ShareTrace) {
ShareTrace.init({ ShareTrace.init({
appkey: "a4a9e45dc76e096a", appkey: "a4a9e45dc76e096a",
success: function () { success: function () {
console.log("init success..."); console.log("init success...");
clearInterval(timer);
}, },
error: function (msg) { error: function (msg) {
console.log(msg); console.log(msg);
}, },
}); });
clearInterval(this.timer);
} }
}, 1000); }, 1000);
const u = navigator.userAgent;
const isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
this.isiOS = isiOS;
this.code =
location.href.split("?")[1] && location.href.split("?")[1].split("=")[1];
if (this.code) {
this.url =
"https://www.yibovip613.com:34225/entry/login?code=" + this.code;
}
}, },
methods: { methods: {
handleDownload() { handleDownload() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论