瀏覽代碼

appplat重建

lizhen_gitee 1 年之前
父節點
當前提交
5711f9f9a4

+ 1 - 1
application/admin/controller/Appplat.php

@@ -22,8 +22,8 @@ class Appplat extends Backend
     {
         parent::_initialize();
         $this->model = new \app\admin\model\Appplat;
-        $this->view->assign("statusList", $this->model->getStatusList());
         $this->view->assign("typeList", $this->model->getTypeList());
+        $this->view->assign("biglogoList", $this->model->getBiglogoList());
     }
 
 

+ 11 - 11
application/admin/lang/zh-cn/appplat.php

@@ -1,15 +1,15 @@
 <?php
 
 return [
-    'Id'       => 'id',
-    'Name'     => '名字',
-    'Image'    => 'logo',
-    'Url'      => '跳转地址',
-    'Weigh'    => '排序',
-    'Status'   => '状态',
-    'Status 1' => '上架',
-    'Status 0' => '下架',
-    'Type'     => '位置',
-    'Type 1'   => '留个好评',
-    'Type 2'   => '关注我们'
+    'Id'        => 'id',
+    'Name'      => '名字',
+    'Image'     => 'logo',
+    'Url'       => '跳转地址',
+    'Weigh'     => '排序',
+    'Type'      => '位置',
+    'Type 1'    => '留个好评',
+    'Type 2'    => '关注我们',
+    'Biglogo'   => '大图标',
+    'Biglogo 1' => '是',
+    'Biglogo 0' => '否'
 ];

+ 12 - 12
application/admin/model/Appplat.php

@@ -25,8 +25,8 @@ class Appplat extends Model
 
     // 追加属性
     protected $append = [
-        'status_text',
-        'type_text'
+        'type_text',
+        'biglogo_text'
     ];
     
 
@@ -39,22 +39,14 @@ class Appplat extends Model
     }
 
     
-    public function getStatusList()
-    {
-        return ['1' => __('Status 1'), '0' => __('Status 0')];
-    }
-
     public function getTypeList()
     {
         return ['1' => __('Type 1'), '2' => __('Type 2')];
     }
 
-
-    public function getStatusTextAttr($value, $data)
+    public function getBiglogoList()
     {
-        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
-        $list = $this->getStatusList();
-        return isset($list[$value]) ? $list[$value] : '';
+        return ['1' => __('Biglogo 1'), '0' => __('Biglogo 0')];
     }
 
 
@@ -66,6 +58,14 @@ class Appplat extends Model
     }
 
 
+    public function getBiglogoTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['biglogo']) ? $data['biglogo'] : '');
+        $list = $this->getBiglogoList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
 
 
 }

+ 12 - 12
application/admin/view/appplat/add.html

@@ -23,7 +23,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-url" class="form-control" name="row[url]" type="text" value="">
+            <input id="c-url" data-rule="required" class="form-control" name="row[url]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
@@ -33,24 +33,24 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
         <div class="col-xs-12 col-sm-8">
-            
-            <div class="radio">
-            {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
-            {/foreach}
-            </div>
+                        
+            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
+                {foreach name="typeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
 
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Biglogo')}:</label>
         <div class="col-xs-12 col-sm-8">
                         
-            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
-                {foreach name="typeList" item="vo"}
-                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
+            <select  id="c-biglogo" data-rule="required" class="form-control selectpicker" name="row[biglogo]">
+                {foreach name="biglogoList" item="vo"}
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 

+ 12 - 12
application/admin/view/appplat/edit.html

@@ -23,7 +23,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-url"  class="form-control" name="row[url]" type="text" value="{$row.url|htmlentities}">
+            <input id="c-url" data-rule="required" class="form-control" name="row[url]" type="text" value="{$row.url|htmlentities}">
         </div>
     </div>
     <div class="form-group">
@@ -33,24 +33,24 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
         <div class="col-xs-12 col-sm-8">
-            
-            <div class="radio">
-            {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
-            {/foreach}
-            </div>
+                        
+            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
+                {foreach name="typeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
 
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Biglogo')}:</label>
         <div class="col-xs-12 col-sm-8">
                         
-            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
-                {foreach name="typeList" item="vo"}
-                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
+            <select  id="c-biglogo" data-rule="required" class="form-control selectpicker" name="row[biglogo]">
+                {foreach name="biglogoList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.biglogo"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 

+ 1 - 11
application/admin/view/appplat/index.html

@@ -1,15 +1,5 @@
 <div class="panel panel-default panel-intro">
-    
-    <div class="panel-heading">
-        {:build_heading(null,FALSE)}
-        <ul class="nav nav-tabs" data-field="status">
-            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
-            {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
-            {/foreach}
-        </ul>
-    </div>
-
+    {:build_heading()}
 
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">

+ 1 - 1
public/assets/js/backend/appplat.js

@@ -30,8 +30,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                         {field: 'url', title: __('Url'), operate: 'LIKE', formatter: Table.api.formatter.url},
                         {field: 'weigh', title: __('Weigh'), operate: false},
-                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0')}, formatter: Table.api.formatter.status},
                         {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
+                        {field: 'biglogo', title: __('Biglogo'), searchList: {"1":__('Biglogo 1'),"0":__('Biglogo 0')}, formatter: Table.api.formatter.normal},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]