微信小程序开发实现的互联网协议(互联网协议)地址查询功能示例
本文实例讲述了微信小程序开发实现的互联网协议(互联网协议)地址查询功能。分享给大家供大家参考,具体如下:
微信小程序开发参考https://mp.weixin.qq.com/debug/wxadoc/dev/component/
search.wxml
view class=' container ' view class=' page-body ' view class=' weui-search-bar { { search focuss } } id='搜索栏' view class=' weui-search-bar _ _ form ' view class=' weui-search-bar _ _ box ' icon class=' weui-icon-search '/icon input type=' text ' class=' weui-search-bar _ _ input ' id=' search input ' placeholder='输入IP ' confirm-type=' search ' bind input=' bindKeyInput ' bind confirm=' search submit ' value=' { { search value } } ' focus=' { { focus } } '/a href=' JavaScript : ' rel=' external no follow ' class=' weui-icon-clear ' id=' search clear ' bind tap=' search clear click '/a/view view class=' weui-search-bar _ _ label ' id=' search text ' bind tap=' search text click ' icon class=' weui-icon-search '/icon view class=' weui-search-bar _ _ label _ span '搜索(8 . 8 .8 .8)/view/view view view class=' weui-search-bar _ _ cancel-BTN ' id=' search cancel ' bind tap=' search cancel click '取消/view/view/view view class=' page-section ' view class=' page-section-title '文本查询结果/text/view view view class=' page-section-space ' scroll-view scroll-y=' true ' class=' IP-scroll ' bindscroll to pper=' upper ' bindscroll to lower=' lower ' bindscroll=' roll ' roll-in-view=' { { to view } } scroll-top=' { { scroll-top } } ' view class=' scroll-view-item ' view class=' view-item-IP ' { r . IP } }/view/view view view view view class=' weui-cell ' view class='大洲/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . country } }/text/view view class=' weui-cell _ _ ft '国家/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r。省份} }/text/view view class=' weui-cell _ _ ft '省份/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . city } }/text/view view class=' weui-cell _ _ ft '城市/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . district } }/text/view view class=' weui-cell _ _ ft '县区/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . ISP } }/text/view view class=' weui-cell _ _ ft '运营商/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r .区号} }/text/view view class=' weui-cell _ _ ft '行政区划/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . en } }/text/view view class=' weui-cell _ _ ft '国家英文/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . cc } }/text/view view class=' weui-cell _ _ ft '国家缩写/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . LNG } }/text/view view class=' weui-cell _ _ ft '经度/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . lat } }/text/view view class=' weui-cell _ _ ft '纬度/view/view view class=' weui-cell ' view class=' weui-cell _ _ BD ' text { { r . version } }/text/view view class=' weui-cell _ _ ft '版本/view/view/scroll-view view class=' IP-tip '滚动查看内容/view/view/view/view/view/view搜索。 射流研究…
page({ data : { input value : ' ',focus: false,searchFocusCss: ' ',r: [] },onread : function(){ var那=thiswx。请求({ URL : ' https://www。qqzeng。com/IP ',method: 'POST ',data: { ip: 'qqzengip' },header : { ' content-type ' : ' application/x-www-form-URL encoded ' },success : function(RES){ that。setdata({ r : RES . data。data })},fail:函数搜索提交searchSubmit:函数(){ var=thisvar IP=这个。数据。InputVaLueif(IP){ var isip=ip.match(/^([1-9]\d*|0[0-7]*|0x[\da-f])(?\.([1-9]\d*|0[0-7]*|0x[\da-f])(?\.([1-9]\d*|0[0-7]*|0x[\da-f])(?\.([1-9]\ d * | 0[0-7]* |0x[\ da-f])$/I;if(!ISip){ wx。ShowToast({ title : ' IP格式不正确,image : '/images/tip。png ' });返回false} wx.showToast({ title: '搜索中,图标: '正在加载' });wx。请求({ URL : ' https://www。qqzeng。com/IP ',method: 'POST ',data: { ip: ip },header : { ' content-type ' : ' application/x-www-form-URL encoded ' },success : function(RES){ that。setdata({ r : RES . data。data })},fail : function(){//fail } })} },onShareAppMessage:函数(){返回{ title: 'IP地址查询-qqzeng-ip ',path: '/pages/ip/search ',success: function (res) { //分享成功},fail:函数(res) { //分享失败} } }})search.wxss
@导入./common/weui。wxss ';页-节-间距{ margin-top : 0 rpx;}.页面-部分-标题{ text-align :居中;padd : 40 rpx 0 rpx 0 rpx 0 rpxcolor : # 9b9 B9 bfont-size : 36rpx;}@media(最小宽度: 320px) { .IP-卷轴{高度: 640 rpx}}@media(最小宽度: 360px) { .IP-卷轴{高度: 816 rpx}}@media(最小宽度: 375px) { .IP-卷轴{高度: 836 rpx}}@media(最小宽度: 384px) { .IP-卷轴{高度: 826 rpx}}@media(最小宽度: 414px) { .IP-卷轴{高度: 868 rpx}}.滚动查看项目{ height: 90rpx线高: 90 rpx颜色: # 000边框-底部: 1px实心# eee文本对齐:中心;垂直对齐: 中间;margin: 0px 20px}。视图-项目-IP {行高: 90 rpxcolor: # 2ab059display:内联块;font-size : 36rpx}.weui-cell _ _ BD { color : # 2ab 059;}.IP-tip { color : # eee;font-size : 20 rpx文本对齐:中心;衬垫-顶部: 20 rpx}app.json
{ 'pages': [ 'pages/ip/search ',' pages/about/info ',' window ' : { ' backgroundTextStyle ' : ' light ',' navigationbarckgroundcolor ' : ' # 2ab 059 ',' navigationBarTitleText ' : ' IP地址查询,' navigationBarTextStyle ' : ' # ffffff ' },' tabBar ' : { ' color ' : ' # 7a 7e 83 ',' selectedColor': '#2ab059 ',' borderStyle': '#2ab059 ','背景色' : ' # ffffffffff ',' list ' :[{ ' page path ' 33: ' pages/IP/search ',' icon path ' 33333336查询},{ '页面路径' : '页面/关于/信息','图标路径' : '图像/关于。png ',' selectedicinpath ' : ' images/about _ HL。png ',' text': '关于} ] }}SSL证书
安全超文本传输协议请求
坦克激光瞄准镜(坦克激光瞄准器的缩写)仅支持1.2 及以上版本
官网:https://www.qqzeng.com演示:https://www.qqzeng.com/ip开发:https://github。com/曾展/QQ曾叶
希望本文所述对大家微信小程序开发有所帮助。
版权声明:微信小程序开发实现的互联网协议(互联网协议)地址查询功能示例是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。