Alipay applet built with uni-app requires marketing component mkt
<!-- #ifdef MP-ALIPAY -->
<mkt
mode="AUTOMATIC"
boothCode="MERCHANT_SELF_TINYAPP"
onError="onError" onRender="onRender" onApplySuccess="onApplySuccess"
/>
<!-- #endif -->
Write the onError, onRender, and onApplySuccess methods directly in the methods will not get the callback
Solution
Write in onload
this.$scope.onRender = this.onRender.bind(this)
this.$scope.onApplySuccess = this.onApplySuccess.bind(this)
this.$scope.onError = this.onError.bind(this)
methods: {
onError (e) {
console.log('mktError2',e)
},
onRender (e) {
console.log('onRender2',e)
},
onApplySuccess (e) {
console.log('onApplySuccess2',e)
},
}
So you can get the callback
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。