<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] # 用組件寫音樂播放器 ## wxml ``` <image src="{{isPlay?play:pause}}" class="m-play" bind:tap="onMusic"></image> ``` ## js ``` const audio = wx.getBackgroundAudioManager(); Component({ /** * 組件的屬性列表 */ properties: { image:String, content:String, url:String, title:String }, /** * 組件的初始數據 */ data: { isPlay:false, play:"images/play.png", pause:"images/pause.png" }, /** * 組件的方法列表 */ methods: { onMusic(){ if(this.data.isPlay){ audio.pause(); this.setData({ isPlay:false }) }else{ audio.title = this.properties.title; audio.src=this.properties.url; this.setData({ isPlay:true }) } }, _recoveryMusic(){ if(audio.src==this.properties.url){ this.setData({ isPlay:true }) } if(audio.paused){ this.setData({ isPlay:false }) } }, //監聽 _monitorMusic(){ //監聽音樂播放 audio.onPlay(() => { this.setData({ isPlay: true }) }) //監聽音樂停止 audio.onPause(() => { this.setData({ isPlay: false }) }) audio.onStop(() => { this.setData({ isPlay: false }) }) audio.onEnded(() => { this.setData({ isPlay: false }) }) } }, attached(){ this._recoveryMusic(); this._monitorMusic(); } }) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看