<del id="d4fwx"><form id="d4fwx"></form></del>
      <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

            <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
          • 小程序仿美團(tuán)城市選擇的實(shí)現(xiàn)示例-創(chuàng)新互聯(lián)

            這篇文章將為大家詳細(xì)講解有關(guān)小程序仿美團(tuán)城市選擇的實(shí)現(xiàn)示例,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

            專注于為中小企業(yè)提供成都網(wǎng)站制作、網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)交城免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了近千家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

            具體內(nèi)容如下


            小程序仿美團(tuán)城市選擇的實(shí)現(xiàn)示例

            代碼很簡(jiǎn)單.

            var city = require('../../utils/city.js');
            var app = getApp()
            Page({
             data: {
             searchLetter: [],
             showLetter: "",
             winHeight: 0,
             // tHeight: 0,
             // bHeight: 0,
             cityList: [],
             isShowLetter: false,
             scrollTop: 0,//置頂高度
             scrollTopId: '',//置頂id
             city: "上海市",
             hotcityList: [{ cityCode: 110000, city: '北京市' }, { cityCode: 310000, city: '上海市' }, { cityCode: 440100, city: '廣州市' }, { cityCode: 440300, city: '深圳市' }, { cityCode: 330100, city: '杭州市' }, { cityCode: 320100, city: '南京市' }, { cityCode: 420100, city: '武漢市' }, { cityCode: 410100, city: '鄭州市' }, { cityCode: 120000, city: '天津市' }, { cityCode: 610100, city: '西安市' }, { cityCode: 510100, city: '成都市' }, { cityCode: 500000, city: '重慶市' }]
             },
             onLoad: function () {
             // 生命周期函數(shù)--監(jiān)聽頁面加載
             var searchLetter = city.searchLetter;
             var cityList = city.cityList();
             var sysInfo = wx.getSystemInfoSync();
             var winHeight = sysInfo.windowHeight;
             var itemH = winHeight / searchLetter.length;
             var tempObj = [];
             for (var i = 0; i < searchLetter.length; i++) {
              var temp = {};
              temp.name = searchLetter[i];
              temp.tHeight = i * itemH;
              temp.bHeight = (i + 1) * itemH;
              tempObj.push(temp)
             }
             this.setData({
              winHeight: winHeight,
              itemH: itemH,
              searchLetter: tempObj,
              cityList: cityList
             })
            
             },
             onReady: function () {
             // 生命周期函數(shù)--監(jiān)聽頁面初次渲染完成
            
             },
             onShow: function () {
             // 生命周期函數(shù)--監(jiān)聽頁面顯示
            
             },
             onHide: function () {
             // 生命周期函數(shù)--監(jiān)聽頁面隱藏
            
             },
             onUnload: function () {
             // 生命周期函數(shù)--監(jiān)聽頁面卸載
            
             },
             onPullDownRefresh: function () {
             // 頁面相關(guān)事件處理函數(shù)--監(jiān)聽用戶下拉動(dòng)作
            
             },
             onReachBottom: function () {
             // 頁面上拉觸底事件的處理函數(shù)
            
             },
             clickLetter: function (e) {
             console.log(e.currentTarget.dataset.letter)
             var showLetter = e.currentTarget.dataset.letter;
             this.setData({
              showLetter: showLetter,
              isShowLetter: true,
              scrollTopId: showLetter,
             })
             var that = this;
             setTimeout(function () {
              that.setData({
              isShowLetter: false
              })
             }, 1000)
             },
             //選擇城市
             bindCity: function (e) {
             console.log("bindCity")
             this.setData({ city: e.currentTarget.dataset.city })
             },
             //選擇熱門城市
             bindHotCity: function (e) {
             console.log("bindHotCity")
             this.setData({
              city: e.currentTarget.dataset.city
             })
             },
             //點(diǎn)擊熱門城市回到頂部
             hotCity: function () {
             this.setData({
              scrollTop: 0,
             })
             }
            })

            關(guān)于“小程序仿美團(tuán)城市選擇的實(shí)現(xiàn)示例”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。

            文章題目:小程序仿美團(tuán)城市選擇的實(shí)現(xiàn)示例-創(chuàng)新互聯(lián)
            分享URL:http://www.jbt999.com/article4/eoooe.html

            成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動(dòng)態(tài)網(wǎng)站網(wǎng)站維護(hù)、品牌網(wǎng)站制作手機(jī)網(wǎng)站建設(shè)、搜索引擎優(yōu)化、面包屑導(dǎo)航

            廣告

            聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

            商城網(wǎng)站建設(shè)

              <del id="d4fwx"><form id="d4fwx"></form></del>
              <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

                    <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
                  • 亚洲免费大片 | 99视频在线免费 | 人人看人人摸人人操 | 好逼网站 | 亚洲成人黄色影院 |