Commit c6f6688b authored by zhangyanni's avatar zhangyanni

试一下首页适配

parent db90fcda
......@@ -20,14 +20,16 @@ Vue.use(vuePreview, {
var u = navigator.userAgent,ucFlag = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;
let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|MicroMessenger|miniProgram|webview|wechatdevtools|MacWechat NetType)/i);
// 手机
if(window.innerWidth>=1000){
document.getElementsByTagName("html")[0].style.minWidth = "1300px";
document.getElementsByTagName("body")[0].style.minWidth = "1300px";
}
if (flag||ucFlag||window.innerWidth<980) {
// if(window.innerWidth>=1000){
// document.getElementsByTagName("html")[0].style.minWidth = "1300px";
// document.getElementsByTagName("body")[0].style.minWidth = "1300px";
// }
if (flag||ucFlag||/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)&&navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger') {
require('../public/css/phone.scss');
}else{
require('../public/css/pc.scss')
require('../public/css/pc.scss');
document.getElementsByTagName("html")[0].style.minWidth = "1300px";
document.getElementsByTagName("body")[0].style.minWidth = "1300px";
}
import Element, { Message } from 'element-ui'
import Mintui from 'mint-ui';
......@@ -171,10 +173,18 @@ router.beforeEach((to, from, next) => {
if (i18n.locale == "zh-CN") router.push({path:'/mobileRegisterCmpt',query:to.query});
}
if(to.name=="dashboard"){
if(window.innerWidth<=950) router.replace('/index');
// if(window.innerWidth<=950) router.replace('/index');
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)&&navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger') router.replace('/index');
else {
alert(1)
}
}
if(to.name=="mobileIndex"){
if(window.innerWidth>950) router.push('/');
// if(window.innerWidth>950) router.push('/');
if(!(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)&&navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger')) router.push('/');
else {
alert(2)
}
}
if (to.name == "mobileLogin") {
if (i18n.locale == "zh-CN") router.push({path:'/loginByPhone',query:to.query});
......
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