<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                > 效果如圖 ![](https://box.kancloud.cn/43dbbf35e9fcdd09111b1f367467346f_242x220.gif) >1. 制作component組件 在組件中通過play是否為true控制: 圖片是否加`rotate` 旋轉屬性,以及播放圖片的src ``` --music.wxml-- <view class="banner"> <image class="{{play?'rotate':''}}" src="/images/banner.png" /> <image class="play" src="{{play?'/images/play.png':'/images/pause.png'}}" mode="widthFix" bindtap="onMusic"/> </view> ``` ``` --rotate動畫-- .rotate { animation: rotate 3s linear infinite; //linear線性平滑過渡 } @keyframes rotate { 0% { transform: rotate(0);} 100% { transform: rotate(360deg);} } ``` >2. 注冊并使用組件 先在index.json中注冊組件 ``` "usingComponents":{ "v-music": "/components/music/music" } ``` 再在index.wxml中使用并通過屬性傳遞數據 ``` <v-music title="{{music.title}}" url="{{music.url}}"></v-music> ``` >3. 組件接受所需數據 ``` --music.js-- properties: { title: String, url: String } ``` >4. 實現點擊功能 ``` const audio = wx.getBackgroundAudioManager(); methods: { onPlay(){ if(this.data.isPlay){ audio.pause(); this.setData({ isPlay: !this.data.isPlay }) }else{ audio.title = this.properties.mTitle; audio.src = this.properties.mUrl; this.setData({ isPlay: !this.data.isPlay }); } } }, attached(){ /* 音樂播放 */ audio.onPlay(()=>{ this.setData({ play: true }); }); /* 暫停 */ audio.onPause(()=>{ this.setData({ play: false }); }); /* 停止 */ audio.onStop(()=>{ this.setData({ play: false }); }); /* 播放完 */ audio.onEnded(()=>{ this.setData({ play: false }); }); } ```
                  <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>

                              哎呀哎呀视频在线观看