洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.3 KiB

8 months ago
  1. <template>
  2. <view class="page-web">
  3. <!-- 签署合同webview -->
  4. <view class="page-inner">
  5. <web-view :src="$store.state.webViewUrl" @message="message" @onPostMessage="handlePostMessage"></web-view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import learnDriveApi from '@/api/learnDrive.js'
  11. export default {
  12. data() {
  13. return {
  14. title: '加载中...',
  15. trainingApplyId: ''
  16. }
  17. },
  18. onLoad(options) {
  19. this.trainingApplyId = options.id
  20. let _this = this
  21. // const currentWebview = _this.$mp.page.$getAppWebview();
  22. this.shang()
  23. },
  24. mounted() {
  25. },
  26. methods: {
  27. shang() {
  28. let _this = this
  29. var currentWebview = this.$scope.$getAppWebview();
  30. setTimeout(()=>{
  31. console.log('currentWebview')
  32. console.log(currentWebview)
  33. let wv = currentWebview.children()[0]
  34. wv.addEventListener('loaded', async function () {
  35. let webVeiwUrl = wv.getURL()
  36. console.log(webVeiwUrl)
  37. var reg = RegExp(/wait/i);//signaturecallback
  38. if(reg.test(webVeiwUrl)){
  39. console.log('匹配成功了')
  40. uni.navigateTo({
  41. url: '/pages/learnDriveStep/payMoney/payMoney?trainingApplyId='+_this.trainingApplyId
  42. })
  43. }
  44. console.log('监听到了————————————————————')
  45. }, false);
  46. },500)
  47. },
  48. handlePostMessage(e) {
  49. console.log('好消息' + e)
  50. }
  51. },
  52. onReady() {
  53. // #ifdef APP-PLUS
  54. // var wv;
  55. // var height = 0;
  56. // uni.getSystemInfo({
  57. // //成功获取的回调函数,返回值为系统信息
  58. // success: (sysinfo) => {
  59. // height = sysinfo.windowHeight; //自行修改,自己需要的高度 此处如底部有其他内容,可以直接---(-50)这种
  60. // },
  61. // complete: () => {}
  62. // });
  63. // var currentWebview = this.$scope
  64. // .$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
  65. // console.log(height)
  66. // setTimeout(function() {
  67. // wv = currentWebview.children()[0]
  68. // wv.setStyle({
  69. // top: 70,
  70. // height: height
  71. // })
  72. // }, 1000); //如果是页面初始化调用时,需要延时一下
  73. // #endif
  74. }
  75. }
  76. </script>
  77. <style>
  78. .page-web {
  79. flex: 1;
  80. width: 100%;
  81. flex-direction: column;
  82. }
  83. .page-inner {
  84. flex: 1;
  85. }
  86. </style>