mui.plusReady(function(){
	// some Ajax
	var data = [
		{level_id: 1, level_name: '一层', helpSaleCount: 2, preGetHelpSale: 123.456},
		{level_id: 2, level_name: '二层', helpSaleCount: 4, preGetHelpSale: 123.456},
		{level_id: 3, level_name: '三层', helpSaleCount: 5, preGetHelpSale: 123.456},
		{level_id: 4, level_name: '四层', helpSaleCount: 7, preGetHelpSale: 123.456},
		{level_id: 5, level_name: '五层', helpSaleCount: 8, preGetHelpSale: 123.456},
		{level_id: 6, level_name: '六层', helpSaleCount: 10, preGetHelpSale: 123.456},
		{level_id: 7, level_name: '七层', helpSaleCount: 17, preGetHelpSale: 123.456},
		{level_id: 8, level_name: '八层', helpSaleCount: 28, preGetHelpSale: 123.456},
		{level_id: 9, level_name: '⑨层', helpSaleCount: 99, preGetHelpSale: 999.999},
	];
	for (let i in data) {
		let each = data[i];
		$("#helpSaleTable").append('<div class="row helpSaleTableRow shadown_wai"><span class="c1">'+each.helpSaleCount+'</span><span class="c2">'+each.preGetHelpSale+'</span>'+
					'<span class="c3">'+each.level_name+'</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');
	})
})