人人商城

manage-system-webapp.html 40KB

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