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

<script>
	import {
		getTPigKFCToken,
		getTPigCinemaToken,
		getGatewayToken
	} from '../../../Utils/Api.js';
	let app = getApp();
	export default {
		data() {
			return {
				url: '',
				typeId: ''
			}
		},
		onLoad(options) {
			this.typeId = options.id;
			this.reqUlr();
		},
		methods: {
			reqUlr() {
				if (this.typeId == 1) {
					let params = {
						userId: app.globalData.userInfo.id
					}
					getTPigKFCToken(params).then(res => {
						if (res.return_code == '000000') {
							this.url = res.return_data;
						}
					})
				} else if (this.typeId == 2) {
					let params = {
						userId: app.globalData.userInfo.id
					}
					getTPigCinemaToken(params).then(res => {
						if (res.return_code == '000000') {
							this.url = res.return_data;
						}
					})
				} else if (this.typeId == 3) {
					let params = {
						userId: app.globalData.userInfo.id
					}
					getGatewayToken(params).then(res => {
						if (res.return_code == '000000') {
							this.url = res.return_data;
						}
					})
				}
			}
		}
	}
</script>

<style>

</style>