detail.vue 906 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <web-view :src="url"></web-view>
  3. </template>
  4. <script>
  5. import {h5BaseUrl} from '../utils/config'
  6. export default {
  7. data () {
  8. return {
  9. url:''
  10. }
  11. },
  12. onLoad(options){
  13. const queryObj={
  14. ChartInfoId:options.chartInfoId,
  15. source:'ybxcx_my_chart',
  16. token:this.$store.state.user.token||uni.getStorageSync("token"),
  17. timestamp:new Date().getTime(),//防止缓存
  18. }
  19. let queryObjStr=''
  20. for (const key in queryObj) {
  21. if(!queryObjStr){
  22. queryObjStr=`${key}=${queryObj[key]}`
  23. }else{
  24. queryObjStr=`${queryObjStr}&${key}=${queryObj[key]}`
  25. }
  26. }
  27. console.log('拼接字符串:',queryObjStr);
  28. this.url=`${h5BaseUrl}/hzyb/chart/detail?${queryObjStr}#wechat_redirect`
  29. }
  30. }
  31. </script>
  32. <style>
  33. </style>