| onShareAppMessage: function(res) {  console.log(res.from);  let _this = this;  let shareObj = {    title: '自定义转发标题',    path: '/pages/main/main',    //imageUrl: _this.cardPic,    success: function(res) {      console.log("转发成功!");      console.log(res);    }  }  console.log(shareObj);  returnshareObj;} | 
不管是点击右上角的分享,还是按钮设置 open-type="share"
都没有执行这个 onShareAppMessage 方法
基础库版本:154
网友回复:
找到原因了。。。竟然是被自动创建的onShareAppMessage空白方法覆盖了
不说了,脸已红。。。。。
我也碰到了这个情况。你说的“被自动创建的onShareAppMessage空白方法覆盖了”,具体是怎样的?为什么还会有自动创建的空白方法呢?
创建页面的时候,开发工具不是自动创建了page.js文件吗
那个文件里面,默认初始化了很多常用方法,其中就包括 onShareAppMessage
 
                   
                
                   
                   
                
                   
                
         
     
		 
					 
	 
     
     
 
            
 
			



 
                  
                  
                  
                  
                  
                  
                     