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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
   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("获取签到位置信,结束!");
     }
   });
    */

  

posted @   A汉克先生  阅读(522)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
点击右上角即可分享
微信分享提示