//查询指定报价单内容
function getPrivateOrder(){
    $.ajax({
        url: "/privateOrder/getPrivateOrderById",
        type: "get",
        data: {
            "uuid": uuid
        },
        headers: {"token": token},
        dataType: "json",
        success: (data) => {
            if(data.data != null){
                $(".destination_end").html(data.data.origin + " - " + data.data.destination);
                $(".start_end_time").html(data.data.startTime + " — " + data.data.endTime);
                $(".people_number").html(data.data.peopleNum);
                $(".amount_range").html(data.data.budgetMin + " - " + data.data.budgetMax);
                $(".hotel_scale").html("酒店档次：" + (data.data.hotelScale == null ? "暂无" : data.data.hotelScale));
                $("input[name=planDate]").val(data.data.startTime);
                for(let i = 0; i < dateDiffVal(data.data.endTime, data.data.startTime); i++){
                    addDay(addDatePlus(data.data.startTime, i + 1));
                }
            }
            layer.closeAll("loading");
        },
        error: () => {
            layer.alert("服务器异常，请联系管理员", {icon: 2});
            layer.closeAll("loading");
        }
    });
}
//鼠标移入
function operationOver(obj){
    $(obj).addClass("operation_headr");
}
//鼠标移出
function operationOut(obj){
    $(obj).removeClass("operation_headr");
}
//新增天
function addDay(addTiemVal){
   var uuid = guid();
   var dayNum = $(".pre-actived").attr("dayNum");
    $(".timeline ul").find("li").removeClass("pre-actived");
    $(".timeline ul").append("<li onClick='clickDayNum(this)' dayNum="+ (parseInt(dayNum) + 1) +" class=\"pre-actived\" data-v-2d69a44a=\"\">\n" +
        "                        <i data-v-2d69a44a=\"\">Day"+ (parseInt(dayNum) + 1) +"</i>\n" +
        "                        <span data-v-2d69a44a=\"\"></span>\n" +
        "                    </li>");
    $(".contract_uplod").before("<div class=\"content_add_div\" daynum="+ (parseInt(dayNum) + 1) +">\n" +
        "                <!-- 日期选择 -->\n" +
        "                <div class=\"layui-inline\">\n" +
        "                    <label class=\"layui-form-label\" style=\"margin-top: 8px\">日&nbsp;&nbsp;&nbsp;&nbsp;期：</label>\n" +
        "                    <div class=\"layui-input-inline\">\n" +
        "                        <div class=\"date_content_div\">\n" +
        "                            <img class=\"date_content_img\" src=\"/images/demandForSingle/date.png\">\n" +
        "                            <input value="+ (addTiemVal == null ? new Data() : addTiemVal) +" type=\"text\" class=\"layui-input date_content_input select_date_input"+ uuid +"\" name='planDate' placeholder=\"请输入时间 年.月.日\" lay-key=\"1\" readonly = \"readonly\">\n" +
        "                        </div>\n" +
        "                    </div>\n" +
        "                </div>\n" +
        "                <!-- 时间增加 -->\n" +
        "                <div class=\"layui-inline\">\n" +
        "                    <label class=\"layui-form-label\" style=\"margin-top: 8px\">时间点：</label>\n" +
        "                    <div class=\"layui-input-inline positioning_div\" style=\"width: 90%\">\n" +
        "                        <div class=\"date_content_div\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content_input date_hours_content_val"+ uuid +"\" value='08:00' placeholder=\"时间\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content date_content_input\" placeholder=\"请输入内容\">\n" +
        "                            <div class=\"del_date\" onclick=\"delteDate(this)\"><i class=\"layui-icon layui-icon-subtraction\"></i></div>\n" +
        "                        </div>\n" +
        "                        <div class=\"date_content_div\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content_input date_hours_content_val"+ uuid +"\" value='12:00' placeholder=\"时间\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content date_content_input\" placeholder=\"请输入内容\">\n" +
        "                            <div class=\"del_date\" onclick=\"delteDate(this)\"><i class=\"layui-icon layui-icon-subtraction\"></i></div>\n" +
        "                        </div>\n" +
        "                        <div class=\"date_content_div\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content_input date_hours_content_val"+ uuid +"\" value='14:00' placeholder=\"时间\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content date_content_input\" placeholder=\"请输入内容\">\n" +
        "                            <div class=\"del_date\" onclick=\"delteDate(this)\"><i class=\"layui-icon layui-icon-subtraction\"></i></div>\n" +
        "                        </div>\n" +
        "                        <div class=\"date_content_div\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content_input date_hours_content_val"+ uuid +"\" value='17:00' placeholder=\"时间\">\n" +
        "                            <input type=\"text\" class=\"layui-input date_hours_content date_content_input\" placeholder=\"请输入内容\">\n" +
        "                            <div class=\"del_date\" onclick=\"delteDate(this)\"><i class=\"layui-icon layui-icon-subtraction\"></i></div>\n" +
        "                        </div>\n" +
        "                        <img class=\"add_date\" src=\"/images/demandForSingle/add_date.png\"  onClick=\"addDate(this)\">\n" +
        "                    </div>\n" +
        "                </div>\n" +
        "                <!-- 游玩内容 -->\n" +
        "                <div class=\"play_div\">\n" +
        "                    <!-- 地点 -->\n" +
        "                    <div class=\"play_content_div scenic_spot_div\">\n" +
        "                        <div class=\"title_name_spot\">\n" +
        "                            <svg viewBox=\"0 0 1024 1024\" class=\"title_name_img\">\n" +
        "                                <path d=\"M512 64C317.92 64 160 221.92 160 416c0 187.36 315.424 520.032 328.832 534.08C494.88 956.448 503.264 960 512 960c0.224 0 0.48 0 0.704 0 8.992 0 17.472-4.192 23.392-10.944l109.216-125.12C790.432 646.176 864 508.928 864 416 864 221.92 706.08 64 512 64zM512 576c-88.384 0-160-71.616-160-160s71.616-160 160-160 160 71.616 160 160S600.384 576 512 576z\" p-id=\"2190\"></path>\n" +
        "                            </svg>\n" +
        "                            <input type=\"text\" placeholder=\"地点名称\" class=\"layui-input date_content_input\">\n" +
        "                        </div>\n" +
        "                        <div class=\"editor-assets\" data-v-400c2eb9=\"\">\n" +
        "                            <div class=\"editor-assets-control\" data-v-400c2eb9=\"\">\n" +
        "                                <div class=\"editor-assets-control-item file_videos"+ uuid +"\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-videos-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入视频</span></div>\n" +
        "                                <div class=\"editor-assets-control-item file_img"+ uuid +" file_margin\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-images-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入图片</span></div>\n" +
        "                            </div>\n" +
        "                            <div class=\"editor-assets-content\" data-v-400c2eb9=\"\"></div>\n" +
        "                        </div>\n" +
        "                        <div class=\"editor-content\" data-v-400c2eb9=\"\"><p data-v-400c2eb9=\"\">地点介绍</p>\n" +
        "                            <textarea placeholder=\"地点介绍\" maxlength=\"2000\" data-v-400c2eb9=\"\"></textarea>\n" +
        "                        </div>\n" +
        "                        <!-- 关闭按钮 -->\n" +
        "                        <div class=\"close_play_button\" onClick=\"delPlay(this)\">\n" +
        "                           <i class=\"layui-icon layui-icon-close\"></i>\n" +
        "                        </div>\n" +
        "                    </div>\n" +
        "                    <!-- 悬浮效果 -->\n" +
        "                    <div class=\"operation\" data-v-67b53f28=\"\" data-v-5161540f=\"\" onmouseover=\"operationOver(this)\" onmouseout=\"operationOut(this)\">\n" +
        "                        <div class=\"operation-leader\" data-v-67b53f28=\"\">\n" +
        "                            <svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" data-v-67b53f28=\"\">\n" +
        "                                <path fill=\"currentColor\" d=\"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z\"></path>\n" +
        "                            </svg>\n" +
        "                        </div>\n" +
        "                        <div class=\"icon-group\" data-v-67b53f28=\"\">\n" +
        "                            <div class=\"icon-item\" data-v-67b53f28=\"\" onclick=\"addDay(this)\">\n" +
        "                                <i class=\"icon icon-dir\" data-v-67b53f28=\"\"></i>\n" +
        "                                <span data-v-67b53f28=\"\">添加目录/天</span>\n" +
        "                            </div>\n" +
        "                            <div class=\"icon-item\" data-v-67b53f28=\"\" onclick='addPlace(this)'>\n" +
        "                                <i class=\"icon icon-location\" data-v-67b53f28=\"\"></i>\n" +
        "                                <span data-v-67b53f28=\"\">添加地点</span>\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                    </div>\n" +
        "                    <!-- 酒店 -->\n" +
        "                    <div class=\"play_content_div hotel_play_div\">\n" +
        "                        <div class=\"title_name_spot\">\n" +
        "                            <svg viewBox=\"0 0 1024 1024\" class=\"title_name_img\">\n" +
        "                                <path d=\"M512 64C317.92 64 160 221.92 160 416c0 187.36 315.424 520.032 328.832 534.08C494.88 956.448 503.264 960 512 960c0.224 0 0.48 0 0.704 0 8.992 0 17.472-4.192 23.392-10.944l109.216-125.12C790.432 646.176 864 508.928 864 416 864 221.92 706.08 64 512 64zM512 576c-88.384 0-160-71.616-160-160s71.616-160 160-160 160 71.616 160 160S600.384 576 512 576z\" p-id=\"2190\"></path>\n" +
        "                            </svg>\n" +
        "                            <input type=\"text\" placeholder=\"酒店名称\" class=\"layui-input date_content_input\">\n" +
        "                        </div>\n" +
        "                        <div class=\"editor-assets\" data-v-400c2eb9=\"\">\n" +
        "                            <div class=\"editor-assets-control\" data-v-400c2eb9=\"\">\n" +
        "                                <div class=\"editor-assets-control-item file_videos"+ uuid +"\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-videos-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入视频</span></div>\n" +
        "                                <div class=\"editor-assets-control-item file_img"+ uuid +" file_margin\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-images-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入图片</span></div>\n" +
        "                            </div>\n" +
        "                            <div class=\"editor-assets-content\" data-v-400c2eb9=\"\"></div>\n" +
        "                        </div>\n" +
        "                        <div class=\"editor-content\" data-v-400c2eb9=\"\"><p data-v-400c2eb9=\"\">酒店介绍</p>\n" +
        "                            <textarea placeholder=\"酒店介绍\" maxlength=\"2000\" data-v-400c2eb9=\"\"></textarea>\n" +
        "                        </div>\n" +
        "                        <!-- 关闭按钮 -->\n" +
        "                        <div class=\"close_play_button\" onClick=\"delPlay(this)\">\n" +
        "                           <i class=\"layui-icon layui-icon-close\"></i>\n" +
        "                        </div>\n" +
        "                    </div>\n" +
        "                    <!-- 包车,车型-->\n" +
        "                    <div class=\"play_content_div charte_play_div\">\n" +
        "                        <div class=\"title_name_spot\">\n" +
        "                            <svg viewBox=\"0 0 1024 1024\" class=\"title_name_img\">\n" +
        "                                <path d=\"M512 64C317.92 64 160 221.92 160 416c0 187.36 315.424 520.032 328.832 534.08C494.88 956.448 503.264 960 512 960c0.224 0 0.48 0 0.704 0 8.992 0 17.472-4.192 23.392-10.944l109.216-125.12C790.432 646.176 864 508.928 864 416 864 221.92 706.08 64 512 64zM512 576c-88.384 0-160-71.616-160-160s71.616-160 160-160 160 71.616 160 160S600.384 576 512 576z\" p-id=\"2190\"></path>\n" +
        "                            </svg>\n" +
        "                            <input type=\"text\" placeholder=\"包车,车型\" class=\"layui-input date_content_input\">\n" +
        "                        </div>\n" +
        "                        <div class=\"editor-assets\" data-v-400c2eb9=\"\">\n" +
        "                            <div class=\"editor-assets-control\" data-v-400c2eb9=\"\">\n" +
        "                                <div class=\"editor-assets-control-item file_videos"+ uuid +"\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-videos-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入视频</span></div>\n" +
        "                                <div class=\"editor-assets-control-item file_img"+ uuid +" file_margin\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-images-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入图片</span></div>\n" +
        "                            </div>\n" +
        "                            <div class=\"editor-assets-content\" data-v-400c2eb9=\"\"></div>\n" +
        "                        </div>\n" +

        "                        <div class=\"editor-content\" data-v-400c2eb9=\"\"><p data-v-400c2eb9=\"\">包车，司机介绍</p>\n" +
        "                            <textarea placeholder=\"包车，司机介绍\" maxlength=\"2000\" data-v-400c2eb9=\"\"></textarea>\n" +
        "                        </div>\n" +
        "                        <!-- 关闭按钮 -->\n" +
        "                        <div class=\"close_play_button\" onClick=\"delPlay(this)\">\n" +
        "                           <i class=\"layui-icon layui-icon-close\"></i>\n" +
        "                        </div>\n" +
        "                    </div>\n" +
        "                    <!-- 悬浮效果 -->\n" +
        "                    <div class=\"operation\" data-v-67b53f28=\"\" data-v-5161540f=\"\" onmouseover=\"operationOver(this)\" onmouseout=\"operationOut(this)\">\n" +
        "                        <div class=\"operation-leader\" data-v-67b53f28=\"\">\n" +
        "                            <svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" data-v-67b53f28=\"\">\n" +
        "                                <path fill=\"currentColor\" d=\"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z\"></path>\n" +
        "                            </svg>\n" +
        "                        </div>\n" +
        "                        <div class=\"icon-group\" data-v-67b53f28=\"\">\n" +
        "                           <div class=\"icon-item\" data-v-67b53f28=\"\" onClick=\"addDay(this)\">\n" +
        "                               <i class=\"icon icon-dir\" data-v-67b53f28=\"\"></i>\n" +
        "                               <span data-v-67b53f28=\"\">添加目录/天</span>\n" +
        "                            </div>\n" +
        "                            <div class=\"icon-item\" data-v-67b53f28=\"\" onClick=\"addPlace(this)\">\n" +
        "                                <i class=\"icon icon-location\" data-v-67b53f28=\"\"></i>\n" +
        "                                <span data-v-67b53f28=\"\">添加地点</span>\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                    </div>\n" +
        "                </div>\n" +
        "            </div>");
    addUrl(uuid);

}
//点击天数跳转滚动条跳转
function clickDayNum(obj){
    var dayNum = $(obj).attr("dayNum");
    $(".list_div").animate({scrollTop: $(".content_add_div[dayNum="+ dayNum +"]")[0].offsetTop - 254}, "slow")
}
//添加地点
function addPlace(obj){
    var uuid = guid();
    $(obj).parent().parent().before("<!-- 地点 -->\n" +
        "                    <div class=\"play_content_div scenic_spot_div\">\n" +
        "                        <div class=\"title_name_spot\">\n" +
        "                            <svg viewBox=\"0 0 1024 1024\" class=\"title_name_img\">\n" +
        "                                <path d=\"M512 64C317.92 64 160 221.92 160 416c0 187.36 315.424 520.032 328.832 534.08C494.88 956.448 503.264 960 512 960c0.224 0 0.48 0 0.704 0 8.992 0 17.472-4.192 23.392-10.944l109.216-125.12C790.432 646.176 864 508.928 864 416 864 221.92 706.08 64 512 64zM512 576c-88.384 0-160-71.616-160-160s71.616-160 160-160 160 71.616 160 160S600.384 576 512 576z\" p-id=\"2190\"></path>\n" +
        "                            </svg>\n" +
        "                            <input type=\"text\" placeholder=\"地点名称\" class=\"layui-input date_content_input\">\n" +
        "                        </div>\n" +
        "                        <div class=\"editor-assets\" data-v-400c2eb9=\"\">\n" +
        "                            <div class=\"editor-assets-control\" data-v-400c2eb9=\"\">\n" +
        "                                <div class=\"editor-assets-control-item file_videos"+ uuid +"\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-videos-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入视频</span></div>\n" +
        "                                <div class=\"editor-assets-control-item file_img"+ uuid +" file_margin\" data-v-400c2eb9=\"\"><i\n" +
        "                                        class=\"assets-icon assets-images-icon\" data-v-400c2eb9=\"\"></i><span\n" +
        "                                        data-v-400c2eb9=\"\">插入图片</span></div>\n" +
        "                            </div>\n" +
        "                            <div class=\"editor-assets-content\" data-v-400c2eb9=\"\"></div>\n" +
        "                        </div>\n" +
        "                        <div class=\"editor-content\" data-v-400c2eb9=\"\"><p data-v-400c2eb9=\"\">地点介绍</p>\n" +
        "                            <textarea placeholder=\"地点介绍\" maxlength=\"2000\" data-v-400c2eb9=\"\"></textarea>\n" +
        "                        </div>\n" +
        "                        <span class=\"content-length\" data-v-400c2eb9=\"\">0/2000</span>\n" +
        "                        <!-- 关闭按钮 -->\n" +
        "                        <div class=\"close_play_button\" onClick=\"delPlay(this)\">\n" +
        "                            <i class=\"layui-icon layui-icon-close\"></i>\n" +
        "                        </div>\n" +
        "                    </div>");
    addUrl(uuid);
}
//删除游玩记录
delPlay = function(obj){
    $(obj).parent().remove();
}
//新增路线信息
function submitAdd(){
    layer.load(3);
    let arryValue = theValues();
    $.ajax({
        url: "/supplierRelease/" + urlAddUpate,
        type: "post",
        data: JSON.stringify({
            "demandUuid": uuid,
            "releaseDayString": arryValue.releaseDayString,
            "releasePlayString": arryValue.releasePlayString,
            "uuid": releaseUUid,
            "priceAll": arryValue.priceAll,
            "titleImg": titleImg,
            "offerName": arryValue.offerName,
            "other": arryValue.other,
            "priceDetail": arryValue.priceDetail,
            "priceDetailText": arryValue.priceDetailText,
            "contractFile": contractFile
        }),
        headers: {"token": token},
        contentType: "application/json",
        dataType: "json",
        success: (data) => {
            if(data.msg == "200"){
                layer.msg("发布成功", {icon: 1});
                getData();
            }
            layer.closeAll("loading");
        },
        error: () => {
            layer.alert("服务器异常，请联系管理员", {icon: 2});
            layer.closeAll("loading");
        }
    });
}
//重新渲染上传
function addUrl(uuid){
    layui.use(["laydate", 'upload'], function(){
        var upload1 = layui.upload;
        var laydate1 = layui.laydate;
        //执行实例
        upload1.render({
            elem: '.file_videos' + uuid //绑定元素
            ,url: '/upload/uploadFile' //上传接口
            ,method: 'post'  //可选项。HTTP类型，默认post
            ,accept: 'video'
            ,acceptMime: 'video/*'
            ,headers: {token: token}
            ,done: function(res){
                $(this.item[0]).parent().next().append("<video src="+ res.data +" controls=\"\" data-v-400c2eb9=\"\"></video>");
            }
            ,error: function(){
                //请求异常回调
            }
        });

        //图片上传
        upload1.render({
            elem: '.file_img' + uuid //绑定元素
            ,url: '/upload/uploadFile' //上传接口
            ,method: 'post'  //可选项。HTTP类型，默认post
            ,accept: 'images'
            ,acceptMime: 'image/*'
            ,headers: {token: token}
            ,done: function(res){
                $(this.item[0]).parent().next().append("<div class=\"editor-assets-content-info\" data-v-400c2eb9=\"\">\n" +
                    "                                    <div class=\"el-image\" data-v-400c2eb9=\"\"><img style='width: 100px;height: 100px;' alt=\"upload-assets\"\n" +
                    "                                                                                  src="+ res.data +"\n" +
                    "                                                                                  class=\"el-image__inner el-image__preview\"\n" +
                    "                                                                                  style=\"object-fit: cover;\"><!--v-if-->\n" +
                    "                                    </div>\n" +
                    "                                    <svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" onclick=\"closeSvg(this)\" data-v-400c2eb9=\"\">\n" +
                    "                                        <path fill=\"currentColor\"\n" +
                    "                                              d=\"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336L512 457.664z\"></path>\n" +
                    "                                    </svg>\n" +
                    "                                </div>");
            }
            ,error: function(){
                //请求异常回调
            }
        });

        laydate1.render({
            elem: '.select_date_input' + uuid
            ,format: 'yyyy.MM.dd'
        });

        laydate.render({
            elem: '.date_hours_content_val' + uuid
            ,type: 'time'
            ,format: 'HH:mm'
        });
    });
}
//生成uuid
function guid() {
    return 'xxxxxxxx_xxxx_4xxx_yxxx_xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = Math.random() * 16 | 0,
            v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}
//元素渲染
function elementDrawing(data){
    $(".timeline ul li").remove();
    $(".content_right .content_add_div").remove();
    $(".all_price_input input[name=priceAll]").val(data.data[0].priceAll);
    $("input[name=offerName]").val(data.data[0].offerName);
    $("input[name=priceDetail]").val(data.data[0].priceDetail);
    $("textarea[name=priceDetailText]").val(data.data[0].priceDetailText);
    contractFile = data.data[0].contractFile
    titleImg = data.data[0].titleImg
    if(data.data[0].other != null){
        //其他渲染
        for(var i = 0; i < data.data[0].other.split(",").length; i++){
            $.each($(".radio_div_select"), (index, element) => {
                if(data.data[0].other.split(",")[i] == $(element).find("span").text()){
                    $(element).find(".radio_icon").addClass("radio_icon_color")
                }
            });
        }
    }
    //游玩渲染
    var uuid = guid();
    //时间渲染
    var day = null;
    $.each(data.data[0].releaseDay, (index, item) => {
        if(day != item.dayNum){
            //左侧时间轴
            if(index == 0){
                $(".timeline ul").append("<li dayNum="+ item.dayNum +" class=\"pre-actived\" data-v-2d69a44a=\"\" onclick=\"clickDayNum(this)\">\n" +
                    "                        <i data-v-2d69a44a=\"\">Day"+ item.dayNum +"</i>\n" +
                    "                        <span data-v-2d69a44a=\"\"></span>\n" +
                    "                    </li>")
            }else{
                $(".timeline ul").append("<li dayNum="+ item.dayNum +" data-v-2d69a44a=\"\" onclick=\"clickDayNum(this)\">\n" +
                    "                        <i data-v-2d69a44a=\"\">Day"+ item.dayNum +"</i>\n" +
                    "                        <span data-v-2d69a44a=\"\"></span>\n" +
                    "                    </li>")
            }
            $(".content_right .contract_uplod").before(
                "<div class='content_add_div' dayNum="+ item.dayNum +">" +
                "                <!-- 日期选择 -->\n" +
                "                <div class=\"layui-inline\">\n" +
                "                    <label class=\"layui-form-label\" style=\"margin-top: 8px\">日&nbsp;&nbsp;&nbsp;&nbsp;期：</label>\n" +
                "                    <div class=\"layui-input-inline\">\n" +
                "                        <div class=\"date_content_div\">\n" +
                "                            <img class=\"date_content_img\" src=\"/images/demandForSingle/date.png\"/>\n" +
                "                            <input type=\"text\" class=\"layui-input date_content_input select_date_input"+ uuid +"\" value="+ item.planDate +" name='planDate' placeholder=\"请输入时间 年.月.日\" readonly = \"readonly\">\n" +
                "                        </div>\n" +
                "                    </div>\n" +
                "                </div>\n" +
                "<!-- 时间增加 -->\n" +
                "                <div class=\"layui-inline\">\n" +
                "                    <label class=\"layui-form-label\" style=\"margin-top: 8px\">时间点：</label>\n" +
                "                    <div class=\"layui-input-inline positioning_div\" style=\"width: 90%\">\n" +
                "                        <img class=\"add_date\" src=\"/images/demandForSingle/add_date.png\"/>\n" +
                "                        <div class=\"date_content_div\">\n" +
                "                            <input type=\"text\" class=\"layui-input date_hours_content_input date_hours_content_val"+ uuid +"\" value="+item.dateTime+">\n" +
                "                            <input type=\"text\" class=\"layui-input date_hours_content date_content_input\" value="+item.content+">\n" +
                "                            <div class=\"del_date\" onclick=\"delteDate(this)\"><i class=\"layui-icon layui-icon-subtraction\"></i></div>\n" +
                "                        </div>\n"+
                "                    </div>\n" +
                "                </div>\n"+
                " <!-- 游玩内容 -->\n" +
                "                <div class=\"play_div\"></div>\n"+
                "</div>")
            day = item.dayNum;
        } else {
            $(".content_add_div[dayNum="+ item.dayNum +"] .positioning_div").append("<div class=\"date_content_div\">\n" +
                "                            <input type=\"text\" class=\"layui-input date_hours_content_input date_hours_content_val"+ uuid +"\" value="+item.dateTime+">\n" +
                "                            <input type=\"text\" class=\"layui-input date_hours_content date_content_input\" value="+item.content+">\n" +
                "                            <div class=\"del_date\" onclick=\"delteDate(this)\"><i class=\"layui-icon layui-icon-subtraction\"></i></div>\n" +
                "                        </div>");
        }
    });
    $(".add_date").css("bottom", "6px");
    $.each(data.data[0].releasePlay, (index, elem) => {
        if(elem.typeVal == "0"){
            $(".content_add_div[daynum="+ elem.dayNum +"] .play_div").append("<!-- 景点 -->\n" +
                "                    <div class=\"play_content_div scenic_spot_div "+ elem.uuid +"\">\n" +
                "                        <div class=\"title_name_spot\">\n" +
                "                            <svg viewBox=\"0 0 1024 1024\" class=\"title_name_img\">\n" +
                "                                <path d=\"M512 64C317.92 64 160 221.92 160 416c0 187.36 315.424 520.032 328.832 534.08C494.88 956.448 503.264 960 512 960c0.224 0 0.48 0 0.704 0 8.992 0 17.472-4.192 23.392-10.944l109.216-125.12C790.432 646.176 864 508.928 864 416 864 221.92 706.08 64 512 64zM512 576c-88.384 0-160-71.616-160-160s71.616-160 160-160 160 71.616 160 160S600.384 576 512 576z\" p-id=\"2190\"></path>\n" +
                "                            </svg>\n" +
                "                            <input type=\"text\" placeholder=\"景点名称\" value='"+ elem.name +"' class=\"layui-input date_content_input\">\n" +
                "                        </div>\n" +
                "                        <div class=\"editor-assets\" data-v-400c2eb9=\"\">\n" +
                "                            <div class=\"editor-assets-control\" data-v-400c2eb9=\"\">\n" +
                "                                <div class=\"editor-assets-control-item file_videos"+ uuid +"\" data-v-400c2eb9=\"\"><i\n" +
                "                                        class=\"assets-icon assets-videos-icon\" data-v-400c2eb9=\"\"></i><span\n" +
                "                                        data-v-400c2eb9=\"\">插入视频</span></div>\n" +
                "                                <div class=\"editor-assets-control-item file_img"+ uuid +" file_margin\" data-v-400c2eb9=\"\"><i\n" +
                "                                        class=\"assets-icon assets-images-icon\" data-v-400c2eb9=\"\"></i><span\n" +
                "                                        data-v-400c2eb9=\"\">插入图片</span></div>\n" +
                "                            </div>\n" +
                "                            <div class=\"editor-assets-content\" data-v-400c2eb9=\"\">\n" +
                "                            </div>\n" +
                "                        </div>\n" +
                "                        <div class=\"editor-content\" data-v-400c2eb9=\"\"><p data-v-400c2eb9=\"\">景点介绍</p>\n" +
                "                            <textarea placeholder=\"景点介绍\"  maxlength=\"2000\" data-v-400c2eb9=\"\">"+ elem.content + "</textarea>\n" +
                "                        </div>\n" +
                "                        <!-- 关闭按钮 -->\n" +
                "                        <div class=\"close_play_button\" onClick=\"delPlay(this)\">\n" +
                "                            <i class=\"layui-icon layui-icon-close\"></i>\n" +
                "                        </div>\n" +
                "                    </div>\n" +
                "                    <!-- 悬浮效果 -->\n" +
                "                    <div class=\"operation\" data-v-67b53f28=\"\" data-v-5161540f=\"\" onmouseover=\"operationOver(this)\" onmouseout=\"operationOut(this)\">\n" +
                "                        <div class=\"operation-leader\" data-v-67b53f28=\"\">\n" +
                "                            <svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" data-v-67b53f28=\"\">\n" +
                "                                <path fill=\"currentColor\" d=\"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z\"></path>\n" +
                "                            </svg>\n" +
                "                        </div>\n" +
                "                        <div class=\"icon-group\" data-v-67b53f28=\"\">\n" +
                "                            <div class=\"icon-item\" data-v-67b53f28=\"\" onClick=\"addDay(this)\">\n" +
                "                                <i class=\"icon icon-dir\" data-v-67b53f28=\"\"></i>\n" +
                "                                <span data-v-67b53f28=\"\">添加目录/天</span>\n" +
                "                            </div>\n" +
                "                            <div class=\"icon-item\" data-v-67b53f28=\"\" onClick=\"addPlace(this)\">\n" +
                "                                <i class=\"icon icon-location\" data-v-67b53f28=\"\"></i>\n" +
                "                                <span data-v-67b53f28=\"\">添加地点</span>\n" +
                "                            </div>\n" +
                "                        </div>\n" +
                "                    </div>");
        }else if(elem.typeVal == "1"){
            $(".content_add_div[daynum="+ elem.dayNum +"] .play_div").append("<!-- 酒店 -->\n" +
                "                    <div class=\"play_content_div scenic_spot_div "+ elem.uuid +"\">\n" +
                "                        <div class=\"title_name_spot\">\n" +
                "                            <svg viewBox=\"0 0 1024 1024\" class=\"title_name_img\">\n" +
                "                                <path d=\"M512 64C317.92 64 160 221.92 160 416c0 187.36 315.424 520.032 328.832 534.08C494.88 956.448 503.264 960 512 960c0.224 0 0.48 0 0.704 0 8.992 0 17.472-4.192 23.392-10.944l109.216-125.12C790.432 646.176 864 508.928 864 416 864 221.92 706.08 64 512 64zM512 576c-88.384 0-160-71.616-160-160s71.616-160 160-160 160 71.616 160 160S600.384 576 512 576z\" p-id=\"2190\"></path>\n" +
                "                            </svg>\n" +
                "                            <input type=\"text\" placeholder=\"酒店名称\" value='"+ elem.name +"' class=\"layui-input date_content_input\">\n" +
                "                        </div>\n" +
                "                        <div class=\"editor-assets\" data-v-400c2eb9=\"\">\n" +
                "                            <div class=\"editor-assets-control\" data-v-400c2eb9=\"\">\n" +
                "                                <div class=\"editor-assets-control-item file_videos\" data-v-400c2eb9=\"\"><i\n" +
                "                                        class=\"assets-icon assets-videos-icon\" data-v-400c2eb9=\"\"></i><span\n" +
                "                                        data-v-400c2eb9=\"\">插入视频</span></div>\n" +
                "                                <div class=\"editor-assets-control-item file_img file_margin\" data-v-400c2eb9=\"\"><i\n" +
                "                                        class=\"assets-icon assets-images-icon\" data-v-400c2eb9=\"\"></i><span\n" +
                "                                        data-v-400c2eb9=\"\">插入图片</span></div>\n" +
                "                            </div>\n" +
                "                            <div class=\"editor-assets-content\" data-v-400c2eb9=\"\"></div>\n" +
                "                        </div>\n" +
                "                        <div class=\"editor-content\" data-v-400c2eb9=\"\"><p data-v-400c2eb9=\"\">酒店介绍</p>\n" +
                "                            <textarea placeholder=\"酒店介绍\" maxlength=\"2000\" data-v-400c2eb9=\"\">"+ elem.content + "</textarea>\n" +
                "                        </div>\n" +
                "                        <!-- 关闭按钮 -->\n" +
                "                        <div class=\"close_play_button\" onClick=\"delPlay(this)\">\n" +
                "                            <i class=\"layui-icon layui-icon-close\"></i>\n" +
                "                        </div>\n" +
                "                    </div>");
        }else if(elem.typeVal == "2"){
            $(".content_add_div[daynum="+ elem.dayNum +"] .play_div").append("<!-- 包车,车型-->\n" +
                "                    <div class=\"play_content_div scenic_spot_div "+ elem.uuid +"\">\n" +
                "                        <div class=\"title_name_spot\">\n" +
                "                            <svg viewBox=\"0 0 1024 1024\" class=\"title_name_img\">\n" +
                "                                <path d=\"M512 64C317.92 64 160 221.92 160 416c0 187.36 315.424 520.032 328.832 534.08C494.88 956.448 503.264 960 512 960c0.224 0 0.48 0 0.704 0 8.992 0 17.472-4.192 23.392-10.944l109.216-125.12C790.432 646.176 864 508.928 864 416 864 221.92 706.08 64 512 64zM512 576c-88.384 0-160-71.616-160-160s71.616-160 160-160 160 71.616 160 160S600.384 576 512 576z\" p-id=\"2190\"></path>\n" +
                "                            </svg>\n" +
                "                            <input type=\"text\" placeholder=\"包车,车型\" value='"+ elem.name +"' class=\"layui-input date_content_input\">\n" +
                "                        </div>\n" +
                "                        <div class=\"editor-assets\" data-v-400c2eb9=\"\">\n" +
                "                            <div class=\"editor-assets-control\" data-v-400c2eb9=\"\">\n" +
                "                                <div class=\"editor-assets-control-item file_videos\" data-v-400c2eb9=\"\"><i\n" +
                "                                        class=\"assets-icon assets-videos-icon\" data-v-400c2eb9=\"\"></i><span\n" +
                "                                        data-v-400c2eb9=\"\">插入视频</span></div>\n" +
                "                                <div class=\"editor-assets-control-item file_img file_margin\" data-v-400c2eb9=\"\"><i\n" +
                "                                        class=\"assets-icon assets-images-icon\" data-v-400c2eb9=\"\"></i><span\n" +
                "                                        data-v-400c2eb9=\"\">插入图片</span></div>\n" +
                "                            </div>\n" +
                "                            <div class=\"editor-assets-content\" data-v-400c2eb9=\"\"></div>\n" +
                "                        </div>\n" +
                "                        <div class=\"editor-content\" data-v-400c2eb9=\"\"><p data-v-400c2eb9=\"\">包车，司机介绍</p>\n" +
                "                            <textarea placeholder=\"包车，司机介绍\" maxlength=\"2000\" data-v-400c2eb9=\"\">"+ elem.content + "</textarea>\n" +
                "                        </div>\n" +
                "                        <!-- 关闭按钮 -->\n" +
                "                        <div class=\"close_play_button\" onClick=\"delPlay(this)\">\n" +
                "                            <i class=\"layui-icon layui-icon-close\"></i>\n" +
                "                        </div>\n" +
                "                    </div>\n" +
                "                    <!-- 悬浮效果 -->\n" +
                "                    <div class=\"operation\" data-v-67b53f28=\"\" data-v-5161540f=\"\" onmouseover=\"operationOver(this)\" onmouseout=\"operationOut(this)\">\n" +
                "                        <div class=\"operation-leader\" data-v-67b53f28=\"\">\n" +
                "                            <svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" data-v-67b53f28=\"\">\n" +
                "                                <path fill=\"currentColor\" d=\"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z\"></path>\n" +
                "                            </svg>\n" +
                "                        </div>\n" +
                "                        <div class=\"icon-group\" data-v-67b53f28=\"\">\n" +
                "                            <div class=\"icon-item\" data-v-67b53f28=\"\" onClick=\"addDay(this)\">\n" +
                "                                <i class=\"icon icon-dir\" data-v-67b53f28=\"\"></i>\n" +
                "                                <span data-v-67b53f28=\"\">添加目录/天</span>\n" +
                "                            </div>\n" +
                "                            <div class=\"icon-item\" data-v-67b53f28=\"\" onClick=\"addPlace(this)\">\n" +
                "                                <i class=\"icon icon-location\" data-v-67b53f28=\"\"></i>\n" +
                "                                <span data-v-67b53f28=\"\">添加地点</span>\n" +
                "                            </div>\n" +
                "                        </div>\n" +
                "                    </div>");
        }
        var imgUrlArray = elem.imgUrl == null ? new Array() : elem.imgUrl.split(",");
        var videoUrlArray = elem.videoUrl == null ? new Array() : elem.videoUrl.split(",");
        for(var i = 0; i < imgUrlArray.length; i++){
            $("." + elem.uuid + " .editor-assets-content").append("<div class=\"editor-assets-content-info\" data-v-400c2eb9=\"\">\n" +
                "                                    <div class=\"el-image\" data-v-400c2eb9=\"\"><img style='width: 100px;height: 100px;' alt=\"upload-assets\"\n" +
                "                                                                                  src="+ imgUrlArray[i] +"\n" +
                "                                                                                  class=\"el-image__inner el-image__preview\"\n" +
                "                                                                                  style=\"object-fit: cover;\"><!--v-if-->\n" +
                "                                    </div>\n" +
                "                                    <svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" onclick=\"closeSvg(this)\" data-v-400c2eb9=\"\">\n" +
                "                                        <path fill=\"currentColor\"\n" +
                "                                              d=\"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336L512 457.664z\"></path>\n" +
                "                                    </svg>\n" +
                "                                </div>");
        }
        for(var j = 0; j < videoUrlArray.lengthl; j++){
            $("." + elem.uuid + " .editor-assets-content").append("<video src="+ videoUrlArray[j] +" controls=\"\" data-v-400c2eb9=\"\"></video>");
        }
    })
    addUrl(uuid);
}
//查询订制
function getData(){
    layer.load(3);
    $.ajax({
        url: "/supplierRelease/getSupplierRelease",
        type: "get",
        data:{
            "demandUuid": uuid
        },
        headers: {"token": token},
        dataType: "json",
        success: (data) => {
            if(data.msg == "200"){
                if(data.data.length != 0){
                    urlAddUpate = "updateSupplierRelease"; //如果存在后面操作是修改
                    releaseUUid = data.data[0].uuid; //赋值
                    elementDrawing(data);
                } else {
                    urlAddUpate = "addSupplierRelease";
                }
            }
            layer.closeAll("loading");
        },
        error: () => {
            layer.alert("服务器异常，请联系管理员", {icon: 2});
            layer.closeAll("loading");
        }
    });
}
//删除选中图片或者视频
function closeSvg(obj){
    $(obj).parent().remove();
}
addDate = function(obj){
    //游玩渲染
    var uuid = guid();
    $(obj).before("<div class=\"date_content_div\">\n" +
        "<input type=\"text\" class=\"layui-input date_hours_content_input date_hours_content_val"+ uuid +"\" placeholder=\"时间\">\n" +
        "<input type=\"text\" class=\"layui-input date_hours_content date_content_input\" placeholder=\"请输入内容\">\n" +
        "<div class=\"del_date\" onclick=\"delteDate(this)\"><i class=\"layui-icon layui-icon-subtraction\"></i></div>\n" +
        "</div>")
    addUrl(uuid);
}
delteDate = function (obj) {
    $(obj).parent().remove();
}
//取值
function theValues(){
    let map = {};
    var releaseDay = new Array();//天信息数组
    var releasePlay = new Array();//游玩信息数组
    var priceAll = $(".all_price input[name=priceAll]").val(); //总价
    var titleName = $("input[name=offerName]").val();
    var priceDetail = $("input[name=priceDetail]").val();
    var priceDetailText = $("textarea[name=priceDetailText]").val();
    var other = "";//其他
    $.each($(".radio_icon_color"), (index, item) => {
        other += $(item).next().text() + ",";
    });
    map.priceAll = priceAll;
    map.titleName = titleName;
    map.other = other.substring(0, other.length - 1);
    map.priceDetail = priceDetail;
    map.priceDetailText = priceDetailText;
    if(titleName == null || titleName == ""){
        layer.msg("请输入报价单名称", {icon: 2, time: 1000});
        layer.closeAll("loading");
        return false;
    }
    if(priceAll == null || priceAll == ""){
        layer.msg("请输入总价", {icon: 2, time: 1000});
        layer.closeAll("loading");
        return false;
    }
    //取值
    $.each($(".content_add_div"), (index, item) => {
        var dayNum = $(item).attr("dayNum"); //天数
        //时间信息
        var planDate = $(item).find("input[name=planDate]").val(); //日期
        if(planDate == null || planDate == ''){
            layer.msg("第" + dayNum + "天日期不能为空", {icon: 2});
            return false;
        }
        $.each($(item).find(".positioning_div .date_content_div"), (index, elem) => {
            let dateTime = $(elem).find("input").eq(0).val();
            let content = $(elem).find("input").eq(1).val();
            //赋值
            releaseDay.push({"dayNum": dayNum, "planDate": planDate, "dateTime": dateTime, "content": content})
        });

        //游玩信息
        $.each($(item).find(".play_div"), (index, elemVal) => {
            //景点
            $.each($(elemVal).find(".scenic_spot_div"), (index, element) => {
                var imgUrl = "";
                var videoUrl = "";
                $.each($(element).find(".editor-assets .editor-assets-content"), function(index, element1){
                    if($(element1).find("img") != "undefined"){
                        imgUrl = imgUrl + $(element1).find("img").attr("src") + ","
                    }
                    if($(element1).find("video").attr("src") != "undefined"){
                        videoUrl = videoUrl + $(element1).find("video").attr("src") + ","
                    }
                });
                if(imgUrl != ""){
                    imgUrl = imgUrl.substring(0, imgUrl.length - 1);
                }
                if(videoUrl != ""){
                    videoUrl = videoUrl.substring(0, videoUrl.length - 1);
                }

                var name = $(element).find(".title_name_spot input").val();
                var content = $(element).find(".editor-content textarea").val();
                releasePlay.push({"dayNum": dayNum, "imgUrl": (imgUrl == "undefined" ? null : imgUrl), "videoUrl": (videoUrl == "undefined" ? null : videoUrl), "name": name, "content": content, "typeVal": "0"});
            });
            //酒店
            $.each($(elemVal).find(".hotel_play_div"), (index, element) => {
                var imgUrl = "";
                var videoUrl = "";
                $.each($(element).find(".editor-assets .editor-assets-content .editor-assets-content-info"), function(index, element1){
                    if($(element1).find("img") != "undefined"){
                        imgUrl = imgUrl + $(element1).find("img").attr("src") + ","
                    }
                    if($(element1).find("video").attr("src") != "undefined"){
                        videoUrl = videoUrl + $(element1).find("video").attr("src") + ","
                    }
                });
                if(imgUrl != ""){
                    imgUrl = imgUrl.substring(0, imgUrl.length - 1);
                }
                if(videoUrl != ""){
                    videoUrl = videoUrl.substring(0, videoUrl.length - 1);
                }
                var name = $(element).find(".title_name_spot input").val();
                var content = $(element).find(".editor-content textarea").val();
                releasePlay.push({"dayNum": dayNum, "imgUrl": (imgUrl == "" ? null : imgUrl), "videoUrl": (videoUrl == "" ? null : videoUrl), "name": name, "content": content, "typeVal": "1"});
            });

            //包车
            $.each($(elemVal).find(".charte_play_div"), (index, element) => {
                var imgUrl = "";
                var videoUrl = "";
                $.each($(element).find(".editor-assets .editor-assets-content .editor-assets-content-info"), function(index, element1){
                    if($(element1).find("img") != "undefined"){
                        imgUrl = imgUrl + $(element1).find("img").attr("src") + ","
                    }
                    if($(element1).find("video").attr("src") != "undefined"){
                        videoUrl = videoUrl + $(element1).find("video").attr("src") + ","
                    }
                });
                if(imgUrl != ""){
                    imgUrl = imgUrl.substring(0, imgUrl.length - 1);
                }
                if(videoUrl != ""){
                    videoUrl = videoUrl.substring(0, videoUrl.length - 1);
                }
                var name = $(element).find(".title_name_spot input").val();
                var content = $(element).find(".editor-content textarea").val();
                releasePlay.push({"dayNum": dayNum, "imgUrl": (imgUrl == "" ? null : imgUrl), "videoUrl": (videoUrl == "" ? null : videoUrl), "name": name, "content": content, "typeVal": "2"});
            });
        });
    });
    var releaseDayString = JSON.stringify(releaseDay);
    var releasePlayString = JSON.stringify(releasePlay);
    map.releaseDayString = releaseDayString;
    map.releasePlayString = releasePlayString;
    return map;
}
//保存模板
function submitAddTemplate(){
    layer.load(3);
    let arryValue = theValues();
    $.ajax({
        url: "/template/addSupplierRelease",
        type: "post",
        data: JSON.stringify({
            "releaseDayString": arryValue.releaseDayString,
            "releasePlayString": arryValue.releasePlayString,
            "priceAll": arryValue.priceAll,
            "titleImg": titleImg,
            "offerName": arryValue.offerName,
            "travelTime": $(".start_end_time").text(),
            "other": arryValue.other,
        }),
        headers: {"token": token},
        contentType: "application/json",
        dataType: "json",
        success: (data) => {
            if(data.msg == "200"){
                layer.msg("保存成功", {icon: 1});
            }
            layer.closeAll("loading");
        },
        error: () => {
            layer.alert("服务器异常，请联系管理员", {icon: 2});
            layer.closeAll("loading");
        }
    });
}
//点击其他
function radioClick(obj){
    if($(obj).find(".radio_icon").hasClass("radio_icon_color")){
        $(obj).find(".radio_icon").removeClass("radio_icon_color");
    } else {
        $(obj).find(".radio_icon").addClass("radio_icon_color");
    }
}
//关闭选择订单弹框
function closeVan(obj){
    layer.closeAll();
}
//监听输入框搜索
function getValue(obj){
    let name = $(obj).val();
    loadTemplate(name);
}
//加载模板
function loadTemplate(name){
    $.ajax({
        url: "/template/getSupplierRelease",
        type: "get",
        data: {
            "offerName": name
        },
        headers: {"token": token},
        dataType: "json",
        success: (data) => {
            if(data.msg == "200"){
                $(".van-popup .info .list").find("article").remove();
                $.each(data.data, function(index, item){
                    $(".van-popup .info .list").append("<article onclick='clickTemplae(this)' uuidTemplate="+ item.uuid +" class=\"order\" data-v-429d1032=\"\"><img alt=\"orderCover\" src="+ item.titleImg +" data-v-429d1032=\"\">\n" +
                        "                    <div class=\"order-description\" data-v-429d1032=\"\">\n" +
                        "                        <div class=\"order-description-info\" data-v-429d1032=\"\"><h3 data-v-429d1032=\"\">\n" +
                        "                            "+ item.offerName +"</h3>\n" +
                        "                            <div class=\"introduce\" data-v-429d1032=\"\"><p data-v-429d1032=\"\">该方案由三亚国际旅行社定制师为您提供</p>\n" +
                        "                                <p data-v-429d1032=\"\">出行时间："+ item.travelTime +"</p></div>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"order-description-money\" data-v-429d1032=\"\"><p data-v-429d1032=\"\">报价 <i data-v-429d1032=\"\">¥</i><span data-v-429d1032=\"\">"+ item.priceAll +"</span></p></div>\n" +
                        "                    </div>\n" +
                        "                </article>");
                });
            }
            layer.closeAll("loading");
        },
        error: () => {
            layer.alert("服务器异常，请联系管理员", {icon: 2});
            layer.closeAll("loading");
        }
    });
}
//选择模板
function selectTemplate(uuidTemplate){
    layer.load(3);
    $.ajax({
        url: "/template/getSupplierRelease",
        type: "get",
        data: {
            "uuid": uuidTemplate
        },
        headers: {"token": token},
        dataType: "json",
        success: (data) => {
            if(data.msg == "200"){
                elementDrawing(data);
            }
            layer.closeAll();
        },
        error: () => {
            layer.alert("服务器异常，请联系管理员", {icon: 2});
            layer.closeAll("loading");
        }
    });
}
//选择模板
function clickTemplae(obj){
    $(obj).addClass("order-selected");
}