表单 · form-location 微信定位
input[data-type="location"] 微信定位:渲染“地址框 + 定位按钮”。
点击定位调 a.wxGetlocation(gcj02)获取坐标,POST location=lat,lng 到 data-url(腾讯地图反地址解析接口),返回 {status:1,data:{address, formatted_addresses:{standard_address|recommend}}} 回填。
data-url 必填(缺失 init 告警);需在微信体系内且已引用并初始化 weixin.js。
表单家族
索引
base
input
textarea
select
number
search
checkbox
radio
switch
choose
multipled
labels
inpselect
button
label
file
files
upload
video
image
images
imgurls
date
datetime
color
price
sms
sign
listing
json
arrays
infinite
location
latlng
editor
richtext
line
modifier
data
关键属性
| 属性 | 说明 |
|---|---|
data-type | location(必填) |
data-url | 反地址解析接口(必填) |
placeholder | 地址框提示 |
value | 初始地址 |
微信定位
<div class="form-item">
<label class="label label-text pd-none">收货地址</label>
<input type="hidden" data-type="location" data-url="/api/location" name="address" placeholder="点击定位获得当前位置">
</div>
KuoqiUI v2.00 · 离线静态文档 · 界面基于 KuoqiUI ·
返回首页