@ -5150,7 +5150,7 @@ class Information extends CI_Controller
$data = array();
#region 公用数据
$apiurl = "http://202.103.68.104:97 /info.php"; //本地测试
$apiurl = "http://202.103.68.104:61 /info.php"; //本地测试
//$apiurl = "https://ct.mycht.cn/info.php"; //网前
//先准备数据,采用直接赋值视图然后返回视图字符串的模式,不使用一次次替换视图模板内容的模式。
@ -5205,7 +5205,7 @@ class Information extends CI_Controller
$arrExitUrl = array("/", "/culture", "/guide", "/tour", "/citytour", "/daytrip", "/asia-tour", "/china-trains");
if (empty(get_meta($information->ic_id, 'meta_product_code')) || in_array($information->ic_url, $arrExitUrl)) {
$data["FloatIcon"] = "< div class = \"fixed-tm\" > < a href = \"/forms/customize\" > Create My Trip < / a > < / div > ";
$data["FloatIcon"] = "< div class = \"fixed-tm\" > < a href = \"/forms/customize\" > 私人定制 < / a > < / div > ";
} else {
$data["ISPRODUCT"] = "yes";
}
@ -5220,7 +5220,7 @@ class Information extends CI_Controller
//主样式表,内联模式
$apiweb="http://202.103.68.104:97"; //本地测试
//$apiweb = "https://data.guilinchina.net ";
//$apiweb = "https://data.hualiyingtravel.com ";
$cssUrl = $apiweb . "/css/css3/base.css?v=" . time();
$main_css_string = compress_css(GET_HTTP($cssUrl));
$data["MAINCSS"] = '< style type = "text/css" > ' . $main_css_string . ' < / style > ';
@ -5253,15 +5253,24 @@ class Information extends CI_Controller
$data["ConstructionCode"] = $meta_construction_code;
}
$data["meta_index_set"]="";
$meta_index_set = get_meta($information->ic_id, 'meta_index_set');
if (!empty($meta_index_set)) {
$data["meta_index_set"] = '< meta name = "robots" content = "' . $meta_index_set . '" / > ';
}
//总JS: 为了方便以后js好维护, 必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js, 所以必须在这里进行判断
$addBaseJs = false;
$addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
$meta_ct_page_Carousel = get_meta($information->ic_id,'meta_ct_page_Carousel'); //是否有顶部轮播图
if ($meta_ct_page_price == "yes") {
$addBaseJs = true;
} else if ($meta_ct_page_type !== false & & $meta_ct_page_type != "") {
$addBaseJs = true;
}else if ($meta_ct_page_Carousel == "yes"){
$addBaseJs = true;
}
if ($addBaseJs) {
@ -5285,9 +5294,11 @@ class Information extends CI_Controller
$addonJs .= '< script src = "' . $apiweb . '/js/mobile-first/getlist.js" defer > < / script > ';
}
//天气
if (in_array($meta_ct_page_type, array('weatherpage'))) {
$addonJs .= '< script src = "' . $apiweb . '/js/mobile-first/getweather.js" defer > < / script > ';
//顶部轮播图
if ($meta_ct_page_Carousel == "yes"){
$addonJs .= '< script src = "'.$apiweb.'/js/splide4/splide.min.js" defer > < / script > ';
$addonJs .= '< script src = "'.$apiweb.'/js/mobile-first/carouse.js" defer > < / script > ';
$data["ADDONCSS"] .= '< link href = "' . $apiweb . '/js/splide4/splide.min.css" rel = "preload" as = "style" onload = "this.rel=\'stylesheet\'" / > ';
}
//页面传递参数
@ -5320,15 +5331,60 @@ class Information extends CI_Controller
if (!empty($meta_ct_page_value)) {
$productCode = $meta_ct_page_value;
}
$addonJs .= '< script src = "' . $apiweb . '/js/mobile-first/daytripdetail.js" defer > < / script > ';
//$addonJs .= '< script src = "'.$apiweb.'/js/mobile-first/flatpickr.js" > < / script > ';
$data["ADDONCSS"] .= '< link href = "' . $apiweb . '/css/css3/flatpickr.css" rel = "preload" as = "style" onload = "this.rel=\'stylesheet\'" / > ';
//一日游表单的替换
$DayTripData["productCode"] = $productCode;
$template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
//使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
$DayTripData["picture_mobile"] = get_meta($information->ic_id, 'meta_addon_picture_mobile');
$DayTripData["picture_pc"] = get_meta($information->ic_id, 'meta_addon_picture');
$DayTripData["TITLE"] = $information->ic_title;
$arrCAD = ['HLYCAD-S','HLYCAD-V','HLYCAD-P'];//水灯节
$arrTest = ['QM-9-A','QM-9-B','QM-9-C'];
if (in_array($productCode,$arrTest)){ //水灯节
/**替换左右结构的线路表单标签 2024-7-4*/
if (strpos($ic_content, '<!-- @DAYTRIP - CAD - FORM@ --> ') !== false) {
//准备数据
$InfoData = new stdClass(); //传递用来计算的信息平台数据
//附加选项
$t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
$t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
$t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
$InfoData->t_excludedate = $t_excludedate;
$InfoData->t_includedate = $t_includedate;
$InfoData->t_excludemonth = $t_excludemonth;
$DayTripData["InfoData"] = $InfoData; //传递信息平台数据
$linktour = get_meta($information->ic_id, 'meta_trainspread_linktour'); //关联线路
if (!empty($linktour)){
$paramCode = $productCode.",".$linktour;
}else{
$paramCode = $productCode;
}
//产品汉特信息,测试地址: http://202.103.68.104:61/info.php/thirdparty/ctmobilefirst/api/getDaytripDetail/?webcode=hly& param=QM-9-A,QM-9-B,QM-9-C
$TourData = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getDaytripDetail/?webcode=hly& param=" . $paramCode));
$DayTripData["TourData"] = $TourData;
//替换模板
$template_form_daydetail = $this->load->view($template_path . '-cad-form', $DayTripData, true); //模板内容
$ic_content = str_replace('<!-- @DAYTRIP - CAD - FORM@ --> ', $template_form_daydetail, $ic_content);
}
}
else if (1==2) { //默认,暂时没有
$addonJs .= '< script src = "' . $apiweb . '/js/mobile-first/daytripdetail.js" defer > < / script > ';
$data["ADDONCSS"] .= '< link href = "' . $apiweb . '/css/css3/flatpickr.css" rel = "preload" as = "style" onload = "this.rel=\'stylesheet\'" / > ';
$template_form_daydetail = $this->load->view($template_path . '-daydetail-form', $DayTripData, true); //模板内容
//使用simple_html_dom_lib库来进行表单添加
$ic_content = $this->html_optimize_lib->add_htmlcode($ic_content, "#maincontent", $template_form_daydetail);
}
}
if ($meta_ct_page_type == "tourdetail") {
//线路
@ -5339,23 +5395,26 @@ class Information extends CI_Controller
}
//获取cli_sn
$tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode."&webcode= guilin "));
$tourdata = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getCliSn/?param=" . $productCode."&webcode= hly "));
$data["clisn"] = $tourdata->clisn;
//获取price
$tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode."&webcode= guilin "));
$tourprice = json_decode(GET_HTTP($apiurl . "/thirdparty/ctmobilefirst/api/getTourPrice/?param=" . $productCode."&webcode= hly "));
$dataform["tourprice"] = $tourprice->price;
//调取模板
$dataform["TourCode"] = $productCode;
$dataform["CLI_SN"] = $tourdata->clisn;
$dataform["TourName"] = $information->ic_title;
$addonJs .= '< script src = "' . $apiweb . '/js/mobile-first/tourdetail.js" defer > < / script > ';
$data["ADDONCSS"] .= '< link href = "' . $apiweb . '/css/css3/flatpickr.css" rel = "preload" as = "style" onload = "this.rel=\'stylesheet\'" / > ';
}
//表单页
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform", "tourdetail" ))) {
if (in_array($meta_ct_page_type, array("customize", "contactus", "pagewithform"))) {
$productType = $meta_ct_page_type;
$addonJs .= '< script src = "' . $apiweb . '/js/mobile-first/form.js" defer > < / script > ';
$data["ADDONCSS"] .= '< link href = "' . $apiweb . '/css/css3/flatpickr.css" rel = "preload" as = "style" onload = "this.rel=\'stylesheet\'" / > ';
@ -5407,9 +5466,26 @@ class Information extends CI_Controller
if ($meta_ct_page_type == "tourdetail") { //线路表单,左右结构,用标签来做
$dataform['device'] = $device;
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi-new', $dataform, true);
$ic_content = str_replace('<!-- @TOUR - FORM@ --> ', $template_form_tourqi, $ic_content);
$data["CUSTOMCONENT"] = $ic_content;
if (strpos($ic_content, '<!-- @TOUR - FORM@ --> ') !== false) {
$InfoData = new stdClass(); //传递用来计算的信息平台数据
$t_excludedate = get_meta($information->ic_id, "meta_trippest_excludedate");
$t_includedate = get_meta($information->ic_id, "meta_trippest_includedate");
$t_excludemonth = get_meta($information->ic_id, "meta_trippest_excludemonth");
$InfoData->t_excludedate = $t_excludedate;
$InfoData->t_includedate = $t_includedate;
$InfoData->t_excludemonth = $t_excludemonth;
$InfoData->t_defaultDate = get_meta($information->ic_id, "meta_trippest_defaultDate");
$dataform["InfoData"] = $InfoData; //传递信息平台数据
$template_form_tourqi = $this->load->view($template_path . '-form-tourqi', $dataform, true);
$ic_content = str_replace('<!-- @TOUR - FORM@ --> ', $template_form_tourqi, $ic_content);
$data["CUSTOMCONENT"] = $ic_content;
}
}
//两种设备分别调用两种模板 ,静态化