3 Star 0 Fork 0

中测信息 / 嗨黔东南数据采集

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
app.js 1.07 KB
Copy Edit Raw Blame History
徐凯 authored 2018-04-02 15:07 . fix bugs
//app.js
import QQMapWX from './assets/js/qqmap-wx-jssdk.min.js'
import { QQMAP_KEY } from './config/apiConfig.js'
App({
onLaunch: function () {
// 腾讯地图
this.globalData.QQMap = new QQMapWX({
key: QQMAP_KEY
})
const _self = this
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
globalData: {
userInfo: {},
QQMap: null,
position: [],
areaInfo: {},
pageId: null
}
})
1
https://gitee.com/zcinfo/hi_qiandongnan_data_collection.git
git@gitee.com:zcinfo/hi_qiandongnan_data_collection.git
zcinfo
hi_qiandongnan_data_collection
嗨黔东南数据采集
master

Search