市北人才赋能平台 --小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

6 years ago
//app.js
import {HTTP} from '/utils/http.js'
const http = new HTTP()
6 years ago
App({
onLaunch: function (options) {
wx.getSystemInfo({
success: res => {
this.globalData.systemInfo = res
this.globalData.windowHeight = res.windowHeight
this.globalData.screenHeight = res.screenHeight
}
})
if(options.referrerInfo.hasOwnProperty('extraData')){
this.globalData.navigate.mobile = options.referrerInfo.extraData.mobile,
this.globalData.navigate.nickname = options.referrerInfo.extraData.nickname,
3 years ago
this.globalData.navigate.faceImg = options.referrerInfo.extraData.faceImg,
this.globalData.navigate.id = options.referrerInfo.extraData.id
}
http.fetchAuthToken(res => {
4 years ago
console.log('app登录--->',res)
let openId=res.result.userInfo.openId
console.log('app登录openId--->',openId)
http.postAuthOpenID(openId,data=>{
console.log(data)
})
})
http.getConfig(res=>{
3 years ago
console.log(res)
if(res.result.projectFlag == 1){
this.globalData.flag = 1;
}
})
6 years ago
},
globalData: {
userInfo: null,
navigate:{
mobile:'',
nickname:'',
faceImg:'',
3 years ago
id:''
},
windowHeight:'',
screenHeight:'',
4 years ago
flag:0,
currentTab:''
3 years ago
},
6 years ago
})