Merge branch 'devs' of https://gitlab.com/big.imcloud/badyfeed/bf into devs
commit
6b94f20679
@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="jst.web" version="3.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="jst.jaxrs" version="1.1"/>
|
||||
<installed facet="java" version="1.7"/>
|
||||
<installed facet="jst.web" version="3.0"/>
|
||||
</faceted-project>
|
||||
|
@ -1,79 +0,0 @@
|
||||
<#include "/m/include/index_top.ftl">
|
||||
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/swiper.min.css">
|
||||
<script src="${URL_STATIC_ROOT}/m/js/swiper.min.js"></script>
|
||||
<script src="${URL_STATIC_ROOT}/m/js/jquery_popupoverlay.js"></script>
|
||||
<script src="${URL_STATIC_ROOT}/m/js/design.js"></script>
|
||||
|
||||
<body class="bg_nutrition">
|
||||
|
||||
<!-- wrap -->
|
||||
<div class="wrap">
|
||||
|
||||
<!-- header_sub -->
|
||||
<header class="header_wrapper">
|
||||
<a href="javascript:back.return_url();" class="side_Lbtn hidden pre_btn">이전으로</a>
|
||||
<h1 class="header_title">모유/젖병</h1>
|
||||
<div class="side_Rbtn">
|
||||
</div>
|
||||
</header>
|
||||
<!-- //header_sub -->
|
||||
|
||||
<!-- main_nutrition -->
|
||||
<main class="main_nutrition">
|
||||
|
||||
<!-- nutrition_search_main -->
|
||||
<div class="nutrition_search_main">
|
||||
|
||||
<div class="cart_list_btn">
|
||||
<a href="#" id="save">저장</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- //nutrition_search_main -->
|
||||
|
||||
</main>
|
||||
<!-- //main_nutrition -->
|
||||
|
||||
</div>
|
||||
<!-- //wrap -->
|
||||
|
||||
<!-- 하단 네비 iyu_nav -->
|
||||
<#include "/m/include/index_bottom_menu.ftl">
|
||||
<!-- //iyu_nav -->
|
||||
|
||||
<#include "/m/bf_food/include_return_url.ftl">
|
||||
|
||||
</body>
|
||||
<#include "/m/include/index_bottom.ftl">
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$(function() { //전체선택 체크박스 클릭
|
||||
$("#save").click(function() {
|
||||
debugger;
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_bottle/ajax_insert_bottle.do',
|
||||
type:'post',
|
||||
data:{
|
||||
"dbi_no":'84',
|
||||
"title": '테스트 타이틀 입니다.',
|
||||
"member_id":'${model['member_id']!}'
|
||||
},
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
},
|
||||
success:function(result){
|
||||
if(result.RESULT==1)
|
||||
alert('카트에 분유수유가 추가되었습니다.');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
@ -0,0 +1,325 @@
|
||||
<#include "/m/include/index_top.ftl">
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/anypicker-all.css">
|
||||
<!-- 달력 datepicker -->
|
||||
<script type="text/javascript" src="${URL_STATIC_ROOT}/m/js/anypicker.min.js"></script>
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/datepicker.css" type="text/css" />
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
|
||||
<script src="http://code.jquery.com/jquery-1.7.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="/bf/m/js/jquery.bpopup.min.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.Pstyle {
|
||||
opacity: 0;
|
||||
display: none;
|
||||
position: relative;
|
||||
width: auto;
|
||||
border: 5px solid #fff;
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.b-close {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
padding: 5px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<#assign thumb_path = (model['rm_child']['append_300_img_file'])!>
|
||||
<#if thumb_path?has_content>
|
||||
<#assign thumb_path="/file/get_img.do?mt_file_seq="+thumb_path >
|
||||
<#if thumb_path?index_of("http") != 0><#assign thumb_path = URL_ROOT + thumb_path></#if>
|
||||
<#else>
|
||||
<#if (model['rm_child']['gender'])! == 'F'>
|
||||
<#assign thumb_path = '/bf/m/img/child/child_pic_04.png' >
|
||||
<#else>
|
||||
<#assign thumb_path = '/bf/m/img/child/child_pic_03.png' >
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
<script>
|
||||
function CMD_MEASUREMENT_HEIGHT(smc_no) {
|
||||
var cmd = 'CMD_MEASUREMENT_HEIGHT';
|
||||
var args = {
|
||||
smc_no: smc_no,
|
||||
};
|
||||
try{
|
||||
window.interface.executeInterface(function(r){console.log('sussess:', r);}, function(r){console.log('fail:', r);}, cmd, args);
|
||||
}catch(e){
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<body><!--grey_bg / blue_w_bg /blue_g_bg-->
|
||||
<div class="wrap">
|
||||
<header class="header_wrapper">
|
||||
<a href="javascript:back.return_url()" class="side_Lbtn hidden pre_btn">이전으로</a>
|
||||
<h1 class="header_title">${model['rm_child']['name']} 분유 추가</h1>
|
||||
<div class="side_Rbtn">
|
||||
<a href="#" class="growth_cal">
|
||||
<input type="text" id="date">
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<main class="m_child_direct_input" id="top_move">
|
||||
<div class="profile_wrap">
|
||||
<input type="hidden" id="smc_no" class="required" name="smc_no" value="${model['smc_no']}" data-tit="아이 코드"/>
|
||||
<form class="profile_header" id="frmLacMilk" method="POST">
|
||||
<div class="p_header_pic">
|
||||
<div class="pic hidden" style="background: url(${thumb_path})">프로필 사진</div>
|
||||
<div class="child_tit">
|
||||
<div class="name"><a href="javascript:CMD_MEASUREMENT_HEIGHT('${model['rm_child']['smc_no']}');">${model['rm_child']['name']}</a></div>
|
||||
<div class="age">${model['rm_child']['age_y']!}세 ${model['rm_child']['age_m']!}개월</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile_list">
|
||||
<h2 class="p_title">정보입력</h2>
|
||||
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_height" class="p_label">분유 선택</label>
|
||||
<div class="p_select_box">
|
||||
<select id="dm_fg_cd" name="dm_fg_cd" value="${model['dm_fg_cd']!}" class="form-control m-r-3" >
|
||||
<option value="1">분유</option>
|
||||
<option value="2">유축수유</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_height" class="p_label">섭취시간</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="dm_minute" name="dm_minute" value="${model['dm_minute']!}" class="required" placeholder="섭취시간(분)" data-tit="섭취시간(분)" step="1">
|
||||
<span class="unit">분</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_height" class="p_label">섭취시간</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="dm_second" name="dm_second" value="${model['dm_second']!}" class="required" placeholder="섭취시간(초)" data-tit="섭취시간(초)" step="1">
|
||||
<span class="unit">초</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_height" class="p_label">수유량</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="dm_lac" name="dm_lac" value="${model['dm_lac']!}" class="required" placeholder="수유량" data-tit="수유량" step="1">
|
||||
<span class="unit">ml</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_height" class="p_label">메모</label>
|
||||
<div class="p_input_box">
|
||||
<input type="text" id="memo" name="memo" value="${model['memo']!}" class="required" placeholder="메모" data-tit="메모" step="1">
|
||||
</div>
|
||||
<input type="button" value="팝업 클릭" onclick="javascript:frmLacMilk.go_popup()">
|
||||
</div>
|
||||
|
||||
<button type="submit" id="" name="" class="btns">저장</button>
|
||||
</div>
|
||||
<p class="p_info">
|
||||
<span class="blue_tit">※ 입력하신 내용을 저장하시면 아래 목록에 추가됩니다.</span>
|
||||
<span class="blue_tit">※ 동일한 날짜에 여러번 측정 혹은 입력하였을 시, 해당 날짜의 마지막 측정기록만 저장됩니다.</span>
|
||||
</p>
|
||||
</form>
|
||||
<#if (model['lm_lac_milk'])??>
|
||||
<div class="direct_input_wrap">
|
||||
<h2 class="title"><span class="blue_tit">분유/유축수유 섭취</span> 리스트</h2>
|
||||
<div class="result_list_box">
|
||||
<#list model['lm_lac_milk'] as item>
|
||||
<div class="r_list_item">
|
||||
<div>
|
||||
<div class="result_num_box">
|
||||
<div class="height_result result_num">[${item['dm_fg_nm']}] ${item['dm_minute']?string('0')}<span class="unit">분</span> / ${item['dm_second']?string('0')}<span class="unit">초</span>
|
||||
${item['dm_lac']?string('0')}<span class="unit">ml</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="date">
|
||||
<span><span class="hidden icon">입력일 아이콘</span>입력일</span>${item['reg_dt']?string('yyyy. MM. dd')}
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" id="" name="" class="hidden del_btn" onclick="javascript:frmLacMilk.ajax_delete_lac_milk(${item['dm_no']})" >삭제</button>
|
||||
</div>
|
||||
</#list>
|
||||
</div>
|
||||
<#--페이지네이션-->
|
||||
<ul class="pagination">
|
||||
<@b.Paging url="${URL_PATH}/list_bf_milk.do"
|
||||
pageCount="${model['page']['pageCount']?c}"
|
||||
rowCount="${model['page']['rowCount']?c}"
|
||||
rowMax="${model['page']['rowMax']?c}"
|
||||
nowPage="${model['page']['nowPage']?c}"
|
||||
params="smc_no=${model['smc_no']}&is_search=${model['is_search']!}&search_col=${model['search_col']!}&search_text=${model['search_text']!}&search_col_dt=${model['search_col_dt']!}&search_s_dt=${model['search_s_dt']!}&search_e_dt=${model['search_e_dt']!}&return_url=${model['return_url']!}&"
|
||||
|
||||
class_page_active=" active"
|
||||
|
||||
is_prev_first="N"
|
||||
is_next_end="N"
|
||||
/>
|
||||
</ul>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<div id="popup" class="Pstyle">
|
||||
|
||||
<span class="b-close">X</span>
|
||||
<div class="content" style="height: auto; width: auto;">
|
||||
레이어 팝업이 완성 되었습니다. <br>팝업에 대한 크기는 content div에서 조정이 가능합니다
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 하단 네비 iyu_nav -->
|
||||
<#include "/m/include/index_bottom_menu.ftl">
|
||||
<!-- //iyu_nav -->
|
||||
|
||||
<script type="text/javascript">
|
||||
var frmLacMilk = {
|
||||
|
||||
init: function(){
|
||||
SNUtil.initInputAction()
|
||||
|
||||
$('#frmLacMilk').on('submit',function(e){
|
||||
|
||||
if (!SNValidator.validateWithAlert('#frmLacMilk')) {
|
||||
e.preventDefault()
|
||||
return;
|
||||
}
|
||||
/*
|
||||
if($('#child_height').val() >= 210 || $('#child_height').val() < 30){
|
||||
Swal.fire({
|
||||
text: '신장범위(30~210cm)를 초과했습니다'
|
||||
}).then((result)=>{ $('#child_height').focus() })
|
||||
e.preventDefault()
|
||||
return;
|
||||
}
|
||||
if($('#child_weight').val() >= 100 || $('#child_weight').val() < 1){
|
||||
Swal.fire({
|
||||
text: '체중범위(1~100Kg)를 초과했습니다'
|
||||
}).then((result)=>{ $('#child_weight').focus() })
|
||||
e.preventDefault()
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
this.ajax_insert_lac_milk();
|
||||
e.preventDefault()
|
||||
return;
|
||||
|
||||
}.bind(this))
|
||||
},
|
||||
|
||||
ajax_insert_lac_milk: function(){
|
||||
var data = {}
|
||||
data.smc_no = $('#smc_no').val()
|
||||
data.base_dt = moment( $('#input_date').val(),'YYYY. MM. DD' ).format('YYYYMMDD')
|
||||
data.dm_fg_cd = $('#dm_fg_cd').val()
|
||||
data.dm_minute = $('#dm_minute').val()
|
||||
data.dm_second = $('#dm_second').val()
|
||||
data.dm_minute = $('#dm_minute').val()
|
||||
data.dm_lac = $('#dm_lac').val()
|
||||
data.memo = $('#memo').val()
|
||||
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_food/ajax_insert_lac_milk.do?1=1',
|
||||
type:'post',
|
||||
data: data,
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
Swal.fire({text:"등록되지 않았습니다"})
|
||||
},
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
var RESULT = result.RESULT
|
||||
if(RESULT == 0){ //0:RESULT_SUCCESS
|
||||
Swal.fire({text:"입력되었습니다"}).then((result) => { location.replace('./list_bf_milk.do?smc_no=${(model["smc_no"])!}') })
|
||||
}else{
|
||||
Swal.fire({text:"등록되지 않았습니다"})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
ajax_delete_lac_milk: function(dm_no){
|
||||
if(!dm_no){return}
|
||||
|
||||
var data = {}
|
||||
data.dm_no = dm_no
|
||||
|
||||
Swal.fire({
|
||||
text: "기록을 삭제하시겠습니까?",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '네',
|
||||
cancelButtonText: '취소'
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_food/ajax_delete_lac_milk.do?1=1',
|
||||
type:'post',
|
||||
data: data,
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
Swal.fire({text:"삭제되지 않았습니다"})
|
||||
},
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
var RESULT = result.RESULT
|
||||
if(RESULT == 0){ //0:RESULT_SUCCESS
|
||||
location.replace('./list_bf_milk.do?smc_no=${(model["smc_no"])!}')
|
||||
}else{
|
||||
Swal.fire({text:"삭제되지 않았습니다"})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
go_popup: function() {
|
||||
$('#popup').bPopup();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function(){
|
||||
frmLacMilk.init();
|
||||
debugger;
|
||||
var today = moment().format('YYYY.MM.DD');
|
||||
$("#input_date").val(today)
|
||||
var input_date = SNUtil.makeAnyPicker('input_date', $("#input_date").val(), -80, '.');
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript">
|
||||
// 달력 datepicker
|
||||
jQuery("#date").datepicker({
|
||||
showMonthAfterYear: true,
|
||||
yearSuffix: '년',
|
||||
showOn: "button",
|
||||
buttonImage: "${URL_STATIC_ROOT}/m/img/growth/growth_cal_ico.png",
|
||||
buttonImageOnly: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
nextText: '다음 달',
|
||||
prevText: '이전 달',
|
||||
monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
|
||||
dayNamesShort: ['일', '월', '화', '수', '목', '금', '토']
|
||||
});
|
||||
</script>
|
||||
-->
|
||||
|
||||
<#include "/m/bf_growth_body/include_return_url.ftl">
|
||||
</body>
|
||||
<#include "/m/include/index_bottom.ftl">
|
@ -0,0 +1,271 @@
|
||||
<#include "/m/include/index_top.ftl">
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/anypicker-all.css">
|
||||
<!-- 달력 datepicker -->
|
||||
<script type="text/javascript" src="${URL_STATIC_ROOT}/m/js/anypicker.min.js"></script>
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/datepicker.css" type="text/css" />
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
|
||||
|
||||
<#assign thumb_path = (model['rm_child']['append_300_img_file'])!>
|
||||
<#if thumb_path?has_content>
|
||||
<#assign thumb_path="/file/get_img.do?mt_file_seq="+thumb_path >
|
||||
<#if thumb_path?index_of("http") != 0><#assign thumb_path = URL_ROOT + thumb_path></#if>
|
||||
<#else>
|
||||
<#if (model['rm_child']['gender'])! == 'F'>
|
||||
<#assign thumb_path = '/bf/m/img/child/child_pic_04.png' >
|
||||
<#else>
|
||||
<#assign thumb_path = '/bf/m/img/child/child_pic_03.png' >
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
<script>
|
||||
function CMD_MEASUREMENT_HEIGHT(smc_no) {
|
||||
var cmd = 'CMD_MEASUREMENT_HEIGHT';
|
||||
var args = {
|
||||
smc_no: smc_no,
|
||||
};
|
||||
try{
|
||||
window.interface.executeInterface(function(r){console.log('sussess:', r);}, function(r){console.log('fail:', r);}, cmd, args);
|
||||
}catch(e){
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<body><!--grey_bg / blue_w_bg /blue_g_bg-->
|
||||
<div class="wrap">
|
||||
<header class="header_wrapper">
|
||||
<a href="javascript:back.return_url()" class="side_Lbtn hidden pre_btn">이전으로</a>
|
||||
<h1 class="header_title">${model['rm_child']['name']} 이유식 추가</h1>
|
||||
<div class="side_Rbtn">
|
||||
<a href="#" class="growth_cal">
|
||||
<input type="text" id="date">
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<main class="m_child_direct_input" id="top_move">
|
||||
<div class="profile_wrap">
|
||||
<input type="hidden" id="smc_no" class="required" name="smc_no" value="${model['smc_no']}" data-tit="아이 코드"/>
|
||||
<form class="profile_header" id="frmCommerce" method="POST">
|
||||
<div class="p_header_pic">
|
||||
<div class="pic hidden" style="background: url(${thumb_path})">프로필 사진</div>
|
||||
<div class="child_tit">
|
||||
<div class="name"><a href="javascript:CMD_MEASUREMENT_HEIGHT('${model['rm_child']['smc_no']}');">${model['rm_child']['name']}</a></div>
|
||||
<div class="age">${model['rm_child']['age_y']!}세 ${model['rm_child']['age_m']!}개월</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile_list">
|
||||
<h2 class="p_title">정보입력</h2>
|
||||
<div class="nutrition_kinds_basic">
|
||||
<h2>내가만든이유식을 선택해주세요.</h2>
|
||||
<div class="nutrition_kinds_search">
|
||||
<!-- 이전입력 -->
|
||||
<p class="search_pre_input">이전 입력
|
||||
<a href="javascript:void(0);" id="last_prd_nm" class=""></a>
|
||||
</p>
|
||||
<!-- 검색input -->
|
||||
<p class="search_input">
|
||||
<input type="text" id="prd_nm" name="prd_nm" placeholder="내가만든이유식 검색창"><a href="javascript:list_more('Y');">검색</a>
|
||||
</p>
|
||||
<!-- 검색결과 -->
|
||||
<ul id="ul_board" class="search_result">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_height" class="p_label">섭취시간</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="eat_minute" name="eat_minute" value="${model['df_minute']!}" class="required" placeholder="섭취시간(분)" data-tit="분" step="0.1">
|
||||
<span class="unit">분</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_weight" class="p_label">섭취시간</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="eat_second" name="eat_second" value="${model['df_second']!}" class="required" placeholder="섭취시간(초)" data-tit="초" step="0.1">
|
||||
<span class="unit">초</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_weight" class="p_label">섭취량</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="eat_lac" name="eat_lac" value="${model['df_lac']!}" class="required" placeholder="섭취량" data-tit="ml" step="0.1">
|
||||
<span class="unit">ml</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_weight" class="p_label">메모</label>
|
||||
<div class="p_input_box">
|
||||
<input type="text" id="memo" name="memo" value="${model['memo']!}" class="required" placeholder="메모" data-tit="ml" step="0.1">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" id="" name="" class="btns">저장</button>
|
||||
</div>
|
||||
<p class="p_info">
|
||||
<span class="blue_tit">※ 입력하신 내용을 저장하시면 아래 목록에 추가됩니다.</span>
|
||||
<span class="blue_tit">※ 동일한 날짜에 여러번 측정 혹은 입력하였을 시, 해당 날짜의 마지막 측정기록만 저장됩니다.</span>
|
||||
</p>
|
||||
</form>
|
||||
<#if (model['lm_lac_commerce'])??>
|
||||
<div class="direct_input_wrap">
|
||||
<h2 class="title"><span class="blue_tit">시판이유식</span> 리스트</h2>
|
||||
<div class="result_list_box">
|
||||
<#list model['lm_lac_commerce'] as item>
|
||||
<div class="r_list_item">
|
||||
<div>
|
||||
<div class="result_num_box">
|
||||
<div class="height_result result_num"> ${item['df_minute']?string('0')}<span class="unit">분</span> ${item['df_second']?string('0')}<span class="unit">초</span>
|
||||
${item['df_lac']?string('0')}<span class="unit">ml</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="date">
|
||||
<span><span class="hidden icon">입력일 아이콘</span>입력일</span>${item['reg_dt']?string('yyyy. MM. dd')}
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" id="" name="" class="hidden del_btn" onclick="javascript:frmCommerce.ajax_delete_lac_commerce(${item['df_no']})" >삭제</button>
|
||||
</div>
|
||||
</#list>
|
||||
</div>
|
||||
<#--페이지네이션-->
|
||||
<ul class="pagination">
|
||||
<@b.Paging url="${URL_PATH}/list_bf_milk.do"
|
||||
pageCount="${model['page']['pageCount']?c}"
|
||||
rowCount="${model['page']['rowCount']?c}"
|
||||
rowMax="${model['page']['rowMax']?c}"
|
||||
nowPage="${model['page']['nowPage']?c}"
|
||||
params="smc_no=${model['smc_no']}&is_search=${model['is_search']!}&search_col=${model['search_col']!}&search_text=${model['search_text']!}&search_col_dt=${model['search_col_dt']!}&search_s_dt=${model['search_s_dt']!}&search_e_dt=${model['search_e_dt']!}&return_url=${model['return_url']!}&"
|
||||
|
||||
class_page_active=" active"
|
||||
|
||||
is_prev_first="N"
|
||||
is_next_end="N"
|
||||
/>
|
||||
</ul>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<!-- 하단 네비 iyu_nav -->
|
||||
<#include "/m/include/index_bottom_menu.ftl">
|
||||
<!-- //iyu_nav -->
|
||||
|
||||
<script type="text/javascript">
|
||||
var frmCommerce = {
|
||||
|
||||
init: function(){
|
||||
SNUtil.initInputAction()
|
||||
|
||||
$('#frmCommerce').on('submit',function(e){
|
||||
|
||||
if (!SNValidator.validateWithAlert('#frmCommerce')) {
|
||||
e.preventDefault()
|
||||
return;
|
||||
}
|
||||
|
||||
this.ajax_insert_commerce()
|
||||
e.preventDefault()
|
||||
return;
|
||||
|
||||
}.bind(this))
|
||||
},
|
||||
|
||||
ajax_insert_commerce: function(){
|
||||
|
||||
var data = {}
|
||||
data.smc_no = $('#smc_no').val()
|
||||
data.base_dt = moment( $('#input_date').val(),'YYYY. MM. DD' ).format('YYYYMMDD')
|
||||
data.df_minute = $('#eat_minute').val()
|
||||
data.df_second = $('#eat_second').val()
|
||||
data.df_lac = $('#eat_lac').val()
|
||||
data.memo = $('#memo').val()
|
||||
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_food/ajax_insert_commerce.do?1=1',
|
||||
type:'post',
|
||||
data: data,
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
Swal.fire({text:"등록되지 않았습니다"})
|
||||
},
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
var RESULT = result.RESULT
|
||||
if(RESULT == 0){ //0:RESULT_SUCCESS
|
||||
Swal.fire({text:"입력되었습니다"}).then((result) => { location.replace('./view_bf_commerce_input.do?smc_no=${(model["smc_no"])!}') })
|
||||
}else{
|
||||
Swal.fire({text:"등록되지 않았습니다"})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
ajax_delete_lac_commerce: function(df_no){
|
||||
if(!df_no){return}
|
||||
|
||||
var data = {}
|
||||
data.df_no = df_no
|
||||
|
||||
Swal.fire({
|
||||
text: "기록을 삭제하시겠습니까?",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '네',
|
||||
cancelButtonText: '취소'
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_food/ajax_delete_lac_commerce.do?1=1',
|
||||
type:'post',
|
||||
data: data,
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
Swal.fire({text:"삭제되지 않았습니다"})
|
||||
},
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
var RESULT = result.RESULT
|
||||
if(RESULT == 0){ //0:RESULT_SUCCESS
|
||||
location.replace('./view_bf_commerce_input.do?smc_no=${(model["smc_no"])!}')
|
||||
}else{
|
||||
Swal.fire({text:"삭제되지 않았습니다"})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function(){
|
||||
frmCommerce.init();
|
||||
|
||||
var today = moment().format('YYYY.MM.DD');
|
||||
$("#input_date").val(today)
|
||||
var input_date = SNUtil.makeAnyPicker('input_date', $("#input_date").val(), -80, '.');
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 달력 datepicker
|
||||
jQuery("#date").datepicker({
|
||||
showMonthAfterYear: true,
|
||||
yearSuffix: '년',
|
||||
showOn: "button",
|
||||
buttonImage: "${URL_STATIC_ROOT}/m/img/growth/growth_cal_ico.png",
|
||||
buttonImageOnly: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
nextText: '다음 달',
|
||||
prevText: '이전 달',
|
||||
monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
|
||||
dayNamesShort: ['일', '월', '화', '수', '목', '금', '토']
|
||||
});
|
||||
</script>
|
||||
|
||||
<#include "/m/bf_growth_body/include_return_url.ftl">
|
||||
</body>
|
||||
<#include "/m/include/index_bottom.ftl">
|
@ -0,0 +1,271 @@
|
||||
<#include "/m/include/index_top.ftl">
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/anypicker-all.css">
|
||||
<!-- 달력 datepicker -->
|
||||
<script type="text/javascript" src="${URL_STATIC_ROOT}/m/js/anypicker.min.js"></script>
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/datepicker.css" type="text/css" />
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
|
||||
|
||||
<#assign thumb_path = (model['rm_child']['append_300_img_file'])!>
|
||||
<#if thumb_path?has_content>
|
||||
<#assign thumb_path="/file/get_img.do?mt_file_seq="+thumb_path >
|
||||
<#if thumb_path?index_of("http") != 0><#assign thumb_path = URL_ROOT + thumb_path></#if>
|
||||
<#else>
|
||||
<#if (model['rm_child']['gender'])! == 'F'>
|
||||
<#assign thumb_path = '/bf/m/img/child/child_pic_04.png' >
|
||||
<#else>
|
||||
<#assign thumb_path = '/bf/m/img/child/child_pic_03.png' >
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
<script>
|
||||
function CMD_MEASUREMENT_HEIGHT(smc_no) {
|
||||
var cmd = 'CMD_MEASUREMENT_HEIGHT';
|
||||
var args = {
|
||||
smc_no: smc_no,
|
||||
};
|
||||
try{
|
||||
window.interface.executeInterface(function(r){console.log('sussess:', r);}, function(r){console.log('fail:', r);}, cmd, args);
|
||||
}catch(e){
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<body><!--grey_bg / blue_w_bg /blue_g_bg-->
|
||||
<div class="wrap">
|
||||
<header class="header_wrapper">
|
||||
<a href="javascript:back.return_url()" class="side_Lbtn hidden pre_btn">이전으로</a>
|
||||
<h1 class="header_title">${model['rm_child']['name']} 이유식 추가</h1>
|
||||
<div class="side_Rbtn">
|
||||
<a href="#" class="growth_cal">
|
||||
<input type="text" id="date">
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<main class="m_child_direct_input" id="top_move">
|
||||
<div class="profile_wrap">
|
||||
<input type="hidden" id="smc_no" class="required" name="smc_no" value="${model['smc_no']}" data-tit="아이 코드"/>
|
||||
<form class="profile_header" id="frmCommerce" method="POST">
|
||||
<div class="p_header_pic">
|
||||
<div class="pic hidden" style="background: url(${thumb_path})">프로필 사진</div>
|
||||
<div class="child_tit">
|
||||
<div class="name"><a href="javascript:CMD_MEASUREMENT_HEIGHT('${model['rm_child']['smc_no']}');">${model['rm_child']['name']}</a></div>
|
||||
<div class="age">${model['rm_child']['age_y']!}세 ${model['rm_child']['age_m']!}개월</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile_list">
|
||||
<h2 class="p_title">정보입력</h2>
|
||||
<div class="nutrition_kinds_basic">
|
||||
<h2>내가만든이유식을 선택해주세요.</h2>
|
||||
<div class="nutrition_kinds_search">
|
||||
<!-- 이전입력 -->
|
||||
<p class="search_pre_input">이전 입력
|
||||
<a href="javascript:void(0);" id="last_prd_nm" class=""></a>
|
||||
</p>
|
||||
<!-- 검색input -->
|
||||
<p class="search_input">
|
||||
<input type="text" id="prd_nm" name="prd_nm" placeholder="내가만든이유식 검색창"><a href="javascript:list_more('Y');">검색</a>
|
||||
</p>
|
||||
<!-- 검색결과 -->
|
||||
<ul id="ul_board" class="search_result">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_height" class="p_label">섭취시간</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="eat_minute" name="eat_minute" value="${model['df_minute']!}" class="required" placeholder="섭취시간(분)" data-tit="분" step="0.1">
|
||||
<span class="unit">분</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_weight" class="p_label">섭취시간</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="eat_second" name="eat_second" value="${model['df_second']!}" class="required" placeholder="섭취시간(초)" data-tit="초" step="0.1">
|
||||
<span class="unit">초</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_weight" class="p_label">섭취량</label>
|
||||
<div class="p_input_box">
|
||||
<input type="number" id="eat_lac" name="eat_lac" value="${model['df_lac']!}" class="required" placeholder="섭취량" data-tit="ml" step="0.1">
|
||||
<span class="unit">ml</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p_list_item p_border_box">
|
||||
<label for="child_weight" class="p_label">메모</label>
|
||||
<div class="p_input_box">
|
||||
<input type="text" id="memo" name="memo" value="${model['memo']!}" class="required" placeholder="메모" data-tit="ml" step="0.1">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" id="" name="" class="btns">저장</button>
|
||||
</div>
|
||||
<p class="p_info">
|
||||
<span class="blue_tit">※ 입력하신 내용을 저장하시면 아래 목록에 추가됩니다.</span>
|
||||
<span class="blue_tit">※ 동일한 날짜에 여러번 측정 혹은 입력하였을 시, 해당 날짜의 마지막 측정기록만 저장됩니다.</span>
|
||||
</p>
|
||||
</form>
|
||||
<#if (model['lm_lac_commerce'])??>
|
||||
<div class="direct_input_wrap">
|
||||
<h2 class="title"><span class="blue_tit">시판이유식</span> 리스트</h2>
|
||||
<div class="result_list_box">
|
||||
<#list model['lm_lac_commerce'] as item>
|
||||
<div class="r_list_item">
|
||||
<div>
|
||||
<div class="result_num_box">
|
||||
<div class="height_result result_num"> ${item['df_minute']?string('0')}<span class="unit">분</span> ${item['df_second']?string('0')}<span class="unit">초</span>
|
||||
${item['df_lac']?string('0')}<span class="unit">ml</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="date">
|
||||
<span><span class="hidden icon">입력일 아이콘</span>입력일</span>${item['reg_dt']?string('yyyy. MM. dd')}
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" id="" name="" class="hidden del_btn" onclick="javascript:frmCommerce.ajax_delete_lac_commerce(${item['df_no']})" >삭제</button>
|
||||
</div>
|
||||
</#list>
|
||||
</div>
|
||||
<#--페이지네이션-->
|
||||
<ul class="pagination">
|
||||
<@b.Paging url="${URL_PATH}/list_bf_milk.do"
|
||||
pageCount="${model['page']['pageCount']?c}"
|
||||
rowCount="${model['page']['rowCount']?c}"
|
||||
rowMax="${model['page']['rowMax']?c}"
|
||||
nowPage="${model['page']['nowPage']?c}"
|
||||
params="smc_no=${model['smc_no']}&is_search=${model['is_search']!}&search_col=${model['search_col']!}&search_text=${model['search_text']!}&search_col_dt=${model['search_col_dt']!}&search_s_dt=${model['search_s_dt']!}&search_e_dt=${model['search_e_dt']!}&return_url=${model['return_url']!}&"
|
||||
|
||||
class_page_active=" active"
|
||||
|
||||
is_prev_first="N"
|
||||
is_next_end="N"
|
||||
/>
|
||||
</ul>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<!-- 하단 네비 iyu_nav -->
|
||||
<#include "/m/include/index_bottom_menu.ftl">
|
||||
<!-- //iyu_nav -->
|
||||
|
||||
<script type="text/javascript">
|
||||
var frmCommerce = {
|
||||
|
||||
init: function(){
|
||||
SNUtil.initInputAction()
|
||||
|
||||
$('#frmCommerce').on('submit',function(e){
|
||||
|
||||
if (!SNValidator.validateWithAlert('#frmCommerce')) {
|
||||
e.preventDefault()
|
||||
return;
|
||||
}
|
||||
|
||||
this.ajax_insert_commerce()
|
||||
e.preventDefault()
|
||||
return;
|
||||
|
||||
}.bind(this))
|
||||
},
|
||||
|
||||
ajax_insert_commerce: function(){
|
||||
|
||||
var data = {}
|
||||
data.smc_no = $('#smc_no').val()
|
||||
data.base_dt = moment( $('#input_date').val(),'YYYY. MM. DD' ).format('YYYYMMDD')
|
||||
data.df_minute = $('#eat_minute').val()
|
||||
data.df_second = $('#eat_second').val()
|
||||
data.df_lac = $('#eat_lac').val()
|
||||
data.memo = $('#memo').val()
|
||||
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_food/ajax_insert_commerce.do?1=1',
|
||||
type:'post',
|
||||
data: data,
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
Swal.fire({text:"등록되지 않았습니다"})
|
||||
},
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
var RESULT = result.RESULT
|
||||
if(RESULT == 0){ //0:RESULT_SUCCESS
|
||||
Swal.fire({text:"입력되었습니다"}).then((result) => { location.replace('./view_bf_commerce_input.do?smc_no=${(model["smc_no"])!}') })
|
||||
}else{
|
||||
Swal.fire({text:"등록되지 않았습니다"})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
ajax_delete_lac_commerce: function(df_no){
|
||||
if(!df_no){return}
|
||||
|
||||
var data = {}
|
||||
data.df_no = df_no
|
||||
|
||||
Swal.fire({
|
||||
text: "기록을 삭제하시겠습니까?",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '네',
|
||||
cancelButtonText: '취소'
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_food/ajax_delete_lac_commerce.do?1=1',
|
||||
type:'post',
|
||||
data: data,
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
Swal.fire({text:"삭제되지 않았습니다"})
|
||||
},
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
var RESULT = result.RESULT
|
||||
if(RESULT == 0){ //0:RESULT_SUCCESS
|
||||
location.replace('./view_bf_commerce_input.do?smc_no=${(model["smc_no"])!}')
|
||||
}else{
|
||||
Swal.fire({text:"삭제되지 않았습니다"})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function(){
|
||||
frmCommerce.init();
|
||||
|
||||
var today = moment().format('YYYY.MM.DD');
|
||||
$("#input_date").val(today)
|
||||
var input_date = SNUtil.makeAnyPicker('input_date', $("#input_date").val(), -80, '.');
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 달력 datepicker
|
||||
jQuery("#date").datepicker({
|
||||
showMonthAfterYear: true,
|
||||
yearSuffix: '년',
|
||||
showOn: "button",
|
||||
buttonImage: "${URL_STATIC_ROOT}/m/img/growth/growth_cal_ico.png",
|
||||
buttonImageOnly: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
nextText: '다음 달',
|
||||
prevText: '이전 달',
|
||||
monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
|
||||
dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
|
||||
dayNamesShort: ['일', '월', '화', '수', '목', '금', '토']
|
||||
});
|
||||
</script>
|
||||
|
||||
<#include "/m/bf_growth_body/include_return_url.ftl">
|
||||
</body>
|
||||
<#include "/m/include/index_bottom.ftl">
|
@ -0,0 +1,7 @@
|
||||
/*================================================================================
|
||||
* @name: bPopup - if you can't get it up, use bPopup
|
||||
* @author: (c)Bjoern Klinggaard (twitter@bklinggaard)
|
||||
* @demo: http://dinbror.dk/bpopup
|
||||
* @version: 0.9.4.min
|
||||
================================================================================*/
|
||||
(function(b){b.fn.bPopup=function(z,F){function K(){a.contentContainer=b(a.contentContainer||c);switch(a.content){case "iframe":var h=b('<iframe class="b-iframe" '+a.iframeAttr+"></iframe>");h.appendTo(a.contentContainer);r=c.outerHeight(!0);s=c.outerWidth(!0);A();h.attr("src",a.loadUrl);k(a.loadCallback);break;case "image":A();b("<img />").load(function(){k(a.loadCallback);G(b(this))}).attr("src",a.loadUrl).hide().appendTo(a.contentContainer);break;default:A(),b('<div class="b-ajax-wrapper"></div>').load(a.loadUrl,a.loadData,function(){k(a.loadCallback);G(b(this))}).hide().appendTo(a.contentContainer)}}function A(){a.modal&&b('<div class="b-modal '+e+'"></div>').css({backgroundColor:a.modalColor,position:"fixed",top:0,right:0,bottom:0,left:0,opacity:0,zIndex:a.zIndex+t}).appendTo(a.appendTo).fadeTo(a.speed,a.opacity);D();c.data("bPopup",a).data("id",e).css({left:"slideIn"==a.transition||"slideBack"==a.transition?"slideBack"==a.transition?g.scrollLeft()+u:-1*(v+s):l(!(!a.follow[0]&&m||f)),position:a.positionStyle||"absolute",top:"slideDown"==a.transition||"slideUp"==a.transition?"slideUp"==a.transition?g.scrollTop()+w:x+-1*r:n(!(!a.follow[1]&&p||f)),"z-index":a.zIndex+t+1}).each(function(){a.appending&&b(this).appendTo(a.appendTo)});H(!0)}function q(){a.modal&&b(".b-modal."+c.data("id")).fadeTo(a.speed,0,function(){b(this).remove()});a.scrollBar||b("html").css("overflow","auto");b(".b-modal."+e).unbind("click");g.unbind("keydown."+e);d.unbind("."+e).data("bPopup",0<d.data("bPopup")-1?d.data("bPopup")-1:null);c.undelegate(".bClose, ."+a.closeClass,"click."+e,q).data("bPopup",null);H();return!1}function G(h){var b=h.width(),e=h.height(),d={};a.contentContainer.css({height:e,width:b});e>=c.height()&&(d.height=c.height());b>=c.width()&&(d.width=c.width());r=c.outerHeight(!0);s=c.outerWidth(!0);D();a.contentContainer.css({height:"auto",width:"auto"});d.left=l(!(!a.follow[0]&&m||f));d.top=n(!(!a.follow[1]&&p||f));c.animate(d,250,function(){h.show();B=E()})}function L(){d.data("bPopup",t);c.delegate(".bClose, ."+a.closeClass,"click."+e,q);a.modalClose&&b(".b-modal."+e).css("cursor","pointer").bind("click",q);M||!a.follow[0]&&!a.follow[1]||d.bind("scroll."+e,function(){B&&c.dequeue().animate({left:a.follow[0]?l(!f):"auto",top:a.follow[1]?n(!f):"auto"},a.followSpeed,a.followEasing)}).bind("resize."+e,function(){w=y.innerHeight||d.height();u=y.innerWidth||d.width();if(B=E())clearTimeout(I),I=setTimeout(function(){D();c.dequeue().each(function(){f?b(this).css({left:v,top:x}):b(this).animate({left:a.follow[0]?l(!0):"auto",top:a.follow[1]?n(!0):"auto"},a.followSpeed,a.followEasing)})},50)});a.escClose&&g.bind("keydown."+e,function(a){27==a.which&&q()})}function H(b){function d(e){c.css({display:"block",opacity:1}).animate(e,a.speed,a.easing,function(){J(b)})}switch(b?a.transition:a.transitionClose||a.transition){case "slideIn":d({left:b?l(!(!a.follow[0]&&m||f)):g.scrollLeft()-(s||c.outerWidth(!0))-C});break;case "slideBack":d({left:b?l(!(!a.follow[0]&&m||f)):g.scrollLeft()+u+C});break;case "slideDown":d({top:b?n(!(!a.follow[1]&&p||f)):g.scrollTop()-(r||c.outerHeight(!0))-C});break;case "slideUp":d({top:b?n(!(!a.follow[1]&&p||f)):g.scrollTop()+w+C});break;default:c.stop().fadeTo(a.speed,b?1:0,function(){J(b)})}}function J(b){b?(L(),k(F),a.autoClose&&setTimeout(q,a.autoClose)):(c.hide(),k(a.onClose),a.loadUrl&&(a.contentContainer.empty(),c.css({height:"auto",width:"auto"})))}function l(a){return a?v+g.scrollLeft():v}function n(a){return a?x+g.scrollTop():x}function k(a){b.isFunction(a)&&a.call(c)}function D(){x=p?a.position[1]:Math.max(0,(w-c.outerHeight(!0))/2-a.amsl);v=m?a.position[0]:(u-c.outerWidth(!0))/2;B=E()}function E(){return w>c.outerHeight(!0)&&u>c.outerWidth(!0)}b.isFunction(z)&&(F=z,z=null);var a=b.extend({},b.fn.bPopup.defaults,z);a.scrollBar||b("html").css("overflow","hidden");var c=this,g=b(document),y=window,d=b(y),w=y.innerHeight||d.height(),u=y.innerWidth||d.width(),M=/OS 6(_\d)+/i.test(navigator.userAgent),C=200,t=0,e,B,p,m,f,x,v,r,s,I;c.close=function(){a=this.data("bPopup");e="__b-popup"+d.data("bPopup")+"__";q()};return c.each(function(){b(this).data("bPopup")||(k(a.onOpen),t=(d.data("bPopup")||0)+1,e="__b-popup"+t+"__",p="auto"!==a.position[1],m="auto"!==a.position[0],f="fixed"===a.positionStyle,r=c.outerHeight(!0),s=c.outerWidth(!0),a.loadUrl?K():A())})};b.fn.bPopup.defaults={amsl:50,appending:!0,appendTo:"body",autoClose:!1,closeClass:"b-close",content:"ajax",contentContainer:!1,easing:"swing",escClose:!0,follow:[!0,!0],followEasing:"swing",followSpeed:500,iframeAttr:'scrolling="no" frameborder="0"',loadCallback:!1,loadData:!1,loadUrl:!1,modal:!0,modalClose:!0,modalColor:"#000",onClose:!1,onOpen:!1,opacity:0.7,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,speed:250,transition:"fadeIn",transitionClose:!1,zIndex:9997}})(jQuery);
|
Loading…
Reference in new issue