当前位置: 首页 > news >正文

html5可以做网站吗百度小说排行榜完本

html5可以做网站吗,百度小说排行榜完本,域名解析错误是怎么回事,真正的一手货源网站需求 有个表单需要一键获取对应位置 并显示出来效果如下&#xff1a; 点击一键获取获取对应位置 显示在 picker 默认选中 前端 代码如下: <view class"box_7 {{ showChange1? change-style: }}"><view class"box_11"><view class"…

需求 有个表单需要一键获取对应位置 并显示出来效果如下:

点击一键获取获取对应位置 显示在  picker 默认选中

前端  代码如下:

     <view class="box_7  {{ showChange==1? 'change-style':'' }}"><view class="box_11"><view class="text-wrapper_6 {{ showChange==1? 'change-style-postiona':'' }}"><text lines="1" class="text_29">考试地址</text><text lines="1" class="text_30" /><text lines="1" class="text_31">*</text></view><picker class="region-select" mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}"><view class="picker">{{region[0]}}   {{region[1]}}     {{region[2]}}</view></picker><button  bindtap="getUserLocation" class="get-position {{ showChange==1? 'change-style-postion':''}}">一键获取</button></view></view>

一定注意:小程序中要配置,不然获取位置不生效。

  "permission": {"scope.userLocation": {"desc": "你的位置信息将用于小程序位置接口的效果展示"}},"requiredPrivateInfos" : [ "getLocation" ],

小程序js如下:注意 获取到 经纬度之后 请求腾讯 api key 要进行申请 ,申请很快

申请地址 腾讯位置服务 - 立足生态,连接未来

getUserLocation: function () {let that = this;wx.getSetting({success: (res) => {if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {//如果没有授权就提示需要授权wx.showModal({title: '请求授权当前位置',content: '需要获取您的地理位置,请确认授权',success: function (res) {if (res.cancel) {wx.showToast({title: '拒绝授权',icon: 'none',duration: 1000})} else if (res.confirm) {wx.openSetting({success: function (dataAu) {if (dataAu.authSetting["scope.userLocation"] == true) {wx.showToast({title: '授权成功',icon: 'success',duration: 1000})//再次授权,调用wx.getLocation的APIthat.getLocations();} else {wx.showToast({title: '授权失败',icon: 'none',duration: 1000})}}})}}})} else if (res.authSetting['scope.userLocation'] == undefined) {that.getLocations();}else {that.getLocations();}}})
},
//获取经纬度getLocations()
{let that = this;wx.getLocation({type: 'wgs84',success (res) {const latitude = res.latitudeconst longitude = res.longitudewx.request({url: 'https://apis.map.qq.com/ws/geocoder/v1/',data: {location: `${latitude},${longitude}`,key: that.data.key,get_poi: 0},success(res) {if(res.statusCode==200){const addressComponent = res.data.result.address_component;const province = addressComponent.province;const city = addressComponent.city;const district = addressComponent.district;var showChange =0;if((province+city+district).length>=12){showChange =1;}var result = [province, city, district];that.setData({region: result,showChange: showChange,addressSelect:1,})}else{wx.showToast({title: '定位获取失败,请手动选择~',icon: 'none'})}}})}})
},

http://www.hkea.cn/news/863979/

相关文章:

  • 长春个人做网站哪家好百度指数热度榜
  • 嘉兴手机网站开发费用百度学术论文官网入口
  • 刷业务网站怎么做seo关键词挖掘
  • 企业移动网站品牌苏州网站外包
  • 网站建设流程 文档东莞seo技术
  • 公众号开发网站建设合同信息流广告投放流程
  • 长清网站建设费用友情链接出售平台
  • 先做网站再付款百度推广的广告真实可信吗
  • 湖南省人民政府一事一办企业网站seo排名优化
  • 深圳招聘网官方网站网站搜索引擎优化
  • 怎么知道一个网站是谁做的中国最大的企业培训公司
  • m2c是什么意思南昌百度seo
  • 专业做羽绒服的服装网站域名注册网
  • 公司网站建设需要显示什么软件世界球队最新排名
  • 做微信平台图片网站有没有免费的广告平台
  • 渭南网站建设风尚网络站长工具seo词语排名
  • 广告传媒网站模板免费网站推广方式
  • 如何用api方式做网站域名批量查询工具
  • wordpress 网易云跟帖优化合作平台
  • 建设党建网站联盟青岛网站推广公司
  • 石湾网站建设湘潭关键词优化服务
  • 淘宝优惠券怎么做网站网络服务提供商
  • 哪里有网站建设电话查排名官网
  • 做网站需要准备的工具网络营销方案模板
  • 科技未来网站建设百度推广开户公司
  • 十度网站建设保定网站推广公司
  • php可以做视频网站有哪些软文推广渠道主要有
  • 成都网站建设桔子科技淘宝付费推广有几种方式
  • 福田的网站建设公司网络营销成功案例ppt免费
  • 网站建设英文专业术语百度推广网址