• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專(zhuān)題視頻專(zhuān)題問(wèn)答1問(wèn)答10問(wèn)答100問(wèn)答1000問(wèn)答2000關(guān)鍵字專(zhuān)題1關(guān)鍵字專(zhuān)題50關(guān)鍵字專(zhuān)題500關(guān)鍵字專(zhuān)題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專(zhuān)題關(guān)鍵字專(zhuān)題tag2tag3文章專(zhuān)題文章專(zhuān)題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專(zhuān)題3
    問(wèn)答文章1 問(wèn)答文章501 問(wèn)答文章1001 問(wèn)答文章1501 問(wèn)答文章2001 問(wèn)答文章2501 問(wèn)答文章3001 問(wèn)答文章3501 問(wèn)答文章4001 問(wèn)答文章4501 問(wèn)答文章5001 問(wèn)答文章5501 問(wèn)答文章6001 問(wèn)答文章6501 問(wèn)答文章7001 問(wèn)答文章7501 問(wèn)答文章8001 問(wèn)答文章8501 問(wèn)答文章9001 問(wèn)答文章9501
    當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

    微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能示例

    來(lái)源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 21:59:35
    文檔

    微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能示例

    微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能示例:本文實(shí)例講述了微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能。分享給大家供大家參考,具體如下: 微信小程序 開(kāi)發(fā) 參考 https://mp.weixin.qq.com/debug/wxadoc/dev/component/ search.wxml <view class=container> &
    推薦度:
    導(dǎo)讀微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能示例:本文實(shí)例講述了微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能。分享給大家供大家參考,具體如下: 微信小程序 開(kāi)發(fā) 參考 https://mp.weixin.qq.com/debug/wxadoc/dev/component/ search.wxml <view class=container> &

    本文實(shí)例講述了微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能。分享給大家供大家參考,具體如下:

    微信小程序 開(kāi)發(fā) 參考   https://mp.weixin.qq.com/debug/wxadoc/dev/component/

    search.wxml

    <view class="container">
     <view class="page-body">
     <view class="weui-search-bar {{searchFocusCss}}" id="searchBar">
     <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="searchInput" placeholder="輸入IP" confirm-type="search" bindinput="bindKeyInput" bindconfirm="searchSubmit" value="{{searchValue}}" focus="{{focus}}" />
     <a href="javascript:" rel="external nofollow" class="weui-icon-clear" id="searchClear" bindtap="searchClearClick"></a> 
     </view>
     <view class="weui-search-bar__label" id="searchText" bindtap="searchTextClick">
     <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="searchCancel" bindtap="searchCancelClick">取消</view>
     </view>
     </view>
     <view class="page-section">
     <view class="page-section-title">
     <text>查詢結(jié)果</text>
     </view>
     <view class="page-section-spacing">
     <scroll-view scroll-y="true" class="ip-scroll" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
     <view class="scroll-view-item">
     <view class="view-item-ip"> {{r.ip}}</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.continent}}</text>
     </view>
     <view class="weui-cell__ft">大洲</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.country}}</text>
     </view>
     <view class="weui-cell__ft">國(guó)家</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.province}}</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">縣區(qū)</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.isp}}</text>
     </view>
     <view class="weui-cell__ft">運(yùn)營(yíng)商</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.areacode}}</text>
     </view>
     <view class="weui-cell__ft">行政區(qū)劃</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.en}}</text>
     </view>
     <view class="weui-cell__ft">國(guó)家英文</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.cc}}</text>
     </view>
     <view class="weui-cell__ft">國(guó)家縮寫(xiě)</view>
     </view>
     <view class="weui-cell">
     <view class="weui-cell__bd">
     <text>{{r.lng}}</text>
     </view>
     <view class="weui-cell__ft">經(jīng)度</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">滾動(dòng)查看內(nèi)容</view>
     </view>
     </view>
    </view>
    
    

    search.js

    Page({
     data: {
     inputValue: '',
     focus: false,
     searchFocusCss: '',
     r: []
     },
     onReady: function () {
     var that = this;
     wx.request({
     url: 'https://www.qqzeng.com/ip',
     method: 'POST',
     data: {
     ip: 'qqzengip'
     },
     header: { 'content-type': 'application/x-www-form-urlencoded' },
     success: function (res) {
     that.setData({
     r: res.data.data
     })
     },
     fail: function () {
     // fail
     },
     complete: function () {
     // complete
     }
     })
     },
     searchTextClick: function () {
     this.setData({ searchFocusCss: 'weui-search-bar_focusing', focus: true })
     },
     searchCancelClick: function () {
     this.setData({ searchFocusCss: '', focus: false })
     },
     searchClearClick: function () {
     this.setData({ searchValue: '', focus: true })
     },
     bindKeyInput: function (e) {
     this.setData({ inputValue: e.detail.value })
     },
     //搜索提交
     searchSubmit: function () {
     var that = this;
     var ip = this.data.inputValue;
     if (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' });
     return false;
     }
     wx.showToast({
     title: '搜索中',
     icon: 'loading'
     });
     wx.request({
     url: 'https://www.qqzeng.com/ip',
     method: 'POST',
     data: {
     ip: ip
     },
     header: { 'content-type': 'application/x-www-form-urlencoded' },
     success: function (res) {
     that.setData({
     r: res.data.data
     })
     },
     fail: function () {
     // fail
     },
     complete: function () {
     // complete
     wx.hideToast();
     }
     })
     }
     },
     onShareAppMessage: function () {
     return {
     title: 'IP地址查詢-qqzeng-ip',
     path: '/pages/ip/search',
     success: function (res) {
     // 分享成功
     },
     fail: function (res) {
     // 分享失敗
     }
     }
     }
    })
    
    

    search.wxss

    @import "../common/weui.wxss";
    .page-section-spacing {
     margin-top: 0rpx;
    }
    .page-section-title {
     text-align: center;
     padding: 40rpx 0rpx 0rpx 0rpx;
     color: #9b9b9b;
     font-size: 36rpx;
    }
    @media (min-width: 320px) {
     .ip-scroll {
     height: 640rpx;
     }
    }
    @media (min-width: 360px) {
     .ip-scroll {
     height: 816rpx;
     }
    }
    @media (min-width: 375px) {
     .ip-scroll {
     height: 836rpx;
     }
    }
    @media (min-width: 384px) {
     .ip-scroll {
     height: 826rpx;
     }
    }
    @media (min-width: 414px) {
     .ip-scroll {
     height: 868rpx;
     }
    }
    .scroll-view-item {
     height: 90rpx;
     line-height: 90rpx;
     color: #000;
     border-bottom: 1px solid #eee;
     text-align: center;
     vertical-align: middle;
     margin: 0px 20px;
    }
    .view-item-ip {
     line-height: 90rpx;
     color: #2ab059;
     display: inline-block;
     font-size: 36rpx;
    }
    .weui-cell__bd {
     color: #2ab059;
    }
    .ip-tip {
     color: #eee;
     font-size: 20rpx;
     text-align: center;
     padding-top: 20rpx;
    }
    
    

    app.json

    {
     "pages": [
     "pages/ip/search",
     "pages/about/info"
     ],
     "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#2ab059",
     "navigationBarTitleText": "IP地址查詢",
     "navigationBarTextStyle": "#ffffff"
     },
     "tabBar": {
     "color": "#7A7E83",
     "selectedColor": "#2ab059",
     "borderStyle": "#2ab059",
     "backgroundColor": "#ffffff",
     "list": [
     {
     "pagePath": "pages/ip/search",
     "iconPath": "images/location.png",
     "selectedIconPath": "images/location_hl.png",
     "text": "IP查詢"
     },
     {
     "pagePath": "pages/about/info",
     "iconPath": "images/about.png",
     "selectedIconPath": "images/about_hl.png",
     "text": "關(guān)于"
     }
     ]
     }
    }
    
    

    SSL證書(shū)

    HTTPS 請(qǐng)求

    tls 僅支持 1.2 及以上版本

    官網(wǎng):https://www.qqzeng.com
    演示:https://www.qqzeng.com/ip
    開(kāi)發(fā):https://github.com/zengzhan/qqzeng-ip

    希望本文所述對(duì)大家微信小程序開(kāi)發(fā)有所幫助。

    聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能示例

    微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能示例:本文實(shí)例講述了微信小程序開(kāi)發(fā)實(shí)現(xiàn)的IP地址查詢功能。分享給大家供大家參考,具體如下: 微信小程序 開(kāi)發(fā) 參考 https://mp.weixin.qq.com/debug/wxadoc/dev/component/ search.wxml <view class=container> &
    推薦度:
    標(biāo)簽: 微信 小程序 ip地址查詢
    • 熱門(mén)焦點(diǎn)

    最新推薦

    猜你喜歡

    熱門(mén)推薦

    專(zhuān)題
    Top
    主站蜘蛛池模板: 精品国产麻豆免费人成网站| 国产乱人伦偷精品视频免观看| 91精品婷婷国产综合久久| 四虎成人精品| 色偷偷888欧美精品久久久| 无码日韩人妻精品久久蜜桃 | 98视频精品全部国产| 亚洲精品WWW久久久久久| 成人午夜精品久久久久久久小说 | 国产精品白丝jkav网站| 国产乱人伦偷精品视频AAA| 日韩专区亚洲精品欧美专区| 国产AV国片精品一区二区| 国产精品欧美日韩| 国内精品久久久久影院优| 亚洲AV无码久久精品狠狠爱浪潮| 四虎成人精品| 四虎永久在线精品国产馆V视影院| 精品人妻少妇一区二区三区在线 | 久久免费99精品国产自在现线| 911亚洲精品不卡| 四虎最新永久在线精品免费| 国产精品www| 91久久精品91久久性色| 99精品国产高清一区二区麻豆| 久久精品aⅴ无码中文字字幕重口 久久精品a亚洲国产v高清不卡 | 日产欧美国产日韩精品| 亚洲精品无码永久在线观看你懂的| 精品人妻少妇一区二区三区| 精品人妻少妇一区二区| 久久亚洲中文字幕精品一区四| 国产在线精品一区二区三区不卡 | 国产午夜福利精品一区二区三区| 日产精品久久久一区二区| 日韩精品内射视频免费观看| 久久综合国产乱子伦精品免费| 欧美亚洲色综久久精品国产| 久久婷婷国产综合精品| 精品人无码一区二区三区| 精品无码国产自产拍在线观看| 精品国偷自产在线|