/**
 * 请求地址头
 */ export const APP_SERVE_URL = 'http://118.190.150.148:9001/jfsc' ; export const AES_key = ")O[NB]6,YF}+efcaj{+oESb9d8>Z'e9M" ; /**
 * App配置信息
 */ export class AppConfig { static PCmodel : boolean = false ; static Appmodel : number = 3 ; static deviceId : string = '' ; static deviceCordova : string = '' ; static deviceModel : string = '' ; static devicePlatform : string = '' ; static devicePlatformVersion : string = '' ; static deviceManufacturer : string = '' ; static deviceSerial : string = '' ; static platform : string = '' ; static appName : string = 'CRM_KmfApp' ; static appVersion : string = '2.0.2' ; static userProtocol : string = '' ; static userName : string = '' ; static token : string = '' ; static userInfo : any = { } ; static callingType : number = 2 ; static inited : boolean = true ; static balanceMinute : number = 0 ; static showCustomerPhone : boolean = false ; static expireDate : any = '2018.01.01' ; static jPushRegistrationId : string = '' ; static jPushAlias : string = '' ; static jPushTags : string = '' ; public static getWindowHeight ( ) { return window . screen . height ; } public static getWindowWidth ( ) { return window . screen . width ; } public static getFenbianlv ( ) { let x = window . screen . width * window . devicePixelRatio ; let y = window . screen . height * window . devicePixelRatio ; return [ x , y ] ; } public static getCallingType ( ) { return this . callingType ; } public static getInited ( ) { return this . inited ; } public static getBalanceMinute ( ) { return this . balanceMinute ; } public static getLocalTime ( ) { let date = new Date ( ) ; let month = date . getMonth ( ) + 1 ; let strDate = date . getDate ( ) ; if ( month >= 1 && month <= 9 ) { month = "0" + month ; } if ( strDate >= 0 && strDate <= 9 ) { strDate = "0" + strDate ; } let dd = date . getFullYear ( ) + "-" + month + "-" + strDate ; return dd ; } public static getLocalTime2 ( ) { let date = new Date ( ) ; let month = date . getMonth ( ) + 1 ; let strDate = date . getDate ( ) ; if ( month >= 1 && month <= 9 ) { month = "0" + month ; } if ( strDate >= 0 && strDate <= 9 ) { strDate = "0" + strDate ; } let dd = date . getFullYear ( ) + "" + month + "" + strDate ; return dd ; } public static getIsExpired ( ) { if ( ! this . expireDate ) { return true ; } var DateTwo = this . expireDate ; var myDate = new Date ( ) ; var DateOne = myDate . toLocaleDateString ( ) ; var TwoMonth = DateTwo . substring ( 5 , 7 ) ; var TwoDay = DateTwo . substring ( 8 , 10 ) ; var TwoYear = DateTwo . substring ( 0 , 4 ) ; var cha = ( ( Date . parse ( TwoMonth + '/' + TwoDay + '/' + TwoYear ) - Date . parse ( DateOne ) ) / 86400000 ) ; return ( cha < 0 ) ? true : false ; } public static getToken ( ) { return this . token || '' ; } public static getPlatform ( ) { return this . platform || '' ; } public static getDeviceid ( ) { return this . deviceId || '' ; } public static getAppName ( ) { return this . appName || '' ; } public static getAppVersion ( ) { let version = this . appVersion || '' ; let t = version . split ( '.' ) ; let num = parseInt ( t [ 0 ] ) * 1000000 + parseInt ( t [ 1 ] ) * 1000 + parseInt ( t [ 2 ] ) ; return num || '' ; } public static getuserName ( ) { return this . userName || '' ; } public static getUserInfo ( ) { let userInfo = { userId : 0 , uuid : 0 , userName : '' , token : '' , orgId : 0 , name : '' , mobile : '' } ; return this . userInfo || userInfo ; } public static trim ( str ) { return str . replace ( /(^s*)|(s*$)/g , "" ) ; } public static getTestCount ( ) { let x = Math . floor ( ( Math . random ( ) * 4 ) ) ; let cc = { name : '测试号:谢大见' , number : '18558756920' , } ; if ( x === 0 ) { cc = { name : '测试号0:赵' , number : '15306907390' , } ; } else if ( x == 1 ) { cc = { name : '测试号1:林' , number : '13459202232' , } ; } else if ( x == 2 ) { cc = { name : '测试号2:袁' , number : '18221612515' , } ; } else if ( x == 3 ) { cc = { name : '测试号3:詹' , number : '18250347781' , } ; } else if ( x == 4 ) { cc = { name : '测试号4:阳阳' , number : '15060067536' , } ; } return cc ; } public static RegExp ( str , event ) { let regex = /[^\a-zA-Z0-9\u4E00-\u9FA5]/g ; if ( regex . test ( str ) ) { str = str . replace ( regex , "" ) ; event . target . value = str ; return false ; } } public static RegExpCn ( str ) { let regex = /[^\a-zA-Z0-9\|\$\(\)\*\+\.\[\]\?\\\/\^\{\}\-~`!@#%&_=,<>;:'"]/g ; if ( regex . test ( str ) ) { return true ; } } }