<template>
  <view>
    <web-view :src="src"></web-view>
  </view>
</template>

<script>
import { getToken } from '@/utils/auth'
export default {
    data() {
      return {
			src:'',
        params: {},
        webviewStyles: {
          progress: {
            color: "#FF3333"
          }
        }
      }
    },
    props: {
      // src: {
      //   type: [String],
      //   default: null
      // }
    },
    onLoad(e) {
		this.params = JSON.parse(decodeURIComponent(e.data))
		console.log(this.params,123)
		var token=getToken()
		// const token = await tokenInvalidReturnInfo(3)
		let data = {
			file_id: this.params.fileId,
			type: this.params.type,
			// handel_type: this.params.handelType,
			token: token
		}
		console.log(data,2)
		this.src = '/hybrid/html/web-office.html?data='+encodeURIComponent(JSON.stringify(data))
		
  //     this.params = event
  //     if (event.title) {
  //       uni.setNavigationBarTitle({
  //         title: event.title
  //       })
  //     }
	 //  wpsInit(){
		
	 //  }
    }
  }
</script>
