欧美free性护士vide0shd,老熟女,一区二区三区,久久久久夜夜夜精品国产,久久久久久综合网天天,欧美成人护士h版

首頁綜合 正文
目錄

柚子快報激活碼778899分享:微信小程序?qū)懸粋€錄音機

柚子快報激活碼778899分享:微信小程序?qū)懸粋€錄音機

http://yzkb.51969.com/

微信小程序?qū)懸粋€錄音機

代碼: wxml:

{{duration}}

wxss:

.container {

display: flex;

flex-direction: column;

align-items: center;

justify-content: center;

height: 84vh;

}

.btn {

margin: 10px;

padding: 10px 20px;

background-color: #4CAF50;

color: white;

border: none;

border-radius: 5px;

}

.duration {

margin-top: -50px;

font-size: 24px;

}

js:

let timer = null;

Page({

data: {

isRecording: false,

recordPath: '',

duration: '00:00'

},

startRecord: function() {

const recorderManager = wx.getRecorderManager();

this.setData({

isRecording: true,

duration: '00:00'

});

let startTime = new Date().getTime();

timer = setInterval(() => {

let currentTime = new Date().getTime();

let diff = currentTime - startTime;

let m = Math.floor(diff / 60000 % 60);

let s = Math.floor(diff / 1000 % 60);

this.setData({

duration: `${this.formatTime(m)}:${this.formatTime(s)}`

});

}, 1000);

recorderManager.start({

format: 'mp3'

});

recorderManager.onStart(() => {

console.log('recorder start');

});

recorderManager.onStop((res) => {

console.log('recorder stop', res);

this.setData({

recordPath: res.tempFilePath,

isRecording: false

});

});

},

stopRecord: function() {

const recorderManager = wx.getRecorderManager();

clearInterval(timer);

recorderManager.stop();

},

playRecord: function() {

this.setData({

// isRecording: true,

duration: '錄音播放'

});

const audioCtx = wx.createInnerAudioContext();

audioCtx.src = this.data.recordPath;

audioCtx.play();

},

formatTime: function(time) {

return time < 10 ? `0${time}` : time;

}

});

json:

{

"usingComponents": {},

"navigationBarTitleText": "錄音機"

}

以上就是實現(xiàn)一個錄音機的小程序!

柚子快報激活碼778899分享:微信小程序?qū)懸粋€錄音機

http://yzkb.51969.com/

推薦文章

評論可見,查看隱藏內(nèi)容

本文內(nèi)容根據(jù)網(wǎng)絡(luò)資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點和立場。

轉(zhuǎn)載請注明,如有侵權(quán),聯(lián)系刪除。

本文鏈接:http://gantiao.com.cn/post/19079271.html

發(fā)布評論

您暫未設(shè)置收款碼

請在主題配置——文章設(shè)置里上傳

掃描二維碼手機訪問

文章目錄