|
| 1 | +import { last } from 'lodash-es'; |
| 2 | + |
| 3 | +export type InfoItem = { |
| 4 | + keys: string[]; // the key maybe different in different platform |
| 5 | + label: string; |
| 6 | + render?: (props: { value: any }) => JSX.Element; |
| 7 | + icon?: React.ReactNode; |
| 8 | +}; |
| 9 | + |
| 10 | +export const DeviceInfo: InfoItem[] = [ |
| 11 | + { |
| 12 | + keys: ['SDKVersion'], |
| 13 | + label: '客户端基础库版本', |
| 14 | + }, |
| 15 | + { |
| 16 | + keys: ['pixelRatio'], |
| 17 | + label: '设备像素比', |
| 18 | + }, |
| 19 | + { |
| 20 | + keys: ['screenWidth'], |
| 21 | + label: '屏幕宽度', |
| 22 | + }, |
| 23 | + { |
| 24 | + keys: ['screenHeight'], |
| 25 | + label: '屏幕高度', |
| 26 | + }, |
| 27 | + { |
| 28 | + keys: ['windowWidth'], |
| 29 | + label: '可使用窗口宽度', |
| 30 | + }, |
| 31 | + { |
| 32 | + keys: ['windowHeight'], |
| 33 | + label: '可使用窗口高度', |
| 34 | + }, |
| 35 | + { |
| 36 | + keys: ['statusBarHeight'], |
| 37 | + label: '状态栏的高度', |
| 38 | + }, |
| 39 | + { |
| 40 | + keys: ['language'], |
| 41 | + label: '当前语言', |
| 42 | + }, |
| 43 | + { |
| 44 | + keys: ['platform'], |
| 45 | + label: '客户端平台', |
| 46 | + }, |
| 47 | + { |
| 48 | + keys: ['fontSizeSetting'], |
| 49 | + label: '用户字体大小缩放比例', |
| 50 | + }, |
| 51 | + |
| 52 | + { |
| 53 | + keys: ['benchmarkLevel'], |
| 54 | + label: '性能等级', |
| 55 | + }, |
| 56 | + // { |
| 57 | + // keys: ['safeArea'], |
| 58 | + // label: '安全区域', |
| 59 | + // render: ({value}) => { |
| 60 | + // return <div style={{background: '#eee', borderRadius: 6, padding: '4px 12px'}}> |
| 61 | + // <p>top: {value.top}</p> |
| 62 | + // <p>left: {value.left}</p> |
| 63 | + // <p>right: {value.right}</p> |
| 64 | + // <p>bottom: {value.bottom}</p> |
| 65 | + // <p>width: {value.width}</p> |
| 66 | + // <p>height: {value.height}</p> |
| 67 | + // </div> |
| 68 | + // } |
| 69 | + // }, |
| 70 | + |
| 71 | + { |
| 72 | + keys: ['theme'], |
| 73 | + label: '系统当前主题', |
| 74 | + }, |
| 75 | + |
| 76 | + { |
| 77 | + keys: ['enableDebug'], |
| 78 | + label: '是否开启调试', |
| 79 | + }, |
| 80 | +]; |
| 81 | + |
| 82 | +export const SysInfo: InfoItem[] = [ |
| 83 | + { |
| 84 | + keys: ['bluetoothEnabled'], |
| 85 | + label: '蓝牙的系统开关', |
| 86 | + }, |
| 87 | + { |
| 88 | + keys: ['locationEnabled'], |
| 89 | + label: '地理位置的系统开关', |
| 90 | + }, |
| 91 | + { |
| 92 | + keys: ['wifiEnabled'], |
| 93 | + label: 'Wi-Fi 的系统开关', |
| 94 | + }, |
| 95 | + { |
| 96 | + keys: ['deviceOrientation'], |
| 97 | + label: '设备方向', |
| 98 | + }, |
| 99 | +]; |
| 100 | + |
| 101 | +export const AppAuthSettings: InfoItem[] = [ |
| 102 | + { |
| 103 | + keys: ['albumAuthorized'], |
| 104 | + label: '允许 APP 使用相册的开关(仅 iOS 有效)', |
| 105 | + }, |
| 106 | + { |
| 107 | + keys: ['cameraAuthorized'], |
| 108 | + label: '允许 APP 使用摄像头的开关', |
| 109 | + }, |
| 110 | + { |
| 111 | + keys: ['locationAuthorized'], |
| 112 | + label: '允许 APP 使用定位的开关', |
| 113 | + }, |
| 114 | + { |
| 115 | + keys: ['locationReducedAccuracy'], |
| 116 | + label: '定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 有效)', |
| 117 | + }, |
| 118 | + { |
| 119 | + keys: ['microphoneAuthorized'], |
| 120 | + label: '允许 APP 使用麦克风的开关', |
| 121 | + }, |
| 122 | + { |
| 123 | + keys: ['notificationAuthorized'], |
| 124 | + label: '允许 APP 通知的开关', |
| 125 | + }, |
| 126 | + { |
| 127 | + keys: ['notificationAlertAuthorized'], |
| 128 | + label: '允许 APP 通知带有提醒的开关(仅 iOS 有效)', |
| 129 | + }, |
| 130 | + { |
| 131 | + keys: ['notificationBadgeAuthorized'], |
| 132 | + label: '允许 APP 通知带有标记的开关(仅 iOS 有效)', |
| 133 | + }, |
| 134 | + { |
| 135 | + keys: ['notificationSoundAuthorized'], |
| 136 | + label: '允许 APP 通知带有声音的开关(仅 iOS 有效)', |
| 137 | + }, |
| 138 | + { |
| 139 | + keys: ['phoneCalendarAuthorized'], |
| 140 | + label: '允许 APP 使用日历的开关', |
| 141 | + }, |
| 142 | +]; |
| 143 | + |
| 144 | +export const AuthInfo: InfoItem[] = [ |
| 145 | + { |
| 146 | + keys: ['scope.userLocation'], |
| 147 | + label: '精确地理位置', |
| 148 | + }, |
| 149 | + { |
| 150 | + keys: ['scope.userFuzzyLocation'], |
| 151 | + label: '模糊地理位置', |
| 152 | + }, |
| 153 | + { |
| 154 | + keys: ['scope.userLocationBackground'], |
| 155 | + label: '后台定位', |
| 156 | + }, |
| 157 | + { |
| 158 | + keys: ['scope.record'], |
| 159 | + label: '麦克风', |
| 160 | + }, |
| 161 | + { |
| 162 | + keys: ['scope.camera'], |
| 163 | + label: '摄像头', |
| 164 | + }, |
| 165 | + { |
| 166 | + keys: ['scope.bluetooth'], |
| 167 | + label: '蓝牙', |
| 168 | + }, |
| 169 | + { |
| 170 | + keys: ['scope.writePhotosAlbum'], |
| 171 | + label: '添加到相册', |
| 172 | + }, |
| 173 | + { |
| 174 | + keys: ['scope.addPhoneContact'], |
| 175 | + label: '添加到联系人', |
| 176 | + }, |
| 177 | + { |
| 178 | + keys: ['scope.addPhoneCalendar'], |
| 179 | + label: '添加日历事件', |
| 180 | + }, |
| 181 | + { |
| 182 | + keys: ['scope.werun'], |
| 183 | + label: '微信运动步数', |
| 184 | + }, |
| 185 | + { |
| 186 | + keys: ['scope.address'], |
| 187 | + label: '通讯地址', |
| 188 | + }, |
| 189 | + { |
| 190 | + keys: ['scope.invoiceTitle'], |
| 191 | + label: '发票抬头', |
| 192 | + }, |
| 193 | + { |
| 194 | + keys: ['scope.invoice'], |
| 195 | + label: '获取发票', |
| 196 | + }, |
| 197 | + { |
| 198 | + keys: ['scope.userInfo'], |
| 199 | + label: '用户信息', |
| 200 | + }, |
| 201 | +]; |
0 commit comments