123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- {template 'common/header'}
- <div class="new-keyword">
- <ol class="breadcrumb we7-breadcrumb">
- <a href="{url 'platform/reply' array('m' => $m)}"><i class="wi wi-back-circle"></i> </a>
- <li>
- <a href="{url 'platform/reply' array('m' => $m)}">自动回复管理</a>
- </li>
- <li>
- {if empty($rid)}<a href="{url 'platform/reply/post' array('m' => $m)}">新建{$module['title']}</a></li>{/if}
- {if !empty($rid)}<a href="{php echo url('platform/reply/post', array('m' => $m, 'rid' => $rid))}">编辑{$module['title']}</a></li>{/if}
- </li>
- </ol>
- {if $m == 'keyword' || $m == 'userapi' || !in_array($m, $sysmods)}
- <form id="reply-form" action="{php echo url('platform/reply/post', array('m' => $m, 'rid' => $rid))}" method="post" enctype="multipart/form-data" ng-controller="KeywordReply" ng-cloak>
- <div class="we7-form">
- <input type="hidden" name="keywords">
- <table class="we7-table table-hover">
- <col width="530px"/>
- <col />
- <col width="150px"/>
- <tr>
- <th>关键字</th>
- <th>触发类型</th>
- <th class="text-right">操作</th>
- </tr>
- <tr ng-repeat="keyword in reply.entry.keywords">
- <td ng-bind="keyword.content"></td>
- <td>
- <span ng-if="keyword.type == 1">精准触发</span>
- <span ng-if="keyword.type == 2">包含关键字触发</span>
- <span ng-if="keyword.type == 3">正则匹配关键字触发</span>
- </td>
- <td>
- <div class="link-group">
- <!-- <a href="javascript:;" data-toggle="modal" data-target="keyword-edit" ng-click="editKeyword(keyword)">修改</a> -->
- <a href="javascript:;" class="del" ng-click="delKeyword(keyword)">删除</a>
- </div>
- </td>
- </tr>
- <tr>
- <td colspan="3" class="text-left" ng-click="showAddkeywordModal()">
- <a class="color-gray add-new-keyword" href="javascript:;">
- <span class="add-icon"><i class="wi wi-plus"></i></span>
- <span class="text">添加关键字</span>
- </a>
- </td>
- </tr>
- </table>
- <div class="modal fade" id="addkeywordModal" tabindex="-1" role="dialog" aria-labelledby="addkeywordsModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title" id="addkeywordsModalLabel">添加关键字</h4>
- </div>
- <div class="modal-body" ng-style="{'height': '335px'}">
- <div class="form-group">
- <label class="control-label col-sm-3">触发关键字</label>
- <div class="form-controls col-sm-8 form-coltrol-static">
- <input type="radio" id="radio1" name="radio" ng-model="newKeyword.type" value="1" ng-click="changeKeywordType(1)"/>
- <label for="radio1" ng-click="changeKeywordType(1)">精准触发</label>
- <input type="radio" id="radio2" name="radio" ng-model="newKeyword.type" value="2" ng-click="changeKeywordType(2)"/>
- <label for="radio2" ng-click="changeKeywordType(2)">包含关键字触发</label>
- <input type="radio" id="radio3" name="radio" ng-model="newKeyword.type" value="3" ng-click="changeKeywordType(3)"/>
- <label for="radio3" ng-click="changeKeywordType(3)">正则匹配关键字触发</label>
- </div>
- </div>
- <div class="form-group" ng-show="newKeyword.type == 1">
- <label for="" class="control-label col-sm-3"></label>
- <div class="form-controls input-group col-sm-6">
- <input type="text" class="keyword-input form-control" max="30" id="keyword-exact" ng-model="newKeyword.content" ng-blur="checkKeyWord($event);" data-type="keyword">
- <span class="help-block"> </span>
- <span class="input-group-btn"><a href="javascript:;" class="btn btn-default" id="emoji-exact" ng-init="initEmotion();" style="position:absolute;top:0px"><i class="fa fa-github-alt" style="font-size:14px;"></i> 表情</a></span>
- </div>
- </div>
- <div class="form-group" ng-show="newKeyword.type == 2">
- <label for="" class="control-label col-sm-3"></label>
- <div class="form-controls input-group col-sm-6">
- <input type="text" class="keyword-input form-control" max="30" id="keyword-indistinct" ng-model="newKeyword.content" ng-blur="checkKeyWord($event);" data-type="keyword">
- <span class="help-block"> </span>
- <span class="input-group-btn"><a href="javascript:;" class="btn btn-default" id="emoji-indistinct" style="position:absolute;top:0px"><i class="fa fa-github-alt" style="font-size:14px;"></i> 表情</a></span>
- </div>
- </div>
- <div class="form-group" ng-show="newKeyword.type == 3">
- <label for="" class="control-label col-sm-3"></label>
- <div class="form-controls input-group col-sm-6">
- <input type="text" class="keyword-input form-control" max="30" id="keyword-regexp" ng-model="newKeyword.content" ng-blur="checkKeyWord($event);" data-type="keyword">
- <span class="help-block"> </span>
- </div>
- </div>
- <div class="form-controls col-sm-offset-3">
- <span class="help-block" ng-hide="newKeyword.type == 1 || newKeyword.type == 2">
- 用户进行交谈时,对话内容符合述关键字中定义的模式才会执行这条规则。<br/>
- 注意:如果你不明白正则表达式的工作方式,请不要使用正则匹配<br/>
- 注意:正则匹配使用MySQL的匹配引擎,请使用MySQL的正则语法<br/>
- 示例:<br/>
- ^微信匹配以“微信”开头的语句<br/>
- 微信$匹配以“微信”结尾的语句<br/>
- ^微信$匹配等同“微信”的语句<br/>
- 微信匹配包含“微信”的语句<br/>
- [0-9.-]匹配所有的数字,句号和减号<br/>
- ^[a-zA-Z_]$所有的字母和下划线<br/>
- ^[[:alpha:]]{3}$所有的3个字母的单词<br/>
- ^a{4}$aaaa<br/>
- ^a{2,4}$aa,aaa或aaaa<br/>
- ^a{2,}$匹配多于两个a的字符串<br/>
- </span>
- <span class="help-block" ng-hide="newKeyword.type == 3">多个关键字请使用逗号隔开,如天气,今日天气</span>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
- <button type="button" class="btn btn-primary" ng-click="addNewKeyword()">确定</button>
- </div>
- </div>
- </div>
- </div>
-
-
-
- <div class="form-group">
- <label for="" class="control-label col-sm-2"> </label>
- <div class="form-controls color-default col-sm-10 text-right">
- <a href="javascript:void(0);" ng-click="changeShowAdvance()"><span ng-show="!reply.showAdvance">展开</span><span ng-show="reply.showAdvance">收起</span>高级设置<i class="fa fa-chevron-down" ng-class="{'fa-chevron-down': !reply.showAdvance, 'fa-chevron-up': reply.showAdvance}"></i></a>
- </div>
- </div>
- <div class="panel we7-panel" ng-show="reply.showAdvance">
- <div class="panel-body we7-padding" style="background-color: #f4f6f9;">
- <input type="hidden" name="rid" value="{$rid}" />
- <div class="form-group" ng-show="reply.showAdvance">
- <label for="" class="control-label col-sm-2">规则名称</label>
- <div class="form-controls col-sm-8">
- <input type="text" class="form-control" placeholder="请输入回复规则的名称" name="rulename" value="{if empty($reply['name']) && !empty($_GPC['name'])}{$_GPC['name']}{else}{$reply['name']}{/if}">
- <span class="help-block">您可以给这组触发关键字规则起一个名字, 方便下次修改和查看. </span>
- </div>
- </div>
- <div class="form-group" ng-show="reply.showAdvance">
- <label for="" class="control-label col-sm-2">全局置顶</label>
- <div class="form-controls col-sm-8">
- <input id="istop-1" type="radio" name="istop" ng-model="reply.entry.istop" ng-value="1" value="1" {if intval($reply['displayorder'] >= 255)} checked="checked"{/if}/>
- <label for="istop-1" >是</label>
- <input id="istop-2" type="radio" name="istop" ng-model="reply.entry.istop" ng-value="0" value="0" {if intval($reply['displayorder'] < 255)} checked="checked"{/if}/>
- <label for="istop-2">否</label>
- </div>
- </div>
- <div class="form-group" ng-show="reply.entry.istop == 0 && reply.showAdvance">
- <label for="" class="control-label col-sm-2">回复优先级</label>
- <div class="form-controls col-sm-4">
- <input type="number" min="0" max="254" name="displayorder_rule" value="{if intval($reply['displayorder']) < 255}{$reply['displayorder']}{/if}" placeholder="输入这条回复规则的优先级" class="form-control">
- <span class="help-block">
- 规则优先级,越大则越靠前,最大不得超过254
- </span>
- </div>
- </div>
- <div class="form-group" ng-show="reply.showAdvance">
- <label for="" class="control-label col-sm-2">是否开启</label>
- <div class="form-controls col-sm-8">
- <label>
- <input name="status" class="form-control" ng-model="reply.status" ng-hide="1">
- <div class="switch" ng-class="{'switchOn': reply.status}" ng-click="changeStatus()"></div>
- </label>
- <span class="help-block">您可以选择临时禁用这条回复.</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div>
- <nav class="navbar navbar-wxapp-bottom navbar-fixed-bottom" role="navigation">
- <div class="container">
- <div class="pager">
- <input type="submit" name="submit" value="发布" class="reply-form-submit hidden">
- <span value="发布" class="btn btn-primary" ng-click="submitForm()">发布</span>
- </div>
- </div>
- </nav>
- </div>
- <div>
- {if $m == 'userapi'}
- {php echo module_build_form('userapi', $rid)}
- {elseif in_array($m, $sysmods)}
- {if !in_array($_W['account']['type'], array(ACCOUNT_TYPE_XZAPP_NORMAL, ACCOUNT_TYPE_XZAPP_AUTH))}
- {php echo module_build_form('core', $rid, array('basic'=> false,'news'=> false,'image'=> false,'music'=> false,'voice'=> false,'video'=> false))}
- {else}
- {php echo module_build_form('core', $rid, array('basic'=> false,'news'=> false,'image'=> false,'music'=> true,'voice'=> true,'video'=> true))}
- {/if}
- {else}
- {php echo module_build_form($m, $rid)}
- {/if}
- </div>
- <input type="hidden" name="token" value="{$_W['token']}">
- </form>
- {/if}
- {if $m == 'apply'}
- <div id="js-apply" ng-controller="ApplyReply" ng-cloak>
- <div class="we7-step">
- <ul>
- <li class="active">
- 1 选择应用
- </li>
- <li>
- 2 添加应用关键字
- </li>
- </ul>
- </div>
- <ul class="letters-list">
- <li ng-repeat="letter in alphabet" ng-style="{'background-color': letter == activeLetter ? '#ddd' : 'none'}" ng-class="{'active': letter == activeLetter}" ng-click="searchModule(letter)">
- <a href="javascript:;" ng-bind="letter"></a>
- </li>
- </ul>
- {if $moudles}
- <div class="keyword-app">
- <ul class="we7-list-group">
- {if $enable_modules}
- {loop $enable_modules $key $row}
- {if empty($current_user_permission_types) || in_array($key, $current_user_permission_types) || $row['issystem'] == 1}
- <li data-pinyin="{$row['title_first_pinyin']}" ng-show="activeLetter ? activeLetter == '{$row[title_first_pinyin]}' : '1'">
- <div class="we7-list-item">
- <!-- <span class="keyword-status" title="已启用"><i class="fa fa-2x fa-check-circle text-success"></i></span> -->
- <div class="keyword-app-info">
- <img src="{$row['icon']}" alt="{$row['title']}"/>
- <p>{$row['title']}</p>
- <a href="{if $row['type'] != 'system'}./index.php?c=home&a=welcome&do=ext&m={$row['name']}{else}./index.php?c=platform&a=reply{/if}" class="mask">
- <span class="entry">进入</span>
- </a>
- </div>
- </div>
- </li>
- {/if}
- {/loop}
- {/if}
- {if $unenable_modules}
- {loop $unenable_modules $key $row}
- <li data-pinyin="{$row['title_first_pinyin']}" ng-show="activeLetter == {$row['title_first_pinyin']}">
- <div class="we7-list-item">
- <!-- <span class="keyword-status" title="未启用"><i class="fa fa-2x fa-times-circle text-warning"></i></span> -->
- <div class="keyword-app-info">
- <img src="{$row['icon']}" alt="{$row['title']}"/>
- <p>{$row['title']}</p>
- <a href="{if $row['type'] != 'system'}./index.php?c=home&a=welcome&do=ext&m={$row['name']}{else}./index.php?c=platform&a=reply{/if}" class="mask">
- <span class="entry">进入</span>
- </a>
- </div>
- </div>
- </li>
- {/loop}
- {/if}
- </ul>
- </div>
- {/if}
- </div>
- {/if}
- </div>
- <script>
- {if $m == 'keyword' || $m == 'userapi' || !in_array($m, $sysmods)}
- require(['underscore'], function() {
- angular.module('replyFormApp').value('config', {
- replydata: {php echo json_encode($reply)},
- uniacid: {php echo json_encode($_W['uniacid'])},
- links: {
- postUrl: "{php echo url('platform/reply/post', array('m' => $_GPC['m']));}",
- },
- });
- angular.bootstrap($('#reply-form'), ['replyFormApp']);
- });
- {/if}
- {if $m == 'apply'}
- angular.bootstrap($('#js-apply'), ['replyFormApp']);
- {/if}
- </script>
- {template 'common/footer'}
|