[更新]修改模板文件

This commit is contained in:
Anyon 2017-04-26 14:04:29 +08:00
parent 772e1106ce
commit 4cf201b6db
7 changed files with 417 additions and 494 deletions

View File

@ -2,9 +2,7 @@
{block name="button"}
<div class="nowrap pull-right" style="margin-top:10px">
<button data-load="{:url('sync')}" class='layui-btn layui-btn-small'>
<i class='fa fa-referer'></i> 同步粉丝
</button>
<button data-load="{:url('sync')}" class='layui-btn layui-btn-small'><i class='fa fa-referer'></i> 同步粉丝</button>
</div>
{/block}
@ -16,8 +14,7 @@
<div class="row">
<div class="col-xs-3">
<div class="form-group">
<input type="text" name="nickname" value="{$Think.get.nickname|default=''}" placeholder="昵称"
class="input-sm form-control">
<input type="text" name="nickname" value="{$Think.get.nickname|default=''}" placeholder="昵称" class="input-sm form-control">
</div>
</div>
@ -34,32 +31,31 @@
<input type="hidden" value="resort" name="action"/>
<table class="table table-hover">
<thead>
<tr>
<th class='list-table-check-td'>
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
</th>
<th class='text-left'>用户昵称</th>
<th class='text-center'>性别</th>
<th class='text-center'>区域</th>
<th class='text-center'>关注时间</th>
</tr>
<tr>
<th class='list-table-check-td'>
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
</th>
<th class='text-left'>用户昵称</th>
<th class='text-center'>性别</th>
<th class='text-center'>区域</th>
<th class='text-center'>关注时间</th>
</tr>
</thead>
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
</td>
<td class='text-left'>
<img style="width:25px;height:25px;border-radius:50%;margin-right:10px" data-tips-image="{$vo.headimgurl}"
onerror="this.src='__PUBLIC__/static/theme/default/img/image.png'" alt="" src="{$vo.headimgurl}"/>
{$vo.nickname|default="<span style='color:#999'>未设置微信昵称</span>"}
</td>
<td class='text-center'>{$vo.sex==1?'男':($vo.sex==2?'女':'未知')}</td>
<td class='text-center'>{$vo.country|default='<span style="color:#999">未设置区域信息</span>'}{$vo.province}{$vo.city}</td>
<td class='text-center'>{$vo.subscribe_at}</td>
</tr>
{/foreach}
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
</td>
<td class='text-left'>
<img style="width:25px;height:25px;border-radius:50%;margin-right:10px" data-tips-image src="{$vo.headimgurl}"/>
{$vo.nickname|default="<span style='color:#999'>未设置微信昵称</span>"}
</td>
<td class='text-center'>{$vo.sex==1?'男':($vo.sex==2?'女':'未知')}</td>
<td class='text-center'>{$vo.country|default='<span style="color:#999">未设置区域信息</span>'}{$vo.province}{$vo.city}</td>
<td class='text-center'>{$vo.subscribe_at}</td>
</tr>
{/foreach}
</tbody>
</table>
{if isset($page)}<p>{$page}</p>{/if}

View File

@ -28,8 +28,7 @@
<div class="form-group">
<label class="col-md-2 control-label layui-form-label ">关 键 字</label>
<div class="col-md-9">
<input required="required" title='请输入关键字' maxlength='20' name='keys' class="layui-input"
value='{$vo.keys|default=""}'>
<input required="required" title='请输入关键字' maxlength='20' name='keys' class="layui-input" value='{$vo.keys|default=""}'>
</div>
</div>
{else}
@ -61,6 +60,7 @@
<label class="col-md-2 control-label layui-form-label label-required">消息类型</label>
<div class="col-md-9">
<select name='type' class='layui-input'>
{if !isset($vo.type) or $vo.type eq 'text'}
<option value='text' selected>文字</option>
{else}
@ -96,6 +96,7 @@
{else}
<option value='video'>视频</option>
{/if}
</select>
</div>
</div>

View File

@ -14,91 +14,88 @@
<input type="hidden" value="resort" name="action"/>
<table class="table table-hover">
<thead>
<tr>
<th class='list-table-check-td'>
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
</th>
<th class='list-table-sort-td'>
<button type="submit" class="layui-btn layui-btn-normal layui-btn-mini">排 序</button>
</th>
<th class="text-center">关键字</th>
<th class="text-center">回复类型</th>
<th class="text-center">回复内容</th>
<th class="text-center">更新时间</th>
<th class="text-center">状态</th>
<th class="text-center">操作</th>
</tr>
<tr>
<th class='list-table-check-td'>
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
</th>
<th class='list-table-sort-td'>
<button type="submit" class="layui-btn layui-btn-normal layui-btn-mini">排 序</button>
</th>
<th class="text-center">关键字</th>
<th class="text-center">回复类型</th>
<th class="text-center">回复内容</th>
<th class="text-center">更新时间</th>
<th class="text-center">状态</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
</td>
<td class='list-table-sort-td'>
<input name="_{$vo.id}" value="{$vo.sort}" class="list-sort-input"/>
</td>
<td class="text-center">{$vo.keys}</td>
<td class="text-center">{$vo.type}</td>
<td class="text-center">
{if $vo.type eq '音乐'}
<a data-phone-view='{:url("@wechat/review")}?type=music&title={$vo.music_title|urlencode}&desc={$vo.music_desc|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '文字'}
<a data-phone-view='{:url("@wechat/review")}?type=text&content={$vo.content|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '图片'}
<a data-phone-view='{:url("@wechat/review")}?type=image&content={$vo.image_url|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '图文'}
<a data-phone-view='{:url("@wechat/review")}?type=news&content={$vo.news_id}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '视频'}
<a data-phone-view='{:url("@wechat/review")}?type=video&title={$vo.video_title|urlencode}&desc={$vo.video_desc|urlencode}&url={$vo.video_url|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{else}
{$vo.content}
{/if}
</td>
<td class="text-center">{$vo.create_at}</td>
<td class='text-center'>
{if $vo.status eq 0}
<span>已禁用</span>
{elseif $vo.status eq 1}
<span style="color:#090">使用中</span>
{/if}
</td>
<td class='text-center nowrap'>
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
</td>
<td class='list-table-sort-td'>
<input name="_{$vo.id}" value="{$vo.sort}" class="list-sort-input"/>
</td>
<td class="text-center">{$vo.keys}</td>
<td class="text-center">{$vo.type}</td>
<td class="text-center">
{if $vo.type eq '音乐'}
<a data-phone-view='{:url("@wechat/review")}?type=music&title={$vo.music_title|urlencode}&desc={$vo.music_desc|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '文字'}
<a data-phone-view='{:url("@wechat/review")}?type=text&content={$vo.content|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '图片'}
<a data-phone-view='{:url("@wechat/review")}?type=image&content={$vo.image_url|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '图文'}
<a data-phone-view='{:url("@wechat/review")}?type=news&content={$vo.news_id}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{elseif $vo.type eq '视频'}
<a data-phone-view='{:url("@wechat/review")}?type=video&title={$vo.video_title|urlencode}&desc={$vo.video_desc|urlencode}&url={$vo.video_url|urlencode}'
class="btn btn-link"><i class="fa fa-eye"></i> 预览
</a>
{else}
{$vo.content}
{/if}
</td>
<td class="text-center">{$vo.create_at}</td>
<td class='text-center'>
{if $vo.status eq 0}
<span>已禁用</span>
{elseif $vo.status eq 1}
<span style="color:#090">使用中</span>
{/if}
</td>
<td class='text-center nowrap'>
{if auth("$classuri/edit")}
<span class="text-explode">|</span>
<a data-open='{:url("edit")}?id={$vo.id}'>编辑</a>
{/if}
{if auth("$classuri/edit")}
<span class="text-explode">|</span>
<a data-open='{:url("edit")}?id={$vo.id}'>编辑</a>
{/if}
{if $vo.status eq 1 and auth("$classuri/forbid")}
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}'
href="javascript:void(0)">禁用</a>
{elseif auth("$classuri/resume")}
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}'
href="javascript:void(0)">启用</a>
{/if}
{if $vo.status eq 1 and auth("$classuri/forbid")}
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}' href="javascript:void(0)">禁用</a>
{elseif auth("$classuri/resume")}
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}' href="javascript:void(0)">启用</a>
{/if}
{if auth("$classuri/del")}
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("del")}'
href="javascript:void(0)">删除</a>
{/if}
{if auth("$classuri/del")}
<span class="text-explode">|</span>
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("del")}' href="javascript:void(0)">删除</a>
{/if}
</td>
</tr>
{/foreach}
</td>
</tr>
{/foreach}
</tbody>
</table>
{if isset($page)}<p>{$page}</p>{/if}

View File

@ -1,314 +1,312 @@
{extend name='extra@admin/content' /}
{block name="style"}
<style>
.mobile-preview { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -khtml-user-select: none; user-select: none; }
.menu-editor { left: 317px; display: block; max-width: 500px; width: 500px; height: 580px; border-radius: 0; border-color: #e7e7eb; box-shadow: none }
.menu-editor .arrow { top: auto !important; bottom: 15px }
.menu-editor .popover-title { margin-top: 0 }
.menu-delete { font-weight: 400; font-size: 12px; }
.menu-submit { margin-right: 10px }
</style>
<style>
.mobile-preview { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -khtml-user-select: none; user-select: none; }
.menu-editor { left: 317px; display: block; max-width: 500px; width: 500px; height: 580px; border-radius: 0; border-color: #e7e7eb; box-shadow: none }
.menu-editor .arrow { top: auto !important; bottom: 15px }
.menu-editor .popover-title { margin-top: 0 }
.menu-delete { font-weight: 400; font-size: 12px; }
.menu-submit { margin-right: 10px }
</style>
{/block}
{block name='content'}
<div class='mobile-preview pull-left'>
<div class='mobile-header'>公众号</div>
<div class='mobile-body'></div>
<ul class='mobile-footer'>
{foreach $list as $menu}
<li class="parent-menu">
<a><i class="icon-sub hide"></i> <span data-type="{$menu.type}" data-content="{$menu.content}">{$menu.name}</span></a>
<div class="sub-menu text-center hide">
<ul>
{if empty($menu['sub']) eq false}
{foreach $menu.sub as $submenu}
<li>
<a class="bottom-border"><span data-type="{$submenu.type}" data-content="{$submenu.content}">{$submenu.name}</span></a>
</li>
{/foreach}
{/if}
<li class="menu-add"><a><i class="icon-add"></i></a></li>
</ul>
<i class="arrow arrow_out"></i>
<i class="arrow arrow_in"></i>
</div>
</li>
{/foreach}
<li class="parent-menu menu-add">
<a><i class="icon-add"></i></a>
</li>
</ul>
<div class='mobile-preview pull-left'>
<div class='mobile-header'>公众号</div>
<div class='mobile-body'></div>
<ul class='mobile-footer'>
{foreach $list as $menu}
<li class="parent-menu">
<a><i class="icon-sub hide"></i> <span data-type="{$menu.type}" data-content="{$menu.content}">{$menu.name}</span></a>
<div class="sub-menu text-center hide">
<ul>
{if empty($menu['sub']) eq false}
{foreach $menu.sub as $submenu}
<li>
<a class="bottom-border"><span data-type="{$submenu.type}" data-content="{$submenu.content}">{$submenu.name}</span></a>
</li>
{/foreach}
{/if}
<li class="menu-add"><a><i class="icon-add"></i></a></li>
</ul>
<i class="arrow arrow_out"></i>
<i class="arrow arrow_in"></i>
</div>
</li>
{/foreach}
<li class="parent-menu menu-add">
<a><i class="icon-add"></i></a>
</li>
</ul>
</div>
<div class="pull-left" style="position:absolute">
<div class="popover fade right up in menu-editor">
<div class="arrow"></div>
<h3 class="popover-title">
菜单名称
{if auth("$classuri/edit")}
<a class="pull-right menu-delete">删除</a>
{/if}
</h3>
<div class="popover-content menu-content"></div>
</div>
<div class="pull-left" style="position:absolute">
<div class="popover fade right up in menu-editor">
<div class="arrow"></div>
<h3 class="popover-title">
菜单名称
{if auth("$classuri/edit")}
<a class="pull-right menu-delete">删除</a>
{/if}
</h3>
<div class="popover-content menu-content">
</div>
<div class="hide menu-editor-parent-tpl">
<form class="form-horizontal">
<p>已添加子菜单,仅可设置菜单名称。</p>
<div class="form-group" style="margin-top:50px">
<label class="col-xs-3 control-label">菜单名称</label>
<div class="col-xs-6">
<input name="menu-name" class="form-control input-sm">
<span class="help-block m-b-none">字数不超过5个汉字或16个字母</span>
</div>
</div>
</div>
<div class="hide menu-editor-parent-tpl">
<form class="form-horizontal">
<p>已添加子菜单,仅可设置菜单名称。</p>
<div class="form-group" style="margin-top:50px">
<label class="col-xs-3 control-label">菜单名称</label>
<div class="col-xs-6">
<input name="menu-name" class="form-control input-sm">
<span class="help-block m-b-none">字数不超过5个汉字或16个字母</span>
</form>
</div>
<div class="hide menu-editor-content-tpl">
<form class="form-horizontal">
<div class="form-group" style="margin-top:50px">
<label class="col-xs-3 control-label">菜单名称</label>
<div class="col-xs-6">
<input name="menu-name" class="form-control input-sm">
<span class="help-block m-b-none">字数不超过13个汉字或40个字母</span>
</div>
</div>
<div class="form-group" style="margin-top:30px">
<label class="col-xs-3 control-label">菜单内容</label>
<div class="col-xs-8">
<div class="row">
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="text"> 文字消息
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="keys"> 关键字
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="view"> 跳转网页
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="event"> 事件功能
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="customservice"> 多客服
</label>
</div>
</div>
</form>
</div>
<div class="hide menu-editor-content-tpl">
<form class="form-horizontal">
<div class="form-group" style="margin-top:50px">
<label class="col-xs-3 control-label">菜单名称</label>
<div class="col-xs-6">
<input name="menu-name" class="form-control input-sm">
<span class="help-block m-b-none">字数不超过13个汉字或40个字母</span>
</div>
</div>
<div class="form-group" style="margin-top:30px">
<label class="col-xs-3 control-label">菜单内容</label>
<div class="col-xs-8">
<div class="row">
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="text"> 文字消息
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="keys"> 关键字
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="view"> 跳转网页
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="event"> 事件功能
</label>
<label class="col-xs-5 font-noraml">
<input class="cuci-radio" type="radio" name="menu-type" value="customservice"> 多客服
</label>
</div>
</div>
</div>
<div class="form-group" style="margin-top:30px">
<div class="col-xs-10 col-xs-offset-1 editor-content-input"></div>
</div>
</form>
</div>
<div style="clear:both"></div>
<div style="width:830px;padding-top:40px;text-align:center">
{if auth("$classuri/edit")}
<button class="layui-btn menu-submit">保存发布</button>
{/if}
{if auth("$classuri/cancel")}
<button data-load='{:url("$classuri/cancel")}' class="layui-btn layui-btn-danger">取消发布</button>
{/if}
</div>
</div>
<div class="form-group" style="margin-top:30px">
<div class="col-xs-10 col-xs-offset-1 editor-content-input"></div>
</div>
</form>
</div>
<div style="clear:both"></div>
<div style="width:830px;padding-top:40px;text-align:center">
{if auth("$classuri/edit")}
<button class="layui-btn menu-submit">保存发布</button>
{/if}
{if auth("$classuri/cancel")}
<button data-load='{:url("$classuri/cancel")}' class="layui-btn layui-btn-danger">取消发布</button>
{/if}
</div>
{/block}
{block name="script"}
<script>
$(function () {
/**
* 菜单事件构造方法
* @returns {menu.index_L2.menu}
*/
var menu = function () {
this.version = '1.0';
this.$btn;
this.listen();
};
/**
* 控件默认事件
* @returns {undefined}
*/
menu.prototype.listen = function () {
var self = this;
$('.mobile-footer').on('click', 'li a', function () {
self.$btn = $(this);
self.$btn.parent('li').hasClass('menu-add') ? self.add() : self.checkShow();
}).find('li:first a:first').trigger('click');
$('.menu-delete').on('click', function () {
var index = $.msg.confirm('删除后菜单下设置的内容将被删除!', function () {
self.del(), $.msg.close(index);
});
<script>
$(function () {
/**
* 菜单事件构造方法
* @returns {menu.index_L2.menu}
*/
var menu = function () {
this.version = '1.0';
this.$btn;
this.listen();
};
/**
* 控件默认事件
* @returns {undefined}
*/
menu.prototype.listen = function () {
var self = this;
$('.mobile-footer').on('click', 'li a', function () {
self.$btn = $(this);
self.$btn.parent('li').hasClass('menu-add') ? self.add() : self.checkShow();
}).find('li:first a:first').trigger('click');
$('.menu-delete').on('click', function () {
var index = $.msg.confirm('删除后菜单下设置的内容将被删除!', function () {
self.del(), $.msg.close(index);
});
$('.menu-submit').on('click', function () {
self.submit();
});
};
/**
* 添加一个菜单
* @returns {undefined}
*/
menu.prototype.add = function () {
var $add = this.$btn.parent('li'), $ul = $add.parent('ul');
if ($ul.hasClass('mobile-footer')) { /* 添加一级菜单 */
var $li = $('<li class="parent-menu"><a class="active"><i class="icon-sub hide"></i> <span>一级菜单</span></a></li>').insertBefore($add);
this.$btn = $li.find('a');
$('<div class="sub-menu text-center hide"><ul><li class="menu-add"><a><i class="icon-add"></i></a></li></ul><i class="arrow arrow_out"></i><i class="arrow arrow_in"></i></div>').appendTo($li);
} else { /* 添加二级菜单 */
this.$btn = $('<li><a class="bottom-border"><span>二级菜单</span></a></li>').prependTo($ul).find('a');
}
this.checkShow();
};
/**
* 数据校验显示
* @returns {unresolved}
*/
menu.prototype.checkShow = function () {
var $li = this.$btn.parent('li'), $ul = $li.parent('ul');
/* 选中一级菜单时显示二级菜单 */
if ($li.hasClass('parent-menu')) {
$('.parent-menu .sub-menu').not(this.$btn.parent('li').find('.sub-menu').removeClass('hide')).addClass('hide');
}
});
$('.menu-submit').on('click', function () {
self.submit();
});
};
/**
* 添加一个菜单
* @returns {undefined}
*/
menu.prototype.add = function () {
var $add = this.$btn.parent('li'), $ul = $add.parent('ul');
if ($ul.hasClass('mobile-footer')) { /* 添加一级菜单 */
var $li = $('<li class="parent-menu"><a class="active"><i class="icon-sub hide"></i> <span>一级菜单</span></a></li>').insertBefore($add);
this.$btn = $li.find('a');
$('<div class="sub-menu text-center hide"><ul><li class="menu-add"><a><i class="icon-add"></i></a></li></ul><i class="arrow arrow_out"></i><i class="arrow arrow_in"></i></div>').appendTo($li);
} else { /* 添加二级菜单 */
this.$btn = $('<li><a class="bottom-border"><span>二级菜单</span></a></li>').prependTo($ul).find('a');
}
this.checkShow();
};
/**
* 数据校验显示
* @returns {unresolved}
*/
menu.prototype.checkShow = function () {
var $li = this.$btn.parent('li'), $ul = $li.parent('ul');
/* 选中一级菜单时显示二级菜单 */
if ($li.hasClass('parent-menu')) {
$('.parent-menu .sub-menu').not(this.$btn.parent('li').find('.sub-menu').removeClass('hide')).addClass('hide');
}
/* 一级菜单添加按钮 */
var $add = $('li.parent-menu:last');
$add.siblings('li').size() >= 3 ? $add.addClass('hide') : $add.removeClass('hide');
/* 二级菜单添加按钮 */
$add.siblings('li').map(function () {
var $add = $(this).find('ul li:last');
$add.siblings('li').size() >= 5 ? $add.addClass('hide') : $add.removeClass('hide');
});
/* 处理一级菜单 */
var parentWidth = 100 / $('li.parent-menu:visible').size() + '%';
$('li.parent-menu').map(function () {
var $icon = $(this).find('.icon-sub');
$(this).width(parentWidth).find('ul li').size() > 1 ? $icon.removeClass('hide') : $icon.addClass('hide');
});
/* 更新选择中状态 */
$('.mobile-footer a.active').not(this.$btn.addClass('active')).removeClass('active');
this.renderEdit();
return $ul;
};
/**
* 删除当前菜单
* @returns {undefined}
*/
menu.prototype.del = function () {
var $li = this.$btn.parent('li'), $ul = $li.parent('ul');
var $default = function () {
if ($li.prev('li').size() > 0) {
return $li.prev('li');
}
if ($li.next('li').size() > 0 && !$li.next('li').hasClass('menu-add')) {
return $li.next('li');
}
if ($ul.parents('li.parent-menu').size() > 0) {
return $ul.parents('li.parent-menu');
}
return $('null');
}.call(this);
$li.remove();
this.$btn = $default.find('a:first');
this.checkShow();
};
/**
* 显示当前菜单的属性值
* @returns {undefined}
*/
menu.prototype.renderEdit = function () {
var $span = this.$btn.find('span'), $li = this.$btn.parent('li'), $ul = $li.parent('ul');
var $html = '';
if ($li.find('ul li').size() > 1) { /*父菜单*/
$html = $($('.menu-editor-parent-tpl').html());
$html.find('input[name="menu-name"]').val($span.text()).on('change keyup', function () {
$span.text(this.value || ' ');
});
$('.menu-editor .menu-content').html($html);
} else {
$html = $($('.menu-editor-content-tpl').html());
$html.find('input[name="menu-name"]').val($span.text()).on('change keyup', function () {
$span.text(this.value || ' ');
});
$('.menu-editor .menu-content').html($html);
var type = $span.attr('data-type') || 'text';
$html.find('input[name="menu-type"]').on('click', function () {
$span.attr('data-type', this.value || 'text');
var content = $span.attr('data-content') || '';
var html = function () {
switch (this.value) {
case 'customservice':
case 'text':
return '<div>回复内容<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'view':
return '<div>跳转地址<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'keys':
return '<div>匹配内容<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'event':
var options = {
'scancode_push': '扫码推事件',
'scancode_waitmsg': '扫码推事件且弹出“消息接收中”提示框',
'pic_sysphoto': '弹出系统拍照发图',
'pic_photo_or_album': '弹出拍照或者相册发图',
'pic_weixin': '弹出微信相册发图器',
'location_select': '弹出地理位置选择器'
};
var select = [], tpl = '<div><label class="font-noraml"><input class="cuci-radio" name="content" type="radio" {checked} value="{value}"> {title}</label></div>';
if (!(options[content] || false)) {
content = 'scancode_push';
$span.attr('data-content', content);
}
for (var i in options) {
select.push(tpl.replace('{value}', i).replace('{title}', options[i]).replace('{checked}', (i === content) ? 'checked' : ''));
}
return select.join('');
}
}.call(this);
var $html = $(html), $input = $html.find('input,textarea');
$input.on('change keyup click', function () {
$span.attr('data-content', $(this).val() || $(this).html());
});
$('.editor-content-input').html($html);
}).filter('input[value="{type}"]'.replace('{type}', type)).trigger('click');
/* 一级菜单添加按钮 */
var $add = $('li.parent-menu:last');
$add.siblings('li').size() >= 3 ? $add.addClass('hide') : $add.removeClass('hide');
/* 二级菜单添加按钮 */
$add.siblings('li').map(function () {
var $add = $(this).find('ul li:last');
$add.siblings('li').size() >= 5 ? $add.addClass('hide') : $add.removeClass('hide');
});
/* 处理一级菜单 */
var parentWidth = 100 / $('li.parent-menu:visible').size() + '%';
$('li.parent-menu').map(function () {
var $icon = $(this).find('.icon-sub');
$(this).width(parentWidth).find('ul li').size() > 1 ? $icon.removeClass('hide') : $icon.addClass('hide');
});
/* 更新选择中状态 */
$('.mobile-footer a.active').not(this.$btn.addClass('active')).removeClass('active');
this.renderEdit();
return $ul;
};
/**
* 删除当前菜单
* @returns {undefined}
*/
menu.prototype.del = function () {
var $li = this.$btn.parent('li'), $ul = $li.parent('ul');
var $default = function () {
if ($li.prev('li').size() > 0) {
return $li.prev('li');
}
};
/**
* 提交数据
* @returns {undefined}
*/
menu.prototype.submit = function () {
var data = [];
function getdata($span) {
var menudata = {};
menudata.name = $span.text();
menudata.type = $span.attr('data-type');
menudata.content = $span.attr('data-content') || '';
return menudata;
if ($li.next('li').size() > 0 && !$li.next('li').hasClass('menu-add')) {
return $li.next('li');
}
$('li.parent-menu').map(function (index, item) {
if (!$(item).hasClass('menu-add')) {
var menudata = getdata($(item).find('a:first span'));
menudata.index = index + 1;
menudata.pindex = 0;
menudata.sub = [];
menudata.sort = index;
data.push(menudata);
$(item).find('.sub-menu ul li:not(.menu-add) span').map(function (ii, span) {
var submenudata = getdata($(span));
submenudata.index = (index + 1) + '' + (ii + 1);
submenudata.pindex = menudata.index;
submenudata.sort = ii;
data.push(submenudata);
});
}
if ($ul.parents('li.parent-menu').size() > 0) {
return $ul.parents('li.parent-menu');
}
return $('null');
}.call(this);
$li.remove();
this.$btn = $default.find('a:first');
this.checkShow();
};
/**
* 显示当前菜单的属性值
* @returns {undefined}
*/
menu.prototype.renderEdit = function () {
var $span = this.$btn.find('span'), $li = this.$btn.parent('li'), $ul = $li.parent('ul');
var $html = '';
if ($li.find('ul li').size() > 1) { /*父菜单*/
$html = $($('.menu-editor-parent-tpl').html());
$html.find('input[name="menu-name"]').val($span.text()).on('change keyup', function () {
$span.text(this.value || ' ');
});
$.form.load('{:url("$classuri/edit")}', {data: data}, 'POST');
};
/**
* 实例菜单控件
*/
new menu();
});
</script>
$('.menu-editor .menu-content').html($html);
} else {
$html = $($('.menu-editor-content-tpl').html());
$html.find('input[name="menu-name"]').val($span.text()).on('change keyup', function () {
$span.text(this.value || ' ');
});
$('.menu-editor .menu-content').html($html);
var type = $span.attr('data-type') || 'text';
$html.find('input[name="menu-type"]').on('click', function () {
$span.attr('data-type', this.value || 'text');
var content = $span.attr('data-content') || '';
var html = function () {
switch (this.value) {
case 'customservice':
case 'text':
return '<div>回复内容<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'view':
return '<div>跳转地址<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'keys':
return '<div>匹配内容<textarea style="resize:none;height:225px" name="content" class="form-control input-sm">{content}</textarea></div>'.replace('{content}', content);
case 'event':
var options = {
'scancode_push': '扫码推事件',
'scancode_waitmsg': '扫码推事件且弹出“消息接收中”提示框',
'pic_sysphoto': '弹出系统拍照发图',
'pic_photo_or_album': '弹出拍照或者相册发图',
'pic_weixin': '弹出微信相册发图器',
'location_select': '弹出地理位置选择器'
};
var select = [], tpl = '<div><label class="font-noraml"><input class="cuci-radio" name="content" type="radio" {checked} value="{value}"> {title}</label></div>';
if (!(options[content] || false)) {
content = 'scancode_push';
$span.attr('data-content', content);
}
for (var i in options) {
select.push(tpl.replace('{value}', i).replace('{title}', options[i]).replace('{checked}', (i === content) ? 'checked' : ''));
}
return select.join('');
}
}.call(this);
var $html = $(html), $input = $html.find('input,textarea');
$input.on('change keyup click', function () {
$span.attr('data-content', $(this).val() || $(this).html());
});
$('.editor-content-input').html($html);
}).filter('input[value="{type}"]'.replace('{type}', type)).trigger('click');
}
};
/**
* 提交数据
* @returns {undefined}
*/
menu.prototype.submit = function () {
var data = [];
function getdata($span) {
var menudata = {};
menudata.name = $span.text();
menudata.type = $span.attr('data-type');
menudata.content = $span.attr('data-content') || '';
return menudata;
}
$('li.parent-menu').map(function (index, item) {
if (!$(item).hasClass('menu-add')) {
var menudata = getdata($(item).find('a:first span'));
menudata.index = index + 1;
menudata.pindex = 0;
menudata.sub = [];
menudata.sort = index;
data.push(menudata);
$(item).find('.sub-menu ul li:not(.menu-add) span').map(function (ii, span) {
var submenudata = getdata($(span));
submenudata.index = (index + 1) + '' + (ii + 1);
submenudata.pindex = menudata.index;
submenudata.sort = ii;
data.push(submenudata);
});
}
});
$.form.load('{:url("$classuri/edit")}', {data: data}, 'POST');
};
/**
* 实例菜单控件
*/
new menu();
});
</script>
{/block}

View File

@ -8,15 +8,13 @@
<div class="panel-body news-box">
{if empty($vo['articles']) eq false}
{foreach $vo.articles as $key=>$value}
<div class="news-item transition" data-id="{$value.id}"
style="background-image:url('{$value.local_url}?imageView2/1/w/338/h/190/interlace/1')">
<div class="news-item transition" data-id="{$value.id}" style="background-image:url('{$value.local_url}?imageView2/1/w/338/h/190/interlace/1')">
<span class="news-title">{$value.title}</span>
</div>
<hr/>
{/foreach}
{else}
<div class="news-item transition active news-image"
style="background-image:url('__PUBLIC__/static/plugs/uploader/theme/image.png')">
<div class="news-item transition active news-image" style="background-image:url('__PUBLIC__/static/plugs/uploader/theme/image.png')">
<span class="news-title" style='display:none'>标题</span>
</div>
<hr/>
@ -36,8 +34,7 @@
<div class="col-md-12">
<div class="input-group">
<span class="input-group-addon">标题</span>
<input maxlength="64" required="required" title="标题不能为空哦" placeholder="请在这里输入标题"
name='title' class="layui-input">
<input maxlength="64" required="required" title="标题不能为空哦" placeholder="请在这里输入标题" name='title' class="layui-input">
<input type="hidden" name="id">
</div>
</div>
@ -47,8 +44,7 @@
<div class="col-md-12">
<div class="input-group">
<span class="input-group-addon">作者</span>
<input maxlength="8" required="required" title="作者不能为空哦" placeholder="请输入作者"
name='author' class="layui-input">
<input maxlength="8" required="required" title="作者不能为空哦" placeholder="请输入作者" name='author' class="layui-input">
</div>
</div>
</div>
@ -260,82 +256,17 @@
{block name="style"}
<style>
.news-left {
left: 20px;
width: 300px;
position: absolute;
}
.news-right {
position: absolute;
left: 335px;
right: 20px;
}
.news-left .news-item {
position: relative;
width: 280px;
height: 150px;
max-width: 270px;
overflow: hidden;
border: 1px solid #ccc;
background-size: cover;
background-position: center center;
}
.news-left .news-item.active {
border: 1px solid #44b549 !important;
}
.news-left .article-add {
font-size: 22px;
text-align: center;
display: block;
color: #999;
}
.news-left .article-add:hover {
color: #666;
}
.news-left .news-title {
bottom: 0;
width: 272px;
color: #fff;
display: block;
padding: 0 5px;
overflow: hidden;
position: absolute;
margin-left: -1px;
text-overflow: ellipsis;
max-height:6em;
background: rgba(0, 0, 0, 0.7);
}
.news-right .layui-input {
border-radius: 0;
border: 1px solid #e5e6e7;
}
.news-right .layui-input:hover, .news-right .layui-input:focus {
border-color: #e5e6e7 !important;
}
.news-right .input-group-addon {
background: #fff;
border-radius: 0;
border-color: #e5e6e7;
}
.news-right .upload-image-box {
width: 150px;
height: 120px;
background-size: cover;
background-position: center center;
}
.panel {
border-radius: 0
}
.panel{border-radius:0}
.news-left {left:20px;width:300px;position:absolute;}
.news-right {position:absolute;left:335px;right:20px;}
.news-left .news-item {position:relative;width:280px;height:150px;max-width:270px;overflow:hidden;border:1px solid #ccc;background-size:cover;background-position:center center;}
.news-left .news-item.active {border:1px solid #44b549 !important;}
.news-left .article-add {font-size:22px;text-align:center;display:block;color:#999;}
.news-left .article-add:hover{color:#666;}
.news-left .news-title{bottom:0;width:272px;color:#fff;display:block;padding:0 5px;overflow:hidden;position:absolute;margin-left:-1px;text-overflow:ellipsis;max-height:6em;background:rgba(0,0,0,0.7);}
.news-right .layui-input{border-radius:0;border:1px solid #e5e6e7;}
.news-right .layui-input:hover, .news-right .layui-input:focus{border-color:#e5e6e7!important;}
.news-right .input-group-addon{background:#fff;border-radius:0;border-color:#e5e6e7;}
.news-right .upload-image-box{width:150px;height:120px;background-size:cover;background-position:center center;}
</style>
{/block}

View File

@ -73,15 +73,15 @@
<style>
#news_box {position:relative;}
#news_box .news_item {position:relative;left:0;top:0;padding:5px;border:1px solid #ccc;box-sizing:content-box;margin:10px;width: 300px}
#news_box .news_item {position:relative;left:0;top:0;padding:5px;border:1px solid #ccc;box-sizing:content-box;margin:10px;width:300px}
#news_box .news_item .news_articel_item{background-position:center center;background-size:100%;position:relative;height:150px;width:100%;overflow:hidden;}
#news_box .news_item .news_articel_item p {padding:5px;max-height:5em;font-size:12px;color:#fff;overflow:hidden;text-overflow: ellipsis;background: rgba(0, 0, 0, 0.7);position:absolute;width: 100%;bottom:0}
#news_box .news_item .news_articel_item p {padding:5px;max-height:5em;font-size:12px;color:#fff;overflow:hidden;text-overflow:ellipsis;background:rgba(0,0,0,0.7);position:absolute;width:100%;bottom:0}
#news_box .news_item .news_articel_item.other{height:50px;padding:5px 0;}
#news_box .news_item .news_articel_item .left-image{width:50px;height:50px;position:relative;float:left;background-position:center center;background-size:100%;overflow:hidden;}
#news_box .news_item .news_articel_item .right-text{float:left;width:250px;padding-right:10px;overflow:hidden;text-overflow:ellipsis;}
#news_box .news_item .hr-line-dashed:last-child{display:none}
#news_box .hr-line-dashed{margin:6px 0 1px 0}
#news_box .news_tools{top:0;z-index:80;color:#fff;width:312px;margin-left:-6px;position:absolute;background: rgba(0, 0, 0, 0.7);text-align:right;padding:0 5px;line-height: 38px;}
#news_box .news_tools{top:0;z-index:80;color:#fff;width:312px;margin-left:-6px;position:absolute;background:rgba(0,0,0,0.7);text-align:right;padding:0 5px;line-height:38px;}
#news_box .news_tools a{color:#fff;margin-left:10px}
</style>

View File

@ -5,7 +5,7 @@
<title>Wechat Preview</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta name="viewport" content="initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="__PUBLIC__/static/plugs/aui/aui.css">
</head>
@ -16,7 +16,7 @@
.aui-chat .aui-chat-media img {border-radius:0}
.aui-chat .aui-chat-inner {max-width:80%!important;}
.aui-chat .bg-white {background: #f5f5f5!important;border:1px solid #ccc;}
.aui-chat .time {color: #f5f5f5;background:rgba(0, 0, 0, .3);padding:.1rem .3rem;border-radius:.2rem;font-size:.5rem;}
.aui-chat .time {color: #f5f5f5;background:rgba(0,0,0,.3);padding:.1rem .3rem;border-radius:.2rem;font-size:.5rem;}
.aui-chat .aui-chat-content .aui-chat-arrow.two {top:.7rem!important;background:#f5f5f5!important;left:-0.25rem!important;}
.aui-chat .aui-chat-content .aui-chat-arrow.one {top:.7rem!important;background:#f5f5f5!important;border:1px solid #ccc!important;left:-0.28rem!important;}
.aui-card-list-content-padded img {max-width: 100% !important;}