在这个资料文档【https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html】中1.4的例子里
<button open-type="liveActivity" activity-type="1001" bindcreateliveactivity="onLiveActivityCreate">立即呼叫</button>
点击之后会报错
Component "pages/settlement/settlement" does not have a method "onLiveActivityCreate" to handle event "createliveactivity".
然后找到了buttun文档【https://developers.weixin.qq.com/miniprogram/dev/component/button.html】中改为
<button open-type="liveActivity" activity-type="1004" createliveactivity="onLiveActivityCreate">立即支付</button>
同样点击按钮之后 onLiveActivityCreate方法无反应控制台也无打印,所以是createliveactivity还是bindcreateliveactivity?现在情况完全都走不通
用 bindcreateliveactivity ,我试了下没问题呀,能正常获取code。
这个报错是js文件里面没有 onLiveActivityCreate 这个方法,如果你确认有写,看下是不是有编译缓存呢?可以清除编译缓存、重新编译下再试试看。