mui.ready(function(){
	var showCityPickerButton = dc('showCityPicker3');	
	mui.ajax({
		data:{},
		dataType: "json",//服务器返回json格式数据
		type:'post',//HTTP请求类型
		url:base_path + '/placeInfo/get_placeInfo_detail',
		timeout:10000,//超时时间设置为10秒；
		success:function(data){
			//服务器返回响应
			console.log(data);
			var tips="";
			var roleName=data.returnMsg.placeInfo.roleName;
			var placeInfoStus = data.returnMsg.placeInfo.placeInfoStus;
			if(placeInfoStus == 1){
				$('#updateBtn').show();
			}
			if(data.resultCode=="200"){
				var btn=dc('btn_submit');
				switch (data.returnCode){
				case 2002:
					btn.setAttribute('disabled','disabled');
					break;
				default:
				    btn.removeAttribute('disabled');
				    btn.className='mui-btn mui-btn-block mui-btn-red';
				    btn.innerText='马上修改';
					break;
				}
				
				dc('nickname').innerText=decodeURI(data.returnMsg.placeInfo.userNickname);
				dc('userhead').src=data.returnMsg.placeInfo.userHead;
				dc('userRoleName').innerText=data.returnMsg.placeInfo.roleName;

				var tel=data.returnMsg.placeInfo.tel;
				tel==null?'':dc('ipt-phone').innerText=tel;
				var name=data.returnMsg.placeInfo.name;
				name==null?'':dc('ipt-shop-name').innerText=name;
				var areaName=data.returnMsg.placeInfo.areaName;
				areaName==null?'':dc('city').innerText=areaName;
				var detailsAdress=data.returnMsg.placeInfo.addr;
				detailsAdress==null?'':dc('ipt-address').innerText=detailsAdress;
				var username=data.returnMsg.placeInfo.userName;
				username==null? '':dc('ipt-name').innerText=username;
				console.log("页面加载完毕")
				document.querySelector('.loading-bg').style.display='none';
			}else{
				mui.alert('获取信息失败，请刷新重试！')
			}
		},
		error:function(xhr,type,errorThrown){
			//异常处理；
			console.log(type);
		}
	});
});
mui('body').on('tap', '#btn_submit', function() {
	mui.openWindow({
		url: base_path + '/drp/placeInfo_update?dates=' + new Date().getTime() //add_information.html
	});
});