dever 6 年之前
父節點
當前提交
33066fdf1d
共有 2 個文件被更改,包括 11 次插入1 次删除
  1. 1 1
      assets/html/show.html
  2. 10 0
      src/View.php

+ 1 - 1
assets/html/show.html

@@ -47,7 +47,7 @@
     
     <ul class="component-anim-demo">
     	<{loop($file):}>
-      <li class="<{if(strstr($cur, $v1.url)):}>layui-anim-yes<{else:}>layui-anim-no<{endif}>">
+      <li class="<{if($v1.check):}>layui-anim-yes<{else:}>layui-anim-no<{endif}>">
         <div class="layui-anim" data-anim="layui-anim-up" onclick="showUploadFilesSet($(this), '<{$v1.name}>','<{$v1.url}>','<{$v1.id}>')"><img src="<{$v1.pic}>" style="max-width: 150px;max-height: 100px;margin-left: 10px;"/></div>
         <div class="code"><{$v1.source_name}></div>
       </li>

+ 10 - 0
src/View.php

@@ -35,6 +35,7 @@ class View
         $name = Dever::input('name');
         $tag = Dever::input('tag');
         $data['cur'] = Dever::input('cur');
+        $data['value'] = Dever::input('value');
         $data['search_pg'] = Dever::input('pg', 1);
 
         $param = array();
@@ -86,6 +87,13 @@ class View
                 } else {
                     $data['file'][$k]['url'] = $v['file'];
                 }
+
+                $data['file'][$k]['check'] = false;
+                if ($data['value'] && $data['value'] == $v['id']) {
+                    $data['file'][$k]['check'] = true;
+                } elseif ($data['cur'] && (isset($v['pic']) && $v['pic'] && strstr($data['cur'], $v['pic']) || isset($v['file']) && $v['file'] && strstr($data['cur'], $v['file']))) {
+                    $data['file'][$k]['check'] = true;
+                }
                 
                 if (isset($v['pic']) && $v['pic']) {
                     $data['file'][$k]['pic'] = $v['pic'];
@@ -212,6 +220,8 @@ class View
                 $handle = new Handle($image);
                 $method = 'handle_' . $type;
                 $file = $handle->$method($id, $source, $dest, $path);
+
+                echo $file;die;
             }
         }