class Common {
	constructor() {

	}

	//跳转
	navTo(url) {
		uni.navigateTo({
			url: url
		})
	}

	goback(url) {
		var page = getCurrentPages();
		//debugger
		console.log(page);
		console.log(url);
		let windpowerstationName = uni.getStorageSync('windpowerstationName');
		page[page.length - 1].$vm.address = windpowerstationName;
		// if(windpowerstationName=="宁夏新能源公司"){
		// 	if(page[page.length-1].route=="components/weatherProphethomepage/WeatherProphethomepage"){
		// 		page[page.length-1].$vm.FDC="MHS_FDC";
		// 	}else{
		// 		page[page.length-1].$vm.FDC="0";
		// 	}
		//  	 }
		//  	 if(windpowerstationName=="麻黄山风电场"){
		//  	 	page[page.length-1].$vm.FDC="MHS_FDC";
		//  	 }
		//  	 if(windpowerstationName=="牛首山风电场"){
		//  	 	page[page.length-1].$vm.FDC="NSS_FDC";
		//  	 }
		//  	 if(windpowerstationName=="石板泉风电场"){
		//  	 	page[page.length-1].$vm.FDC="SBQ_FDC";
		//  	 }
		//  	 if(windpowerstationName=="青山风电场"){
		//  	 	page[page.length-1].$vm.FDC="QS_FDC";
		//  	 }
		//  	 if(windpowerstationName=="香山风电场"){
		//  	 	page[page.length-1].$vm.FDC="XS_FDC";
		//  	 }
		//首页
		if (page[page.length - 1].route == "pages/index/Index") {
			page[page.length - 1].$vm.FDC = uni.getStorageSync('windPowerStationId');
			page[page.length - 1].$vm.target_comprehensive_indicators();
			page[page.length - 1].$vm.target_windSpeed_power();
			page[page.length - 1].$vm.index_windturbine_status();
			page[page.length - 1].$vm.index_electricQuantity();
			page[page.length - 1].$vm.index_target_basic_indicators();
			page[page.length - 1].$vm.index_curve_columnar_windSpeed_power();

		} else if (page[page.length - 1].route == "components/monitor/MatrixMonitor") {
			page[page.length - 1].$vm.FDC = uni.getStorageSync('windPowerStationId');
			page[page.length - 1].$vm.windStationName = windpowerstationName.replace('风电场', '');

		} else if (page[page.length - 1].route == "pages/forecast/Forecast") {

			//#ifdef H5
			page[page.length - 1].$refs.r1.viewUserid();
			page[page.length - 1].$refs.r1.address = uni.getStorageSync('windpowerstationName');
			page[page.length - 1].$refs.r1.FDC = uni.getStorageSync('windPowerStationId');
			page[page.length - 1].$refs.r1.windStationName = windpowerstationName.replace('风电场', '');
			page[page.length - 1].$refs.r1.getWeatherDataToday();
			page[page.length - 1].$refs.r1.getWeatherData7();
			page[page.length - 1].$refs.r1.getWeatherData();
			page[page.length - 1].$refs.r1.getWeatherData40();
			//#endif


			//#ifdef APP-PLUS  
			page[page.length - 1].$vm.$children[0].address = uni.getStorageSync('windpowerstationName');
			page[page.length - 1].$vm.$children[0].FDC = uni.getStorageSync('windPowerStationId');
			page[page.length - 1].$vm.$children[0].windStationName = windpowerstationName.replace('风电场', '');
			page[page.length - 1].$vm.$children[0].getWeatherDataToday();
			page[page.length - 1].$vm.$children[0].getWeatherData7();
			page[page.length - 1].$vm.$children[0].getWeatherData();
			page[page.length - 1].$vm.$children[0].getWeatherData40();
			//#endif
			



		}

		//    uni.showModal({
		// 		title: '提示',
		// 		content: page,
		// 		success: function (res) {
		// 			if (res.confirm) {
		// 				console.log('用户点击确定');
		// 			} else if (res.cancel) {
		// 				console.log('用户点击取消');
		// 			}
		// 		}
		// 	});

		// uni.switchTab({

		// 	url: url,success: function(e) {				
		// 		//if (page[0] == undefined || page[0] == null) return;
		// 			page[page.length-1].onLoad();
		// 		}

		// })


	}


}

let common = new Common();
export default common;
