//渲染
function load(){
    layer.load(3);
    $.ajax({
        url: "/supplierRelease/getConfirmOrdering",
        type: "get",
        data: {
            "demandUuid": uuid
        },
        headers: {"token": token},
        dataType: "json",
        success: (data) => {
            console.log(data)
            $(".content-title h1").html(data.data.titleTravel);//报价单标题
            $(".content-title .content-subtitle").find("li").eq(0).html(data.data.origin + "出发");//出发地
            $(".content-title .content-subtitle").find("li").eq(1).html(data.data.travelDate);//游玩时间
            $(".content-title .content-subtitle").find("li").eq(2).html(data.data.peopleNum);//游玩人数
            $("input[name=contractName]").val(data.data.name);//联系人信息姓名
            $("#tel").val(data.data.phone);//联系人电话
            $("input[name=email]").val(data.data.email);//联系人信息邮箱
            $(".money-count span").html("￥" + data.data.amount);//金额
            $(".money-list span").eq(1).html("￥" + data.data.amount);//金额
            $(".note").val(data.data.invoiceRemark);//发票备注
            $(".note").prev().html(data.data.isInvoice == "0" ? "用户需要发票" : "用户不需要发票");//是否需要发票
            //渲染行程
            $(".detail-list li").remove();
            $(".detail-list").html(data.data.trip);
            //清空旅客信息
            $("form .contact__info-wrapper").eq(0).find(".field").remove();
            //旅客信息
            console.log(data)
            $.each(data.data.usedUserArray, (index, item) => {
                var nationality = "中国"; //国籍
                var documentType = "身份证";//证件类型
                //国籍
                if(item.nationality == "1"){
                    nationality == "中国"
                } else if(item.nationality == "2"){
                    nationality == "日本"
                } else if(item.nationality == "3"){
                    nationality == "韩国"
                } else if(item.nationality == "4"){
                    nationality == "英国"
                } else if(item.nationality == "5"){
                    nationality == "美国"
                } else if(item.nationality == "6"){
                    nationality == "加拿大"
                }
                //证件类型
                if(item.documentType == "1"){
                    documentType == "身份证"
                } else if(item.documentType == "2"){
                    documentType == "港澳台通行证"
                } else if(item.documentType == "3"){
                    documentType == "护照"
                }
                var htmlStr = "<div class=\"field\" data-v-dcd7fa2e data-v-76c9b258><h3 class=\"title\" data-locale=\"lvke\" data-v-dcd7fa2e=\"\">旅客"+ (index + 1) +"</h3>\n" +
                    "                                <h5 class=\"subtitle\" data-v-dcd7fa2e=\"\">为顺利出行，请确保出行姓名与证件上一致。</h5><div class=\"filed-group\" data-v-dcd7fa2e=\"\">\n" +
                    "                                <div class=\"field-item\" data-v-dcd7fa2e=\"\"><label for=\"name_0\" data-v-dcd7fa2e=\"\">中文姓名</label><input id=\"name_0\" type=\"text\" name=\"name\" value='"+ item.name +"' class=\"field-normal-input\" placeholder=\"与证件姓名一致\" data-v-dcd7fa2e=\"\" readonly=\"\"></div>\n" +
                    "                                <div class=\"field-item\" data-v-dcd7fa2e=\"\"><label data-v-dcd7fa2e=\"\">国籍</label>\n" +
                    "                                    <input id=\"name_1\" type=\"text\" name=\"name\" value='"+ nationality +"' class=\"field-normal-input\" placeholder=\"国籍\" data-v-dcd7fa2e=\"\" readonly=\"\">\n" +
                    "                                </div>\n" +
                    "                                <div class=\"field-item\" data-v-dcd7fa2e=\"\"><label data-v-dcd7fa2e=\"\">证件类型</label>\n" +
                    "                                    <input id=\"name_2\" type=\"text\" name=\"name\" value='"+ documentType +"' class=\"field-normal-input\" placeholder=\"证件类型\" data-v-dcd7fa2e=\"\" readonly=\"\">\n" +
                    "                                </div>\n" +
                    "                                <div class=\"field-item\" data-v-dcd7fa2e=\"\"><label for=\"idcard_0\" data-v-dcd7fa2e=\"\">身份证号码</label><input id=\"idcard_0\" type=\"text\" name=\"idcard\" value='"+ item.idNumber +"' class=\"field-normal-input\" placeholder=\"请输入\" data-v-dcd7fa2e=\"\" readonly=\"\"></div>\n" +
                    "                                <div class=\"field-item\" data-v-dcd7fa2e=\"\"><label data-v-dcd7fa2e=\"\">出生日期</label>\n" +
                    "                                    <input id=\"name_4\" type=\"text\" name=\"name\" class=\"field-normal-input\" value='"+ item.dateOfBirth +"' placeholder=\"出生日期\" data-v-dcd7fa2e=\"\" readonly=\"\"><!--teleport start--><!--teleport end--></div>\n" +
                    "                                <div class=\"field-item\" data-v-dcd7fa2e=\"\"><label data-v-dcd7fa2e=\"\">性别</label>\n" +
                    "                                    <input id=\"name_3\" type=\"text\" name=\"name\" value='"+ (item.sex == "1" ? "男" : "女") +"' class=\"field-normal-input\" placeholder=\"性别\" data-v-dcd7fa2e=\"\" readonly=\"\">\n" +
                    "                                </div>\n" +
                    "                                <div class=\"field-item\" data-v-dcd7fa2e=\"\"><label for=\"tel_0\" data-v-dcd7fa2e=\"\">电话号码</label>\n" +
                    "                                    <div class=\"tel-group\" data-v-dcd7fa2e=\"\">\n" +
                    "                                        <input id=\"tel_0\" type=\"tel\" placeholder=\"请输入手机号\" value='"+ item.phone +"' data-v-dcd7fa2e=\"\" readonly=\"\"></div>\n" +
                    "                                </div>\n" +
                    "                            </div></div>";
                $("form .contact__info-wrapper").eq(0).append(htmlStr);
            });
            layer.closeAll("loading");
        },
        error: () => {

        }
    });
}