Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

location #9

Open
snowtreetree opened this issue Jan 14, 2018 · 3 comments
Open

location #9

snowtreetree opened this issue Jan 14, 2018 · 3 comments

Comments

@snowtreetree
Copy link

bindInput: function(e){
var that = this;
var keywords = e.detail.value;
var key = config.Config.key;
var myAmapFun = new amapFile.AMapWX({key: key});
myAmapFun.getInputtips({
keywords: keywords,
location: lonlat,
city: city,
success: function(data){
if(data && data.tips){
that.setData({
tips: data.tips
});
}
}
})
},

location 不是特别明确,应当说明是'lon,lat', lon和lat分别是经纬度。

还有在搜索的时候出现了bug数据。

请求接口:https://restapi.amap.com/v3/assistant/inputtips?key=3419175136c6b0204d77cd94a96c60ba&s=rsx&platform=WXJS&appname=3419175136c6b0204d77cd94a96c60ba&sdkversion=1.2.0&logversion=2.0&location=103.99302254443359%2C30.61976965766218&keywords=%E5%8E%95%E6%89%80
返回数据(tips):
tips[ {id: [], name: "厕所", district: [], adcode: [], location: [], address: [], typecode: []}。。。。。。]

@benmo1602
Copy link

Page({
data: {
tips: {}
},
onLoad: function() {

},
bindInput: function(e) {
var that = this;
var keywords = e.detail.value;
//console.log(config)
//var key = config.Config.key;
var myAmapFun = new amapFile.AMapWX({
key: "81b89841fe5fd04d71f112e430016d00"
});
myAmapFun.getInputtips({
keywords: keywords,
location: "",
success: function(data) {
if (data && data.tips) {
console.log( data.tips)
that.setData({
tips: data.tips
});
}
}
});
},
bindSearch: function(e) {
var keywords = e.target.dataset.keywords;
//var url = "../poi/poi?keywords=" + keywords;
console.log(keywords);
/* wx.redirectTo({
url: url
});*/
}
})

{{item.name}} {{item.district}} {{item.address}}

@benmo1602
Copy link

上面的 文件 别忘记 引

@snowtreetree
Copy link
Author

这些确实是引入了的。
https://github.com/SnowZhangXl/wechat.git
这个是我的项目地址,或许您可以帮我看下(项目写的有点low),然后这两天好像又出现了location不生效的情况。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants