uatcomponent
Version:
20 lines (19 loc) • 468 B
JavaScript
import {
Dimensions,
} from "react-native";
export function autoBaseUrl(baseUrl:String,imgUrl:String=''):String{
if(!imgUrl)return '';
if(imgUrl.indexOf('http')!=0){
return `${baseUrl}/${imgUrl}`;
}
return imgUrl;
}
/**
* 判断是否iphone & ipad;
* 横屏iphone当作ipad处理
*/
const BIG_DEVICE_VALUE : Number = 700;
export function isWidthDevice():Boolean{
const Width : Number = Dimensions.get('window').width;
return BIG_DEVICE_VALUE<=Width;
}