모바일 상품 보기 타입 버튼 미작동 오류 수정
This commit is contained in:
@ -142,7 +142,7 @@ var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
|
||||
$list->set_order_by($order_by);
|
||||
$list->set_from_record($from_record);
|
||||
$list->set_view('it_img', true);
|
||||
$list->set_view('it_id', true);
|
||||
$list->set_view('it_id', false);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_price', true);
|
||||
$list->set_view('sns', true);
|
||||
@ -161,7 +161,7 @@ var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
|
||||
if($i > 0 && $total_count > $items) {
|
||||
$qstr1 .= 'ca_id='.$ca_id;
|
||||
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
|
||||
$ajax_url = G5_SHOP_URL.'/ajax.list.php?'.$qstr1;
|
||||
$ajax_url = G5_SHOP_URL.'/ajax.list.php?'.$qstr1.'&use_sns=1';
|
||||
?>
|
||||
<div class="li_more">
|
||||
<p id="item_load_msg"><img src="<?php echo G5_SHOP_CSS_URL; ?>/img/loading.gif" alt="로딩이미지" ><br>잠시만 기다려주세요.</p>
|
||||
|
||||
@ -5,7 +5,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<?php if($config['cf_kakao_js_apikey']) { ?>
|
||||
<?php if(!defined('G5_IS_SHOP_AJAX_LIST') && $config['cf_kakao_js_apikey']) { ?>
|
||||
<script src="https://developers.kakao.com/sdk/js/kakao.min.js"></script>
|
||||
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
|
||||
<script>
|
||||
@ -16,15 +16,20 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
|
||||
<!-- 메인상품진열 10 시작 { -->
|
||||
<?php
|
||||
$li_width = intval(100 / $this->list_mod);
|
||||
$is_gallery_list = ($this->ca_id && isset($_COOKIE['ck_itemlist'.$this->ca_id.'_type'])) ? $_COOKIE['ck_itemlist'.$this->ca_id.'_type'] : '';
|
||||
if(!$is_gallery_list){
|
||||
$is_gallery_list = 'gallery';
|
||||
}
|
||||
$li_width = ($is_gallery_list === 'gallery') ? intval(100 / $this->list_mod) : 100;
|
||||
$li_width_style = ' style="width:'.$li_width.'%;"';
|
||||
$ul_sct_class = ($is_gallery_list === 'gallery') ? 'sct_10' : 'sct_20';
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
if ($i == 0) {
|
||||
if ($this->css) {
|
||||
echo "<ul id=\"sct_wrap\" class=\"{$this->css}\">\n";
|
||||
} else {
|
||||
echo "<ul id=\"sct_wrap\" class=\"sct sct_10\">\n";
|
||||
echo "<ul id=\"sct_wrap\" class=\"sct ".$ul_sct_class."\">\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +38,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
else
|
||||
$li_clear = '';
|
||||
|
||||
echo "<li class=\"sct_li{$li_clear}\"$li_width_style><div class=\"li_wr\">\n";
|
||||
echo "<li class=\"sct_li{$li_clear}\"$li_width_style><div class=\"li_wr is_view_type_list\">\n";
|
||||
|
||||
if ($this->href) {
|
||||
echo "<div class=\"sct_img\"><a href=\"{$this->href}{$row['it_id']}\">\n";
|
||||
@ -90,3 +95,40 @@ if ($i > 0) echo "</ul>\n";
|
||||
if($i == 0) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
|
||||
?>
|
||||
<!-- } 상품진열 10 끝 -->
|
||||
|
||||
<?php if( !defined('G5_IS_SHOP_AJAX_LIST') ) { ?>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
var li_width = "<?php echo intval(100 / $this->list_mod); ?>",
|
||||
img_width = "<?php echo $this->img_width; ?>",
|
||||
img_height = "<?php echo $this->img_height; ?>",
|
||||
list_ca_id = "<?php echo $this->ca_id; ?>";
|
||||
|
||||
function shop_list_type_fn(type){
|
||||
var $ul_sct = $("ul.sct");
|
||||
|
||||
if(type == "gallery") {
|
||||
$ul_sct.removeClass("sct_20").addClass("sct_10")
|
||||
.find(".sct_li").attr({"style":"width:"+li_width+"%"});
|
||||
} else {
|
||||
$ul_sct.removeClass("sct_10").addClass("sct_20")
|
||||
.find(".sct_li").removeAttr("style");
|
||||
}
|
||||
|
||||
if (typeof g5_cookie_domain != 'undefined') {
|
||||
set_cookie("ck_itemlist"+list_ca_id+"_type", type, 1, g5_cookie_domain);
|
||||
}
|
||||
}
|
||||
|
||||
$("button.sct_lst_view").on("click", function() {
|
||||
var $ul_sct = $("ul.sct");
|
||||
|
||||
if($(this).hasClass("sct_lst_gallery")) {
|
||||
shop_list_type_fn("gallery");
|
||||
} else {
|
||||
shop_list_type_fn("list");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
@ -101,6 +101,10 @@
|
||||
.sct_20 .sct_txt{font-weight:bold;font-size:1.083em;margin:0px 10px 5px;line-height:1.5em}
|
||||
.sct_20 .sct_cost{margin:5px 10px}
|
||||
.sct_20 .sct_sns{margin:10px 10px}
|
||||
.sct_20 .li_wr.is_view_type_list{padding-left:130px;height:130px}
|
||||
.sct_20 .li_wr.is_view_type_list .sct_img{width:130px}
|
||||
.sct_20 .li_wr.is_view_type_list .sct_img a{display:block}
|
||||
.sct_20 .li_wr.is_view_type_list img{width:100%;height:auto}
|
||||
|
||||
/* 상품 목록 스킨 30 */
|
||||
.sct_30 .sct_li{;width:100%;margin:5px 0; text-align:left;width:100%;float:left}
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
include_once('./_common.php');
|
||||
include_once(G5_LIB_PATH.'/json.lib.php');
|
||||
|
||||
define('G5_IS_SHOP_AJAX_LIST', true);
|
||||
|
||||
$data = array();
|
||||
|
||||
$sql = " select *
|
||||
@ -60,6 +62,9 @@ $list->set_view('it_img', true);
|
||||
$list->set_view('it_id', false);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_price', true);
|
||||
if(isset($use_sns) && $use_sns){
|
||||
$list->set_view('sns', true);
|
||||
}
|
||||
echo $list->run();
|
||||
|
||||
$content = ob_get_contents();
|
||||
|
||||
@ -5,7 +5,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<?php if($config['cf_kakao_js_apikey']) { ?>
|
||||
<?php if(!defined('G5_IS_SHOP_AJAX_LIST') && $config['cf_kakao_js_apikey']) { ?>
|
||||
<script src="https://developers.kakao.com/sdk/js/kakao.min.js"></script>
|
||||
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
|
||||
<script>
|
||||
@ -16,15 +16,20 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
|
||||
<!-- 메인상품진열 10 시작 { -->
|
||||
<?php
|
||||
$li_width = intval(100 / $this->list_mod);
|
||||
$is_gallery_list = ($this->ca_id && isset($_COOKIE['ck_itemlist'.$this->ca_id.'_type'])) ? $_COOKIE['ck_itemlist'.$this->ca_id.'_type'] : '';
|
||||
if(!$is_gallery_list){
|
||||
$is_gallery_list = 'gallery';
|
||||
}
|
||||
$li_width = ($is_gallery_list === 'gallery') ? intval(100 / $this->list_mod) : 100;
|
||||
$li_width_style = ' style="width:'.$li_width.'%;"';
|
||||
$ul_sct_class = ($is_gallery_list === 'gallery') ? 'sct_10' : 'sct_20';
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
if ($i == 0) {
|
||||
if ($this->css) {
|
||||
echo "<ul id=\"sct_wrap\" class=\"{$this->css}\">\n";
|
||||
} else {
|
||||
echo "<ul id=\"sct_wrap\" class=\"sct sct_10\">\n";
|
||||
echo "<ul id=\"sct_wrap\" class=\"sct ".$ul_sct_class."\">\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +38,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
else
|
||||
$li_clear = '';
|
||||
|
||||
echo "<li class=\"sct_li{$li_clear}\"$li_width_style><div class=\"li_wr\">\n";
|
||||
echo "<li class=\"sct_li{$li_clear}\"$li_width_style><div class=\"li_wr is_view_type_list\">\n";
|
||||
|
||||
if ($this->href) {
|
||||
echo "<div class=\"sct_img\"><a href=\"{$this->href}{$row['it_id']}\">\n";
|
||||
@ -90,3 +95,40 @@ if ($i > 0) echo "</ul>\n";
|
||||
if($i == 0) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
|
||||
?>
|
||||
<!-- } 상품진열 10 끝 -->
|
||||
|
||||
<?php if( !defined('G5_IS_SHOP_AJAX_LIST') ) { ?>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
var li_width = "<?php echo intval(100 / $this->list_mod); ?>",
|
||||
img_width = "<?php echo $this->img_width; ?>",
|
||||
img_height = "<?php echo $this->img_height; ?>",
|
||||
list_ca_id = "<?php echo $this->ca_id; ?>";
|
||||
|
||||
function shop_list_type_fn(type){
|
||||
var $ul_sct = $("ul.sct");
|
||||
|
||||
if(type == "gallery") {
|
||||
$ul_sct.removeClass("sct_20").addClass("sct_10")
|
||||
.find(".sct_li").attr({"style":"width:"+li_width+"%"});
|
||||
} else {
|
||||
$ul_sct.removeClass("sct_10").addClass("sct_20")
|
||||
.find(".sct_li").removeAttr("style");
|
||||
}
|
||||
|
||||
if (typeof g5_cookie_domain != 'undefined') {
|
||||
set_cookie("ck_itemlist"+list_ca_id+"_type", type, 1, g5_cookie_domain);
|
||||
}
|
||||
}
|
||||
|
||||
$("button.sct_lst_view").on("click", function() {
|
||||
var $ul_sct = $("ul.sct");
|
||||
|
||||
if($(this).hasClass("sct_lst_gallery")) {
|
||||
shop_list_type_fn("gallery");
|
||||
} else {
|
||||
shop_list_type_fn("list");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
@ -15,7 +15,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<!-- 메인상품진열 10 시작 { -->
|
||||
<!-- 메인상품진열 20 시작 { -->
|
||||
<?php
|
||||
$li_width = intval(100 / $this->list_mod);
|
||||
$li_width_style = ' style="width:'.$li_width.'%;"';
|
||||
@ -95,4 +95,4 @@ if ($i > 0) echo "</ul>\n";
|
||||
|
||||
if($i == 0) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
|
||||
?>
|
||||
<!-- } 상품진열 10 끝 -->
|
||||
<!-- } 상품진열 20 끝 -->
|
||||
|
||||
@ -15,7 +15,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<!-- 메인상품진열 10 시작 { -->
|
||||
<!-- 메인상품진열 30 시작 { -->
|
||||
<?php
|
||||
$li_width = intval(100 / $this->list_mod);
|
||||
$li_width_style = ' style="width:'.$li_width.'%;"';
|
||||
@ -95,4 +95,4 @@ if ($i > 0) echo "</ul>\n";
|
||||
|
||||
if($i == 0) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
|
||||
?>
|
||||
<!-- } 상품진열 10 끝 -->
|
||||
<!-- } 상품진열 30 끝 -->
|
||||
|
||||
@ -100,6 +100,10 @@
|
||||
.sct_20 .sct_txt{font-weight:bold;font-size:1.083em;margin:0px 10px 5px;line-height:1.5em}
|
||||
.sct_20 .sct_cost{margin:5px 10px}
|
||||
.sct_20 .sct_sns{margin:10px 10px}
|
||||
.sct_20 .li_wr.is_view_type_list{padding-left:130px;height:130px}
|
||||
.sct_20 .li_wr.is_view_type_list .sct_img{width:130px}
|
||||
.sct_20 .li_wr.is_view_type_list .sct_img a{display:block}
|
||||
.sct_20 .li_wr.is_view_type_list img{width:100%;height:auto}
|
||||
|
||||
/* 상품 목록 스킨 30 */
|
||||
.sct_30 .sct_li{;width:100%;margin:5px 0; text-align:left;width:100%;float:left}
|
||||
|
||||
Reference in New Issue
Block a user