当前位置:网站首页>uniapp小程序打开地图选择位置demo效果wx.chooseLocation(整理)
uniapp小程序打开地图选择位置demo效果wx.chooseLocation(整理)
2022-06-21 18:16:00 【000000001111】
效果图:
<template>
<view class="address">
<view class="container">
<button bindtap='getLocation'>打开地图选择位置</button>
<view wx:if="{
{address !=''}}">
<view>位置名称:{
{
name}}</view>
<view>详细地址:{
{
address}}</view>
<view>纬度:{
{
latitude}}</view>
<view>经度:{
{
longitude}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {
name: '',
address: '',
latitude: '',
longitude: '',
},
data() {
return {
pageNum: 1,
data: {
name: '',
address: '',
latitude: '',
longitude: ''
},
}
},
// 页面加载
onLoad(e) {
uni.hideTabBar(); //不让底部显示tab选项
this.getData();
},
// 页面显示
onShow() {
},
// 方法
methods: {
//获取数据
getData() {
var _this = this;
wx.chooseLocation({
success: function(res) {
var name = res.name
var address = res.address
var latitude = res.latitude
var longitude = res.longitude
console.log(name,address,latitude,longitude,'58')
},
complete(r) {
// 点击确定完成以后-进入对应的页面
console.log(r,'71');
}
})
},
//获取列表数据
getListData() {
this.$.ajax("POST", "/xxxxx/xxxxx", {
page: this.pageNum,
}, (res) => {
if (res) {
if (this.pageNum == 1) {
this.list = res.data
} else {
this.list = this.list.concat(res.data)
if (res.data.length === 0) {
this.pageNum--
}
}
}
uni.stopPullDownRefresh()
});
}
},
// 计算属性
computed: {
},
// 侦听器
watch: {
},
// 页面隐藏
onHide() {
},
// 页面卸载
onUnload() {
},
// 触发下拉刷新
onPullDownRefresh() {
this.pageNum = 1
// this.getListData()
},
// 页面上拉触底事件的处理函数
onReachBottom() {
this.pageNum++
// this.getListData()
},
}
</script>
<style lang="scss" scoped>
.address {
}
</style>
边栏推荐
- 动态规划【一】(背包问题)
- Jupyter notebook compiles ipynb files into latex and then converts them into PDF
- 298th weekly match
- 记一些PAT题目(一)
- 动态规划【二】(线性dp)
- 剑指 Offer II 029. 排序的循环链表
- The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the summary function is used to view the summary statistical information of t
- 【面试高频题】难度 1.5/5,经典「前缀和 + 二分」运用题
- 决策树的实现和调优(sklearn,GridSearchCV)
- Notez quelques questions Pat (1)
猜你喜欢

Yolov5 trains its own data set to report error records

Grain College p40~43

在Qt中设置程序图标的方法介绍

Gradle下载与安装配置

HMS Core机器学习服务身份证识别功能,实现信息高效录入

Kubernetes migration of persistent volumes across storageclasses Complete Guide

出院小结识别api接口-医疗票据OCR识别/出院诊断记录/电子病历/理赔服务

《安富莱嵌入式周报》第270期:2022.06.13--2022.06.19
![Dynamic programming [1] (knapsack problem)](/img/a6/3f60aa162b0597cf91a05bbc2d2b53.png)
Dynamic programming [1] (knapsack problem)

动态规划【一】(背包问题)
随机推荐
如何在Chrome浏览器中临时修改SameSite=None和Secure
Yolov5 trains its own data set to report error records
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用line.col参数自定义曲线的颜色(色彩)
Ogg-21.3 error reporting ogg-00768 failed to map database character to ulibcharaset
RecycleView懒加载失效问题(二)
[force deduction 10 days SQL introduction] Day1
Grain College p40~43
After the 80 version of Google browser, how to deal with the problem samesite cross domain problem
MFC interface library bcgcontrolbar v33.0 - Desktop alert window, grid control upgrade
Two ways of encrypting Excel files
The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the coef function is used to obtain the model coefficients and analyze the me
The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the summary function is used to view the summary statistical information of t
在 KubeSphere 上部署 Apache Pulsar
2022年6月25日PMP考试通关宝典-4
Qt Creator 7.0常见问题和常见用法
播放量高达4000w+,情侣如何靠撒狗粮出圈?
Whether Gorm database needs to set foreign keys
Flink 系例 之 TableAPI & SQL 与 示例模块
Tableapi & SQL and example module of Flink
动态规划【一】(背包问题)