123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <style>
- .right-content{
- padding-top:54px!important; padding-left:0!important; width:970px!important;
- }
- </style>
- <div class="content">
- <% include ../leftBar.html %>
- <!-- right content start -->
- <div class="right-content myCover-underReview">
- <div class="pageInfo">My Cover</div>
- <% include topBar.html %>
- <div class="covers-photos">
- <%if(data.length){%>
- <ul>
- <%for(let val of data){%>
- <li class="covers" id="<%=val.id%>" style="width: 210px;">
- <img src="<%=val.img%>" alt=""/>
- <!--<div>-->
- <!--<ul class="edit">-->
- <!--<%if(val.is_use == 1){%>-->
- <!--<li>-->
- <!--<a class="coverDelete" href="javascript:;">-->
- <!--<div><img src="<%=public_path%>/img/u155.png" alt=""/></div>-->
- <!--<div>Delete</div>-->
- <!--</a>-->
- <!--</li>-->
- <!--<%}else{%>-->
- <!--<li>-->
- <!--<a class="coverUse" href="javascript:;">-->
- <!--<div><img src="<%=public_path%>/img/u167.png" alt=""/></div>-->
- <!--<div>Set as Using</div>-->
- <!--</a>-->
- <!--</li>-->
- <!--<li>-->
- <!--<a class="coverDelete" href="javascript:;">-->
- <!--<div><img src="<%=public_path%>/img/u155.png" alt=""/></div>-->
- <!--<div>Delete</div>-->
- <!--</a>-->
- <!--</li>-->
- <!--<%}%>-->
- <!--</ul>-->
- <!--</div>-->
- <div class="using" <%if(val.is_use == 1){%>style="display:block;" <%}%> >Using</div>
- </li>
- <%}%>
- </ul>
- <%}else{%>
- <div class="noData">No photos approved.</div>
- <%}%>
- </div>
- <div id="page" class="pagenation"></div>
- </div>
- <!-- right content end -->
- </div>
- <script>
- $(function(){
- //显示修改和删除
- $('.covers').mouseenter(function(){
- $(this).find('ul.edit').stop();
- $(this).find('ul.edit').slideDown(300);
- })
- $('.covers').mouseleave(function(){
- $(this).find('ul.edit').stop();
- $(this).find('ul.edit').slideUp(300);
- })
- /**
- * 删除封面
- */
- $('.coverDelete').on('click', function () {
- let id = $(this).parents('li.covers').attr('id');
- let length = $('.covers').length;
- if(length < 4){
- parent.layer.msg('Can not delete a cover photo when there are less than 4 cover photos.');
- return false;
- }
- parent.layer.confirm('Are you sure you wish to delete this photo?', {
- btn:['Cancel', 'Yes'],
- title:'',
- btnAlign:'c',
- closeBtn: 0,
- shadeClose:true,
- shade:0.01
- }, function(){
- parent.layer.msg('Cancel Delete');
- }, function(){
- $.post('/broadcast/cover/deleteCover',{id:id},function(data){
- if(data.errno == 0){
- window.location.reload();
- parent.layer.msg('deleted');
- }else{
- parent.layer.msg('Failed to delete');
- }
- })
- });
- })
- /**
- * 设置封面为使用中
- */
- $('.coverUse').on('click', function(){
- let id = $(this).parents('li.covers').attr('id');
- $.post('/broadcast/cover/useCover',{id:id},function(data){
- if(data.errno == 0){
- parent.layer.msg('Successfully set as using.');
- window.location.reload();
- }else{
- parent.layer.msg(data.data.errmsg);
- }
- })
- })
- //分页
- var pages = Math.ceil('<%=count.total%>'/8);
- if(pages>1) {
- page('page', pages);
- }
- })
- </script>
|