<template>
	<view class="">
		<web-view v-if="url1" :src="url1"></web-view>
	</view>
</template>

<script>
	var wv; //计划创建的webview
	export default {
		data() {
			return {
				url1: '',
				canBack: false,

			};
		},
		methods: {
			addViews(data) {
				this.$request('/updateUserViews', 'POST', data).then(res => {
					console.log(res);
				})
			}
		},
		onLoad(e) {
			console.log(e);
			const data = JSON.parse(decodeURIComponent(e.item));
			// return console.log('data',data);
			// let data = JSON.parse(item)
			if(typeof data === 'object'){
				this.addViews({
					oid: this.$store.state.user.openid,
					cid: data.cid
				})
				return this.url1 = data.href
			}
			this.url1=data
		}
	}
</script>

<style lang="scss">
	.custom-back-button {
		position: fixed;
		top: 20px;
		left: 20px;
		background-color: #ffffff;
		padding: 10px;
		border-radius: 5px;
	}
</style>