來說下 ,小程序的多媒體組件。源碼:https://github.com/limingios/wxProgram.git 中的No.14
站在用戶的角度思考問題,與客戶深入溝通,找到光山網(wǎng)站設(shè)計與光山網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:網(wǎng)站設(shè)計制作、做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、主機(jī)域名、虛擬空間、企業(yè)郵箱。業(yè)務(wù)覆蓋光山地區(qū)。
audio
可以在小程序嵌入一些音樂,歌曲,mp3什么的
image
任何小程序中必然會使用圖片組件
* video
視頻組件,主要視頻播放類的
camera
攝像頭組件,新版才提供的
live-player
直播相關(guān)的,跟自媒體有關(guān)系,在線直播什么的。
live-pusher
直播相關(guān)的,跟自媒體有關(guān)系,在線直播什么的。
懶加載比較常用。
<!--pages/image/image.wxml--> <image?src='https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg'></image> <image?src='{{imageSrc}}'></image> <image?src='{{imageSrc}}'?style='width:200px;height:200pxx'></image> <block?wx:for="{{array}}"> ??<image?src='{{imageSrc}}'?mode='{{item.mode}}'?style='width:250px;height:250x'?lazy-load='{{true}}'?bindload='load'></image> </block>
//?pages/image/image.js Page({ ??/** ???*?頁面的初始數(shù)據(jù) ???*/ ??data:?{ ????imageSrc:'../img/cat.jpg', ????array:?[{ ??????mode:?'scaleToFill', ??????text:?'scaleToFill:不保持縱橫比縮放圖片,使圖片完全適應(yīng)' ????},?{ ??????mode:?'aspectFit', ??????text:?'aspectFit:保持縱橫比縮放圖片,使圖片的長邊能完全顯示出來' ????},?{ ??????mode:?'aspectFill', ??????text:?'aspectFill:保持縱橫比縮放圖片,只保證圖片的短邊能完全顯示出來' ????},?{ ??????mode:?'top', ??????text:?'top:不縮放圖片,只顯示圖片的頂部區(qū)域' ????},?{ ??????mode:?'bottom', ??????text:?'bottom:不縮放圖片,只顯示圖片的底部區(qū)域' ????},?{ ??????mode:?'center', ??????text:?'center:不縮放圖片,只顯示圖片的中間區(qū)域' ????},?{ ??????mode:?'left', ??????text:?'left:不縮放圖片,只顯示圖片的左邊區(qū)域' ????},?{ ??????mode:?'right', ??????text:?'right:不縮放圖片,只顯示圖片的右邊邊區(qū)域' ????},?{ ??????mode:?'top?left', ??????text:?'top?left:不縮放圖片,只顯示圖片的左上邊區(qū)域' ????},?{ ??????mode:?'top?right', ??????text:?'top?right:不縮放圖片,只顯示圖片的右上邊區(qū)域' ????},?{ ??????mode:?'bottom?left', ??????text:?'bottom?left:不縮放圖片,只顯示圖片的左下邊區(qū)域' ????},?{ ??????mode:?'bottom?right', ??????text:?'bottom?right:不縮放圖片,只顯示圖片的右下邊區(qū)域' ????}] ??}, ??load:?function(e){ ????console.log(e.detail); ??}, ??/** ???*?生命周期函數(shù)--監(jiān)聽頁面加載 ???*/ ??onLoad:?function?(options)?{ ??}, ??/** ???*?生命周期函數(shù)--監(jiān)聽頁面初次渲染完成 ???*/ ??onReady:?function?()?{ ??}, ??/** ???*?生命周期函數(shù)--監(jiān)聽頁面顯示 ???*/ ??onShow:?function?()?{ ??}, ??/** ???*?生命周期函數(shù)--監(jiān)聽頁面隱藏 ???*/ ??onHide:?function?()?{ ??}, ??/** ???*?生命周期函數(shù)--監(jiān)聽頁面卸載 ???*/ ??onUnload:?function?()?{ ??}, ??/** ???*?頁面相關(guān)事件處理函數(shù)--監(jiān)聽用戶下拉動作 ???*/ ??onPullDownRefresh:?function?()?{ ??}, ??/** ???*?頁面上拉觸底事件的處理函數(shù) ???*/ ??onReachBottom:?function?()?{ ??}, ??/** ???*?用戶點(diǎn)擊右上角分享 ???*/ ??onShareAppMessage:?function?()?{ ??} })
PS:image在后續(xù)的使用會越來越多,一起學(xué)習(xí)進(jìn)步吧。
分享名稱:「小程序JAVA實戰(zhàn)」小程序多媒體組件(27)
文章地址:http://chinadenli.net/article36/pigppg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT、網(wǎng)站收錄、App開發(fā)、App設(shè)計、微信小程序、品牌網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)