index.vue 884 B

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