zoukankan      html  css  js  c++  java
  • 小程序

    底部文字分享栏

    1 wx.showActionSheet({
    2       itemList: ['分享到微信', '分享到QQ', '分享到腾讯微博'],
    3       success: function (res) {
    4         console.log(res.tapIndex)
    5       },
    6       fail: function (res) {
    7         console.log(res.errMsg)
    8       }
    9     })

    右上角分享栏

    1 onShareAppMessage: function () {
    2     return {
    3       title: newsData.initData[this.data.newsid].title,
    4       path:'pages/news/news-detail/news-detail'
    5     }
    6   }

    音频播放

     1  playerMusicTap:function(event){
     2     var _this = this;
     3 
     4 
     5     // 1.2版本以后便不在维护
     6     // 判断status
     7     // wx.getBackgroundAudioManager({
     8     //   success:function(res){
     9     //     var status =res.status;
    10     //     if(status!=1){
    11     //       // 没有在播放
    12           
    13     //     }else{
    14     //       wx.pauseBackgroundAudio();
    15     //     }
    16     //   }
    17     // });
    18 
    19     // 1.2版本以后推荐的
    20     const backgroundAudioManager = wx.getBackgroundAudioManager()
    21 
    22     if (backgroundAudioManager.paused == false){
    23           wx.pauseBackgroundAudio();
    24     }else{
    25       backgroundAudioManager.title = newsData.initData[_this.data.newsid].music.title
    26       backgroundAudioManager.epname = newsData.initData[_this.data.newsid].music.title
    27       backgroundAudioManager.singer = '林俊杰'
    28       backgroundAudioManager.coverImgUrl = 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000'
    29       backgroundAudioManager.src = newsData.initData[_this.data.newsid].music.url // 设置了 src 之后会自动播放
    30     }
    31 
    32   
    33   }
  • 相关阅读:
    Final TFS 2008 Feature List
    来看看微软对测试是什么要求
    淘宝设计流程
    Disable try catch
    jQuery validate API
    iPhone手机开发平台入门介绍和教程
    VSSpeedster Speed up your VS 2010
    Where are the SDK tools? Where is ildasm?
    效率高的删除语句truncate table [tablename]
    修改Hosts去除各站广告
  • 原文地址:https://www.cnblogs.com/cisum/p/8721921.html
Copyright © 2011-2022 走看看