mui.plusReady(function(){
	JZL.ajax(qlgUrl('app/user_level/index'), {}, function(data) {
		// console.log(data); //服务器返回响应，根据响应结果，分析是否登录成功；  
		var data = toJson(data, 1);
		console.log(data);
		for (let i in data) {
			let each = data[i];
			$("#helpSaleTable").append('<div class="row helpSaleTableRow shadown_wai"><span class="c1">'+each.count+'</span><span class="c2">'+each.total+'</span>'+
						'<span class="c3">'+each.level+'</span></div>')
		}
	})

	$("#userName").text(localStorage.getItem("userName"))
	JZL.ajax(qlgUrl('app/users/getIndex'), {}, function(data) {
		// console.log(data); //服务器返回响应，根据响应结果，分析是否登录成功；  
		var data = toJson(data, 1);
		if (data.status == 1) {
			userId = parseInt(data.data.user.userId);
			localStorage.setItem("userName", data.data.user.userName)
			$("#userName").text(data.data.user.userName)
			$("#preGetCouponCount").text("预获产品券：￥"+data.data.expectedCouponsNum);
		}
	})
	$("#preGetCoupon").on("tap",function(){
		JZL.openWindow("vouchers.html", "vouchers.html", {
			data_href: 'expectedProduct',
			data_type: '1',
			data_expect: '1'
		})
	})
	$("#myHelpSaleOrder").on("tap", function(){
		mui.openWindow({
			url: 'indent.html',
			id: 'all',
			extras: {
				data_href: 'all'
			},
			createNew: false, //是否重复创建同样id的webview，默认为false:不重复创建，直接显示
			waiting: {
				autoShow: true, //自动显示等待框，默认为true
				title: '正在加载...', //等待对话框上显示的提示内容
			}
		})
	})
	$("#toHelpSale").on("tap", function(){
		JZL.openWindow('zhugouba.html', 'zhugouba.html');
	})
})