mui.init({})
var state=1;
var openid = helper.cookies.get("openid");
var Itype = helper.request.queryString("Itype");
var turn = helper.request.queryString("turn");

$(function () {
	if (turn) {
		$(".mui-nav").show();
	}else{
		$("#OA_task").css("margin-top","0px");
	}
	Ajax();
})
function Ajax() {
	//$(".order").remove();
	$.ajax({
		url: huayi.config.callcenter_url + 'WxLogin/GetNoticeList',
		data: {
			openid: openid, //微信openid,
			//openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE',
		},
		async: true,
		dataType: 'json',
		type: 'get', //HTTP请求类型
		success: function(data) {
			if(data.rows && data.rows.length > 0) {
				$(".noinfor").text("");
				$("#OA_task").empty();
				$(data.rows).each(function(i, n) {
					
					$('<li class="mui-table-view-cell order" data-index="' + n.F_NoticeId + '">' +
						'<div class="mui-table">' +
						'<div class="mui-table-cell mui-col-xs-10">' +
						'<h4 class="mui-ellipsis">' + n.F_Title +
						'</h4><h5>' + n.F_CreateOn +
						'</h5></div>'+
						'<div class="mui-table-cell mui-col-xs-2 mui-text-right">'+
						'<span class="mui-h5">'+
						'</span></div></div></li>').appendTo('#OA_task');
				});
				//工单跳转
				$('.order').on('tap', function() {
					var index = $(this).attr('data-index');
					window.location.href = "noticeDetail.html?id=" + index+'&type='+state;
				});
			} else {
				$(".noinfor").text("暂无信息");
			}
		},
		error: function(xhr, type, errorThrown) {
			//异常处理；
		}
	})

}