<template>
	<view v-if="params.url">
		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content"></block>
		</cu-custom>
		<web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				params: {},
				webviewStyles: {
					progress: {
						color: "#FF3333"
					}
				}
			}
		},
		props: {
			src: {
				type: [String],
				default: null
			}
		},
		onLoad(event) {
			this.params = event
			if (event.title) {
				uni.setNavigationBarTitle({
					title: event.title
				})
			}
		}
	}
</script>