notice.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. {template 'common/header'}
  2. <ul class="we7-page-tab">
  3. <li {if $do == 'display'}class="active"{/if}><a href="{php echo url('message/notice/display');}">消息列表</a></li>
  4. <li {if $do == 'setting'}class="active"{/if}><a href="{php echo url('message/notice/setting');}">消息设置</a></li>
  5. {if user_is_founder($_W['uid'], true)}
  6. <li {if $do == 'wechat_setting'}class="active"{/if}><a href="{php echo url('message/notice/wechat_setting');}">微信提醒设置</a></li>
  7. {/if}
  8. </ul>
  9. <div id="message-notice" ng-controller="messageNoticeCtrl" ng-cloak>
  10. {if $do == 'display'}
  11. {if !empty($wechat_setting['uniacid'])}
  12. <div class="module-link-box">
  13. <div class="alert we7-page-alert" style="padding: 20px">
  14. <p><i class="wi wi-info"></i> 扫码关注公众号,站内消息随时了解。</p>
  15. <p><i class="wi wi-info"></i> 账号需绑定微信号 <a href="{php echo url('user/profile/bind')}" class="color-default">去绑定微信></a> </p>
  16. <img ng-src="{$uni_account['qrcode']}" width="70px" height="70px" style="float:right;margin-top:-58px;"/>
  17. </div>
  18. </div>
  19. {/if}
  20. <div class="search-box we7-margin-bottom">
  21. <div class="search-form">
  22. <select name="" id="" class="we7-margin-right">
  23. <option value="" data-url="{php echo url('message/notice')}" {if empty($type)} selected {/if}>消息类型</option>
  24. {if permission_check_account_user('see_message_order')}
  25. <option data-url="{php echo url('message/notice', array('type' => MESSAGE_ORDER_TYPE))}" {if $type == MESSAGE_ORDER_TYPE} selected {/if}>订单消息</option>
  26. {/if}
  27. <option data-url="{php echo url('message/notice', array('type' => MESSAGE_ACCOUNT_EXPIRE_TYPE))}" {if $type == MESSAGE_ACCOUNT_EXPIRE_TYPE} selected {/if}>到期消息</a>
  28. {if permission_check_account_user('see_message_register')}
  29. <option data-url="{php echo url('message/notice', array('type' => MESSAGE_REGISTER_TYPE))}" {if $type == MESSAGE_REGISTER_TYPE} selected {/if}>注册提醒</a>
  30. {/if}
  31. </select>
  32. <select name="" id="">
  33. <option data-url="{php echo filter_url('is_read:');}" class="active">消息状态</option>
  34. <option data-url="{php echo filter_url('is_read:' . MESSAGE_READ);}" class="active">已读消息</option>
  35. <option data-url="{php echo filter_url('is_read:' . MESSAGE_NOREAD);}" class="active">未读消息</option>
  36. </select>
  37. </div>
  38. <a href="javascript:;" ng-click="allRead()" class="btn btn-primary">已读所有消息</a>
  39. </div>
  40. <table class="table we7-table table-hover vertical-middle" >
  41. <col>
  42. <col>
  43. <col>
  44. <tr>
  45. <th>标题内容</th>
  46. <th class="text-center" ng-if="type==4" >来源</th>
  47. <th class="text-center">时间</th>
  48. <th class="text-right">操作</th>
  49. </tr>
  50. <tr ng-repeat="list in lists">
  51. <td class="tip-before we7-padding-left unread" ng-if ="list.is_read == 1 || list.is_read == 0">{{list.message}} {{type != 4 && list.source ? '(' + list.source + ')' : ''}}</td>
  52. <td class="tip-before we7-padding-left" ng-if ="list.is_read == 2">{{list.message}} {{type != 4 && list.source ? '(' + list.source + ')' : ''}}</td>
  53. <td class="text-muted text-center" ng-if="type==4" ng-bind = "list.source"></td>
  54. <td class="text-muted text-center" ng-bind = "list.create_time"></td>
  55. <td>
  56. <div class="link-group">
  57. <a ng-href="{{list.url}}" ng-if="list.type==1 || list.type==13">查看我的订单</a>
  58. <a ng-href="{{list.url}}" ng-if="list.type==2">查看公众号</a>
  59. <a ng-href="{{list.url}}" ng-if="list.type==5">查看小程序</a>
  60. <a ng-href="{{list.url}}" ng-if="list.type==6">查看pc</a>
  61. <a ng-href="{{list.url}}" ng-if="list.type==4 && list.status==1">查看我的待审核用户</a>
  62. <a ng-href="{{list.url}}" ng-if="list.type==7">查看我的账号</a>
  63. <a href="javascript:;" ng-if="list.type==10 || list.type==11" ng-click="getOfficialMsg(list.id, list.url)">查看</a>
  64. </div>
  65. </td>
  66. </tr>
  67. </table>
  68. {$pager}
  69. {/if}
  70. {if $do == 'setting'}
  71. <div class="clearfix"></div>
  72. <div class="table we7-tables we7-padding-bottom">
  73. <table class="table we7-table table-hover">
  74. <col width="80px"/>
  75. <col width="300px"/>
  76. <col width="100px"/>
  77. <tr>
  78. <th>消息类型</th>
  79. <th>提醒说明</th>
  80. <th class="text-right">操作</th>
  81. </tr>
  82. {loop $setting $types}
  83. {if $_W['isfounder'] || (!$_W['isfounder'] && empty($types['permission']))}
  84. <tr>
  85. <th height="50px">{$types['title']}</th>
  86. <th>{$types['msg']}</th>
  87. <th></th>
  88. </tr>
  89. {loop $types['types'] $type $info}
  90. {if $_W['isfounder'] || (!$_W['isfounder'] && empty($info['permission']))}
  91. <tr height="50px">
  92. <td class="vertical-middle">{$info['title']}</td>
  93. <td class="vertical-middle">{$info['msg']}</td>
  94. <td class="text-right vertical-middle">
  95. {if (!empty($founder_notice_setting[$type]) && $founder_notice_setting[$type] == MESSAGE_DISABLE)}
  96. <div>未开启全局提醒</div>
  97. {else}
  98. <label>
  99. <div class="switch {if empty($info['status']) || $info['status'] == MESSAGE_ENABLE} switchOn{/if}" id="key-{$type}" ng-click="changeStatus(0, {$type})"></div>
  100. </label>
  101. {/if}
  102. </td>
  103. </tr>
  104. {/if}
  105. {/loop}
  106. {/if}
  107. {/loop}
  108. </table>
  109. </div>
  110. {/if}
  111. {if $do == 'wechat_setting'}
  112. <div class="module-link-box">
  113. <div class="alert">
  114. <p><i class="wi wi-info"></i> 微信提醒接入的公众号须为认证服务号,且与“用户登录/注册设置”中配置的微信登录同属一个微信开放平台,否则无效。</p>
  115. <p><i class="wi wi-info"></i> 选择好公众号后,须给选定的公众设置指定的模板消息。</p>
  116. <p><i class="wi wi-info"></i> 用户账号需绑定微信号,并关注该公众号才能接收消息(如未能正常接收,尝试重新绑定并同步公众号下该用户的粉丝信息)。 </p>
  117. </div>
  118. <div class="panel we7-panel">
  119. <div id="select-account">
  120. <div class="panel-heading">选择公众号</div>
  121. <div class="panel-body">
  122. <div class="app-info">
  123. {if !empty($account)}
  124. <img ng-src="{$account['logo']}" class="logo" alt="">
  125. <div class="info">
  126. <div class="title">{$account['name']}</div>
  127. <div class="type">
  128. 类型:
  129. {if $account['level'] == 1}普通订阅号{/if}
  130. {if $account['level'] == 2}普通服务号{/if}
  131. {if $account['level'] == 3}认证订阅号{/if}
  132. {if $account['level'] == 4}认证服务号{/if}
  133. {if $account['level'] == 0}---{/if}
  134. {if $account['isconnect'] == 0}
  135. <span class="color-red">
  136. <i class="wi wi-error-cricle"></i>未接入
  137. <a href="{php echo url('account/post', array('uniacid' => $account['uniacid'],'acid' => $account['acid']))}" class="color-default font-sm">立即接入></a>
  138. </span>
  139. {else}
  140. <span class="color-green">
  141. <i class="wi wi-right-circle"></i>已接入
  142. </span>
  143. {/if}
  144. </div>
  145. </div>
  146. <a href="#" data-toggle="modal" data-target="#add_module" class="change">修改</a>
  147. <a href="#" class="change color-red we7-margin-left-sm delete-account">删除</a>
  148. {else}
  149. <a href="#" data-toggle="modal" data-target="#add_module" class="add">选择公众号</a>
  150. {/if}
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="uploader-modal modal fade module" id="add_module" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  156. <div class="modal-dialog we7-modal-dialog" >
  157. <div class="modal-content">
  158. <div class="modal-header">
  159. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  160. <h4 class="modal-title">选择公众号</h4>
  161. </div>
  162. <div class="modal-body material-content clearfix">
  163. <div class="material-search">
  164. <div class="input-group col-sm-5">
  165. <input class="form-control" name="keyword" ng-model="keyword" ng-change="searchInAccountData(keyword)" type="text" placeholder="请输入账号名称" autocomplete="false">
  166. </div>
  167. </div>
  168. <div class="material-body">
  169. <div class="col-sm-2 ng-scope" ng-repeat="item in accounts" ng-click="setUniacid(item.uniacid)">
  170. <div class="item">
  171. <img ng-src="{{item.logo}}" class="icon">
  172. <div class="name">{{item.name}}</div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. {/if}
  182. </div>
  183. {if $do == 'wechat_setting'}
  184. <div id="js-profile-tplnotice" ng-controller="tplCtrl" ng-cloak>
  185. <table class="table we7-table table-hover table-form">
  186. <col width="200px " />
  187. <col />
  188. <col width="100px" />
  189. <tr>
  190. <th class="text-left" colspan="3">设置通知模板</th>
  191. </tr>
  192. <tr ng-repeat="(key, tpl) in tplList track by key">
  193. <td class="text-left">
  194. {{ tpl.name }}
  195. </td>
  196. <td class="text-left color-gray">
  197. {{ tpl.tpl }}
  198. </td>
  199. <td class="text-left ">
  200. <div class="link-group"><a href="javascript:;" data-toggle="modal" data-target="#jsauth_acid" ng-click="changeActive(key)">修改</a></div>
  201. </td>
  202. </tr>
  203. </table>
  204. <div class="modal fade" id="jsauth_acid" tabindex="-1" role="dialog" aria-hidden="true">
  205. <div class="we7-modal-dialog modal-dialog">
  206. <div class="modal-content">
  207. <div class="modal-header">
  208. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  209. <div class="modal-title">{{ tplList[active]['name'] }}</div>
  210. </div>
  211. <div class="modal-body">
  212. <div class="form-group">
  213. <input type="" name="" id="" ng-model="activetpl" class="form-control" placeholder="{{ tplList[active]['name'] }}" />
  214. <span class="help-block">{{ tplList[active]['help'] }}</span>
  215. </div>
  216. </div>
  217. <div class="modal-footer">
  218. <button type="button" class="btn btn-primary" ng-click="saveTpl()">确定</button>
  219. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  220. </div>
  221. </div>
  222. </div>
  223. </div>
  224. </div>
  225. <script>
  226. angular.module('profileApp').value('config', {
  227. 'tplList' : {php echo json_encode($tpl_list)},
  228. 'url' : "{php echo url('message/notice/wechat_setting')}"
  229. });
  230. angular.bootstrap($('#js-profile-tplnotice'), ['profileApp']);
  231. </script>
  232. {/if}
  233. <script type="text/javascript">
  234. angular.module('messageApp').value('config', {
  235. 'type' : '{php echo $type}',
  236. 'lists': {php echo !empty($lists) ? json_encode($lists) : 'null'},
  237. 'is_read' : "{$is_read}",
  238. 'all_read_url' : "{php echo url('message/notice/all_read')}",
  239. 'mark_read_url' : "{php echo url('message/notice/read')}",
  240. 'wechat_setting_url' : "{php echo url('message/notice/wechat_setting')}",
  241. 'accounts' : {php echo json_encode($accounts)},
  242. 'token' : "{$_W['token']}",
  243. });
  244. angular.bootstrap($('#message-notice'), ['messageApp']);
  245. $('.delete-account').click(function () {
  246. util.confirm(function () {
  247. window.location.href = "{php echo url('message/notice/wechat_setting', array('delete'=>1))}";
  248. }, function () {
  249. return false;
  250. }, '确认删除?');
  251. })
  252. </script>
  253. {template 'common/footer'}