Files
fangche/pages/index/index.js
2021-04-08 09:13:57 +08:00

69 lines
1.7 KiB
JavaScript

// index.js
// 获取应用实例
const app = getApp()
Page({
data: {
longitude: "117.85",
latitude: "36.3950",
map: '',
markes: [{
id: 1,
longitude: "117.85",
latitude: "36.3950",
iconPath: "../../images/定位.png",
width:50,
height: 50
},
{
id: 1,
longitude: "117.86",
latitude: "36.3950",
iconPath: "../../images/定位.png",
width:50,
height: 50,
callout:{
content:"添加好友",
color: "#fff",
bgColor: "#f00",
padding:5,
display: 'ALWAYS'
}
},
{
id: 1,
longitude: "117.85",
latitude: "36.3850",
iconPath: "../../images/定位.png",
width:50,
height: 50
}]
},
onLoad() {
// console.log("load")
// this.setData({
// map: wx.createMapContext('map')
// })
// console.log(this.data.map)
wx.cloud.callFunction({
name: 'login',
data: {},
success: res => {
console.log('[云函数] [login] user openid: ', res.result.openid)
// app.globalData.openid = res.result.openid
// wx.navigateTo({
// url: '../userConsole/userConsole',
// })
},
fail: err => {
console.error('[云函数] [login] 调用失败', err)
// wx.navigateTo({
// url: '../deployFunctions/deployFunctions',
// })
}
})
}
})