chapterDetail.vue 877 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <web-view :src="url" @message="handleGetMessage"/>
  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 chapterId=options.chapterId
  15. let fromPage=options.fromPage||''
  16. const timestamp=new Date().getTime()
  17. const token=this.$store.state.user.token
  18. this.url=`${h5BaseUrl}/hzyb/report/chapterdetail?chapterId=${chapterId}&fromPage=${fromPage}&token=${token}&timestamp=${timestamp}#wechat_redirect`
  19. },
  20. onShareAppMessage() {
  21. return {
  22. title:msgObj.title,
  23. path:`/pages-report/chapterDetail?chapterId=${msgObj.chapterId}`
  24. }
  25. },
  26. methods: {
  27. handleGetMessage(e){
  28. const data=e.detail.data[e.detail.data.length-1]
  29. console.log('h5传来的数据',data);
  30. this.msgObj=data
  31. }
  32. }
  33. };
  34. </script>