热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

微信小程序地址下拉选择地址名

**wx.chooseLocation({success:function(res){console.log("签到",res)
 /**
    wx.chooseLocation({
      success: function (res) {
        console.log("签到", res)
        if (res.latitude && res.longitude) {
          that.setData({
            \'signInObj.signInName\': res.name,//地址名
            \'signInObj.signInAddress\': res.address,//地址
            \'signInObj.signInLatitude\': res.latitude,//纬度
            \'signInObj.signInLongitude\': res.longitude,//经度
            \'signInObj.signInState\': "已签到",//签到标记
            \'signInObj.signInTime\': util.serverFormatTime(new Date()),
            signInTime: util.frontFormatTime(new Date())
          })
        } else {
          wx.showModal({
            confirmColor: \'#2c89da\',
            cancelColor: \'#515151\',
            confirmText: \'好的\',
            content: \'没有经纬度将无法提交,请打开手机GPS定位再试\',
            showCancel: false,
            title: \'没有获取到经纬度信息\',
            success: (result) => { },
            fail: (res) => { },
            complete: (res) => { },
          })
        }
      }, fail: function (res) {
        wx.showToast({
          title: \'获取位置失败!\',
          duration: 1800,
          icon: \'none\',
          mask: false,
        })
        console.error("getLocation:fail");
      }, complete: function (res) {
        // console.log("获取签到位置信,结束!");
      }
    });
     */

  


推荐阅读
author-avatar
dongmyee
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有