<template>
	<view class="container">
		<web-view class="web-view" :src="web_url"></web-view>
	</view>
</template>

<script>
	const params = require('../../common/params.js');
	const config = require('../../common/config.js');
	const common = require('../../common/common.js');
	var http = require('../../common/http.js');
	var storage = require('../../common/storage.js');
	export default {
		data() {
			return {
				web_url: '',
			};
		}
		/**
		 * 生命周期函数--监听页面加载
		 */
		,
		onLoad: function(options) {
			const macid = options.macid;
			const token = storage.getApiToken()
			const web_zxbms_url = params.web_zxbms_url
			const web_bms_url = params.web_bms_url
			const hostApi = storage.getApiUrl();
			const time = Date.now()
			const title = options.macid;
			//这里做个判断
			if (hostApi == 'https://bmsapi.bms16.com/') {
				this.web_url = web_bms_url + 'monitorGooglePhone?macid=' + macid + '&time=' + time +'&token=' + token
			} else {
				this.web_url = web_zxbms_url + 'monitorGooglePhone?macid=' + macid + '&time=' + time +'&token=' + token
			}
			setTimeout(function() {
				uni.setNavigationBarTitle({
					title: title
				});
			}, 2000);
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function() {},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide: function() {},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function() {},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh: function() {},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom: function() {},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {},
		methods: {

		}
	};
</script>
<style>
	@import './deviceLocal.css';
</style>