123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- {template 'common/header'}
- {if in_array($m, $sysmods)}
- <div class="we7-page-title">
- 自动回复
- </div>
- <ul class="we7-page-tab">
- {loop $active_sub_permission $active_menu}
- {if permission_check_account_user($active_menu['permission_name'], false) && (empty($active_menu['is_display']) || is_array($active_menu['is_display']) && in_array($_W['account']['type'], $active_menu['is_display']))}
- <li {if $m == $active_menu['active']}class="active"{/if}><a href="{$active_menu['url']}">{$active_menu['title']}</a></li>
- {/if}
- {/loop}
- </ul>
- {else}
- <div class="we7-page-title">
- 入口设置
- </div>
- <ul class="we7-page-tab">
- {if !empty($_W['current_module']['isrulefields']) &&!empty($_W['account']) && in_array($_W['account']['type'], array(ACCOUNT_TYPE_OFFCIAL_NORMAL, ACCOUNT_TYPE_OFFCIAL_AUTH))}<li class="active"><a href="{url 'platform/reply' array('m' => $m, 'version_id' => intval($_GPC['version_id']))}">关键字链接入口 </a></li>{/if}
- {if !empty($frames['section']['platform_module_common']['menu']['platform_module_cover'])}
- <li><a href="{url 'platform/cover' array('m' => $m, 'version_id' => intval($_GPC['version_id']))}">封面链接入口</a></li>
- {/if}
- </ul>
- {/if}
- {if $m == 'keyword' || $m == 'userapi' || !in_array($m, $sysmods)}
- <div id="js-keyword-display" ng-controller="KeywordDisplay" ng-cloak>
- <div class="keyword-list-head">
- <form action="./index.php" method="get" class="form-horizontal" role="form">
- <input type="hidden" name="c" value="platform">
- <input type="hidden" name="a" value="reply">
- <input type="hidden" name="m" value="{$_GPC['m']}" />
- <input type="hidden" name="status" value="{$status}" />
- <div class="keyword-list-head clearfix">
- <div class="pull-right">
- <a href="{url 'platform/reply/post' array('m' => $m)}" class="btn btn-primary">+添加{if $m == 'userapi'}自定义接口{else}关键字{/if}回复</a>
- {if in_array($m, $sysmods) && $m != 'userapi'}<a href="{url 'platform/reply/post' array('m' => 'apply')}" class="btn btn-danger we7-margin-left">+添加应用关键字</a>{/if}
- </div>
- <div class="input-group we7-margin-bottom" style="width:465px;">
- <select class="we7-select pull-left" name="search_type">
- <option value="keyword" {if $_GPC['search_type'] == 'keyword'}selected{/if}>关键字</option>
- <option value="rule" {if $_GPC['search_type'] == 'rule'}selected{/if}>规则名</option>
- </select>
- <input name="type" type="hidden" value="{$_GPC['type']}">
- <input class="form-control" name="keyword" type="text" value="{$_GPC['keyword']}" placeholder="输入规则名称或关键字名称" style="width: 330px;">
- <span class="input-group-btn"><button class="btn btn-default"><i class="fa fa-search"></i></button></span>
- </div>
- </div>
- </form>
- </div>
- {if in_array($m, $sysmods) && $m != 'userapi'}
- <div class="btn-group we7-btn-group we7-margin-bottom btn-group-justified">
- <a href="{url 'platform/reply/display' array('m' => 'keyword')}" class="btn {if !$_GPC[type]}active{/if}">全部</a>
- <a href="{url 'platform/reply/display' array('m' => 'keyword', 'type' => 'news')}" class="btn {if $_GPC[type] == 'news'}active{/if}">回复图文</a>
- <a href="{url 'platform/reply/display' array('m' => 'keyword', 'type' => 'apply')}" class="btn {if $_GPC[type] == 'apply'}active{/if}">回复模块</a>
- {if !in_array($_W['account']['type'], array(ACCOUNT_TYPE_XZAPP_NORMAL, ACCOUNT_TYPE_XZAPP_AUTH))}
- <a href="{url 'platform/reply/display' array('m' => 'keyword', 'type' => 'voice')}" class="btn {if $_GPC[type] == 'voice'}active{/if}">回复语音</a>
- {/if}
- <a href="{url 'platform/reply/display' array('m' => 'keyword', 'type' => 'basic')}" class="btn {if $_GPC[type] == 'basic'}active{/if}">回复文字</a>
- {if !in_array($_W['account']['type'], array(ACCOUNT_TYPE_XZAPP_NORMAL, ACCOUNT_TYPE_XZAPP_AUTH))}
- <a href="{url 'platform/reply/display' array('m' => 'keyword', 'type' => 'music')}" class="btn {if $_GPC[type] == 'music'}active{/if}">回复音乐</a>
- {/if}
- <a href="{url 'platform/reply/display' array('m' => 'keyword', 'type' => 'images')}" class="btn {if $_GPC[type] == 'images'}active{/if}">回复图片</a>
- {if !in_array($_W['account']['type'], array(ACCOUNT_TYPE_XZAPP_NORMAL, ACCOUNT_TYPE_XZAPP_AUTH))}
- <a href="{url 'platform/reply/display' array('m' => 'keyword', 'type' => 'video')}" class="btn {if $_GPC[type] == 'video'}active{/if}">回复视频</a>
- {/if}
- </div>
- {/if}
- <div class="clearfix"></div>
- <div class="table we7-tables {if !in_array($m, $sysmods)} we7-padding-bottom {/if}">
- <form action="{php echo url('platform/reply/delete');}" method="post" role="form" class="form we7-form" id="form1">
- <input type="hidden" name="m" value="{$m}">
- {if !empty($replies)}
- {loop $replies $row}
- <table class="table we7-table table-hover">
- <col width="80px"/>
- <col width=""/>
- <col width="120px"/>
- <col width="230px"/>
- <tr>
- <th class="text-left" colspan="2">
- <div class="pull-left">
- <input id='rid-{$row['id']}' type="checkbox" name='rid[]' we7-check-all="we7-check-all" value="{$row['id']}"/>
- <label class="text-over reply-item-name" for="rid-{$row['id']}"> </label>
- <label class="text-over reply-item-name">{if !empty($row['name'])}规则名:{$row['name']}{/if}</label>
- </div>
- <span class="pull-right">
- {if $row['displayorder'] > 0}
- {if $row['displayorder'] == '255'}
- <span class="label label-primary">置顶</span>
- {else}
- <span class="label label-info">优先级 {$row['displayorder']}</span>
- {/if}
- {/if}
- </span>
- </th>
- <th>是否开启</th>
- <th class="text-right">操作</th>
- </tr>
- <tr>
- {if !in_array($row['module'], $sysmods)}
-
- <td class="vertical-middle">
- <img src="{$row['module_info']['logo']}" alt="" class="keyword-img"/>
- </td>
- <td class="text-left">
- {else}
- <td class="text-left" colspan="2">
- {/if}
- <div class="we7-form reply-item-keyword">
- <div class="form-inline">
- <label for="" class="control-label">关 键 字</label>
- <div class="form-controls form-control-static">
- {loop $row['keywords'] $kw}
- <span class="keyword-tag" data-toggle="tooltip" data-placement="bottom" title="{if $kw['type']==1}此关键字为精准触发{elseif $kw['type']==2}此关键字为包含触发{elseif $kw['type']==3}此关键字为正则匹配触发{/if}">{$kw['content']}</span>
- {if $kw['type'] == 4}<span class="form-control-static keyword-tag" data-toggle="tooltip" data-placement="bottom" title="托管">优先级在{$row['displayorder']}之下直接生效</span>{/if}
- {/loop}
- </div>
- <div class="form-inline">
- <label for="" class="control-label col-sm-2">回复内容</label>
- <div class="form-controls form-control-static">
- <span class="">
- {if $m == 'userapi'}
- 自定义
- {elseif in_array($row['module'], $sysmods)}
- 共{$row['allreply']['sum']}条({if $row['allreply']['basic'] > 0}{$row['allreply']['basic']}条文字 {/if}{if $row['allreply']['images'] > 0}{$row['allreply']['images']}条图片 {/if}{if $row['allreply']['news'] > 0}{$row['allreply']['news']}条图文 {/if}{if $row['allreply']['music'] > 0}{$row['allreply']['music']}条音乐 {/if}{if $row['allreply']['voice'] > 0}{$row['allreply']['voice']}条语音 {/if}{if $row['allreply']['video'] > 0}{$row['allreply']['video']}条视频 {/if}{if $row['allreply']['wxcard'] > 0}{$row['allreply']['wxcard']}条卡券{/if})
- {else}
- {php echo cutstr($row['module_info']['title'], 10);}应用
- {/if}
- </span>
- </div>
- </div>
- </div>
- </td>
- <td class="vertical-middle">
- <label>
- <div class="switch {if $row['status']} switchOn{/if}" id="key-{$row['id']}" ng-click="changeStatus({$row[id]})"></div>
- </label>
- </td>
- <td class="vertical-middle text-right">
- <div class="link-group">
- {if in_array($row['module'], $sysmods)}
- <a href="{php echo url('platform/reply/post', array('m' => $m, 'rid' => $row['id']))}">编辑</a>
- {else}
- <a href="{php echo url('platform/reply/post', array('m' => $row['module'], 'rid' => $row['id']))}">编辑</a>
- {/if}
- <a href="{php echo url('platform/reply/delete', array('m' => $m, 'rid' => $row['id']))}" class="del" onclick="return confirm('删除规则将同时删除关键字与回复,确认吗?');return false;">删除</a>
- {loop $entries['rule'] $ext_menu}
- <a href="{$ext_menu['url']}&id={$row['id']}&rid={$row['id']}">{$ext_menu['title']}</a>
- {/loop}
- </div>
- </td>
- </tr>
- </table>
- {/loop}
- <div>
- <input type="checkbox" name="rid[]" we7-check-all="we7-check-all" id="select_all" class="we7-margin-left" value="1" />
- <label for="select_all"> </label>
- <input type="submit" class="btn btn-danger" value="删除" onclick="if(!confirm('确定删除选中的规则吗?')) return false;"/>
- <input type="hidden" name="token" value="{$_W['token']}"/>
- <div class="text-right">
- {$pager}
- </div>
- </div>
- {else}
- <p class="text-center we7-margin-top">暂无数据</p>
- {/if}
- </form>
- </div>
- </div>
- <script>
- $(function () {
- $('[data-toggle="tooltip"]').tooltip();
- $('#select_all').click(function(){
- $('#form1 :checkbox').prop('checked', $(this).prop('checked'));
- });
- $('#form1 :checkbox').click(function(){
- if(!$(this).prop('checked')) {
- $('#select_all').prop('checked', false);
- } else {
- var flag = 0;
- $('#form1 :checkbox[name="rid[]"]').each(function(){
- if(!$(this).prop('checked') && !flag) {
- flag = 1;
- }
- });
- if(flag) {
- $('#select_all').prop('checked', false);
- } else {
- $('#select_all').prop('checked', true);
- }
- }
- });
- });
- angular.bootstrap($('#js-keyword-display'), ['replyFormApp']);
- </script>
- {elseif $m == 'special'}
- <div class="NoKeyword-list" id="js-special-display" ng-controller="SpecialDisplay" ng-cloak>
- <div class="table we7-tables">
- <table class="table we7-table table-hover vertical-middle">
- <col width="160px"/>
- <col />
- <col width="120px"/>
- <col width="180px"/>
- <tr>
- <th class="text-left">类型</th>
- <th class="text-left">关键字/模块</th>
- <th>状态</th>
- <th class="text-left">操作</th>
- </tr>
- {loop $mtypes $name $title}
- <tr>
- <td class="text-left">
- {$title}
- </td>
- <td class="text-left">
- {if !empty($setting[$name]['type'])}
- {if $setting[$name]['type'] == 'keyword'}{$setting[$name]['keyword']}{else}{$module[$setting[$name]['module']]['title']}{/if}
- {else}
- {if !empty($setting[$name]['keyword'])}{$setting[$name]['keyword']}{else}{$module[$setting[$name]['module']]['title']}{/if}
- {/if}
- </td>
- <td>
- <label>
- <div ng-class="switch_class['{$name}']" ng-click="changestatus('{$name}')"></div>
- </label>
- </td>
- <td>
- <div class="link-group text-left">
- <a href="{php echo url('platform/reply/post', array('m' => 'special', 'type' => $name))}" class="keyword-link">编辑</a>
- </div>
- </td>
- </tr>
- {/loop}
- </table>
- </div>
- </div>
- <script>
- $(function() {
- angular.module('replyFormApp').value('config', {
- {loop $mtypes $name $title}
- '{$name}' : '{$setting[$name]['type']}',
- {/loop}
- 'url' : '{php echo url('platform/reply/change_status')}'
- });
- angular.bootstrap($('#js-special-display'), ['replyFormApp']);
- });
- </script>
- {elseif $m == 'welcome'}
- <div class="alert we7-page-alert">
- <i class="wi wi-info-sign"></i>用户关注公众号时,发送的欢迎信息。
- </div>
- <div class="new-keyword" id="welcome" ng-cloak>
- <div class="we7-form" ng-controller="WelcomeDisplay">
- <form id="reply-form" class="form-horizontal form" action="{php echo url('platform/reply/post', array('m' => $m, 'rid' => $rule_keyword_id))}" method="post" enctype="multipart/form-data">
- <div>
- {php echo module_build_form('core', $rule_keyword_id, array('keyword' => false))}
- </div>
- <input type="submit" name="submit" value="保存" class="btn btn-primary" style="padding: 6px 50px;"/>
- <input type="hidden" name="token" value="{$_W['token']}">
- <input type="hidden" name="m" value="{$m}">
- <input type="hidden" name="type" value="{$type}">
- </form>
- </div>
- </div>
- <script>
- require(['underscore'], function() {
- angular.bootstrap($('#welcome'), ['replyFormApp']);
- });
- </script>
- {elseif $m == 'default'}
- <div class="alert we7-page-alert">
- <i class="wi wi-info-sign"></i>当系统不知道该如何回复粉丝的消息时,默认发送的内容。
- </div>
- <div class="new-keyword" id="default">
- <div id="a" class="we7-form" ng-controller="DefaultDisplay">
- <form id="reply-form" class="form-horizontal form" action="{php echo url('platform/reply/post', array('m' => $m, 'rid' => $rule_keyword_id))}" method="post" enctype="multipart/form-data">
- <div>
- {php echo module_build_form('core', $rule_keyword_id, array('keyword' => false))}
- </div>
- <input type="submit" name="submit" value="保存" class="btn btn-primary" style="padding: 6px 50px;"/>
- <input type="hidden" name="token" value="{$_W['token']}">
- <input type="hidden" name="m" value="{$m}">
- <input type="hidden" name="type" value="{$type}">
- </form>
- </div>
- </div>
- <script>
- require(['underscore'], function() {
- angular.bootstrap($('#default'), ['replyFormApp']);
- });
- </script>
- {elseif $m == 'service'}
- <div class="NoKeyword-list" id="js-service-display" ng-controller="serviceDisplay" ng-cloak>
- <div class="table we7-tables">
- <table class="table we7-table table-hover">
- <col width="160px"/>
- <col />
- <col width="120px"/>
- <tr>
- <th class="text-left">服务名称</th>
- <th class="text-left">功能说明</th>
- <th>状态</th>
- </tr>
- <tr ng-repeat="(id, api) in service track by id" ng-if="service">
- <td class="text-left">
- {{ api.name }}
- </td>
- <td class="text-left" ng-bind-html="api.description">
- </td>
- <td class="vertical-middle">
- <label>
- <div ng-class="api.switch == 'checked' ? 'switch switchOn' : 'switch'" ng-click="changeStatus(id)"></div>
- </label>
- </td>
- </tr>
- <tr ng-if="!service">
- <td colspan="3" class="text-center">
- 暂无数据
- </td>
- </tr>
- </table>
- </div>
- </div>
- <script>
- $(function() {
- angular.module('replyFormApp').value('config', {
- 'url' : "{php echo url('platform/reply/change_status')}",
- 'service' : {php echo !empty($service_list) ? json_encode($service_list) : 'null'}
- });
- angular.bootstrap($('#js-service-display'), ['replyFormApp']);
- });
- </script>
- {/if}
- {template 'common/footer'}
|