AliyunCaptcha.vue 758 B

123456789101112131415161718192021
  1. <template>
  2. <!-- <web-view src="https://uniapp.dcloud.io/static/web-view.html" @message="onMessage"></web-view> -->
  3. <web-view src="https://www.chengxiangjiaoyu.com/indexAli.html" @message="onMessage"></web-view>
  4. </template>
  5. <script>
  6. export default {
  7. methods: {
  8. onMessage(e) {
  9. console.log('e.detail.data[0]',e.detail.data[0]);
  10. const captchaVerifyParam = e.detail.data[0];
  11. // 通过事件通道,触发在业务页面中定义的 'getCaptchaVerifyParam' 事件,并把验证参数发送至业务页面
  12. const eventChannel = this.getOpenerEventChannel();
  13. eventChannel && eventChannel.emit('getCaptchaVerifyParam',captchaVerifyParam);
  14. setTimeout(() => {
  15. uni.navigateBack();
  16. }, 300);
  17. }
  18. }
  19. }
  20. </script>