超碰中文网,91久久精品日日躁夜夜躁欧美,一区二区三区精品道,一区二区国产在线观看,亚洲精品中文字幕乱码一区二区,天天看片高清影视在线观看,久久99精品久久久久蜜桃,久久成人影视

VPS參考測評推薦
專注分享VPS主機優惠信息
衡天云優惠活動
熱網互聯2026年促銷活動
hostkvm優惠促銷活動
zji優惠促銷活動
QQGNET優惠促銷活動
QQGNET優惠促銷活動

微信開發:姐妹實用教程。

主機參考:VPS測評參考推薦/專注分享VPS服務器優惠信息!若您是商家可以在本站進行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務,查看詳情!
我們發布的部分優惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關文章充分了解該商家!若非中文頁面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作

本文主要介紹微信小程序實際小程序實例的相關信息,有需要的朋友可以參考一下。

微信小程序的基礎組件和API已經講完了,我們要回到正題。我們花了很長時間做了一個簡化版的謎,包括段落、圖片、音頻、視頻和四個模塊。本文將帶你簡單描述一下這個小APP,源代碼放在GitHub上歡迎開始。

我能從項目中學到什么?

Tabbar使用模式

網絡呼叫真實接口

裝載用途

Scroll-view實現下拉刷新和上拉加載。

圖像組件對圖像的處理,

音樂和視頻組件的使用

跳轉轉移值使用

等等,等等,等等。。。

App.json全局配置文件

{ & quot頁面& quot:

這里只需要配置程序的全局屬性,每個頁面都需要在pags屬性中引入。有時候tabbar不顯示,可能就是這個原因。tabbar底部的導航項目分為四個,都在列表中。這里主要配置每個底部選項頁面的未勾選顏色背景色、頁面介紹、圖片介紹。窗口屬性主要配置表單的整體顏色、文本顏色和背景顏色,這里的窗口屬性會被每個頁面的窗口屬性覆蓋。

app.wxss

/*整體視圖樣式*/。contains view { Padding:15 rpx 15 rpx 15 rpx 15 rpx;margin -top:15 rpx;margin -bottom:15 rpx;background -顏色:白色;}/*整體頭型*/。top contains view { display:flex;flex -方向:rowalign -項:居中;margin -bottom:18 rpx;}/* * *《阿凡達》風格*/。profile image { width:60 rpx;高度:60rpxborder -半徑:30rpx}/*標題中顯示的名稱和時間的整體樣式*/。top right view { margin -left:15 rpx;顯示器:flexflex -方向:列;}/*用戶名樣式*/。top right name { font -size:18 rpx;}/*時間樣式*/。toprighttime { font -size:14r px;顏色:# b 8 b 2 b 2;margin -top:10 rpx;}/*因為中間部分不一樣,所以不放在整體風格里*/*仰視整體風格*/。bottom view { display:flex;flex -方向:rowjustify -內容:space -之間;align -項:居中;}/*每個項目樣式*/。bottom item view { display:flex;flex -方向:rowalign -項:居中;justify -內容:居中;margin -top:18 rpx;劃-左:10rpx劃-右:10rpx}/*項目樣式中的圖標樣式是共享評論的頂部*/。*/.bottom item image { width:45 rpx;高度:45rpx}/*項目中的文字樣式置頂分享評論*/。底部項目文本{ font -size:15 rpx;顏色:# b 8 b 2 b 2;margin -left:10 rpx;margin -top:8 rpx;}/*分割線樣式*/。pLine{背景:# f3f3f3寬度:100%;身高:15rpx}

App.wxss我把四個模塊分為三個部分:頭部、內容區和底部。因為每頁的頭和底的樣式是一樣的,但是中間部分不一樣,所以我把1和3畫成整體,注釋清楚。

分段模塊

word.wxml

& lt正在加載hidden = & quot{ { loadingHidden } } & quot& gt裝貨...;& ltview class = & quotpLine & quot& gt& lt/view & gt;& lt!--整體物品風格-->;& ltview class = & quot包含視圖& quot& gt& ltview class = & quottopContainsView & quot& gt& ltimage class = & quot個人資料圖像& quotsrc = & quot{ { item.profile _ image } } & quot/& gt;& ltview class = & quottopRightView & quot& gt& lttext class = & quottopRightName & quot& gt{ { item.name } } & lt/text & gt;& lttext class = & quottopRightTime & quot& gt{ { item.passtime } } & lt/text & gt;& lt/view & gt;& lt/view & gt;& lt!--中間內容-->& lttext class = & quot中心內容& quot& gt{ { item.text } } & lt/text & gt;& lt!--仰視圖樣式-->& ltview class = & quot底部視圖& quot& gt& ltview class = & quotbottomItemView&quot& gt& ltimage class = & quotbottomItemImage & quotsrc = & quot../../image/ding . png & quot;/& gt;& lttext class = & quotbottomItemText & quot& gt{ { item.ding } } & lt/text & gt;& lt/view & gt;& ltview class = & quotbottomItemView&quot& gt& ltimage class = & quotbottomItemImage & quotsrc = & quot../../image/Cai . png & quot;/& gt;& lttext class = & quotbottomItemText & quot& gt{ { item.cai } } & lt/text & gt;& lt/view & gt;& ltview class = & quotbottomItemView&quot& gt& ltimage class = & quotbottomItemImage & quotsrc = & quot../../image/share . png & quot;/& gt;& lttext class = & quotbottomItemText & quot& gt{ { item.repost } } & lt/text & gt;& lt/view & gt;& ltview class = & quotbottomItemView&quot& gt& ltimage class = & quotbottomItemImage & quotsrc = & quot../../image/comment . png & quot;/& gt;& lttext class = & quotbottomItemText & quot& gt{ { item.comment } } & lt/text & gt;& lt/view & gt;& lt/view & gt;& lt/view & gt;& lt/block & gt;& lt/scroll -view & gt;在外層,我們用scroll-view對其進行包裝,以加載更多并上拉刷新屬性bindscrolltoupper = " bindscrolltoupper "。當滑動到頂部時,將調用此方法。滑動到底部時,會調用這個方法。一開始可以把頁眉和底部布局畫出來,通過介紹來使用,這樣就不用把四頁都寫完了,自己也能記下來。

word.js

頁面({數據:{列表:

這里通過requestData方法加載數據,該方法接受一個參數,即通過這個參數加載的是最新的還是更多的數據,通過maxtime參數加載下一頁,上一頁的maxtime作為加載下一頁的條件。當加載下一頁的數據時,我們通過concat方法拼接數組并改變加載狀態。Word.wxml和word.json,一個設置內容的字體大小,一個設置導航欄,就不貼了。

圖片模塊

image.wxml

& lt正在加載hidden = & quot{ { loadingHidden } } & quot& gt裝貨...;& ltview class = & quotpLine & quot& gt& lt/view & gt;& lt!--整體物品風格-->;& ltview class = & quot包含視圖& quot& gt& ltview class = & quottopContainsView & quot& gt& ltimage class = & quot個人資料圖像& quotsrc = & quot{ { item.profile _ image } } & quot/& gt;& ltview class = & quottopRightView & quot& gt& lttext class = & quottopRightName & quot& gt{ { item.name } } & lt/text & gt;& lttext class = & quottopRightTime & quot& gt{ { item.passtime } } & lt/text & gt;& lt/view & gt;& lt/view & gt;& lt文本樣式= & quotfont -size:30 rpx & quot;& gt{ { item.text } } & lt/text & gt;& lt!-- gif圖-->;& ltview wx:if = & quot;{{item.is_gif!= 0 } } & quotstyle = & quot位置:相對;"& gt& ltimage class = & quot中心內容& quotsrc = & quot{ { item.cdn _ img } } & quotmode = & quotaspectFill & quot/& gt;& lt/view & gt;& lt!--查看大圖,點擊查看所有圖片--& gt;& lt查看數據-URL = & quot;{ { item.cdn _ img } } & quotdata -height = & quot;{ { item.height } } & quotdata -width = & quot;{ { item.width } } & quotbindtap = & quotlookBigPicture & quotwx:elif = & quot;{ { item.is _ gif = = 0 } } & quotstyle = & quot位置:相對;"& gt& lt!--圖片資源--& gt;& ltimage class = & quot中心內容& quotsrc = & quot{ { item.cdn _ img } } & quotmode = & quotaspectFill & quot/& gt;& lt!--點擊浮動圖片查看詳細圖片查看--& gt;& ltview class = & quotflexView & quot& gt& ltimage src = & quot../../image/see big picture . png & quot;style = & quot寬度:60rpx高度:60rpx"/& gt;& lttext class = & quotflexText & quot& gt點擊查看完整圖片

這里主要看中間部分來區分是不是gif。如果不是gif,可以點擊查看大圖。下面是一個視圖懸浮效果,結合界面和image.wxss。

image.wxss

/*中間文本樣式*/。center content { margin -top:20 rpx;寬度:100%;身高:600rpx}/*中間浮動文本樣式*/。flex view { display:flex;justify -內容:居中;align -項:居中;寬度:100%;身高:80rpx位置:絕對;z-指數:2;頂配:540rpx背景:# 000000;不透明度:0.6}/*浮動文本*/。flexText{ color:白色;font -size:35 rpx;}image.js

var明細= & amp#39;../詳細信息/詳細信息& amp#39;Page({ data: { list: [],maxtime:& amp;#39;& amp#39;,Loadinghidden: false},onload:function(options){//頁面初始化選項是參數this . request data(&;#39;新名單& amp#39;);},/* * *滾動到底部時加載下一頁*/BindScrollTower:function(){ console . log(&;#39;到底&;#39;)this . request data(& amp;#39;列表和。#39;);},/* * * Load data */request data:function(a){ var that = this;wx . request({ URL:& amp;#39;http://api.budejie.com/api/api_open.php&第39名;,數據:{ a: a,c:& amp;#39;數據與信息。#39;,//上一頁的maxtime作為加載下一頁的條件,maxtime: this.data.maxtime,type:&;#39;10 & amp#39;,},方法:& amp#39;獲取& amp#39;,成功:function(RES){ console . log(RES)console . log(& amp;#39;上一頁&;#39;,that.datalist) that.setData({ //拼接數組列表:that . data . list . concat(RES . data . list),加載hidden: true,Maxtime:RES . data . info . Maxtime })} },/* *查看大圖*/看大圖:function(e){ console . log(e);console . log(e . current target . id)//Image URL對應wxml = " { { item.url } } & quotvar URL = e . current target . dataset . URL;//獲取數據-height = & quot;在wxml中對應圖片高度;{ { item.height } } & quotvar height = e . current target . dataset . height;//獲取圖片高度對應的wxml中的data -width = & quot;{ { item.width } } & quotvar width = e . current target . dataset . width;//Request wx . navigate to({ URL:detail+&;#39;?& amp#39;+& amp;#39;url = & amp#39;+URL+& quot;& ampheight = & quot+高度+& quot;& ampwidth = & quot+ width,success:function(RES){ console . log(RES)},fail:function(err){ console . log(err)},}) },OnReady: function () {//頁面渲染完成},onShow: function () {//頁面顯示},onHide: function () {//頁面隱藏},OnUnload: function () {//頁面關閉}})這里主要看lookBigPicture方法ViewData-URL = "{{item。cdn _ img}}" Data-height = "{{item。height}}" Data-width = "{{item。寬度} }”將被替換為。語法使用var URL = e . current target . dataset . URL;傳遞值和傳遞,就像發送請求一樣按照格式去獲取。

[相關建議]

1.下載微信微信官方賬號平臺源代碼。

2.下載投票源代碼

這幾篇文章你可能也喜歡:

  • 暫無相關推薦文章

本文由主機參考刊發,轉載請注明:微信開發:姐妹實用教程。 http://www.k2270.com/115288.html

【騰訊云】領8888元采購禮包,搶爆款云服務器 每月 9元起,個人開發者加享折上折!
打賞
轉載請注明原文鏈接:主機參考 » 微信開發:姐妹實用教程。
主機參考僅做資料收集,不對商家任何信息及交易做信用擔保,購買前請注意風險,有交易糾紛請自行解決!請查閱:特別聲明

評論 搶沙發

評論前必須登錄!