reportDetail.vue 909 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <web-view :src="url" @message="handleGetMessage"/></web-view>
  3. </template>
  4. <script>
  5. import {h5BaseUrl} from '@/utils/config'
  6. export default {
  7. data () {
  8. return {
  9. url:'',
  10. msgObj:{}
  11. }
  12. },
  13. onLoad(options) {
  14. let reportId=options.reportId
  15. const timestamp=new Date().getTime()
  16. const token=this.$store.state.user.token
  17. this.url=`${h5BaseUrl}/hzyb/report/detail?reportId=${reportId}&token=${token}&timestamp=${timestamp}#wechat_redirect`
  18. },
  19. onShareAppMessage() {
  20. return {
  21. title:msgObj.title,
  22. path:`/pages-report/reportDetail?reportId=${msgObj.reportId}`
  23. }
  24. },
  25. methods: {
  26. handleGetMessage(e){
  27. const data=e.detail.data[e.detail.data.length-1]
  28. console.log('h5传来的数据',data);
  29. this.msgObj=data
  30. }
  31. }
  32. }
  33. </script>