var id=mobile.getUrlVars("id");
var order;
var money = 0;
var product;
mui.init();
mui.ready(function(){
getById();
$("#product").on("tap","li",function(e){
if($(this).attr("data-id")){
location.href=base+"/mobile/productDetail.jsp?id="+$(this).attr("data-id");
}
});
});
function getById(){
mobile.ajaxPost(base+'/userOrder/getById',{id:id},function(json){
order = json.data;
product = order.list[0];
var html= [];
html.push('
');
html.push(''+order.consignee+' '+ order.mobile +'
');
html.push('');
$.each(order.list,function(id,item){
html.push('');
html.push('');
html.push('

');
if(item.order_hour<=0){
html.push('
免预约')
}
html.push('
');
html.push('');
html.push('
'+item.merchant_name+'
');
html.push('
'+item.product_name+'
');
html.push('
');
html.push('¥'+item.product_price+''+item.product_old_price+'元');
html.push('x'+item.product_qty+'
');
html.push('
');
html.push('');
});
if(order.order_status=="10"){
$('#pay_amt').prev().html('需付款');
$('.mui-title').html('待付款');
$('#pay_amt').html('¥'+order.order_amt+'');
}else if(order.order_status=="20"){
$('#pay_amt').prev().html('已付款');
$('.mui-title').html('待使用');
$('#pay_amt').html('¥'+mobile.nullToZore(order.pay_amt)+'');
}else if(order.order_status=="30"){
$('#pay_amt').prev().html('已付款');
$('.mui-title').html('交易成功');
$('#pay_amt').html('¥'+mobile.nullToZore(order.pay_amt)+'');
}else{
$('.mui-title').html('订单失效');
}
if(order.order_type=="10"){
$("#sumPrice").removeClass("mui-hidden");
}else if(order.order_type=="20"){
$("#sumIntegral").removeClass("mui-hidden");
}
$('#order_amt').html("¥"+order.order_amt);
$('#order_type').html(mobile.getDictVal("order_type",order.order_type));
$('#order_no').html(order.order_no);
$('#order_integral').html(order.order_integral);
$('#create_time').html(order.create_time);
$('#finish_time').html(order.finish_time);
if(order.pay_type=="10"){
$('#pay_type').html("微信支付");
}else if(order.pay_type=="20"){
$('#pay_type').html("余额支付");
}else{
$('#pay_type').parent().hide();
}
$('.mui-content').removeClass('mui-hidden');
$('#product').html(html.join(''));
});
}