菜單按鈕的介紹,點在視頻詳情時會出現菜單按鈕,裏面有多個選項。源碼:https://github.com/limingios/wxProgram.git 中No.15和springboot
官方介紹
https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showActionSheet.html
菜單選項代碼
如果選擇“取消” 不會進入success 方法中。
shareMe:function(){ wx.showActionSheet({ itemList: ["下載到本地","舉報用戶","分享到好友"], success:function(res){ if (res.tapIndex==0){ } else if (res.tapIndex==1){ } else{ } } }) }
PS:菜單選項方便選擇,在日常小程序開發中很常見。