

import { Dimensions, PixelRatio, Platform, StyleSheet } from 'react-native';


let defaultStyle = {

    // 像素转点
    px2dp: (px: number) => {
        return px / PixelRatio.get()
    },

    device: {
        width: Dimensions.get('window').width,
        height: Dimensions.get('window').height
    },

    font: {
        size: {
            size8: 8,//弱
            size10: 10,//弱
            size12: 12,//一般
            size13: 13,//一般
            size14: 14,//一般
            size16: 16,//重要
            size18: 18, //重要
            size24: 24, //
            size28: 28
        },
        color: {
            color1: '#000000',
            color2: '#333333',
            color3: '#666666',
            color4: '#999999',
            color5: '#cccccc',
            color6: '#ffffff',
            color7: '#f86670',
            color8: '#40b0ff',
            color9: '#ed9c27',
            color10: '#e0e0e0',
            color11: '#FFAC32',
            color12: '#5AA9FA',
			color13: '#FFA61A',
			color14: '#FE3B31',
			color15: '#67d100',
			color16: '#f7e1a9',
			color17: '#323232',
			color18: '#d6b87e',
			color19: '#91aac4',
			color20: '#fde53a',
			color21: '#F19000'
        }
    },

    border: {
        size: {
            main: 1,
            assit1: StyleSheet.hairlineWidth, //相当于原来的0.5  这一常量定义了当前平台上的最细的宽度，不是固定值，因为不同的平台和不同的屏幕像素密度会导致不同的结果
            assit2: 2,
            zero: 0
        },
        color: {
            main: '#dcdcdc',
            assit1: '#f86670',
            assit2: '#cccccc',
            assit3: '#40b0ff',
            assit4: '#FFE400',
            assit5: '#fe3b3e'
        }
    },

    color: {
        mainColor: '#5aa9fa'
    },

    /**
    *  图片缩放后缀
    */
    imageSuffix: {
        fit100: '?imageMogr2/thumbnail/100x100',
    },

    defaultHeader: {
        defaultAunt: 'http://oss.bm001.com/arena/arenaimg/prod/defaultIcon/defaultAunt.png',
        defaultBoss: 'http://oss.bm001.com/arena/arenaimg/prod/defaultIcon/defaultBoss.png',
        defaultCustomer: 'http://oss.bm001.com/arena/arenaimg/prod/defaultIcon/defaultCustomer.png',
        defaultShop: 'http://oss.bm001.com/arena/arenaimg/prod/defaultIcon/defaultShop.png',
        defaultStaff: 'http://oss.bm001.com/arena/arenaimg/prod/defaultIcon/defaultStaff.png',
    },

     //背景色调
     background: {
        color: {
            main: '#5AA9FA',
            assit1: '#f7f7f7',
            assit2: '#000000',
            assit3: '#ffffff',
            assit4: '#eeeeee',
            assit5: '#80caff',
            assit6: '#efefef',
            assit7: '#47B1FF',
            assit8: '#cccccc',
            assit9: '#40b0ff',
            searchBar: 'rgba(255,255,255,0.3)',
            assit10: '#e9e9ef',
            assit11:'#FFA619',
            assit12:'#F3F4F5',
            assit13:'#f8f8f8'
        }
    },

    isIphoneX: () => {
        const SCREEN_WIDTH = Dimensions.get('window').width;
        const SCREEN_HEIGHT = Dimensions.get('window').height;

        return (
            Platform.OS === 'ios' && (Math.floor(SCREEN_HEIGHT / SCREEN_WIDTH * 100000) === 216533)
        )
    },

    isIphoneXrOrMax: () => {
        const SCREEN_WIDTH = Dimensions.get('window').width;
        const SCREEN_HEIGHT = Dimensions.get('window').height;

        return (
            Platform.OS === 'ios' && (Math.floor(SCREEN_HEIGHT / SCREEN_WIDTH * 100000) === 216425)
        )
    },
    isHaveCatHeader: () => {
        const SCREEN_WIDTH = Dimensions.get('window').width;
        const SCREEN_HEIGHT = Dimensions.get('window').height;

        return (
            Platform.OS === 'ios' && (Math.floor(SCREEN_HEIGHT / SCREEN_WIDTH * 100) === 216)
        )
    },
    /**
    *	导航栏状态栏之间的距离
    */
    navBarToStatusBar: () => {
        const SCREEN_WIDTH = Dimensions.get('window').width;
        const SCREEN_HEIGHT = Dimensions.get('window').height;
        if (Platform.OS == 'ios') {
            if ((SCREEN_HEIGHT / SCREEN_WIDTH * 100) === 216) {
                return 44
            } else {
                return 20
            }
        } else {
            return 0
        }
    }

}

export default defaultStyle