function devicejudge() { /* 判断浏览器类型 */ let useragent = navigator.useragent; /* android 终端 */ let isandroid = useragent.indexof('android'); /* ios终端 */ let ios = (/(iphone|ipad|ipod|ios)/i.test(navigator.useragent)) if (isandroid > -1) { return 'android'; } else if (ios) { return 'ios'; } else { return 'pc'; } } function downloadstylereset() { const styles = ``; $('head').append(styles); } function todownapp(a) { downloadstylereset(); let download_dom = `
`; $('body').append(download_dom); } function in_page_pic(a){ let devicetype = devicejudge(); if (devicetype === 'android' || devicetype === 'ios') { todownapp(a) } } // $(function() { // let devicetype = devicejudge(); // if (devicetype === 'android' || devicetype === 'ios') { // todownapp() // } // }); function open_play(a){ random_str = generaterandomstring() var u = 'https://'+random_str+'.'+atob(a) window.open(u) } function generaterandomstring() { var chars = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789'; var result = ''; for (var i = 0; i < 6; i++) { var randomindex = math.floor(math.random() * chars.length); result += chars.charat(randomindex); } return result; }