<template>
	<view>
		<web-view v-if="pagesrc!=null" :src="pagesrc"></web-view>
	</view>
</template>

<script>
	var _this;
	export default {
		data() {
			return {
				pagesrc: null
			}
		},
		onLoad: function(option) {
			_this = this;
			var pagesrc = option.pagesrc || null;
			if (pagesrc == null) {
				uni.showModal({
					title: '温馨提示',
					content: "网页链接不存在。",
					showCancel: false,
					success: function(res) {
						if (res.confirm) {
							uni.navigateBack({
								delta: 1
							});
						}
					}
				});
			} else {
				_this.pagesrc = decodeURIComponent(pagesrc);
			}
		},
		onShareAppMessage: function(res) {
		    return {
				title: "一起运动",
				path: "/pages/tool/webview?pagesrc=" + encodeURIComponent(_this.pagesrc)
		    }
		},
		methods: {}
	}
</script>

<style>

</style>
