<template>
	<view>
    <!-- #ifdef H5-->
    <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
                 left-icon="left" title="文件预览" @clickLeft="back"/>
    <!-- #endif -->

    <web-view v-if="contract.url" :webview-styles="webviewStyles" :src="contract.url"></web-view>


	</view>
</template>

<script>

  export default {
    components: {

    },
		data() {
			return {
        contract:null,
        webviewStyles: {
          progress: {
            color: '#ffffff'
          }
        },
			}
		},

    onLoad(e) {
      if ( e.contract){
        this.contract = JSON.parse(e.contract)
      }
    },

		methods: {
      back() {
        let pages = getCurrentPages()
        if (pages.length > 1) {
          uni.navigateBack({
            delta: 1,
            fail: err => {
              console.log(err)
            }
          })
        } else {
          uni.switchTab({
            url: '/pages/index/index'
          });
        }
      },
		}
	}
</script>

<style>

</style>
