Browse Source

修改图文展示

Anyon 4 years ago
parent
commit
299dc5e762
2 changed files with 6 additions and 5 deletions
  1. 4 1
      app/wechat/view/news/index.html
  2. 2 4
      public/static/admin.js

+ 4 - 1
app/wechat/view/news/index.html

@@ -10,7 +10,7 @@
 
 {block name='content'}
 <div class="think-box-shadow">
-    <div id="news-box" class="layui-clear">
+    <div id="news-box" class="layui-clear layui-hide">
         {foreach $list as $vo}
         <div class="news-item">
             <div class='news-tools layui-hide'>
@@ -45,7 +45,10 @@
     }).off('mouseleave', '.news-item').on('mouseleave', '.news-item', function () {
         $(this).find('.news-tools').addClass('layui-hide');
     });
+    $.msg.loading();
     require(['jquery.masonry'], function (Masonry) {
+        layui.layer.closeAll();
+        $('#news-box').removeClass('layui-hide');
         var newsbox = document.querySelector('#news-box');
         var msnry = new Masonry(newsbox, {itemSelector: '.news-item', columnWidth: 0});
         msnry.layout(), $('body').on('click', '[data-news-del]', function (event) {

+ 2 - 4
public/static/admin.js

@@ -131,7 +131,7 @@ $(function () {
         };
         // 内容区域动态加载后初始化
         this.reInit = function ($dom) {
-            $.vali.listen(this), $dom = $dom || $(this.selecter);
+            $(window).trigger('scroll'), $.vali.listen(this), $dom = $dom || $(this.selecter);
             $dom.find('[required]').map(function ($parent) {
                 if (($parent = $(this).parent()) && $parent.is('label')) {
                     $parent.addClass('label-required-prev');
@@ -160,9 +160,7 @@ $(function () {
                 $this.uploadFile(function (url, file) {
                     $($this.data('input')).data('file', file).val(url).trigger('change');
                 });
-            }), setTimeout(function () {
-                $(window).trigger('scroll');
-            }, 500);
+            });
         };
         // 在内容区显示视图
         this.show = function (html) {