人人商城

cover.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. {template 'common/header'}
  2. <div class="we7-page-title">
  3. 入口设置
  4. </div>
  5. <ul class="we7-page-tab">
  6. {if !empty($module['isrulefields']) &&!empty($_W['account']) && in_array($_W['account']['type'], array(ACCOUNT_TYPE_OFFCIAL_NORMAL, ACCOUNT_TYPE_OFFCIAL_AUTH))}<li><a href="{url 'platform/reply' array('m' => $module['name'], 'version_id' => intval($_GPC['version_id']))}">关键字链接入口 </a></li>{/if}
  7. {if !empty($frames['section']['platform_module_common']['menu']['platform_module_cover'])}
  8. <li class="active"><a href="{url 'platform/cover' array('m' => $module['name'], 'eid' => $entry_id, 'version_id' => intval($_GPC['version_id']))}">封面链接入口</a></li>
  9. {/if}
  10. </ul>
  11. <div id="js-keyword-display">
  12. {if $do == 'module'}
  13. <div ng-controller="KeywordDisplay" ng-cloak>
  14. <table class="table we7-table table-hover vertical-middle">
  15. <col width="150px"/>
  16. <col width="200px" />
  17. <col width="" />
  18. <col width="250px" />
  19. <tr>
  20. <th>二维码</th>
  21. <th class="text-left">入口名称</th>
  22. <th>关键字</th>
  23. <th class="text-right">操作</th>
  24. </tr>
  25. {loop $entries['cover'] $menu}
  26. <tr>
  27. <td data-url="{$_W['siteroot']}app/{$menu['url']}" data-size="100" class="js-url-qrcode">
  28. <div class="qrcode-block"><canvas></canvas></div>
  29. </td>
  30. <td class="text-left">{$menu['title']}</td>
  31. <td>
  32. {loop $menu['cover']['rule']['keywords'] $kw}
  33. <span class="form-control-static 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>&nbsp;
  34. {/loop}
  35. </td>
  36. <td>
  37. <div class="link-group" style="position:relative;">
  38. <a href="{url 'platform/cover/post' array('m' => $modulename, 'eid' => $menu['eid'])}" class="color-default">编辑</a>
  39. <a href="javascript:;" data-url="{$_W['siteroot']}app/{$menu['url']}" style="margin-right:0px;" class="color-default js-clip">复制链接</a>
  40. </div>
  41. </td>
  42. </tr>
  43. {/loop}
  44. </table>
  45. </div>
  46. {elseif $do == 'post'}
  47. <!--二维码-->
  48. <div class="panel we7-panel">
  49. <div class="panel-heading">
  50. 直接链接
  51. </div>
  52. <div class="panel-body we7-form we7-padding">
  53. <div class="form-group">
  54. <label for="" class="control-label col-sm-2">直接URL</label>
  55. <div class="form-controls col-sm-8">
  56. <input type="text" class="form-control" readonly="readonly" name="url_show" value="{$reply['url_show']}">
  57. <span class="help-block">直接指向到入口的URL。您可以在自定义菜单(有oAuth权限)或是其它位置直接使用。 </span>
  58. </div>
  59. </div>
  60. <div class="form-group">
  61. <label for="" class="control-label col-sm-2">二维码</label>
  62. <div data-url="{$reply['url_show']}" data-size="150" class="js-url-qrcode">
  63. <div class="qrcode-block"><canvas></canvas></div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <!--end二维码-->
  69. <div class="we7-form" id="js-reply-form" ng-controller="KeywordReply" ng-cloak>
  70. <form id="reply-form" action="" method="post" enctype="multipart/form-data">
  71. <input type="hidden" name="entry_id" value="{$entry_id}" />
  72. <input type="hidden" name="keywords">
  73. <table class="we7-table table-hover">
  74. <col width="530px"/>
  75. <col />
  76. <col width="150px"/>
  77. <tr>
  78. <th>关键字</th>
  79. <th>触发类型</th>
  80. <th class="text-right">操作</th>
  81. </tr>
  82. <tr ng-repeat="keyword in reply.entry.keywords">
  83. <td ng-bind="keyword.content"></td>
  84. <td>
  85. <span ng-if="keyword.type == 1">精准触发</span>
  86. <span ng-if="keyword.type == 2">包含关键字触发</span>
  87. <span ng-if="keyword.type == 3">正则匹配关键字触发</span>
  88. </td>
  89. <td>
  90. <div class="link-group">
  91. <a href="javascript:;" class="del" ng-click="delKeyword(keyword)">删除</a>
  92. </div>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td colspan="3" class="new-keyword" ng-click="showAddkeywordModal()">
  97. <a class="color-gray add-new-keyword" href="javascript:;">
  98. <span class="add-icon"><i class="wi wi-plus"></i></span>
  99. <span class="text">添加关键字</span>
  100. </a>
  101. </td>
  102. </tr>
  103. </table>
  104. <div class="modal fade" id="addkeywordModal" tabindex="-1" role="dialog" aria-labelledby="addkeywordsModalLabel">
  105. <div class="modal-dialog" role="document">
  106. <div class="modal-content">
  107. <div class="modal-header">
  108. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  109. <h4 class="modal-title" id="addkeywordsModalLabel">添加关键字</h4>
  110. </div>
  111. <div class="modal-body" ng-style="{'height': '335px'}">
  112. <div class="form-group">
  113. <label class="control-label col-sm-3">触发关键字</label>
  114. <div class="form-controls col-sm-8">
  115. <input type="radio" id="radio1" name="radio" ng-model="newKeyword.type" value="1" ng-click="changeKeywordType(1)"/>
  116. <label for="radio1" ng-click="changeKeywordType(1)">精准触发</label>
  117. <input type="radio" id="radio2" name="radio" ng-model="newKeyword.type" value="2" ng-click="changeKeywordType(2)"/>
  118. <label for="radio2" ng-click="changeKeywordType(2)">包含关键字触发</label>
  119. <input type="radio" id="radio3" name="radio" ng-model="newKeyword.type" value="3" ng-click="changeKeywordType(3)"/>
  120. <label for="radio3" ng-click="changeKeywordType(3)">正则匹配关键字触发</label>
  121. </div>
  122. </div>
  123. <div class="form-group" ng-show="newKeyword.type == 1">
  124. <label for="" class="control-label col-sm-3"></label>
  125. <div class="form-controls input-group col-sm-6">
  126. <input type="text" class="keyword-input form-control" max="30" id="keyword-exact" ng-model="newKeyword.content" ng-blur="checkKeyWord($event);" data-type="keyword">
  127. <span class="help-block">&nbsp;</span>
  128. <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>
  129. </div>
  130. </div>
  131. <div class="form-group" ng-show="newKeyword.type == 2">
  132. <label for="" class="control-label col-sm-3"></label>
  133. <div class="form-controls input-group col-sm-6">
  134. <input type="text" class="keyword-input form-control" max="30" id="keyword-indistinct" ng-model="newKeyword.content" ng-blur="checkKeyWord($event);" data-type="keyword">
  135. <span class="help-block">&nbsp;</span>
  136. <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>
  137. </div>
  138. </div>
  139. <div class="form-group" ng-show="newKeyword.type == 3">
  140. <label for="" class="control-label col-sm-3"></label>
  141. <div class="form-controls input-group col-sm-6">
  142. <input type="text" class="keyword-input form-control" max="30" id="keyword-regexp" ng-model="newKeyword.content" ng-blur="checkKeyWord($event);" data-type="keyword">
  143. <span class="help-block">&nbsp;</span>
  144. </div>
  145. </div>
  146. <div class="form-controls col-sm-offset-3">
  147. <span class="help-block" ng-hide="newKeyword.type == 1 || newKeyword.type == 2">
  148. 用户进行交谈时,对话内容符合述关键字中定义的模式才会执行这条规则。<br/>
  149. 注意:如果你不明白正则表达式的工作方式,请不要使用正则匹配<br/>
  150. 注意:正则匹配使用MySQL的匹配引擎,请使用MySQL的正则语法<br/>
  151. 示例:<br/>
  152. ^微信匹配以“微信”开头的语句<br/>
  153. 微信$匹配以“微信”结尾的语句<br/>
  154. ^微信$匹配等同“微信”的语句<br/>
  155. 微信匹配包含“微信”的语句<br/>
  156. [0-9.-]匹配所有的数字,句号和减号<br/>
  157. ^[a-zA-Z_]$所有的字母和下划线<br/>
  158. ^[[:alpha:]]{3}$所有的3个字母的单词<br/>
  159. ^a{4}$aaaa<br/>
  160. ^a{2,4}$aa,aaa或aaaa<br/>
  161. ^a{2,}$匹配多于两个a的字符串<br/>
  162. </span>
  163. <span class="help-block" ng-hide="newKeyword.type == 3">多个关键字请使用逗号隔开,如天气,今日天气</span>
  164. </div>
  165. </div>
  166. <div class="modal-footer">
  167. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  168. <button type="button" class="btn btn-primary" ng-click="addNewKeyword()">确定</button>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div class="we7-form">
  174. <div class="form-group">
  175. <label for="" class="control-label col-sm-2">&nbsp;</label>
  176. <div class="form-controls color-default col-sm-10 text-right">
  177. <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>
  178. </div>
  179. </div>
  180. <div class="panel we7-panel" ng-show="reply.showAdvance">
  181. <div class="panel-body we7-padding" style="background-color: #f4f6f9;">
  182. <input type="hidden" name="rid" value="{$rid}" />
  183. <div class="form-group" ng-show="reply.showAdvance">
  184. <label for="" class="control-label col-sm-2">规则名称</label>
  185. <div class="form-controls col-sm-8">
  186. <input type="text" class="form-control" placeholder="请输入回复规则的名称" name="rulename" value="{$reply['title']}">
  187. <span class="help-block">您可以给这组触发关键字规则起一个名字, 方便下次修改和查看. </span>
  188. </div>
  189. </div>
  190. <div class="form-group" ng-show="reply.showAdvance">
  191. <label for="" class="control-label col-sm-2">全局置顶</label>
  192. <div class="form-controls col-sm-8">
  193. <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}/>
  194. <label for="istop-1" >是</label>
  195. <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}/>
  196. <label for="istop-2">否</label>
  197. </div>
  198. </div>
  199. <div class="form-group" ng-show="reply.entry.istop == 0 && reply.showAdvance">
  200. <label for="" class="control-label col-sm-2">回复优先级</label>
  201. <div class="form-controls col-sm-4">
  202. <input type="number" min="0" max="254" name="displayorder_rule" value="{if intval($reply['rule']['displayorder']) < 255}{$reply['rule']['displayorder']}{/if}" placeholder="输入这条回复规则的优先级" class="form-control">
  203. <span class="help-block">
  204. 规则优先级,越大则越靠前,最大不得超过254
  205. </span>
  206. </div>
  207. </div>
  208. <div class="form-group" ng-show="reply.showAdvance">
  209. <label for="" class="control-label col-sm-2">是否开启</label>
  210. <div class="form-controls col-sm-8">
  211. <label>
  212. <input name="status" class="form-control" ng-model="reply.status" ng-hide="1">
  213. <div class="switch" ng-class="{'switchOn': reply.status}" ng-click="changeStatus()"></div>
  214. </label>
  215. <span class="help-block">您可以选择临时禁用这条回复.</span>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. <div class="form-group">
  222. <nav class="navbar navbar-wxapp-bottom navbar-fixed-bottom" role="navigation">
  223. <div class="container">
  224. <div class="pager">
  225. <input type="hidden" name="token" value="{$_W['token']}">
  226. <input type="submit" name="submit" value="发布" class="reply-form-submit hidden">
  227. <span value="发布" class="btn btn-primary" ng-click="submitForm()">发布</span>
  228. </div>
  229. </div>
  230. </nav>
  231. </div>
  232. <div class="form-group">
  233. <label for="" class="control-label col-sm-2">封面</label>
  234. <div class="form-controls col-sm-8">
  235. {php echo tpl_form_field_image('thumb', $reply['thumb'], '', array('width' => 400));}
  236. </div>
  237. </div>
  238. <div class="form-group">
  239. <label for="" class="control-label col-sm-2">描述</label>
  240. <div class="form-controls col-sm-8">
  241. <textarea class="form-control" placeholder="添加图文消息的简短描述" name="description">{$reply['description']}</textarea>
  242. </div>
  243. </div>
  244. </form>
  245. </div>
  246. {/if}
  247. </div>
  248. <script type="text/javascript">
  249. $(function() {
  250. require(['jquery.qrcode'], function(){
  251. $('.js-url-qrcode').each(function(){
  252. url = $(this).data('url');
  253. $(this).find('.qrcode-block').html('').qrcode({
  254. render: 'canvas',
  255. width: $(this).data('size'),
  256. height: $(this).data('size'),
  257. text: url
  258. });
  259. });
  260. });
  261. $('.js-clip').each(function(){
  262. util.clip(this, $(this).data('url'));
  263. });
  264. });
  265. require(['underscore'], function() {
  266. angular.module('replyFormApp').value('config', {
  267. replydata: {php echo json_encode($reply['rule'])},
  268. uniacid: {php echo json_encode($_W['uniacid'])},
  269. links: {
  270. postUrl: "{php echo url('platform/reply/post', array('m' => $_GPC['m']));}",
  271. },
  272. });
  273. angular.bootstrap($('#js-keyword-display'), ['replyFormApp']);
  274. });
  275. window.validateReplyForm = function(key) {
  276. return true;
  277. }
  278. </script>
  279. {template 'common/footer'}