人人商城

manage-systembak.html 34KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. {template 'common/header'}
  2. <div class="we7-page-title">
  3. 应用管理
  4. </div>
  5. {if !in_array($do, array('install_success', 'module_detail'))}
  6. <ul class="we7-page-tab">
  7. <li {if $do == 'installed'}class="active"{/if}><a href="{php echo url('module/manage-system/installed', array('support' => $module_support_name))}">已安装应用 </a></li>
  8. {if permission_check_account_user('see_module_manage_system_except_installed')}
  9. <li {if $do == 'recycle' && $_GPC['type'] == MODULE_RECYCLE_INSTALL_DISABLED}class="active"{/if}>
  10. <a href="{php echo url('module/manage-system/recycle', array('support' => $module_support_name, 'type' => MODULE_RECYCLE_INSTALL_DISABLED))}">
  11. 已停用应用
  12. </a>
  13. </li>
  14. <li {if $do == 'not_installed'}class="active"{/if}>
  15. <a href="{php echo url('module/manage-system/not_installed', array('support' => $module_support_name))}">
  16. 未安装应用<span class="color-red"> ({$module_uninstall_total}) </span>
  17. </a>
  18. </li>
  19. <li {if $do == 'recycle' && $_GPC['type'] == MODULE_RECYCLE_UNINSTALL_IGNORE}class="active"{/if}>
  20. <a href="{php echo url('module/manage-system/recycle', array('support' => $module_support_name, 'type' => MODULE_RECYCLE_UNINSTALL_IGNORE))}">
  21. 回收站
  22. </a>
  23. </li>
  24. {if $module_support_name == MODULE_SUPPORT_ACCOUNT_NAME}
  25. <li {if $do == 'subscribe'}class="active"{/if}><a href="{php echo url('module/manage-system/subscribe', array('support' => $module_support_name))}">订阅管理</a></li>
  26. {/if}
  27. {/if}
  28. </ul>
  29. {/if}
  30. {if $do == 'installed'}
  31. <div id="js-system-module" ng-controller="installedCtrl" ng-cloak>
  32. <div class="we7-page-search clearfix">
  33. <div class="form-group we7-margin-bottom col-sm-4">
  34. <div class="input-group">
  35. <input class="form-control" name="title" ng-model="search.moduleName" ng-keyup="searchModuleName($event)" type="text" placeholder="名称" >
  36. <span class="input-group-btn"><button ng-click="searchModuleName()" class="btn btn-default" id="search"><i class="fa fa-search"></i></button></span>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="clearfix"></div>
  41. <ul class="letters-list">
  42. <li ng-class="search.letter == letter ? 'active' : ''" ng-repeat="letter in letters"><a href="javascript:;" ng-click="searchLetter(letter)">{{ letter }}</a></li>
  43. </ul>
  44. <form action="" method="get">
  45. <table class="table we7-table table-hover vertical-middle table-manage">
  46. <col width="120px" />
  47. <col width="350px"/>
  48. {if permission_check_account_user('see_module_manage_system_welcome_support') && $_GPC['support'] == 'welcome_support'}<col width="100px">{/if}
  49. <col width="500px" />
  50. <tr>
  51. <th colspan="2" class="text-left filter">
  52. <div class="dropdown dropdown-toggle we7-dropdown">
  53. <a id="dLabel" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  54. 安装时间排序
  55. <span class="caret"></span>
  56. </a>
  57. <ul class="dropdown-menu" aria-labelledby="dLabel">
  58. <li><a href="" class="active">更新时间排序</a></li>
  59. </ul>
  60. </div>
  61. </th>
  62. {if permission_check_account_user('see_module_manage_system_welcome_support') && $_GPC['support'] == 'welcome_support'}<th class="text-right"></th>{/if}
  63. <th class="text-right">
  64. {if permission_check_account_user('see_module_manage_system_ugrade')}
  65. <div class="we7-form" ng-show="checkUpgradeSuccess">
  66. <input type="checkbox" name="" ng-click="filter()" ng-model="search.newBranch" id="filter-1" value="1">
  67. <label class="checkbox-inline" for="filter-1">
  68. 新分支应用
  69. </label>
  70. <span class="we7-margin-right"></span>
  71. <input type="checkbox" name="" ng-click="filter()" ng-model="search.newVersion" id="filter-2" value="1">
  72. <label class="checkbox-inline" for="filter-2">
  73. 有升级的应用
  74. </label>
  75. </div>
  76. {/if}
  77. </th>
  78. </tr>
  79. <tr>
  80. <th colspan="2" class="text-left bg-light-gray">
  81. 应用名/版本
  82. </th>
  83. {if permission_check_account_user('see_module_manage_system_welcome_support') && $_GPC['support'] == 'welcome_support'}<th>启用</th>{/if}
  84. <th class="text-right bg-light-gray">操作</th>
  85. </tr>
  86. <tr ng-repeat="module in moduleList">
  87. <td class="text-left module-img">
  88. <img ng-if="module.main_module == ''" ng-src="{{ module.logo }}" class="img-responsive icon"/>
  89. <div class="img" ng-if="module.main_module != ''">
  90. <img src="" alt="子应用icon" class="plugin-img" ng-src="{{ module.logo }}"/>
  91. <img src="" alt="主应用icon" class="module-img" ng-src="{{ module.main_module_logo }}"/>
  92. </div>
  93. </td>
  94. <td class="text-left">
  95. <p>{{ module.title }}</p>
  96. {if permission_check_account_user('see_module_manage_system_newversion')}
  97. <span>版本:{{ module.version }} </span><span class="color-red" ng-if="module.new_version && isFounder == 1">发现新版本</span>
  98. {/if}
  99. </td>
  100. {if permission_check_account_user('see_module_manage_system_welcome_support') && $_GPC['support'] == 'welcome_support'}
  101. <td><div class="switch" ng-class="{'switchOn' : welcome_module == module.name}" ng-click="change_welcome_module(module.name)"></div></td>
  102. {/if}
  103. <td class="vertical-middle {if $_GPC['support'] != 'welcome_support'} table-manage-td {/if}">
  104. <div class="link-group">
  105. {if permission_check_account_user('see_module_manage_system_ugrade')}
  106. <a ng-href="{{ './index.php?c=module&a=manage-system&do=upgrade&module_name='+module.name}}" class="color-red del" ng-if="module.new_version && module.from == 'local'">升级</a>
  107. <a href="{php echo url('module/manage-system/module_detail')}&name={{ module.name }}&show=upgrade" class="color-red del" ng-if="module.new_branch">新分支</a>
  108. <a href="{php echo url('module/manage-system/module_detail')}&name={{ module.name }}&show=upgrade" class="color-red del" ng-if="module.new_version">升级</a>
  109. {/if}
  110. <a href="{php echo url('module/manage-system/module_detail')}&name={{ module.name }}&support={$module_support_name}&type={ACCOUNT_TYPE_OFFCIAL_NORMAL}" ng-if="isFounder == 1">管理设置</a>
  111. {if permission_check_account_user('see_module_manage_system_stop') && $_GPC['support'] == 'welcome_support'}
  112. <a href="{php echo url('module/manage-system/recycle_post')}&module_name={{ module.name }}" onclick="return confirm('关联的小程序等其它支持也会停用,确认要停用模块吗?')">停用</a>
  113. <a href="{php echo url('home/welcome/ext', array('system_welcome' => 1))}&m={{ module.name }}" ng-if="isFounder == 1">管理</a>
  114. {/if}
  115. </div>
  116. {if $_GPC['support'] != 'welcome_support'}
  117. <div class="manage-option text-right">
  118. <a href="{php echo url('module/manage-system/module_detail')}&name={{ module.name }}&support={$module_support_name}&type={ACCOUNT_TYPE_OFFCIAL_NORMAL}" ng-if="isFounder == 1">基本信息</a>
  119. <a href="{php echo url('module/manage-system/module_detail')}&name={{ module.name }}&support={$module_support_name}&type={ACCOUNT_TYPE_OFFCIAL_NORMAL}&show=group" ng-if="isFounder == 1">应用权限组</a>
  120. {if $module_support_name == MODULE_SUPPORT_ACCOUNT_NAME}
  121. <a href="{php echo url('module/manage-system/module_detail')}&name={{ module.name }}&support={$module_support_name}&type={ACCOUNT_TYPE_OFFCIAL_NORMAL}&show=subscribe" ng-if="isFounder == 1 && module.subscribes.length">订阅消息</a>
  122. {/if}
  123. {if permission_check_account_user('see_module_manage_system_stop')}
  124. <a href="{php echo url('module/manage-system/recycle_post')}&module_name={{ module.name }}" onclick="return confirm('关联的小程序等其它支持也会停用,确认要停用模块吗?')">停用</a>
  125. {/if}
  126. </div>
  127. {/if}
  128. </td>
  129. </tr>
  130. </table>
  131. <div class="select-all" ng-hide="search.moduleName || (search.letter && search.letter != '全部') || search.newVersion || search.newBranch">
  132. <div class="we7-form text-right js-pager">
  133. {$pager}
  134. </div>
  135. </div>
  136. </form>
  137. </div>
  138. <script>
  139. require(['fileUploader'], function() {
  140. angular.module('moduleApp').value('config', {
  141. 'isFounder' : '{if $_W['isfounder']}1{else}2{/if}',
  142. 'moduleList': {php echo json_encode($module_list)},
  143. 'editModuleUrl': "{php echo url('module/manage-system/get_module_info')}",
  144. 'saveModuleUrl' : "{php echo url('module/manage-system/save_module_info')}",
  145. 'checkUpgradeUrl' : "{php echo url('module/manage-system/check_upgrade')}",
  146. 'getUpgradeInfoUrl' : "{php echo url('module/manage-system/get_upgrade_info')}",
  147. 'filterUrl' : "{php echo url('module/manage-system/filter')}",
  148. 'welcome_module' : '{$_W['setting']['site_welcome_module']}',
  149. 'set_site_welcome_url' : "{php echo url('module/manage-system/set_site_welcome_module')}"
  150. });
  151. angular.bootstrap($('#js-system-module'), ['moduleApp']);
  152. });
  153. </script>
  154. {elseif $do == 'not_installed' || $do == 'recycle'}
  155. <div id="js-system-module-not_installed" ng-controller="notInstalledCtrl" ng-cloak>
  156. <div class="we7-page-search clearfix">
  157. <form action="" method="get" class="row">
  158. <div class="form-group col-sm-4">
  159. <div class="input-group we7-margin-bottom">
  160. <input type="hidden" name="c" value="module">
  161. <input type="hidden" name="a" value="manage-system">
  162. <input type="hidden" name="do" value="{$do}">
  163. <input type="hidden" name="type" value="{$type}">
  164. <input type="hidden" name="support" value="{$module_support_name}">
  165. <input type="hidden" name="letter" value="{$letter}">
  166. <input class="form-control" name="title" value="{$title}" type="text" placeholder="名称" >
  167. <span class="input-group-btn"><button id="search" class="btn btn-default"><i class="fa fa-search"></i></button></span>
  168. </div>
  169. </div>
  170. </form>
  171. </div>
  172. <div class="clearfix"> </div>
  173. <ul class="letters-list">
  174. <li ng-class="activeLetter == letter ? 'active' : ''" ng-repeat="letter in letters"><a href="javascript:;" ng-click="searchLetter(letter)">{{ letter }}</a></li>
  175. </ul>
  176. <table class="table we7-table table-hover vertical-middle table-manage">
  177. <tr>
  178. <th colspan="2" class="text-left">公众号应用名</th>
  179. <th class="text-right">操作</th>
  180. </tr>
  181. <tr ng-repeat="module in module_list" ng-if="module[support] == 2">
  182. <td class="text-left module-img">
  183. <img ng-src="{{ module.logo }}" alt="" style="width:50px;height:50px;">
  184. </td>
  185. <td class="text-left">
  186. <p>{{ module.title }}</p>
  187. <span>版本:{{ module.version }} </span>
  188. </td>
  189. <td class="text-right">
  190. {if permission_check_account_user('see_module_manage_system_install')}
  191. {if permission_check_account_user('see_module_manage_system_shopinfo')}
  192. <a ng-if="module.cloud_id" ng-href="{{ 'http://s.we7.cc/module-' + module.cloud_id + '.html' }}" target="_blank" class="btn btn-primary">查看商城详情</a>
  193. {/if}
  194. {if $do == 'recycle'}
  195. {if permission_check_account_user('see_module_manage_system_stop')}
  196. <a href="{php echo url('module/manage-system/recycle_post', array('support' => $module_support_name))}&module_name={{ module.name }}" class="btn btn-primary">恢复</a>
  197. {/if}
  198. {if $type == MODULE_RECYCLE_INSTALL_DISABLED}
  199. <a href="{php echo url('module/manage-system/uninstall', array('support' => $module_support_name))}&module_name={{ module.name }}" class="btn btn-warning" onclick="return confirm('确认卸载该应用吗?')">卸载</a>
  200. {/if}
  201. {else}
  202. <a href="{php echo url('module/manage-system/upgrade', array('support' => $module_support_name))}&module_name={{ module.name }}" ng-if="module.upgrade_support == true" class="btn btn-primary">
  203. {if $_GPC['status'] == 'recycle'}启用{else}安装应用模块{/if}
  204. </a>
  205. <a href="{php echo url('module/manage-system/install', array('support' => $module_support_name))}&module_name={{ module.name }}" ng-if="module.upgrade_support != true" class="btn btn-primary">
  206. {if $_GPC['status'] == 'recycle'}启用{else}安装应用模块{/if}
  207. </a>
  208. {if permission_check_account_user('see_module_manage_system_stop')}
  209. <a ng-if="module.installed_support.length < 1" href="{php echo url('module/manage-system/recycle_post', array('support' => $module_support_name))}&module_name={{ module.name }}" class="btn btn-primary" onclick="return confirm('确认要将应用放入回收站吗?')">删除</a>
  210. <a ng-if="module.installed_support.length > 0" href="#" class="btn btn-primary" data-support="{{module.installed_support.join(',')}}" onclick="util.message('已安装该应用的' + $(this).data('support') + '支持, 不可直接删除该支持','','error')">删除</a>
  211. {/if}
  212. {/if}
  213. {/if}
  214. </td>
  215. </tr>
  216. </table>
  217. </form>
  218. <div class="text-right">
  219. {$pager}
  220. </div>
  221. </div>
  222. <script>
  223. angular.module('moduleApp').value('config', {
  224. 'module_list' : {php echo json_encode($modulelist)},
  225. 'support': {php echo json_encode($_GPC['support'])},
  226. });
  227. angular.bootstrap($('#js-system-module-not_installed'), ['moduleApp']);
  228. </script>
  229. {elseif $do == 'module_detail'}
  230. <div class="js-system-module-detail" ng-controller="detailCtrl" ng-cloak>
  231. <ol class="breadcrumb we7-breadcrumb">
  232. <a href="{php echo url('module/manage-system', array('support' => $module_support_name))}"><i class="wi wi-back-circle"></i> </a>
  233. <li>
  234. 应用列表
  235. </li>
  236. <li>
  237. 应用管理
  238. </li>
  239. </ol>
  240. <div class="user-head-info we7-padding-bottom">
  241. <span class="icon pull-left" ng-if="moduleinfo.{MODULE_SUPPORT_ACCOUNT_NAME} == 2"><i class="wi wi-wx-apply"></i></span>
  242. <span class="icon pull-left" ng-if="moduleinfo.wxapp_support == 2 && moduleinfo.{MODULE_SUPPORT_ACCOUNT_NAME} != 2"><i class="wi wi-wxapp-apply"></i></span>
  243. <div class="img pull-left" ng-if="moduleinfo.main_module != ''">
  244. <img alt="子应用icon" class="plugin-img" ng-src="{{ moduleinfo.logo }}"/>
  245. <img alt="主应用icon" class="module-img" ng-src="{{ moduleinfo.main_module_logo }}"/>
  246. </div>
  247. <img ng-src="{{ moduleinfo.logo }}" class="user-avatar img-rounded pull-left" ng-if="moduleinfo.main_module == ''">
  248. <h3 class="pull-left">{{ moduleinfo.title }}</h3>
  249. {if permission_check_account_user('see_module_manage_system_shopinfo')}
  250. <a ng-if="isFounder == 1 && moduleinfo.cloud_mid != ''" ng-href="{{ 'http://s.we7.cc/module-' + moduleinfo.cloud_mid + '.html' }}" target="_blank" class="btn btn-primary pull-right">查看商城详情</a>
  251. {/if}
  252. </div>
  253. <div class="btn-group we7-btn-group we7-margin-bottom">
  254. <a href="javascript:;" ng-click="changeShow('base')" class="btn " ng-class="{'active' : show == 'base' || show == ''}">基本信息</a>
  255. <a href="javascript:;" ng-click="changeShow('plugin')" class="btn " ng-class="{'active' : show == 'plugin'}" ng-show="moduleinfo.main_module == '' && moduleinfo.plugin_list != undefined && moduleinfo.plugin_list != ''">模块子应用</a>
  256. <a href="javascript:;" ng-click="changeShow('group')" class="btn " ng-class="{'active' : show == 'group'}">应用权限组</a>
  257. {if !empty($module_info['subscribes'])}
  258. <a href="javascript:;" ng-click="changeShow('subscribe')" class="btn " ng-class="{'active' : show == 'subscribe'}">订阅消息</a>
  259. {/if}
  260. {if permission_check_account_user('see_module_manage_system_ugrade')}
  261. <a href="javascript:;" ng-click="changeShow('upgrade')" class="btn " ng-class="{'active' : show == 'upgrade'}" ng-show="checkupgrade == 1">升级</a>
  262. {/if}
  263. </div>
  264. <table class="table we7-table table-hover table-form" ng-show="show == 'base' || show == ''">
  265. <col width="140px">
  266. <col />
  267. <col width="100px">
  268. <tr>
  269. <th class="text-left" colspan="3">编辑模块基本信息</th>
  270. </tr>
  271. <tr>
  272. <td class="table-label">模块标题</td>
  273. <td>{{ moduleinfo.title }}</td>
  274. {if permission_check_account_user('see_module_manage_system_info_edit')}
  275. <td class="text-right">
  276. <div class="link-group"><a href="javascript:;" ng-click="editModule('title', moduleinfo.title)">修改</a></div>
  277. </td>
  278. {/if}
  279. </tr>
  280. {if permission_check_account_user('see_module_manage_system_detailinfo')}
  281. <tr>
  282. <td class="table-label">模块作者</td>
  283. <td colspan="2">{{ moduleinfo.author }}</td>
  284. </tr>
  285. <tr>
  286. <td class="table-label">模块版本</td>
  287. <td colspan="2">{{ moduleinfo.version }}</td>
  288. </tr>
  289. {/if}
  290. <tr>
  291. <td class="table-label">模块简述</td>
  292. <td>{{ moduleinfo.ability }}</td>
  293. {if permission_check_account_user('see_module_manage_system_info_edit')}
  294. <td class="text-right">
  295. <div class="link-group"><a href="javascript:;" ng-click="editModule('ability', moduleinfo.ability)">修改</a></div>
  296. </td>
  297. {/if}
  298. </tr>
  299. <tr>
  300. <td class="table-label">模块介绍</td>
  301. <td>{{ moduleinfo.description }}</td>
  302. {if permission_check_account_user('see_module_manage_system_info_edit')}
  303. <td class="text-right">
  304. <div class="link-group"><a href="javascript:;" ng-click="editModule('description', moduleinfo.description)">修改</a></div>
  305. </td>
  306. {/if}
  307. </tr>
  308. <tr>
  309. <td class="table-label">模块缩略图</td>
  310. <td><img ng-src="{{ moduleinfo.logo }}" alt="" style="width:65px; height:65px;" class="img-rounded"/></td>
  311. {if permission_check_account_user('see_module_manage_system_info_edit')}
  312. <td class="text-right">
  313. <div class="link-group"><a href="javascript:;" ng-click="editModule('logo', moduleinfo.logo)">修改</a></div>
  314. </td>
  315. {/if}
  316. </tr>
  317. <tr>
  318. <td class="table-label">模块封面</td>
  319. <td><img ng-src="{{ moduleinfo.preview }}" alt="" style="width:65px; height:65px;" class="img-rounded"/></td>
  320. {if permission_check_account_user('see_module_manage_system_info_edit')}
  321. <td class="text-right">
  322. <div class="link-group"><a href="javascript:;" ng-click="editModule('preview', moduleinfo.preview)">修改</a></div>
  323. </td>
  324. {/if}
  325. </tr>
  326. </table>
  327. <table class="table we7-table table-hover vertical-middle table-manage" ng-show="show != 'workorder' && moduleinfo.relation">
  328. <col width="150px"/>
  329. <col />
  330. <col />
  331. <tr>
  332. <th colspan="3" class="text-left">可关联</th>
  333. </tr>
  334. <tr ng-repeat="relation in moduleinfo.relation" ng-init="relationtype = {
  335. wxapp_support : '小程序版',
  336. 'account_support' : '公众号版',
  337. 'webapp_support' : 'pc版',
  338. 'phonesupport' : 'APP版'}">
  339. <td class="text-left">
  340. {{ relationtype[relation] }}
  341. </td>
  342. <td class="text-left">
  343. <img ng-src="{{ moduleinfo.logo }}" class="img-responsive pull-left" style="width: 50px;height: 50px; margin-right: 10px;"/>
  344. <p>{{ moduleinfo.title }}</p>
  345. <span class="color-gray">版本:{{ moduleinfo.version }} </span>
  346. </td>
  347. <td class="text-right">
  348. <div class="link-group"><a href="{php echo url('module/manage-system/module_detail')}name={{moduleinfo.name}}&support={{relation}}&type={{moduleinfo.type}}">查看</a></div>
  349. </td>
  350. </tr>
  351. </table>
  352. <div class="panel we7-panel" ng-show="show == 'plugin' && moduleinfo.main_module == ''">
  353. <div class="panel-heading">
  354. 模块子应用
  355. </div>
  356. <div class="panel-body">
  357. <div class="plugin-list clearfix">
  358. <div class="item" ng-repeat="plugin in moduleinfo.plugin_list">
  359. <a href="{php echo url('module/manage-system/module_detail')}name={{plugin.name}}" target="_blank">
  360. <div class="img">
  361. <img ng-src="{{ plugin.logo }}" alt="子应用icon" class="plugin-img"/>
  362. <img ng-src="{{ moduleinfo.logo }}" alt="主应用icon" class="module-img"/>
  363. </div>
  364. <div class="name">{{ plugin.title }}</div>
  365. </a>
  366. </div>
  367. </div>
  368. </div>
  369. </div>
  370. <table class="table we7-table table-hover vertical-middle" ng-show="show == 'upgrade'" ng-if="isFounder == 1 && upgradeInfo.from == 'local'">
  371. <col width="300px"/>
  372. <col />
  373. <col width="200px;"/>
  374. <tr>
  375. <th>目前版本</th>
  376. <th>最新版本</th>
  377. <th class="text-right">操作</th>
  378. </tr>
  379. <tr>
  380. <td>{{ moduleinfo.version }}</td>
  381. <td>{{ upgradeInfo.best_version }}</td>
  382. <td class="text-right">
  383. {if permission_check_account_user('see_module_manage_system_ugrade')}
  384. <a href="{php echo url('module/manage-system/upgrade')}module_name={{ moduleinfo.name }}" class="btn btn-danger">升级</a>
  385. {/if}
  386. </td>
  387. </tr>
  388. </table>
  389. <table class="table we7-table table-hover vertical-middle" ng-show="show == 'upgrade'" ng-if="isFounder == 1 && upgradeInfo.from == 'cloud' && branch.displayorder >= upgradeInfo.site_branch.displayorder" ng-repeat="branch in upgradeInfo.branches">
  390. <col width="300px"/>
  391. <col />
  392. <col />
  393. <col />
  394. <col width="200px"/>
  395. <tr>
  396. <th class="text-left">分支名称</th>
  397. <th>分支价格</th>
  398. <th>目前版本</th>
  399. <th>最新版本</th>
  400. <th class="text-right">操作</th>
  401. </tr>
  402. <tbody>
  403. <tr>
  404. <td class="text-left">{{ branch.name }}</td>
  405. <td class="color-red">
  406. <span ng-if="branch.displayorder > upgradeInfo.site_branch.displayorder" ng-bind="branch.price"></span>
  407. <span ng-if="branch.displayorder == upgradeInfo.site_branch.displayorder && branch.id > upgradeInfo.site_branch.id" ng-bind="branch.upgrade_price"></span>
  408. <span class="label label-success" ng-if="branch.id == upgradeInfo.site_branch.id">当前分支</span>
  409. </td>
  410. <td>{{ upgradeInfo.site_branch.id == branch.id ? moduleinfo.version : ''}}</td>
  411. <td>{{ branch.version.version }}</td>
  412. <td class="text-right">
  413. <span class="text text-success" ng-if="branch.id == upgradeInfo.site_branch.id && branch.version.version == moduleinfo.version">无需升级</span>
  414. {if permission_check_account_user('see_module_manage_system_ugrade')}
  415. <a href="javascript:;" ng-click="notice(service_expire, upgradeInfo.id, upgradeInfo.name)" ng-if="branch.id == upgradeInfo.site_branch.id && branch.version.version != moduleinfo.version" class="btn btn-primary">升级</a>
  416. {/if}
  417. <a href="javascript:;" ng-click="upgrade(branch.upgrade_price, upgradeInfo.name, upgradeInfo.id)" ng-if="branch.displayorder > upgradeInfo.site_branch.displayorder || (branch.displayorder == upgradeInfo.site_branch.displayorder && branch.id > upgradeInfo.site_branch.id)" class="btn btn-danger">购买</a>
  418. </td>
  419. </tr>
  420. <tr>
  421. <td class="text-left">{{ branch.id == upgradeInfo.site_branch.id ? '版本更新内容' : ''}}</td>
  422. <td colspan="4" class="text-right">
  423. <a class="color-default view-detail" ng-if="branch.id == upgradeInfo.site_branch.id && branch.version.version != moduleinfo.version" href="javascript:;" data-id="{{ branch.id }}" onclick="change($(this))">查看详情 <i class="wi wi-angle-down"></i></a>
  424. <a href="http://s.we7.cc/module-{{upgradeInfo.id}}.html" ng-if="branch.displayorder > upgradeInfo.site_branch.displayorder || (branch.displayorder == upgradeInfo.site_branch.displayorder && branch.id > upgradeInfo.site_branch.id)" class="color-default view-detail" target="_blank">查看分支详情</a>
  425. </td>
  426. </tr>
  427. <tr id="version-detail-{{ branch.id }}" style="display:none">
  428. <td colspan="5" class="details-versions">
  429. <div class="js-version-lists">
  430. <div class="details-version">
  431. <div class="details-version-time">
  432. <p class="time-d">{{ branch.day }}</p>
  433. <p class="time-y-m">{{ branch.month }}</p>
  434. </div>
  435. <i class="fa fa-circle-o"></i>
  436. <div class="details-version-content">
  437. <div class="panel panel-version">
  438. <div class="panel-heading">
  439. 版本号:{{ branch.version.version }} - {{ branch.name }} <span class="time-h" ng-bind="branch.hour"></span>
  440. </div>
  441. <div class="panel-body" ng-bind-html="branch.version.description">
  442. </div>
  443. </div>
  444. </div>
  445. </div>
  446. </div>
  447. {if $recent_versions['total'] > 10}
  448. <div class="text-center">
  449. <a href="javascript:;" class="btn c-blue js-versions-more">加载更多<i class="fa fa-angle-down"></i></a>
  450. </div>
  451. {/if}
  452. </td>
  453. </tr>
  454. </tbody>
  455. </table>
  456. <div class="module-group" ng-if="isFounder == 1">
  457. <table class="table we7-table table-hover" ng-show="show == 'group'">
  458. <col />
  459. <col width="100px" />
  460. <tr>
  461. <th class="text-left">
  462. 应用权限组
  463. </th>
  464. <th class="text-right">
  465. {if permission_check_account_user('see_module_manage_system_group_add')}
  466. <a href="{php echo url('module/group')}" class="color-default">添加</a>
  467. {/if}
  468. </th>
  469. </tr>
  470. <tr>
  471. <td class="text-left">
  472. <span>所有服务</span>
  473. </td>
  474. <td>
  475. </td>
  476. </tr>
  477. {loop $module_group $group}
  478. <tr>
  479. <td class="text-left">
  480. <span>{$group['name']}</span>
  481. </td>
  482. <td class="text-right">
  483. {if permission_check_account_user('see_module_manage_system_group_add')}
  484. <div class="link-group"><a href="{php echo url('module/group/post', array('id' => $group['id']))}">设置</a></div>
  485. {/if}
  486. </td>
  487. </tr>
  488. {/loop}
  489. </table>
  490. </div>
  491. {if !empty($module_info['subscribes'])}
  492. <div class="panel we7-panel module-subscription" ng-if="isFounder == 1" ng-show="show == 'subscribe'">
  493. <div class="panel-heading ">
  494. 订阅详情
  495. <div class="pull-right subscription-switch">
  496. <span >启用订阅</span>
  497. <label>
  498. <input name="" id="" class="form-control" type="checkbox" style="display: none;">
  499. <div class="switch" ng-class="{ 'switchOn' : !moduleinfo.is_receive_ban || moduleinfo.is_receive_ban == 0}" ng-click="changeSwitch()"></div>
  500. </label>
  501. </div>
  502. </div>
  503. <div class="panel-body">
  504. <ul>
  505. {loop $module_info['subscribes'] $subscribe}
  506. <li>{$subscribes_type[$subscribe]} <label ng-if="subscribe == 2" class="label label-danger">通讯失败</label> </li>
  507. {/loop}
  508. </ul>
  509. </div>
  510. </div>
  511. {/if}
  512. <table class="table we7-table table-hover" ng-if="isFounder == 1">
  513. <col width="255px"/>
  514. <col width="130px"/>
  515. <col width="250px"/>
  516. <col width="122px"/>
  517. <col />
  518. </table>
  519. <div class="modal fade" id="module-info" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  520. <div class="modal-dialog we7-modal-dialog" style="width:800px">
  521. <div class="modal-content">
  522. <div class="modal-header">
  523. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  524. <h4 class="modal-title">编辑模块信息</h4>
  525. </div>
  526. <div class="modal-body">
  527. <div class="form-group" ng-show="editType == 'title'">
  528. <label class="col-sm-2 control-label"> 模块标题</label>
  529. <div class="col-sm-10">
  530. <input type="text" name="title" ng-model="moduleOriginal.title" class="form-control">
  531. <span class="help-block">模块的名称, 显示在用户的模块列表中. 不要超过10个字符</span>
  532. </div>
  533. </div>
  534. <div class="form-group" ng-show="editType == 'ability'">
  535. <label class="col-sm-2 control-label"> 模块简述</label>
  536. <div class="col-sm-10">
  537. <input type="text" name="ability" ng-model="moduleOriginal.ability" class="form-control">
  538. <span class="help-block">模块功能描述, 使用简单的语言描述模块的作用, 来吸引用户</span>
  539. </div>
  540. </div>
  541. <div class="form-group" ng-show="editType == 'description'">
  542. <label class="col-sm-2 control-label"> 模块介绍</label>
  543. <div class="col-sm-10">
  544. <textarea type="text" name="description" ng-model="moduleOriginal.description" class="form-control" rows="5">{{ moduleinfo.description }}</textarea>
  545. <span class="help-block">模块详细描述, 详细介绍模块的功能和使用方法</span>
  546. </div>
  547. </div>
  548. <div class="form-group" ng-show="editType == 'logo'">
  549. <label class="col-sm-2 control-label"> 模块缩略图</label>
  550. <div class="col-sm-10">
  551. <div class="we7-input-img" ng-class="{ 'active' : moduleOriginal.logo }" style="width: 100px;height: 100px;">
  552. <img ng-src="{{ moduleOriginal.logo }}" ng-if="moduleOriginal.logo">
  553. <a href="javascript:;" class="input-addon" ng-hide="moduleOriginal.logo" ng-click="changePicture('logo')"><span>+</span></a>
  554. <input type="hidden" name="thumb">
  555. <div class="cover-dark">
  556. <a href="javascript:;" class="cut" ng-click="changePicture('logo')">更换</a>
  557. <a href="javascript:;" class="del" ng-click="delPicture('logo')"><i class="fa fa-times text-danger"></i></a>
  558. </div>
  559. </div>
  560. <span class="help-block">用 48*48 的图片来让你的模块更吸引眼球吧。仅支持jpg格式</span>
  561. </div>
  562. </div>
  563. <div class="form-group" ng-show="editType == 'preview'">
  564. <label class="col-sm-2 control-label"> 模块封面</label>
  565. <div class="col-sm-10">
  566. <div class="we7-input-img" ng-class="{ 'active' : moduleOriginal.preview}" style="width: 100px;height: 100px;">
  567. <img ng-src="{{ moduleOriginal.preview }}">
  568. <a href="javascript:;" class="input-addon" ng-click="changePicture('preview')"><span>+</span></a>
  569. <input type="hidden" name="thumb">
  570. <div class="cover-dark">
  571. <a href="javascript:;" class="cut" ng-click="changePicture('preview')">更换</a>
  572. <a href="javascript:;" class="del" ng-click="delPicture('preview')"><i class="fa fa-times text-danger"></i></a>
  573. </div>
  574. </div>
  575. <span class="help-block">模块封面, 大小为 600*350, 更好的设计将会获得官方推荐位置。仅支持jpg格式</span>
  576. </div>
  577. </div>
  578. </div>
  579. <div class="modal-footer">
  580. <button class="btn btn-primary" type="text" name="submit" ng-click="save()" data-dismiss="modal">保存</button>
  581. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  582. <input type="hidden" name="token" value="c781f0df">
  583. </div>
  584. </div>
  585. </div>
  586. </div>
  587. </div>
  588. <script>
  589. require(['fileUploader'], function() {
  590. angular.module('moduleApp').value('config', {
  591. 'isFounder' : "{if $_W['isfounder']}1{else}2{/if}",
  592. 'show' : "{$_GPC['show']}",
  593. 'moduleInfo' : {php echo json_encode($module_info)},
  594. 'receiveBanUrl' : "{php echo url('module/manage-system/change_receive_ban')}",
  595. 'editModuleUrl' : "{php echo url('module/manage-system/get_module_info')}",
  596. 'saveModuleUrl' : "{php echo url('module/manage-system/save_module_info')}",
  597. 'checkReceiveUrl' : "{php echo url('module/manage-system/check_subscribe')}",
  598. 'getUpgradeInfoUrl' : "{php echo url('module/manage-system/get_upgrade_info')}"
  599. });
  600. angular.bootstrap($('.js-system-module-detail'), ['moduleApp']);
  601. });
  602. if(window.addEventListener) {
  603. window.addEventListener('message', function(e){
  604. $('#workorderiframe').height(e.data.height+200); //选中图片导致高度又变高了
  605. });
  606. }
  607. $.getJSON("{php echo url('system/workorder/module')}name={$module_info['name']}", function(data){
  608. if(data.errno == 0) {
  609. $('#workorderiframe').attr('src',data.data.url);
  610. }
  611. });
  612. </script>
  613. {elseif $do == 'subscribe'}
  614. <div class="alert alert-info">
  615. 如果模块测试订阅消息失败,为了不影响系统整体通知,请禁用这些通知失败的模块
  616. </div>
  617. <div class="js-system-module-subscribe" ng-controller="subscribeCtrl" ng-cloak>
  618. <div class="panel panel-default js-test" ng-repeat="(name, module) in subscribe_module track by name">
  619. <div class="panel-heading clearfix">
  620. <div class="pull-right" ng-click="change_ban(module.name)">
  621. <input class="form-control" type="checkbox" style="display: none;">
  622. <div ng-class="module.receive_ban == 0 ? 'switch switchOn' : 'switch'"></div>
  623. </div>
  624. {{ module.title }}
  625. </div>
  626. <div class="panel-body clearfix">
  627. <div class="col-md-3 col-sm-4 col-xs-6 item" style="line-height: 30px; cursor:pointer;" ng-repeat="subscribe in module.subscribe">
  628. {{ types[subscribe] }}
  629. <p class="pull-right">
  630. <span class="label label-success" ng-if="module.subscribe_success == 1">正常</span>
  631. <span class="label label-danger" ng-if="module.subscribe_success == 2">失败</span>
  632. </p>
  633. </div>
  634. </div>
  635. </div>
  636. </div>
  637. <script type="text/javascript">
  638. angular.module('moduleApp').value('config', {
  639. 'subscribe_module' : {php echo json_encode($subscribe_module)},
  640. 'types' : {php echo json_encode($subscribe_type)},
  641. 'change_ban_url' : "{php echo url('module/manage-system/change_receive_ban')}",
  642. 'check_receive_url' : "{php echo url('module/manage-system/check_subscribe')}"
  643. });
  644. angular.bootstrap($('.js-system-module-subscribe'), ['moduleApp']);
  645. </script>
  646. {elseif $do == 'install_success'}
  647. <div class="steps">
  648. <div class="steps-item steps-status-wait">
  649. <div class="steps-line"><span class="steps-num">1</span></div>
  650. <div class="steps-state">安装应用</div>
  651. </div>
  652. <div class="steps-item steps-status-wait">
  653. <div class="steps-line"><span class="steps-num">2</span></div>
  654. <div class="steps-state">分配应用权限</div>
  655. </div>
  656. <div class="steps-item steps-status-finish">
  657. <div class="steps-line"><span class="steps-num">3</span></div>
  658. <div class="steps-state">安装成功</div>
  659. </div>
  660. </div>
  661. <div class="distribution-steps">
  662. <div class="we7-margin-bottom-sm font-lg">应用分配到公众号使用的流程说明</div>
  663. <div class="steps-container">
  664. <div>
  665. <div class="num">1</div>
  666. <div class="title">
  667. <span class="wi wi-appjurisdiction"></span>添加应用权限组
  668. </div>
  669. <div class="content">
  670. 设置应用权限组名称,选择需要添加的公众号应用、小程序应用、微站模板,保存提交。
  671. <div><a href="{php echo url('module/group/post')}" class="color-default">去添加应用组 ></a></div>
  672. </div>
  673. </div>
  674. <div>
  675. <div class="num">2</div>
  676. <div class="title">
  677. <span class="wi wi-userjurisdiction"></span>添加用户权限组
  678. </div>
  679. <div class="content">
  680. 设置用户权限组名称,选择可以添加的的公众号,小程序数量、有效期并选择应用权限组,然后保存提交。
  681. <div><a href="{php echo url('user/group/post')}" class="color-default">去添加用户权限组 ></a></div>
  682. </div>
  683. </div>
  684. <div>
  685. <div class="num">3</div>
  686. <div class="title">
  687. <span class="wi wi-user-group"></span>分配用户权限组
  688. </div>
  689. <div class="content">
  690. 改用户组权限,分配成功后此用户组即可使用该应用组的所有应用。
  691. <div><a href="{php echo url('user/group')}" class="color-default">去分配用户组 ></a></div>
  692. </div>
  693. </div>
  694. </div>
  695. </div>
  696. <div class="we7-margin-bottom">
  697. <a class="btn btn-primary" href="{php echo url('module/manage-system', array('support' => $module_support_name))}">返回已安装应用列表</a>
  698. </div>
  699. {/if}
  700. {template 'common/footer'}