
	vm = new Vue({
		el: "#app",
		data() {
			return {
				// company: '',
				// arrayList: [],
				// detailObj: [],
			
				statement: [],
				goodInfo: {},
				goodId: 0,
				goods: [],
					 bottom: [],
			}
		},
		created() {
			// console.log(window.location.href)
			this.getGoods()
		},
		methods: {
			getId() {
				let url = document.location.toString();
				let arrUrl = url.split("?");
				if(arrUrl[1]) {
					let id = arrUrl[1].split("=")[1];
					this.goodId = id * 1
				}
			},
			getGoods() {
				let data = {
					limit:10000
				}
				let ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product'
				AJAX('get', ajaxUrl, data, ({ data }) => {
					data.list.forEach(item => {
						if (item.category_ids === '67' || item.category_ids === '68' || item.category_ids === '69') {
							item.coverimage = 'http://lanbo.frp.liuniu946.com/' + item.coverimage
							item.content = item.content.replace(/src="/g,'src="http://lanbo.frp.liuniu946.com/')
							this.goods.push(item)
						}
						if (item.category_ids=== '64') {
							this.bottom.push(item)
						}
						if (item.category_ids=== '65') {
							this.statement.push(item)
							console.log(this.statement)
						}
					});
					this.getId()
					console.log(this.goodId)
					if(this.goodId == 0){
						this.goodInfo = this.goods[0]
					}else {
						this.goods.forEach( (item) => {
							if(item.id == this.goodId)
							this.goodInfo = item
						})
					}
				})
			}
		}

	});
	// var datas = {

	// };
	// var getId = localStorage.getItem('id');
	// var data = {
	// 	id: getId
	// };
	// var ajaxUrl = 'http://lanbo.frp.liuniu946.com/apis/product';
	// AJAX('get', ajaxUrl, data, function (res) {
	// 	vm.detailObj = res.data.list.filter(item => item.id == getId)
	// 	console.log(vm.detailObj)
	// })
	// 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.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)
	// 	})
	// })
