index.vue 840 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="content">
  3. <web-view :src="url"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. import {
  8. H5_url
  9. } from '@/config.js'
  10. import {
  11. mapGetters
  12. } from 'vuex'
  13. export default {
  14. data() {
  15. return {
  16. url: ''
  17. }
  18. },
  19. onHide() {
  20. eventChannel.off('acceptDataFromOpenerPage') //取消监听
  21. },
  22. computed: {
  23. ...mapGetters([
  24. 'Token',
  25. ])
  26. },
  27. onLoad(options) { //测试时候需进行加密处理
  28. const eventChannel = this.getOpenerEventChannel()
  29. eventChannel.on('acceptDataFromOpenerPage',(data) => {
  30. this.url = H5_url + options.url + `?value=${data.value || null}&token=${this.Token}&appId=${uni.getStorageSync('storage_users').uid}`
  31. })
  32. },
  33. }
  34. </script>
  35. <style>
  36. .content {
  37. display: flex;
  38. flex-direction: column;
  39. align-items: center;
  40. justify-content: center;
  41. }
  42. </style>