Dragon-v

微信小程序获取地理位置

1.wxml代码:

<input type="text" value="{{home}}" bindtap="home"/>

2.js代码

home(){
    var _this = this
    wx.chooseLocation({
      success:function(e){
        var home=e.name
        _this.setData({
          home:home
        })
      }
    })
  },

(注:这只是一个最基础的,没有经过任何美化,前台的表单可以使用  Lin Ui  进行美化) 

posted on 2021-09-24 11:17  Dragon-v  阅读(109)  评论(0编辑  收藏  举报