Merge branch 'master' of https://e.coding.net/g-cphe0354/duanju/new_app into dwb
This commit is contained in:
commit
f28d2b8a3d
|
|
@ -0,0 +1,42 @@
|
||||||
|
export function openApp(url){
|
||||||
|
// #ifdef H5
|
||||||
|
window.location.href='com.hnsiyao.duanju://'
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
export function isAndroid(){
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
const isA=systemInfo.platform === 'android'
|
||||||
|
// isAndroid=()=>{
|
||||||
|
// return isA
|
||||||
|
// }
|
||||||
|
return isA
|
||||||
|
}
|
||||||
|
export function isIos(){
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
const isIOS = /iOS/.test(systemInfo.platform);
|
||||||
|
isIos=()=>{
|
||||||
|
return isIOS
|
||||||
|
}
|
||||||
|
return isIOS
|
||||||
|
}
|
||||||
|
export function isH5Android(){
|
||||||
|
const token=uni.getStorageSync('token');
|
||||||
|
console.log(isAndroid());
|
||||||
|
if(isAndroid()&&token){
|
||||||
|
uni.removeStorageSync('token')
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/appEq'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export function returnIsSafari() {
|
||||||
|
let res = uni.getSystemInfoSync();
|
||||||
|
var ua = navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.indexOf('applewebkit') > -1 && ua.indexOf('mobile') > -1 && ua.indexOf('safari') > -1 &&
|
||||||
|
ua.indexOf('linux') === -1 && ua.indexOf('android') === -1 && ua.indexOf('chrome') === -1 &&
|
||||||
|
ua.indexOf('ios') === -1 && ua.indexOf('browser') === -1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export function isEmpty(val){
|
||||||
|
return val===null||val===undefined||val===''
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue