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

<script>
	export default {
		data() {
			return {
				url: ''
			};
		},
		onLoad (options) {
			const url = 'http://192.168.100.201'
			const timestamp = new Date().getTime()
			this.url = `${url}?timestamp=${timestamp}`
			uni.onNetworkStatusChange((res) => {
				if (res.isConnected) {
					this.url = `${url}?timestamp=${timestamp}`;
				}
			})
		},
		onUnload () {
			uni.offNetworkStatusChange()
		}
	}
</script>