From 686504e435e02315cdddb423a27298ced9af5438 Mon Sep 17 00:00:00 2001 From: pifire <104460712@qq.com> Date: Fri, 30 Dec 2016 13:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8mip=E8=87=AA=E5=B8=A6=E5=87=BD?= =?UTF-8?q?=E6=95=B0=20=E5=88=A4=E6=96=ADios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mip-dad-appdownload/mip-dad-appdownload.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/mip-dad-appdownload/mip-dad-appdownload.js b/mip-dad-appdownload/mip-dad-appdownload.js index 18bc988da..39c95b350 100644 --- a/mip-dad-appdownload/mip-dad-appdownload.js +++ b/mip-dad-appdownload/mip-dad-appdownload.js @@ -5,23 +5,9 @@ define(function (require) { var $ = require('zepto'); + var util = require('util'); + var platform = util.platform; var customElement = require('customElement').create(); - var browser = { - versions: (function () { - var u = navigator.userAgent; - return { - ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端 - android: u.indexOf('Android') > -1, // android终端或者uc浏览器 - iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, // 是否为iPhone或者QQHD浏览器 - iPad: u.indexOf('iPad') > -1, // 是否iPad - ios9: u.indexOf('iPhone OS 9') > -1, - MQQBrowser: u.indexOf('MQQBrowser') > -1, // 是否MQQBrowser - UCBrowser: u.indexOf('UCBrowser') > -1, // UCBrowser - Safari: u.indexOf('Safari') > -1 - }; - })(), - language: (navigator.browserLanguage || navigator.language).toLowerCase() - }; /** * 构造元素,只会运行一次 @@ -44,7 +30,7 @@ define(function (require) { + '\u8bae\u9009\u62e9\u8c4c\u8c46\u835a\u5b89\u88c5\u9ad8\u901f\u4e0b\u8f7d\uff01'; var innerHTML = ''; var trueurl; - if (browser.versions.ios) { + if (platform.isIos()) { innerHTML = '\u7acb\u5373\u4e0b\u8f7d'; } else {