2

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


流年朝朝
128 声望12 粉丝

但行好事,莫问前程