app
|
|
@ -0,0 +1,393 @@
|
|||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
/**
|
||||
* 手机管理-首页导航管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class AppHomeNavController extends CommonController
|
||||
{
|
||||
/**
|
||||
* [_initialize 前置操作-继承公共前置方法]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-03T12:39:08+0800
|
||||
*/
|
||||
public function _initialize()
|
||||
{
|
||||
// 调用父类前置方法
|
||||
parent::_initialize();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
}
|
||||
|
||||
/**
|
||||
* [Index 手机管理-首页导航列表]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-06T21:31:53+0800
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
// 参数
|
||||
$param = array_merge($_POST, $_GET);
|
||||
|
||||
// 模型对象
|
||||
$m = M('AppHomeNav');
|
||||
|
||||
// 条件
|
||||
$where = $this->GetIndexWhere();
|
||||
|
||||
// 分页
|
||||
$number = MyC('admin_page_number');
|
||||
$page_param = array(
|
||||
'number' => $number,
|
||||
'total' => $m->where($where)->count(),
|
||||
'where' => $param,
|
||||
'url' => U('Admin/AppHomeNav/Index'),
|
||||
);
|
||||
$page = new \Library\Page($page_param);
|
||||
|
||||
// 获取列表
|
||||
$list = $this->SetDataHandle($m->where($where)->limit($page->GetPageStarNumber(), $number)->order('is_enable desc, id desc')->select());
|
||||
|
||||
// 参数
|
||||
$this->assign('param', $param);
|
||||
|
||||
// 分页
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', L('common_is_enable_list'));
|
||||
|
||||
// 所属平台
|
||||
$this->assign('common_platform_type', L('common_platform_type'));
|
||||
|
||||
// app事件类型
|
||||
$this->assign('common_app_event_type', L('common_app_event_type'));
|
||||
|
||||
// 数据列表
|
||||
$this->assign('list', $list);
|
||||
$this->display('Index');
|
||||
}
|
||||
|
||||
/**
|
||||
* [SetDataHandle 数据处理]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-29T21:27:15+0800
|
||||
* @param [array] $data [手机管理-首页导航数据]
|
||||
* @return [array] [处理好的数据]
|
||||
*/
|
||||
private function SetDataHandle($data)
|
||||
{
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_platform_type = L('common_platform_type');
|
||||
$common_is_enable_tips = L('common_is_enable_tips');
|
||||
$common_app_event_type = L('common_app_event_type');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 是否启用
|
||||
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
|
||||
|
||||
// 平台类型
|
||||
$v['platform_text'] = $common_platform_type[$v['platform']]['name'];
|
||||
|
||||
// 跳转类型
|
||||
$v['event_type_text'] = $common_app_event_type[$v['event_type']]['name'];
|
||||
|
||||
// 图片地址
|
||||
$v['images_url'] = empty($v['images_url']) ? '' : C('IMAGE_HOST').$v['images_url'];
|
||||
|
||||
// 添加时间
|
||||
$v['add_time_text'] = date('Y-m-d H:i:s', $v['add_time']);
|
||||
|
||||
// 更新时间
|
||||
$v['upd_time_text'] = date('Y-m-d H:i:s', $v['upd_time']);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* [GetIndexWhere 列表条件]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-10T22:16:29+0800
|
||||
*/
|
||||
private function GetIndexWhere()
|
||||
{
|
||||
$where = array();
|
||||
|
||||
// 模糊
|
||||
if(!empty($_REQUEST['keyword']))
|
||||
{
|
||||
$where['name'] = array('like', '%'.I('keyword').'%');
|
||||
}
|
||||
|
||||
// 是否更多条件
|
||||
if(I('is_more', 0) == 1)
|
||||
{
|
||||
if(I('is_enable', -1) > -1)
|
||||
{
|
||||
$where['is_enable'] = intval(I('is_enable', 0));
|
||||
}
|
||||
if(I('event_type', -1) > -1)
|
||||
{
|
||||
$where['event_type'] = intval(I('event_type', 0));
|
||||
}
|
||||
if(!empty($_REQUEST['platform']))
|
||||
{
|
||||
$where['platform'] = I('platform');
|
||||
}
|
||||
|
||||
// 表达式
|
||||
if(!empty($_REQUEST['time_start']))
|
||||
{
|
||||
$where['add_time'][] = array('gt', strtotime(I('time_start')));
|
||||
}
|
||||
if(!empty($_REQUEST['time_end']))
|
||||
{
|
||||
$where['add_time'][] = array('lt', strtotime(I('time_end')));
|
||||
}
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
* [SaveInfo 添加/编辑页面]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-14T21:37:02+0800
|
||||
*/
|
||||
public function SaveInfo()
|
||||
{
|
||||
// 手机管理-首页导航信息
|
||||
$data = empty($_REQUEST['id']) ? array() : M('AppHomeNav')->find(I('id'));
|
||||
$this->assign('data', $data);
|
||||
|
||||
// 所属平台
|
||||
$this->assign('common_platform_type', L('common_platform_type'));
|
||||
|
||||
// app事件类型
|
||||
$this->assign('common_app_event_type', L('common_app_event_type'));
|
||||
|
||||
// 参数
|
||||
$this->assign('platform_type', 'alipay');
|
||||
$this->assign('param', array_merge($_POST, $_GET));
|
||||
|
||||
$this->display('SaveInfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* [Save 手机管理-首页导航添加/编辑]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-14T21:37:02+0800
|
||||
*/
|
||||
public function Save()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 图片
|
||||
if(!empty($_FILES['file_images_url']))
|
||||
{
|
||||
// 文件上传校验
|
||||
$error = FileUploadError('file_images_url');
|
||||
if($error !== true)
|
||||
{
|
||||
$this->ajaxReturn($error, -1);
|
||||
}
|
||||
|
||||
// 文件类型
|
||||
list($type, $suffix) = explode('/', $_FILES['file_images_url']['type']);
|
||||
$path = 'Public'.DS.'Upload'.DS.'app_home_nav'.DS.date('Y').DS.date('m').DS;
|
||||
if(!is_dir($path))
|
||||
{
|
||||
mkdir(ROOT_PATH.$path, 0777, true);
|
||||
}
|
||||
$filename = date('YmdHis').GetNumberCode(6).'.'.$suffix;
|
||||
$file_images_url = $path.$filename;
|
||||
|
||||
if(move_uploaded_file($_FILES['file_images_url']['tmp_name'], ROOT_PATH.$file_images_url))
|
||||
{
|
||||
$_POST['images_url'] = DS.$file_images_url;
|
||||
}
|
||||
}
|
||||
|
||||
// 添加
|
||||
if(empty($_POST['id']))
|
||||
{
|
||||
$this->Add();
|
||||
|
||||
// 编辑
|
||||
} else {
|
||||
$this->Edit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Add 手机管理-首页导航添加]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-18T16:20:59+0800
|
||||
*/
|
||||
private function Add()
|
||||
{
|
||||
// 手机管理-首页导航模型
|
||||
$m = D('AppHomeNav');
|
||||
|
||||
// 数据自动校验
|
||||
if($m->create($_POST, 1))
|
||||
{
|
||||
// 额外数据处理
|
||||
$m->name = I('name');
|
||||
$m->jump_url = I('jump_url');
|
||||
$m->event_type = intval(I('event_type'));
|
||||
$m->images_url = I('images_url');
|
||||
$m->platform = I('platform');
|
||||
$m->is_enable = intval(I('is_enable', 0));
|
||||
$m->bg_color = I('bg_color');
|
||||
$m->add_time = time();
|
||||
|
||||
// 数据添加
|
||||
if($m->add())
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_add_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_add_error'), -100);
|
||||
}
|
||||
} else {
|
||||
$this->ajaxReturn($m->getError(), -1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Edit 手机管理-首页导航编辑]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-17T22:13:40+0800
|
||||
*/
|
||||
private function Edit()
|
||||
{
|
||||
// 手机管理-首页导航模型
|
||||
$m = D('AppHomeNav');
|
||||
|
||||
// 数据自动校验
|
||||
if($m->create($_POST, 2))
|
||||
{
|
||||
// 额外数据处理
|
||||
$m->name = I('name');
|
||||
$m->jump_url = I('jump_url');
|
||||
$m->event_type = intval(I('event_type'));
|
||||
$m->images_url = I('images_url');
|
||||
$m->platform = I('platform');
|
||||
$m->is_enable = intval(I('is_enable', 0));
|
||||
$m->bg_color = I('bg_color');
|
||||
$m->upd_time = time();
|
||||
|
||||
// 更新数据库
|
||||
if($m->where(array('id'=>I('id')))->save())
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_edit_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_edit_error'), -100);
|
||||
}
|
||||
} else {
|
||||
$this->ajaxReturn($m->getError(), -1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Delete 手机管理-首页导航删除]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-15T11:03:30+0800
|
||||
*/
|
||||
public function Delete()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 参数处理
|
||||
$id = I('id');
|
||||
|
||||
// 删除数据
|
||||
if(!empty($id))
|
||||
{
|
||||
// 模型
|
||||
$m = M('AppHomeNav');
|
||||
|
||||
// 是否存在
|
||||
$data = $m->find($id);
|
||||
if(empty($data))
|
||||
{
|
||||
$this->ajaxReturn(L('common_data_no_exist_error'), -2);
|
||||
}
|
||||
if($data['is_enable'] == 1)
|
||||
{
|
||||
$this->ajaxReturn(L('common_already_is_enable_error'), -3);
|
||||
}
|
||||
|
||||
// 删除
|
||||
if($m->where(array('id'=>$id))->delete() !== false)
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_delete_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_delete_error'), -100);
|
||||
}
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_param_error'), -1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [StatusUpdate 状态更新]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-01-12T22:23:06+0800
|
||||
*/
|
||||
public function StatusUpdate()
|
||||
{
|
||||
// 参数
|
||||
if(empty($_POST['id']) || !isset($_POST['state']))
|
||||
{
|
||||
$this->ajaxReturn(L('common_param_error'), -1);
|
||||
}
|
||||
|
||||
// 数据更新
|
||||
if(M('AppHomeNav')->where(array('id'=>I('id')))->save(array('is_enable'=>I('state'))))
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_edit_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_edit_error'), -100);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -180,9 +180,6 @@ class SlideController extends CommonController
|
|||
$data = empty($_REQUEST['id']) ? array() : M('Slide')->find(I('id'));
|
||||
$this->assign('data', $data);
|
||||
|
||||
// 是否启用
|
||||
$this->assign('common_is_enable_list', L('common_is_enable_list'));
|
||||
|
||||
// 所属平台
|
||||
$this->assign('common_platform_type', L('common_platform_type'));
|
||||
|
||||
|
|
@ -268,7 +265,7 @@ class SlideController extends CommonController
|
|||
$m->jump_url_type = intval(I('jump_url_type'));
|
||||
$m->images_url = I('images_url');
|
||||
$m->platform = I('platform');
|
||||
$m->is_enable = intval(I('is_enable'));
|
||||
$m->is_enable = intval(I('is_enable', 0));
|
||||
$m->bg_color = I('bg_color');
|
||||
$m->add_time = time();
|
||||
|
||||
|
|
@ -305,7 +302,7 @@ class SlideController extends CommonController
|
|||
$m->jump_url_type = intval(I('jump_url_type'));
|
||||
$m->images_url = I('images_url');
|
||||
$m->platform = I('platform');
|
||||
$m->is_enable = intval(I('is_enable'));
|
||||
$m->is_enable = intval(I('is_enable', 0));
|
||||
$m->bg_color = I('bg_color');
|
||||
$m->upd_time = time();
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 模块语言包-导航图片
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
return array(
|
||||
// 添加/编辑
|
||||
'app_home_nav_add_name' => '导航添加',
|
||||
'app_home_nav_edit_name' => '导航编辑',
|
||||
|
||||
'app_home_nav_name_text' => '名称',
|
||||
'app_home_nav_name_format' => '名称格式 2~60 个字符',
|
||||
|
||||
'app_home_nav_images_url_text' => '导航图标',
|
||||
'app_home_nav_images_url_format' => '请上传导航图标',
|
||||
);
|
||||
?>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Admin\Model;
|
||||
use Think\Model;
|
||||
|
||||
/**
|
||||
* 支付宝小程序-首页导航模型
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class AppHomeNavModel extends CommonModel
|
||||
{
|
||||
// 数据自动校验
|
||||
protected $_validate = array(
|
||||
// 添加,编辑
|
||||
array('name', '2,60', '{%app_home_nav_name_format}', 1, 'length', 3),
|
||||
array('platform', array('h5','app','alipay','wechat','baidu'), '{%common_platform_format}', 1, 'in', 3),
|
||||
array('event_value', '0,255', '{%common_app_event_value_format}', 2, 'length', 3),
|
||||
array('event_type', array(0,1,2,3,4), '{%common_app_event_type_format}', 1, 'in', 3),
|
||||
array('images_url', 'require', '{%app_home_nav_images_url_format}', 1, '', 3),
|
||||
array('is_enable', array(0,1), '{%common_enable_tips}', 1, 'in', 3),
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
|
@ -16,7 +16,7 @@ class SlideModel extends CommonModel
|
|||
protected $_validate = array(
|
||||
// 添加,编辑
|
||||
array('name', '0,60', '{%slide_name_format}', 1, 'length', 3),
|
||||
array('platform', array('pc','h5','alipay','wechat','baidu'), '{%common_platform_format}', 1, 'in', 3),
|
||||
array('platform', array('pc','h5','app','alipay','wechat','baidu'), '{%common_platform_format}', 1, 'in', 3),
|
||||
array('jump_url', '0,255', '{%common_jump_url_format}', 2, 'length', 3),
|
||||
array('jump_url_type', array(0,1,2), '{%common_jump_url_type_format}', 1, 'in', 3),
|
||||
array('images_url', 'require', '{%slide_images_url_format}', 1, '', 3),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,122 @@
|
|||
<include file="Public/Header" />
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form view-list" action="{{:U('Admin/AppHomeNav/Index')}}" method="POST">
|
||||
<div class="am-g">
|
||||
<input type="text" class="am-radius form-keyword" placeholder="{{:L('app_home_nav_name_text')}}" name="keyword" <present name="param['keyword']"> value="{{$param.keyword}}"</present> />
|
||||
<button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">{{:L('common_operation_query')}}</button>
|
||||
<label class="fs-12 m-l-5 c-p fw-100 more-submit">
|
||||
{{:L('common_more_screening')}}
|
||||
<input type="checkbox" name="is_more" value="1" id="is_more" <if condition="isset($param['is_more']) and $param['is_more'] eq 1">checked</if> />
|
||||
<i class="am-icon-angle-down"></i>
|
||||
</label>
|
||||
|
||||
<div class="more-where <if condition="!isset($param['is_more']) or $param['is_more'] neq 1">none</if>">
|
||||
<select name="is_enable" class="am-radius c-p m-t-10 m-l-5 param-where">
|
||||
<option value="-1">{{:L('common_view_enable_title')}}</option>
|
||||
<foreach name="common_is_enable_list" item="v">
|
||||
<option value="{{$v.id}}" <if condition="isset($param['is_enable']) and $param['is_enable'] eq $v['id']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
<select name="platform" class="am-radius c-p m-t-10 m-l-5 param-where">
|
||||
<option value="">{{:L('common_platform_text')}}</option>
|
||||
<foreach name="common_platform_type" item="v">
|
||||
<if condition="!in_array($v['value'], ['pc'])">
|
||||
<option value="{{$v.value}}" <if condition="isset($param['platform']) and $param['platform'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
</if>
|
||||
</foreach>
|
||||
</select>
|
||||
<select name="event_type" class="am-radius c-p m-t-10 m-l-5 param-where">
|
||||
<option value="-1">{{:L('common_app_event_type_text')}}</option>
|
||||
<foreach name="common_app_event_type" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($param['event_type']) and $param['event_type'] eq $v['value']">selected</if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
<div class="param-date param-where m-l-5">
|
||||
<input type="text" name="time_start" class="Wdate am-radius m-t-10" placeholder="{{:L('common_time_start_name')}}" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <if condition="isset($param['time_start'])">value="{{$param.time_start}}"</if>/>
|
||||
<span>~</span>
|
||||
<input type="text" class="Wdate am-radius m-t-10" placeholder="{{:L('common_time_end_name')}}" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" <if condition="isset($param['time_end'])">value="{{$param.time_end}}"</if>/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
|
||||
<!-- operation start -->
|
||||
<div class="am-g m-t-15">
|
||||
<a href="{{:U('Admin/AppHomeNav/SaveInfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> {{:L('common_operation_add')}}</a>
|
||||
</div>
|
||||
<!-- operation end -->
|
||||
|
||||
<!-- list start -->
|
||||
<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{:L('app_home_nav_name_text')}}</th>
|
||||
<th>{{:L('common_platform_text')}}</th>
|
||||
<th>{{:L('app_home_nav_images_url_text')}}</th>
|
||||
<th>{{:L('common_app_event_value_text')}}</th>
|
||||
<th>{{:L('common_view_enable_title')}}</th>
|
||||
<th>{{:L('common_create_time_name')}}</th>
|
||||
<th>{{:L('common_operation_name')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<if condition="!empty($list)">
|
||||
<foreach name="list" item="v">
|
||||
<tr id="data-list-{{$v.id}}" <if condition="$v['is_enable'] eq 0">class="am-active"</if>>
|
||||
<td>{{$v.name}}</td>
|
||||
<td>{{$v.platform_text}}</td>
|
||||
<td>
|
||||
<div class="am-circle nav-icon-circle" <if condition="!empty($v['bg_color'])">style="background-color:{{$v.bg_color}};"</if>>
|
||||
<if condition="!empty($v['images_url'])">
|
||||
<a href="{{$v['images_url']}}" target="_blank">
|
||||
<img src="{{$v['images_url']}}" class="am-radius" width="35" />
|
||||
</a>
|
||||
<else />
|
||||
<span class="cr-ddd">{{:L('common_on_fill_in_images')}}</span>
|
||||
</if>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{{$v.event_value}}
|
||||
<if condition="!empty($v['event_value'])">
|
||||
<br /><span class="am-badge am-badge-warning am-radius">{{$v.event_type_text}}</span>
|
||||
</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state <if condition="$v['is_enable'] eq 1">am-success<else />am-default</if>" data-url="{{:U('Admin/AppHomeNav/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1"></a>
|
||||
</td>
|
||||
<td>{{$v.add_time_text}}</td>
|
||||
<td class="view-operation">
|
||||
<a href="{{:U('Admin/AppHomeNav/SaveInfo', array('id'=>$v['id']))}}">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit"> {{:L('common_operation_edit')}}</button>
|
||||
</a>
|
||||
<if condition="$v['is_enable'] eq 0">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/AppHomeNav/Delete')}}" data-id="{{$v.id}}"> {{:L('common_operation_delete')}}</button>
|
||||
</if>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
<else />
|
||||
<tr><td colspan="20" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
|
||||
</if>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- list end -->
|
||||
|
||||
<!-- page start -->
|
||||
<if condition="!empty($list)">
|
||||
{{$page_html}}
|
||||
</if>
|
||||
<!-- page end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<include file="Public/Header" />
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:U('Admin/AppHomeNav/Save')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/AppHomeNav/Index')}}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_image', 2048000)}}" />
|
||||
<legend>
|
||||
<span class="fs-16">
|
||||
<if condition="empty($data['id'])">
|
||||
{{:L('app_home_nav_add_name')}}
|
||||
<else />
|
||||
{{:L('app_home_nav_edit_name')}}
|
||||
</if>
|
||||
</span>
|
||||
<a href="{{:U('Admin/AppHomeNav/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
|
||||
</legend>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('app_home_nav_name_text')}}</label>
|
||||
<input type="text" name="name" placeholder="{{:L('app_home_nav_name_text')}}" minlength="2" maxlength="60" data-validation-message="{{:L('app_home_nav_name_format')}}" class="am-radius" <notempty name="data"> value="{{$data.name}}"</notempty> required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_platform_text')}}</label>
|
||||
<select name="platform" class="am-radius chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" placeholder="{{:L('common_platform_format')}}">
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="common_platform_type" item="v">
|
||||
<if condition="!in_array($v['value'], ['pc'])">
|
||||
<option value="{{$v.value}}" <if condition="isset($data['platform']) and $data['platform'] eq $v['value']">selected<else /><if condition="!isset($data['platform']) and isset($v['checked']) and $v['checked'] eq true">selected</if></if>>{{$v.name}}</option>
|
||||
</if>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_app_event_type_text')}}</label>
|
||||
<select name="event_type" class="am-radius chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" placeholder="{{:L('common_app_event_type_format')}}">
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="common_app_event_type" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($data['event_type']) and $data['event_type'] eq $v['value']">selected<else /><if condition="!isset($data['event_type']) and isset($v['checked']) and $v['checked'] eq true">selected</if></if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-alert am-alert-warning am-radius" data-am-alert>
|
||||
<button type="button" class="am-close">×</button>
|
||||
<p>{{:L('common_app_event_type_tips')}}</p>
|
||||
</div>
|
||||
<label>{{:L('common_app_event_value_text')}}</label>
|
||||
<input type="text" name="event_value" placeholder="{{:L('common_app_event_value_text')}}" data-validation-message="{{:L('common_app_event_value_format')}}" class="am-radius" <notempty name="data"> value="{{$data.event_value}}"</notempty> />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">{{:L('app_home_nav_images_url_text')}}</label>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius">
|
||||
<i class="am-icon-cloud-upload"></i> {{:L('common_select_images_text')}}</button>
|
||||
<input type="text" name="images_url" class="am-radius js-choice-one original-images-url" data-choice-one-to=".images-file-event" <notempty name="data"> value="{{$data.images_url}}"</notempty>" data-validation-message="{{:L('common_select_images_tips')}}" readonly="readonly" <notempty name="data"> value="{{$data.images_url}}"</notempty> required />
|
||||
<input type="file" name="file_images_url" multiple data-validation-message="{{:L('common_select_images_tips')}}" accept="image/gif,image/jpeg,image/jpg,image/png" class="js-choice-one images-file-event" data-choice-one-to=".original-images-url" data-tips-tag="#form-images_url-tips" data-image-tag="#form-img-images_url" required />
|
||||
<div id="form-images_url-tips" class="m-t-5"></div>
|
||||
|
||||
<div class="am-circle m-t-5 nav-icon-circle" <notempty name="data">style="background-color:{{$data.bg_color}};"</notempty>>
|
||||
<img src="<if condition="!empty($data['images_url'])">{{$image_host}}{{$data.images_url}}<else />{{$image_host}}/Public/Admin/Default/Images/default-images.png</if>" id="form-img-images_url" width="35" height="35" data-default="<if condition="!empty($data['images_url'])">{{$image_host}}{{$data.images_url}}<else />{{$image_host}}/Public/Admin/Default/Images/default-images.png</if>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_background_color')}}</label>
|
||||
<input type="hidden" name="bg_color" value="<notempty name="data">{{$data.bg_color}}</notempty>" />
|
||||
<button class="am-btn am-btn-default colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r" type="button" data-input-tag="button.bg-color-tag" data-color-tag="input[name='bg_color']" data-color-style="background-color" <notempty name="data"> style="background-color:{{$data.bg_color}};"</notempty>>
|
||||
<img src="__PUBLIC__/Common/Images/colorpicker.png" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="block">{{:L('common_view_enable_title')}}</label>
|
||||
<input name="is_enable" value="1" type="checkbox" data-off-text="{{:L('common_operation_off_is_text')}}" data-on-text="{{:L('common_operation_on_is_text')}}" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <if condition="!empty($data) and $data['is_enable'] eq 1">checked="true"</if> />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" name="id" <notempty name="data"> value="{{$data.id}}"</notempty> />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
||||
|
|
@ -22,25 +22,27 @@
|
|||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_platform_text')}}</label>
|
||||
<select name="platform" class="am-radius chosen-select" placeholder="{{:L('common_platform_format')}}">
|
||||
<select name="platform" class="am-radius chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" placeholder="{{:L('common_platform_format')}}">
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="common_platform_type" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($data['platform']) and $data['platform'] eq $v['value']">selected<else /><if condition="!isset($data['platform']) and isset($v['checked']) and $v['checked'] eq true">selected</if></if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_jump_url_text')}}</label>
|
||||
<input type="text" name="jump_url" placeholder="{{:L('common_jump_url_text')}}" data-validation-message="{{:L('common_jump_url_format')}}" class="am-radius" <notempty name="data"> value="{{$data.jump_url}}"</notempty> />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_jump_url_type_text')}}<span class="fs-12 fw-100 cr-999">({{:L('common_jump_url_type_tips')}})</span></label>
|
||||
<select name="jump_url_type" class="am-radius chosen-select" placeholder="{{:L('common_jump_url_type_format')}}">
|
||||
<select name="jump_url_type" class="am-radius chosen-select" data-placeholder="{{:L('common_select_can_choose')}}" placeholder="{{:L('common_jump_url_type_format')}}">
|
||||
<option value="">{{:L('common_select_can_choose')}}</option>
|
||||
<foreach name="common_jump_url_type" item="v">
|
||||
<option value="{{$v.value}}" <if condition="isset($data['jump_url_type']) and $data['jump_url_type'] eq $v['value']">selected<else /><if condition="!isset($data['jump_url_type']) and isset($v['checked']) and $v['checked'] eq true">selected</if></if>>{{$v.name}}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_jump_url_text')}}</label>
|
||||
<input type="text" name="jump_url" placeholder="{{:L('common_jump_url_text')}}" data-validation-message="{{:L('common_jump_url_format')}}" class="am-radius" <notempty name="data"> value="{{$data.jump_url}}"</notempty> />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
<label class="block">{{:L('slide_images_url_text')}}</label>
|
||||
|
|
@ -53,12 +55,15 @@
|
|||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_background_color')}}</label>
|
||||
<input type="hidden" name="bg_color" value="" />
|
||||
<input type="hidden" name="bg_color" value="<notempty name="data">{{$data.bg_color}}</notempty>" />
|
||||
<button class="am-btn am-btn-default colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r" type="button" data-input-tag="button.bg-color-tag" data-color-tag="input[name='bg_color']" data-color-style="background-color" <notempty name="data"> style="background-color:{{$data.bg_color}};"</notempty>>
|
||||
<img src="__PUBLIC__/Common/Images/colorpicker.png" />
|
||||
</button>
|
||||
</div>
|
||||
<include file="Lib/Enable" />
|
||||
<div class="am-form-group">
|
||||
<label class="block">{{:L('common_view_enable_title')}}</label>
|
||||
<input name="is_enable" value="1" type="checkbox" data-off-text="{{:L('common_operation_off_is_text')}}" data-on-text="{{:L('common_operation_on_is_text')}}" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <if condition="!empty($data) and $data['is_enable'] eq 1">checked="true"</if> />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" name="id" <notempty name="data"> value="{{$data.id}}"</notempty> />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
|
||||
|
|
|
|||
|
|
@ -317,6 +317,12 @@ return array(
|
|||
'common_linkage_county_format' => '请选择区/县',
|
||||
'common_avatar_upload_title' => '头像上传',
|
||||
|
||||
'common_app_event_type_text' => '事件类型',
|
||||
'common_app_event_type_format' => '事件值类型有误',
|
||||
'common_app_event_type_tips' => '1,2,3',
|
||||
'common_app_event_value_text' => '事件值',
|
||||
'common_app_event_value_format' => '事件值最多 255 个字符',
|
||||
|
||||
// 性别
|
||||
'common_gender_list' => array(
|
||||
0 => array('id' => 0, 'name' => '保密', 'checked' => true),
|
||||
|
|
@ -402,8 +408,9 @@ return array(
|
|||
|
||||
// 所属平台
|
||||
'common_platform_type' => array(
|
||||
'pc' => array('value' => 'pc', 'name' => 'PC网站', 'checked' => true),
|
||||
'pc' => array('value' => 'pc', 'name' => 'PC网站'),
|
||||
'h5' => array('value' => 'h5', 'name' => 'H5手机网站'),
|
||||
'app' => array('value' => 'app', 'name' => 'APP'),
|
||||
'alipay' => array('value' => 'alipay', 'name' => '支付宝小程序'),
|
||||
'wechat' => array('value' => 'wechat', 'name' => '微信小程序'),
|
||||
'baidu' => array('value' => 'baidu', 'name' => '百度小程序'),
|
||||
|
|
@ -411,7 +418,7 @@ return array(
|
|||
|
||||
// 小程序url跳转类型
|
||||
'common_jump_url_type' => array(
|
||||
0 => array('value' => 0, 'name' => 'WEB页面', 'checked' => true),
|
||||
0 => array('value' => 0, 'name' => 'WEB页面'),
|
||||
1 => array('value' => 1, 'name' => '内部页面(小程序或APP内部地址)'),
|
||||
2 => array('value' => 2, 'name' => '外部小程序(同一个主体下的小程序appid)'),
|
||||
),
|
||||
|
|
@ -572,6 +579,15 @@ return array(
|
|||
1 => array('value' => 1, 'name' => '上架', 'checked' => true),
|
||||
),
|
||||
|
||||
// app事件类型
|
||||
'common_app_event_type' => array(
|
||||
0 => array('value' => 0, 'name' => 'WEB页面'),
|
||||
1 => array('value' => 1, 'name' => '内部页面(小程序内部地址)'),
|
||||
2 => array('value' => 2, 'name' => '外部小程序(同一个主体下的小程序appid)'),
|
||||
3 => array('value' => 3, 'name' => '跳转原生地图查看指定位置'),
|
||||
4 => array('value' => 4, 'name' => '拨打电话'),
|
||||
),
|
||||
|
||||
|
||||
// 色彩值
|
||||
'common_color_list' => array(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* 列表
|
||||
*/
|
||||
.form-keyword { width: 55% !important; display: initial !important; }
|
||||
.more-submit input { display: none; }
|
||||
.param-where, .param-date input { display: initial !important; }
|
||||
@media only screen and (max-width: 641px) {
|
||||
.param-where { width: 100% !important; margin-left: 0px !important; }
|
||||
.param-date input { width: 47% !important; }
|
||||
}
|
||||
@media only screen and (min-width: 641px) {
|
||||
.param-where { width: 32% !important; float: left; }
|
||||
.param-date input { width: 45% !important; }
|
||||
.param-where:nth-child(1), .param-where:nth-child(4) { margin-left: 0px !important; }
|
||||
}
|
||||
@media only screen and (max-width: 321px) {
|
||||
.view-operation button { margin: 2px 0px; }
|
||||
}
|
||||
.nav-icon-circle { width: 60px; height: 60px; text-align: center; line-height: 60px; }
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
0
service/Public/Common/Lib/assets/js/amazeui.ie8polyfill.min.js
vendored
Normal file → Executable file
0
service/Public/Common/Lib/assets/js/amazeui.widgets.helper.min.js
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |