

	vm = new Vue({
		el: '#app',
		data: {
			loopProduct: [],
			imgUrl: 'http://lanbo.frp.liuniu946.com',
			about: '',
			company:'',
			company_cover: '',
			serviceList: [],
			recommendProductList: [],

			//文章分类id
			// category_ids: '',
			//首页文章
			arrayList: [],
			moreServiceList: [],
			bottom:'',
			//最新项目
			 latestProjectList:[],
			 //人物介绍
			 characterList:[],
			 blogList:[],//博客文章
			 statement:''
		},
		created() {
			let obj = this;
			var datas = {};
			var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/index';
			AJAX('get', ajaxUrl, datas, function(res) {
				console.log(res);
				var src = res.data.banners;
				obj.$nextTick(function () {
					// 判断是否已经加载
					const b = document.body.querySelector('#showBanner');
					console.log(b);
					// 已经加载删除原先加载对象重新加载
					if(b){
						document.body.removeChild(b)
					}
					let a =	document.createElement('script');
					a.setAttribute('type','text/javascript');
					a.setAttribute('src','js/init.js');
					a.setAttribute('id','showBanner');
					document.body.appendChild(a);
				})
				
				if (src) {
					vm.loopProduct = src.split(',');
				}
				vm.about = res.data.about_us;
			
				vm.company_cover = res.data.company_cover;
				vm.serviceList = res.data.cases;
			});
		
			
		var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
		AJAX('get', ajaxUrl, datas, function(res) {
			vm.statement = res.data.list.filter(item => item.category_ids == "65")
			console.log(vm.statement)
		})
		var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
		AJAX('get', ajaxUrl, datas, function(res) {
			vm.bottom = res.data.list.filter(item => item.category_ids == "64")
			console.log(vm.bottom)
		})
		
		
			var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
		
				AJAX('get',ajaxUrl,datas,function(res){
				vm.arrayList = res.data.list.filter(item => item.category_ids == "51")
				// vm.arrayList = res.data.list;
				console.log(vm.arrayList)
			
			
			});
			
			var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
					
				AJAX('get',ajaxUrl,datas,function(res){
				vm.company = res.data.list.filter(item => item.category_ids == "41")
				// vm.arrayList = res.data.list;
				console.log(vm.company)
			
			
			});
			
			var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
			AJAX('get', ajaxUrl, datas, function(res) {
				vm.moreServiceList = res.data.list.filter(item => item.category_ids == "53")
				// vm.arrayList = res.data.list;
				console.log(vm.moreServiceList)
			});
			//最新项目
			var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
			AJAX('get', ajaxUrl, datas, function(res) {
				vm.latestProjectList = res.data.list.filter(item => item.category_ids == "54")
				// vm.arrayList = res.data.list;
				console.log(vm.latestProjectList)
			});
			//博客
			var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
			AJAX('get', ajaxUrl, datas, function(res) {
				vm.blogList = res.data.list.filter(item => item.category_ids == "44")
				// vm.arrayList = res.data.list;
				console.log(vm.blogList)
			});
	
			
			// var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
			// AJAX('get',ajaxUrl,datas,function(res){
			// 	vm.bottom = res.data.list.filter(item => item.category_ids == "52")
			// 	console.log(vm.bottom)
			// });
			
			//人物介绍
			var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
			AJAX('get',ajaxUrl,datas,function(res){
				vm.characterList = res.data.list.filter(item => item.category_ids == "54")
				console.log(vm.characterList)
			})
			
			
			
		},
		methods:{
			dianji(item) {
				// debugger
				console.log(item);
				
				//存储这个localStronge，存储的是点击的这个内容的id，在需要展示的详情页去接收
				localStorage.setItem('id',item);
			}
			
		}
	});
