first
This commit is contained in:
11
modules/member/themes/_mobile/rc-default/noti/_main.css
Normal file
11
modules/member/themes/_mobile/rc-default/noti/_main.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.table-view-cell p {
|
||||
font-size: .875rem;
|
||||
color: #818a91;
|
||||
line-height: 1.3;
|
||||
max-height: 2.1rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table-view-cell .badge {
|
||||
font-weight: normal;
|
||||
}
|
||||
185
modules/member/themes/_mobile/rc-default/noti/component.php
Normal file
185
modules/member/themes/_mobile/rc-default/noti/component.php
Normal file
@@ -0,0 +1,185 @@
|
||||
<!-- 사이트 페이지 -->
|
||||
<section class="page right" id="page-noti-list">
|
||||
<header class="bar bar-nav bar-light bg-white px-0">
|
||||
<a class="icon pull-left material-icons px-3" role="button" data-history="back">arrow_back</a>
|
||||
<h1 class="title title-left" data-history="back">
|
||||
새 알림
|
||||
<?php if ($my['uid']): ?>
|
||||
<span class="badge badge-danger badge-inverted ml-2" data-role="noti-status"><?php echo $my['num_notice']==0?'':$my['num_notice']?></span>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<div class="content bg-white">
|
||||
|
||||
<?php if ($my['uid']): ?>
|
||||
<ul class="table-view table-view-full border-top-0 my-0 bg-white" data-role="noti-list">
|
||||
<!-- 드러어가 열릴때, 여기에 알림정보를 받아옴 -->
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p class="content-padded">
|
||||
|
||||
<small class="text-muted">
|
||||
내 알림을 확인하기 위해서는 로그인이 필요합니다.
|
||||
</small>
|
||||
|
||||
<button type="button" class="btn btn-secondary btn-block mt-3" data-toggle="modal" data-target="#modal-login">
|
||||
로그인 하기
|
||||
</button>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Sheet -->
|
||||
<div id="sheet-noti" class="sheet">
|
||||
|
||||
<div class="card card-full">
|
||||
<div class="card-header bg-primary px-2 clearfix rounded-0" data-history="back" style="padding-bottom: 0.5rem;">
|
||||
<div class="pull-left">
|
||||
<span data-role="micon" style="vertical-align: middle;"></span>
|
||||
<span data-role="title" class="ml-1" style="vertical-align: middle;"></span>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="icon icon-close" role="button"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="content-padded">
|
||||
|
||||
<div class="media">
|
||||
<span class="media-left">
|
||||
<img class="img-circle" src="" style="width:3.75rem" data-role="avatar">
|
||||
</span>
|
||||
<div class="media-body">
|
||||
<span data-role="message"></span>
|
||||
<div>
|
||||
<span class="badge badge-default badge-inverted" data-role="from"></span>
|
||||
<span class="badge badge-default badge-inverted"><i class="fa fa-clock-o" aria-hidden="true"></i> </span>
|
||||
<span class="badge badge-default badge-inverted" data-role="d_regis"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer bg-white px-2" data-role="has-referer">
|
||||
<a href="" class="btn btn-outline-primary btn-block" data-role="referer">
|
||||
<span data-role="acton-label">내용확인</span>
|
||||
</a>
|
||||
</div><!-- /.card-footer -->
|
||||
</div><!-- /.card -->
|
||||
</div> <!-- /.sheet -->
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
var page_noti_list = $('#page-noti-list');
|
||||
var sheet_noti = $('#sheet-noti'); // 알림보기 시트
|
||||
|
||||
$(function() {
|
||||
|
||||
page_noti_list.on('show.rc.page', function (event) {
|
||||
|
||||
var page = $(this);
|
||||
|
||||
if (memberid) {
|
||||
var page_content = page_noti_list.find('.content')
|
||||
$.get(rooturl+'/?r='+raccount+'&m=notification&a=get_notiList',{
|
||||
sort: noti_sort,
|
||||
orderby: noti_orderby,
|
||||
recnum: noti_recnum,
|
||||
callMod: ''
|
||||
},function(response){
|
||||
var result = $.parseJSON(response);
|
||||
var num=result.num;
|
||||
var tpg=result.tpg;
|
||||
var content=result.content;
|
||||
|
||||
page.find('[data-role="noti-list"]').html(content);
|
||||
page.find('[data-plugin="timeago"]').timeago();
|
||||
bar.find('[data-role="noti-status"]').text(num);
|
||||
page.find('[data-role="noti-status"]').text(num);
|
||||
page.find('[data-role="noti-list"]').attr('data-totalPage',tpg);
|
||||
moreNOTI(page_content,tpg)
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
page_noti_list.on('hidden.rc.page', function (event) {
|
||||
|
||||
var page = $(this);
|
||||
|
||||
if (memberid) {
|
||||
page.find('.content').infinitescroll('destroy') //무한스크롤 리셋
|
||||
page.append('<div class="content bg-white"><ul class="table-view table-view-full my-0 bg-white border-top-0" data-role="noti-list"></ul></div>');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
sheet_noti.on('show.rc.sheet', function (event) {
|
||||
var item = $(event.relatedTarget)
|
||||
var from = item.data('from')
|
||||
var avatar = item.data('avatar')
|
||||
var uid = item.data('uid')
|
||||
var micon = item.data('icon')
|
||||
var cell = item.closest('.table-view-cell')
|
||||
cell.attr('tabindex','-1').focus().removeClass('table-view-active'); // 모달을 호출한 아이템을 포커싱 처리함 (css로 배경색 적용)
|
||||
sheet_noti.find('[data-role="from"]').text(from)
|
||||
sheet_noti.find('[data-role="avatar"]').attr('src',avatar)
|
||||
sheet_noti.find('[data-role="micon"]').addClass(micon)
|
||||
$.post(rooturl+'/?r='+raccount+'&m=notification&a=get_notiData',{
|
||||
uid : uid
|
||||
},function(response){
|
||||
var result = $.parseJSON(response);
|
||||
var referer=result.referer;
|
||||
var button=result.button;
|
||||
var d_regis=result.d_regis;
|
||||
var title=result.title;
|
||||
var message=result.message;
|
||||
sheet_noti.find('[data-role="title"]').text(title)
|
||||
sheet_noti.find('[data-role="message"]').html(message)
|
||||
sheet_noti.find('[data-role="d_regis"]').text(d_regis)
|
||||
|
||||
if (referer) {
|
||||
sheet_noti.find('[data-role="referer"]').attr('href',referer)
|
||||
sheet_noti.find('[data-role="not-referer"]').addClass('d-none')
|
||||
sheet_noti.find('[data-role="has-referer"]').removeClass('d-none')
|
||||
sheet_noti.find('[data-role="acton-label"]').text(button?button:'내용확인')
|
||||
}
|
||||
else {
|
||||
sheet_noti.find('[data-role="not-referer"]').removeClass('d-none')
|
||||
sheet_noti.find('[data-role="has-referer"]').addClass('d-none')
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
sheet_noti.on('hidden.rc.sheet', function (event) {
|
||||
//내용 초기화
|
||||
var item = $(event.relatedTarget)
|
||||
var noti_badge = $('[data-role="noti-status"]')
|
||||
sheet_noti.find('[data-role="from"]').html('')
|
||||
sheet_noti.find('[data-role="referer"]').removeClass('d-none')
|
||||
sheet_noti.find('[data-role="micon"]').removeAttr('class')
|
||||
sheet_noti.find('[data-role="acton-label"]').text('')
|
||||
sheet_noti.find('[data-role="message"]').html('')
|
||||
sheet_noti.find('[data-role="d_regis"]').text('')
|
||||
sheet_noti.find('[data-role="not-referer"]').removeClass('d-none')
|
||||
sheet_noti.find('[data-role="has-referer"]').addClass('d-none')
|
||||
var noti_badge = $('[data-role="noti-status"]')
|
||||
$.post(rooturl+'/?r='+raccount+'&m=notification&a=get_notiNum_ajax',function(response){
|
||||
var result = $.parseJSON(response);
|
||||
var noti_badge_num=result.num;
|
||||
noti_badge.text(noti_badge_num)
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
117
modules/member/themes/_mobile/rc-default/noti/main.php
Normal file
117
modules/member/themes/_mobile/rc-default/noti/main.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
$sort = $sort ? $sort : 'uid';
|
||||
$orderby= $orderby ? $orderby : 'desc';
|
||||
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
|
||||
|
||||
$sqlque = 'mbruid='.$my['uid'];
|
||||
if ($category) $sqlque .= " and category='".$category."'";
|
||||
|
||||
$RCD = getDbArray($table['s_notice'],$sqlque,'*',$sort,$orderby,$recnum,$p);
|
||||
$NUM = getDbRows($table['s_notice'],$sqlque);
|
||||
$TPG = getTotalPage($NUM,$recnum);
|
||||
|
||||
$PageLink = './noti?';
|
||||
if ($type) $PageLink .= 'type='.$type.'&';
|
||||
|
||||
?>
|
||||
|
||||
<header class="bar bar-nav bar-dark bg-primary px-0">
|
||||
<a class="icon icon-left-nav pull-left p-x-1" role="button" data-history="back"></a>
|
||||
<a class="icon icon-gear pull-right p-x-1" role="button" href="<?php echo $g['s'] ?>/?r=<?php echo $r ?>&mod=settings&page=noti"></a>
|
||||
<h1 class="title" data-location="reload">내 알림함</h1>
|
||||
</header>
|
||||
|
||||
<div class="bar bar-standard bar-footer bar-light bg-white">
|
||||
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=notification&a=multi_delete_user&deltype=delete_all" class="btn btn-secondary btn-block" onclick="return hrefCheck(this,true,'정말로 전체 알림 삭제를 하시겠습니까?');">
|
||||
<i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>
|
||||
알림함 비우기
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<main class="content bg-faded">
|
||||
|
||||
<ul class="table-view table-view-full bg-white mb-0 animated fadeIn delay-1" style="margin-top: -.0625rem">
|
||||
<?php $_i=0;while($R=db_fetch_array($RCD)):?>
|
||||
<?php $SM1=$R['mbruid']?getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'name,nic'):array()?>
|
||||
<?php $SM2=$R['frommbr']?getDbData($table['s_mbrdata'],'memberuid='.$R['frommbr'],'memberuid,name,nic'):array()?>
|
||||
<?php $MD = getDbData($table['s_module'],"id='".$R['frommodule']."'",'icon'); ?>
|
||||
<?php $avatar =$R['frommbr']?getAvatarSrc($SM2['memberuid'],'120'):'/_core/images/touch/homescreen-192x192.png' ?>
|
||||
<li class="table-view-cell<?php echo $R['d_read']?'':' table-view-active' ?>">
|
||||
<a data-toggle="sheet" href="#sheet-noti"
|
||||
data-from="<?php echo $SM2[$_HS['nametype']] ?>"
|
||||
data-icon="<?php echo $MD['icon'] ?>"
|
||||
data-avatar="<?php echo $avatar ?>"
|
||||
data-uid="<?php echo $R["uid"] ?>">
|
||||
<span class="media-object pull-left position-relative">
|
||||
<img class="img-circle" src="<?php echo $avatar ?>" style="width:52px">
|
||||
<?php if ($R['frommbr']): ?>
|
||||
<i class="<?php echo $MD['icon'] ?> bg-primary position-absolute"></i>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
|
||||
<div class="media-body">
|
||||
<span class="d-flex justify-content-between">
|
||||
<span><?php echo $R['title'] ?> <span class="badge"><?php echo $R['frommbr']?$SM2[$_HS['nametype']]:'' ?></span></span>
|
||||
<span style="margin-top: -.2rem">
|
||||
<?php echo getNew($R['d_regis'],24)?' <span class="rb-new ml-1"></span>':'' ?>
|
||||
<time class="small badge badge-default badge-inverted" data-plugin="timeago" datetime="<?php echo getDateFormat($R['d_regis'],'c') ?>"></time>
|
||||
</span>
|
||||
</span>
|
||||
<p><?php echo getStrCut($R['message'],150,'')?> </p>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php $_i++;endwhile?>
|
||||
|
||||
<?php if(!$NUM):?>
|
||||
<li class="table-view-cell text-xs-center p-5 text-muted d-flex align-items-center justify-content-center bg-faded" style="height: calc(100vh - 10.5rem);">
|
||||
내역이 없습니다.
|
||||
</li>
|
||||
<?php endif?>
|
||||
|
||||
</ul>
|
||||
|
||||
</main>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// 더보기
|
||||
var currentPage =1; // 처음엔 무조건 1, 아래 더보기 진행되면서 +1 증가
|
||||
var totalPage = '<?php echo $TPG?>';
|
||||
var totalNUM = '<?php echo $NUM?>';
|
||||
var sort = '<?php echo $sort?>';
|
||||
var orderby = '<?php echo $orderby?>';
|
||||
var recnum = '<?php echo $recnum?>';
|
||||
|
||||
$('.content').infinitescroll({
|
||||
dataSource: function(helpers, callback){
|
||||
var nextPage = parseInt(currentPage)+1;
|
||||
if (totalPage>currentPage) {
|
||||
$.get(rooturl+'/?r='+raccount+'&m=notification&a=get_moreList',{
|
||||
page : nextPage,
|
||||
sort: sort,
|
||||
orderby: orderby,
|
||||
recnum: recnum,
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
var content = result.content;
|
||||
if(error) alert(result.error_comment);
|
||||
callback({ content: content });
|
||||
currentPage++; // 현재 페이지 +1
|
||||
console.log(currentPage+'페이지 불러옴')
|
||||
$('[data-plugin="timeago"]').timeago();
|
||||
});
|
||||
} else {
|
||||
callback({ end: true });
|
||||
console.log('더이상 불러올 페이지가 없습니다.')
|
||||
}
|
||||
},
|
||||
appendToEle : $('.table-view'),
|
||||
percentage : 95, // 95% 아래로 스크롤할때 다움페이지 호출
|
||||
hybrid : false // true: 버튼형, false: 자동
|
||||
});
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user