<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題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關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        微信小程序開發實現的IP地址查詢功能示例

        來源:懂視網 責編:小采 時間:2020-11-27 21:59:35
        文檔

        微信小程序開發實現的IP地址查詢功能示例

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

        本文實例講述了微信小程序開發實現的IP地址查詢功能。分享給大家供大家參考,具體如下:

        微信小程序 開發 參考   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>查詢結果</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">國家</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">縣區</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.areacode}}</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>
        
        

        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": "關于"
         }
         ]
         }
        }
        
        

        SSL證書

        HTTPS 請求

        tls 僅支持 1.2 及以上版本

        官網:https://www.qqzeng.com
        演示:https://www.qqzeng.com/ip
        開發:https://github.com/zengzhan/qqzeng-ip

        希望本文所述對大家微信小程序開發有所幫助。

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        微信小程序開發實現的IP地址查詢功能示例

        微信小程序開發實現的IP地址查詢功能示例:本文實例講述了微信小程序開發實現的IP地址查詢功能。分享給大家供大家參考,具體如下: 微信小程序 開發 參考 https://mp.weixin.qq.com/debug/wxadoc/dev/component/ search.wxml <view class=container> &
        推薦度:
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 看成年女人免费午夜视频| 99999久久久久久亚洲| 成人特级毛片69免费观看| 成人永久免费福利视频网站| 亚洲 欧洲 日韩 综合在线| 97无码免费人妻超级碰碰碰碰| 亚洲国产精品久久丫| 69天堂人成无码麻豆免费视频| 91亚洲精品麻豆| 91在线视频免费播放| 亚洲heyzo专区无码综合| 国产免费一区二区三区VR| 免费观看四虎精品成人| 国产精品亚洲综合专区片高清久久久 | 国产精品无码免费专区午夜| 亚洲av午夜成人片精品电影| jzzjzz免费观看大片免费| 亚洲av之男人的天堂网站| 精品国产免费人成电影在线观看 | 日韩在线视精品在亚洲| 亚洲性日韩精品一区二区三区| 好吊色永久免费视频大全 | 国产免费久久久久久无码| 亚洲精品无码MV在线观看| 中文字幕亚洲免费无线观看日本| 亚洲Av高清一区二区三区| 国产成人免费a在线视频色戒| 国产精品九九久久免费视频| 亚洲A∨无码无在线观看| 一二三四在线播放免费观看中文版视频 | 国产精品成人免费视频网站京东| 九九精品国产亚洲AV日韩| 国产午夜亚洲精品午夜鲁丝片| 97av免费视频| 国产亚洲精品AAAA片APP | 亚洲美女高清一区二区三区 | 999国内精品永久免费视频| 国产成人综合亚洲| 久久久久亚洲av无码专区蜜芽| 毛片a级毛片免费观看免下载| 一本一道dvd在线观看免费视频|