|
@@ -1,7 +1,22 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
- onLaunch(){
|
|
|
-
|
|
|
+ globalData: {
|
|
|
+ statusBarHeight: 20,
|
|
|
+ userInfo: {}
|
|
|
+ },
|
|
|
+ onLaunch() {
|
|
|
+ // 获取App方法
|
|
|
+ getUserInfo.postMessage('获取用户信息')
|
|
|
+ getDeviceInfo.postMessage('获取设备信息')
|
|
|
+ // 暴露setUserInfo方法给APP
|
|
|
+ window['setUserInfo'] = res => {
|
|
|
+ console.log(res);
|
|
|
+ this.globalData.userInfo = JSON.parse(res)
|
|
|
+ }
|
|
|
+ window['setDeviceInfo'] = res => {
|
|
|
+ console.log(res);
|
|
|
+ this.globalData.statusBarHeight = JSON.parse(res).statusHeight
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|