detail.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. chartSource: options.chartSource,
  16. chartCode:options.chartCode,
  17. source:'ybxcx_my_chart',
  18. classifyId:options.classifyId||'',
  19. token:this.$store.state.user.token||uni.getStorageSync("token"),
  20. timestamp:new Date().getTime(),//防止缓存
  21. }
  22. let queryObjStr=''
  23. for (const key in queryObj) {
  24. if(!queryObjStr){
  25. queryObjStr=`${key}=${queryObj[key]}`
  26. }else{
  27. queryObjStr=`${queryObjStr}&${key}=${queryObj[key]}`
  28. }
  29. }
  30. console.log('拼接字符串:',queryObjStr);
  31. this.url=`${h5BaseUrl}/hzyb/chart/detail?${queryObjStr}#wechat_redirect`
  32. }
  33. }
  34. </script>
  35. <style>
  36. </style>