价格读取完成,并添加CT使用的页面类型

ct-mobile-first
赵鹏 4 years ago
parent 90c6df6bdb
commit 6290c843a6

@ -776,21 +776,23 @@ class Information extends CI_Controller
/* 详细内容 */ /* 详细内容 */
$ic_content = $information->ic_content; $ic_content = $information->ic_content;
/**替换详细内容里面的价格 // /**替换详细内容里面的价格
* // 一日游价格标签, "<!--@DayTripPrice:XASIC-41@-->" 或者<!--@DayTripPrice:XASIC-41,2@--> 逗号后面是人数 /* 直接使用fetch来啊动态获取价格这样不用替换标签直接录标签
* //精华线路标签"<!--@TourPrice:ct-1@-->" // * // 一日游价格标签, "<!--@DayTripPrice:XASIC-41@-->" 或者<!--@DayTripPrice:XASIC-41,2@--> 逗号后面是人数
*/ // * //精华线路标签"<!--@TourPrice:ct-1@-->"
$ic_content = preg_replace_callback('/<!--@DayTripPrice:(.*)@-->/i',function($match){ // */
//处理一日游每次配备 // $ic_content = preg_replace_callback('/<!--@DayTripPrice:(.*)@-->/i',function($match){
$matchItem = $match[1]; // //处理一日游每次配备
return '<span class="js_getDayTripPrice" data="'.$matchItem.'"></span>';; // $matchItem = $match[1];
},$ic_content); // return '<span class="js_getDayTripPrice" data="'.$matchItem.'"></span>';;
$ic_content = preg_replace_callback('/<!--@TourPrice:(.*)@-->/i',function($match){ // },$ic_content);
//处理精华线路每次配备 // $ic_content = preg_replace_callback('/<!--@TourPrice:(.*)@-->/i',function($match){
$matchItem = $match[1]; // //处理精华线路每次配备
return '<span class="js_getTourPrice" data="'.$matchItem.'"></span>';; // $matchItem = $match[1];
},$ic_content); // return '<span class="js_getTourPrice" data="'.$matchItem.'"></span>';;
// },$ic_content);
$ic_content = '<div class="container-details details-content">'.$ic_content.'</div>'; //兼容拷贝过来的内容样式
$data["CUSTOMCONENT"]=$ic_content; $data["CUSTOMCONENT"]=$ic_content;
@ -802,7 +804,7 @@ class Information extends CI_Controller
if (empty(get_meta($information->ic_id, 'meta_product_code'))) { if (empty(get_meta($information->ic_id, 'meta_product_code'))) {
} else { } else {
$data["PRODUCTJS"] = '<script src="https://data.chinatravel.com/js/mobile-first/flatpickr.js"></script>'; // $data["PRODUCTJS"] = '<script src="https://data.chinatravel.com/js/mobile-first/flatpickr.js"></script>';
} }
//顶部全屏大图 //顶部全屏大图
@ -811,10 +813,10 @@ class Information extends CI_Controller
$meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url'); $meta_addon_picture_url = get_meta($information->ic_id, 'meta_addon_picture_url');
if($device=='mobile'){//移动端读取移动大图 if($device=='mobile'){//移动端读取移动大图
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile'); $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture_mobile');
$bannerImg = '<img class="img-responsive" width="750" height="650" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '">'; $bannerImg = '<img class="img-responsive" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '">';
}else{ }else{
$meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture'); $meta_addon_picture = get_meta($information->ic_id, 'meta_addon_picture');
$bannerImg = '<img class="img-responsive" width="1920" height="720" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '">'; $bannerImg = '<img class="img-responsive" alt="' . $information->ic_title . '" src="' . $meta_addon_picture . '">';
$meta_addon_picture_text = get_meta($information->ic_id,'meta_addon_picture_text'); $meta_addon_picture_text = get_meta($information->ic_id,'meta_addon_picture_text');
if(!empty($meta_addon_picture_url)){ if(!empty($meta_addon_picture_url)){
$ImgText = '<div class="carousel-caption"><p class="ads-title"><a href="'.$meta_addon_picture_url.'">'.$meta_addon_picture_text.'</a></p></div>'; $ImgText = '<div class="carousel-caption"><p class="ads-title"><a href="'.$meta_addon_picture_url.'">'.$meta_addon_picture_text.'</a></p></div>';
@ -860,13 +862,34 @@ class Information extends CI_Controller
} }
//总JS为了方便以后js好维护必须的把一些公用的JS统计到一个文件。但是又不是所有页面都需要调用这个基础js所以必须在这里进行判断
$addBaseJs = false;
$addonJs = "";
$meta_ct_page_price = get_meta($information->ic_id, 'meta_ct_page_price'); //是否包含价格
$meta_ct_page_type = get_meta($information->ic_id, 'meta_ct_page_type'); //页面类型
if ($meta_ct_page_price=="yes"){
$addBaseJs=true;
}else if ($meta_ct_page_type!==false && $meta_ct_page_type!=""){
$addBaseJs=true;
}
if ($addBaseJs){
$addonJs='<script src="/js/mobile-first/base.js"></script>';
}
/// ----- 总JS判断完成-----
//额外js //额外js
$data["ADDONJS"]=""; $data["ADDONJS"]="";
$meta_addon_js = get_meta($information->ic_id, 'meta_addon_js'); $meta_addon_js = get_meta($information->ic_id, 'meta_addon_js');
if (!empty($meta_addon_js)) { if (!empty($meta_addon_js)) {
$data["ADDONJS"]='<script src="' . $meta_addon_js . '"></script>'; $addonJs .='<script src="' . $meta_addon_js . '"></script>';
}
//价格js
if ($meta_ct_page_price=="yes"){
$addonJs .= '<script src="/js/mobile-first/getprice.js"></script>';
} }
$data["ADDONJS"]=$addonJs;
//社媒分享图片 //社媒分享图片
$data["OGIMAGE"]=""; $data["OGIMAGE"]="";
if (!empty($information->ic_photo)) { if (!empty($information->ic_photo)) {

@ -879,7 +879,7 @@
<?php if ($information->ic_sitecode == 'chinatravel') { <?php if ($information->ic_sitecode == 'chinatravel') {
?> ?>
<div> <div>
<div class="col-sm-8"> <div class="col-sm-8">
<label>附加图片说明文字 <label>附加图片说明文字
<a href="javascript:void(0);" <a href="javascript:void(0);"
onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_addon_picture_text', $('#meta_addon_picture_text').val())"><i onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_addon_picture_text', $('#meta_addon_picture_text').val())"><i
@ -894,7 +894,75 @@
class="form-control" class="form-control"
value="<?php echo get_meta($information->ic_id, 'meta_addon_picture_text'); ?>"/> value="<?php echo get_meta($information->ic_id, 'meta_addon_picture_text'); ?>"/>
</div> </div>
</div> <div class="col-sm-6">
<label>页面类型
<a href="javascript:void(0);"
onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_ct_page_type', $('#meta_ct_page_type').val())"><i
class="text-muted glyphicon glyphtext-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);"
onclick="meta('save', '<?php echo $information->ic_id; ?>', 'meta_ct_page_type', $('#meta_ct_page_type').val())"><i
class="text-muted glyphicon glyphtext-muted glyphicon glyphicon-hdd"></i></a>
<a href="javascript:void(0);" title="用于说明页面的类型,比如选择一日游详细页与选择精华游详细页,这两个页面预订流程不一样"><i
class="text-muted glyphicon glyphicon-question-sign"></i></a>
</label>
<select name="meta_ct_page_type" id="meta_ct_page_type" class="form-control">
<option value="" <?php echo get_meta($information->ic_id, 'meta_ct_page_type') === '' ? 'selected' : false; ?>>
</option>
<option value="daytripindex" <?php echo get_meta($information->ic_id, 'meta_ct_page_type') === 'daytripindex' ? 'selected' : false; ?>>
一日游首页
</option>
<option value="daytripdetail" <?php echo get_meta($information->ic_id, 'meta_ct_page_type') === 'daytripdetail' ? 'selected' : false; ?>>
一日游详细
</option>
<option value="tourindex" <?php echo get_meta($information->ic_id, 'meta_ct_page_type') === 'tourindex' ? 'selected' : false; ?>>
线路首页
</option>
<option value="tourdetail" <?php echo get_meta($information->ic_id, 'meta_ct_page_type') === 'tourdetail' ? 'selected' : false; ?>>
线路详细
</option>
</select>
</div>
<div class="col-sm-6">
<label>页面类型值
<a href="javascript:void(0);"
onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_ct_page_value', $('#meta_ct_page_value').val())"><i
class="text-muted glyphicon glyphtext-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);"
onclick="meta('save', '<?php echo $information->ic_id; ?>', 'meta_ct_page_value', $('#meta_ct_page_value').val())"><i
class="text-muted glyphicon glyphtext-muted glyphicon glyphicon-hdd"></i></a>
<a href="javascript:void(0);" title="此属性用于对应上面那个页面类型的值比如选择一日游首页那么这里录入shanghai就可以动态读取上海的一日游列表."><i
class="text-muted glyphicon glyphicon-question-sign"></i></a>
</label>
<input name="meta_ct_page_value" id="meta_ct_page_value" type="text"
class="form-control"
value="<?php echo get_meta($information->ic_id, 'meta_ct_page_value'); ?>"/>
</div>
<div class="col-sm-4">
<label>页面是否有价格
<a href="javascript:void(0);"
onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_ct_page_price', $('#meta_ct_page_price').val())"><i
class="text-muted glyphicon glyphtext-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);"
onclick="meta('save', '<?php echo $information->ic_id; ?>', 'meta_ct_page_price', $('#meta_ct_page_price').val())"><i
class="text-muted glyphicon glyphtext-muted glyphicon glyphicon-hdd"></i></a>
<a href="javascript:void(0);" title='页面上如果有价格,那么需要选择这个选项。并且在页面代码里面设置读取标签。一日游:<span class="js_getDayTripPrice" data="线路编码"></span> 线路:<span class="js_getTourPrice" data="线路编码"> </span>'><i
class="text-muted glyphicon glyphicon-question-sign"></i></a>
</label>
<select name="meta_ct_page_price" id="meta_ct_page_price"
class="form-control">
<option value="no" <?php echo get_meta($information->ic_id, 'meta_ct_page_price') === 'no' ? 'selected' : false; ?>>
</option>
<option value="yes" <?php echo get_meta($information->ic_id, 'meta_ct_page_price') === 'yes' ? 'selected' : false; ?>>
</option>
</select>
</div>
</div>
<?php } ?> <?php } ?>
<input type="hidden" name="ic_photo_width" id="ic_photo_width" <input type="hidden" name="ic_photo_width" id="ic_photo_width"

Loading…
Cancel
Save