weboffice.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view>
  3. <web-view :src="src"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. import { getToken } from '@/utils/auth'
  8. export default {
  9. data() {
  10. return {
  11. src:'',
  12. params: {},
  13. webviewStyles: {
  14. progress: {
  15. color: "#FF3333"
  16. }
  17. }
  18. }
  19. },
  20. props: {
  21. // src: {
  22. // type: [String],
  23. // default: null
  24. // }
  25. },
  26. onLoad(e) {
  27. this.params = JSON.parse(decodeURIComponent(e.data))
  28. console.log(this.params,123)
  29. var token=getToken()
  30. // const token = await tokenInvalidReturnInfo(3)
  31. let data = {
  32. file_id: this.params.fileId,
  33. type: this.params.type,
  34. // handel_type: this.params.handelType,
  35. token: token
  36. }
  37. console.log(data,2)
  38. this.src = '/hybrid/html/web-office.html?data='+encodeURIComponent(JSON.stringify(data))
  39. // this.params = event
  40. // if (event.title) {
  41. // uni.setNavigationBarTitle({
  42. // title: event.title
  43. // })
  44. // }
  45. // wpsInit(){
  46. // }
  47. }
  48. }
  49. </script>