var App = new Vue({
	el:"#App",
	data: function() {
		return {
			list: []
		}
	},
	onLoad: function() {
		this.getPage();
	},
	methods: {
		pass: function(id) {
			var that = this;
			var id = id;
			$.ajax({
				dataType:"json",
				url: "/index.php?m=friend_apply&a=pass",
				data: {
					id: id
				},
				success: function(res) {
					for (var i in that.list) {
						if (that.list[i].id == id) {
							that.list[i].status = 1;
						}
					}
				}
			})
		},
		forbid: function(id) {
			var that = this;
			$.ajax({
				dataType:"json",
				url: "/index.php?m=friend_apply&a=forbid",
				data: {
					id: id
				},
				success: function(res) {
					for (var i in that.list) {
						if (that.list[i].id == id) {
							that.list[i].status = 4;
						}
					}
				}
			})
		},
		getPage: function() {
			var that = this;
			$.ajax({
				dataType:"json",
				url: "/index.php?m=friend_apply",
				success: function(res) {
					that.list = res.data.list;
				}
			})
		}
	}
})
