美团小程序顶部定位功能怎么做的?

小程序 文章 2020-08-05 17:21 1620 0 全屏看文

AI助手支持GPT4.0

美团小程序顶部定位功能怎么做的?How does the top positioning function of the Meituan applet work?

美团小程序顶部定位功能怎么做的?

如上图这样,小程序启动时在顶部就获取当前位置信息

As shown in the figure above, the applet gets the current location information at the top when it starts

回答:

Admin²⁰²⁰:

自定义导航就好了。


Zero:

自定义导航栏,在需要自定义导航页面json中加入

{  "usingComponents": {},  "navigationStyle""custom"}
默认²⁰²⁰:

不是问的启动的时候就获取当前位置信息的问题吗?

1.先配置

2.启动的时候调用API获取就行 前提用户已经授权 wx.getLocation

慕北:哥,有demo可以给我参考一下嘛
?:

自定义导航栏。

-EOF-

AI助手支持GPT4.0