	var openid = helper.cookies.get("openid");
	mui.plusReady(function() {})
	Ajax();
	//获取数据
	function Ajax() {
		$.ajax({
			url: huayi.config.callcenter_url + '/WxLogin/GetProCustomerList',
			data: {
				openid: openid, //微信openid,
			},
			async: true,
			dataType: 'json',
			type: 'get', //HTTP请求类型
			success: function(data) {
				if(data.state.toLowerCase() == "success") {
					
					
					if(data.rows && data.rows.length > 0) {
//						alert(data.rows[0].F_CustomerId);
						var arr = [];
						$(data.rows).each(function(i, n) {
							//alert(data.rows[i].F_CustomerId);
							if (n.ParentId==0) {
								//alert(data.rows[i].F_CustomerId);
								$('<div class="mui-card-header abc" style="background: #2cc6a7;" data-index="'+n.F_CustomerId+'">'+
								'<li class="mui-table-view-cell mui-media mui-col-xs-2">'+
								'<a href="index-list.html" class="Seach" data-index="0">'+
								'<div class="Icon icon-1"><img src="../img/house_icon.png"></div>'+
								'<div class="mui-media-body">房屋一</div>'+
								'</a>'+
								'</li>'+
								'<div class="mui-height"></div>'+
								'<li class="mui-table-view-cell mui-media mui-col-xs-10 font1">'+
								'第一区域绿地新城国际新城国际庄园4号楼2单元2608室'+
								'</li>'+
								'</div>').appendTo('#userList .List_top');
								
								
								//alert($(".abc").attr('data-index'));
								console.log(n.F_CustomerId);
							} else{
								arr.push(n);
							}
							$.each(arr, function(i,v) {
								if(n.F_CustomerId == v.ParentId){
									console.log(v);
									$('<li><span class="font-color3">'+v.CustomerTypeName+
									'</span><span class="font-color2 houses_line">'+v.F_CustomerName+
									'</span></li>').appendTo('#userList ul');
								}
							});
						});
//					f_cust=$(".abc").attr('data-index')
//					$(data.rows).each(function(i, n) {
//							if (data.rows[i].ParentId==f_cust) {
//								//alert(data.rows[i].F_CustomerId);
//								alert("住户")
//							}
//							
//						})
						//工单跳转
						$('.order').on('tap', function() {
							var index = $(this).attr('data-index');
							window.location.href = "details.html?id=" + index + '&itype=' + itype;
	
						});
					}
				}
			},
			error: function(xhr, type, errorThrown) {
				//异常处理；
	
			}
		})
	}