manage-modules-tpl.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. {template 'common/header'}
  2. {template 'account/account-header'}
  3. <div id="js-account-manage-modules-tpl" ng-controller="AccountMangeModulesTpl" ng-cloak>
  4. {if in_array($owner['uid'], $founders)}
  5. <div class="panel we7-panel user-permission">
  6. <div class="panel-heading">
  7. 主管理员的会员权限
  8. </div>
  9. <div class="panel-body we7-padding">
  10. 全部
  11. </div>
  12. </div>
  13. {/if}
  14. {if !in_array($owner['uid'], $founders)}
  15. <!--主管理员会员权限-->
  16. <div class="panel we7-panel user-permission">
  17. <div class="panel-heading">
  18. <span>主管理员: {{owner.group.name}}</span>
  19. {if $_W['role'] == ACCOUNT_MANAGE_NAME_FOUNDER && !in_array($owner['uid'], $founders) || $_W['role'] == ACCOUNT_MANAGE_NAME_VICE_FOUNDER && $owner['uid'] != $_W['uid']}
  20. <a href="{if $owner['founder_groupid'] == ACCOUNT_MANAGE_GROUP_VICE_FOUNDER}{php echo url('founder/edit/edit_modules_tpl', array('uid' => $owner['uid']))}{else}{php echo url('user/edit/edit_modules_tpl',array('uid'=>$owner['uid']))}{/if}" class="pull-right color-default">修改</a>
  21. {/if}
  22. </div>
  23. <div class="we7-group-show we7-padding" ng-repeat="module_tpl in modules_tpl">
  24. <div class="name">
  25. {{module_tpl.name}}
  26. </div>
  27. <div class="group-app-list" >
  28. <div class="group-app-item" ng-repeat="module in module_tpl[account_type_sign]">
  29. <img ng-src="{{module.logo}}" class="module-img" alt="">
  30. <div class="info">
  31. <div class="title text-over">
  32. {{module.title}}
  33. </div>
  34. <div class="type-list">
  35. <i ng-class="we7TypeDefault[account_type_sign]['icon']"></i>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="group-app-item" ng-repeat="module in module_tpl.templates" ng-if="account_type_sign == 'account'">
  40. <img ng-src="{{module.logo}}" class="template-img" alt="">
  41. <div class="info">
  42. <div class="title">
  43. {{module.title}}
  44. </div>
  45. <div class="type-list">
  46. <i class="wi wi-template"></i>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <a class="action" ></a>
  52. </div>
  53. <div class="we7-group-show we7-padding">
  54. <div class="name">
  55. 附加应用
  56. </div>
  57. <div class="group-app-list" >
  58. <div class="group-app-item" ng-repeat="module in user_extend_modules">
  59. <img ng-src="{{module.logo}}" class="module-img" alt="">
  60. <div class="info">
  61. <div class="title text-over">
  62. {{module.title}}
  63. </div>
  64. <div class="type-list">
  65. <i ng-class="we7TypeDefault[account_type_sign]['icon']"></i>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="group-app-item" ng-repeat="module in module_tpl.templates" ng-if="account_type_sign == 'account'">
  70. <img ng-src="{{module.logo}}" class="template-img" alt="">
  71. <div class="info">
  72. <div class="title">
  73. {{module.title}}
  74. </div>
  75. <div class="type-list">
  76. <i class="wi wi-template"></i>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <a class="action" ></a>
  82. </div>
  83. </div>
  84. <!--附加会员权限-->
  85. <div class="panel we7-panel user-permission">
  86. <div class="panel-heading">
  87. <span>附加应用权限组</span>
  88. {if $_W['role'] == ACCOUNT_MANAGE_NAME_FOUNDER && !in_array($owner['uid'], $founders) || $_W['role'] == ACCOUNT_MANAGE_NAME_VICE_FOUNDER && $owner['uid'] != $_W['uid']}
  89. <we7-modal-app title="'修改附加应用权限组'" module-list="groupList" multiple="true" on-confirm="changeGroup()"><a href="javascript:;" class="pull-right color-default">修改</a></we7-modal-app>
  90. {/if}
  91. </div>
  92. <div class="we7-group-show we7-padding" ng-repeat="uni_group in extend.groups">
  93. <div class="name">
  94. {{uni_group.name}}
  95. </div>
  96. <div class="group-app-list" >
  97. <div class="group-app-item" ng-repeat="module in uni_group[account_type_sign]" ng-if="module[account_type_sign + '_support'] == 2">
  98. <img ng-src="{{module.logo}}" class="module-img" alt="">
  99. <div class="info">
  100. <div class="title text-over">
  101. {{module.title}}
  102. </div>
  103. <div class="type-list">
  104. <i ng-class="we7TypeDefault[account_type_sign]['icon']"></i>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="group-app-item" ng-repeat="module in uni_group.templates" ng-if="account_type_sign == 'account'">
  109. <img ng-src="{{module.logo}}" class="template-img" alt="">
  110. <div class="info">
  111. <div class="title">
  112. {{module.title}}
  113. </div>
  114. <div class="type-list">
  115. <i class="wi wi-template"></i>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <a class="action" ></a>
  121. </div>
  122. <div class="we7-empty-block" ng-if="extend.groups | we7IsEmpty">
  123. 暂无
  124. </div>
  125. </div>
  126. <!-- 附加应用 -->
  127. <div class="panel we7-panel user-permission">
  128. <div class="panel-heading">
  129. <span>附加应用</span>
  130. {if $_W['role'] == ACCOUNT_MANAGE_NAME_FOUNDER && !in_array($owner['uid'], $founders) || $_W['role'] == ACCOUNT_MANAGE_NAME_VICE_FOUNDER && $owner['uid'] != $_W['uid']}
  131. <we7-modal-app module-list="moduleList" multiple="true" on-confirm="addExtend()"><a href="javascript:;" class="pull-right color-default">修改</a></we7-modal-app>
  132. {/if}
  133. </div>
  134. <div class="we7-group-show we7-padding">
  135. <div class="name">
  136. 附加应用
  137. </div>
  138. <div class="group-app-list" >
  139. <div class="group-app-item" ng-repeat="module in extend.modules" ng-if="module[account_type_sign + '_support'] == 2">
  140. <img ng-src="{{module.logo}}" class="module-img" alt="">
  141. <div class="info">
  142. <div class="title text-over">
  143. {{module.title}}
  144. </div>
  145. <div class="type-list">
  146. <i ng-class="we7TypeDefault[account_type_sign]['icon']"></i>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="group-app-item" ng-repeat="module in extend.templates" ng-if="account_type_sign == 'account'">
  151. <img ng-src="{{module.logo}}" class="template-img" alt="">
  152. <div class="info">
  153. <div class="title">
  154. {{module.title}}
  155. </div>
  156. <div class="type-list">
  157. <i class="wi wi-template"></i>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. <a class="action" ></a>
  163. </div>
  164. </div>
  165. {/if}
  166. {if !empty($account_buy_package) || !empty($account_buy_modules)}
  167. <div class="panel we7-panel user-permission">
  168. <div class="panel-heading ">
  169. 商城购买权限
  170. </div>
  171. <div class="panel-body">
  172. {if !empty($account_buy_package)}
  173. <table class="table we7-table" >
  174. <tr>
  175. <th colspan="2" class="text-left">
  176. <span class="we7-padding-right">商城购买权限组</span>
  177. <span></span>
  178. </th>
  179. <th colspan="4">
  180. 到期时间
  181. </th>
  182. </tr>
  183. <tbody ng-repeat="package in packagelist">
  184. <tr>
  185. <td colspan="3" class="text-left we7-padding-right" ng-init="module_tpl.show = false">
  186. <span>{{ package['name'] }}</span>
  187. <span class="text text-danger" ng-if="package.near_expire">即将到期</span>
  188. </td>
  189. <td>
  190. {{ package.expire_time }}
  191. {if permission_check_account_user('see_account_post_modules_tpl_edit_store_endtime')}<a href="javascript:;" class="color-default" data-toggle="modal" ng-click="editEndTime(package.expire_time, package.order_id)">修改</a>{/if}
  192. </td>
  193. <td>
  194. <a class="color-default" href="{php echo url('site/entry/goodsbuyer', array('direct' => 1, 'operate' => 'goods_info', 'm' => 'store'))}&goods={{ package.goods_id }}">续费</a>
  195. </td>
  196. <td>
  197. <div class="link-group">
  198. <a href="javascript:;" class="color-default" ng-show="module_tpl.show" ng-click="module_tpl.show = false">收起</a>
  199. <a href="javascript:;" class="color-default" ng-show="!module_tpl.show" ng-click="module_tpl.show = true">展开</a>
  200. </div>
  201. </td>
  202. </tr>
  203. <tr ng-show="module_tpl.show">
  204. <td colspan="5">
  205. <div class="col-sm-1 color-gray text-left we7-padding-none">{php echo $account->typeName}应用</div>
  206. <div class="col-sm-11">
  207. <div class="col-sm-3 text-left we7-margin-bottom"
  208. {if $account->typeSign == ACCOUNT_TYPE_SIGN} ng-repeat="module in package.account"
  209. {elseif $account->typeSign == WXAPP_TYPE_SIGN} ng-repeat="module in package.wxapp"
  210. {elseif $account->typeSign == WEBAPP_TYPE_SIGN} ng-repeat="module in package.webapp"
  211. {elseif $account->typeSign == PHONEAPP_TYPE_SIGN} ng-repeat="module in package.phoneapp"
  212. {elseif $account->typeSign == XZAPP_TYPE_SIGN} ng-repeat="module in package.xzapp"
  213. {elseif $account->typeSign == ALIAPP_TYPE_SIGN} ng-repeat="module in package.aliapp"
  214. {/if} >
  215. <div ng-if="module.name != 'all'" class="text-over text-left">
  216. <img ng-src="{{ module.logo }}" alt="" style="width:50px;height:50px;">
  217. {{ module.title }}
  218. </div>
  219. <label class="label label-info" ng-if="module.name == 'all'">所有模块</label>
  220. </div>
  221. </div>
  222. </td>
  223. <td class="we7-padding-right color-default"></td>
  224. </tr>
  225. {if $account->typeSign == ACCOUNT_TYPE_SIGN}
  226. <tr ng-show="module_tpl.show">
  227. <td colspan="5">
  228. <div class="col-sm-1 color-gray text-left we7-padding-none">模板</div>
  229. <div class="col-sm-11">
  230. <div class="col-sm-3 text-left we7-margin-bottom" ng-repeat="tpl in package.templates">
  231. <a href="javascript:;" class="label label-info" ng-bind="tpl.title"></a>
  232. </div>
  233. </div>
  234. </td>
  235. <td class="we7-padding-right color-default"></td>
  236. </tr>
  237. {/if}
  238. </tbody>
  239. </table>
  240. {/if}
  241. {if !empty($account_buy_modules)}
  242. <table class="table we7-table" >
  243. <tr>
  244. <th colspan="7" class="text-left">
  245. <span class="we7-padding-right">商城购买模块</span>
  246. <span></span>
  247. </th>
  248. <th class="text-left">
  249. <span class="we7-padding-right">到期时间</span>
  250. <span></span>
  251. </th>
  252. <th class="text-left">
  253. <span class="we7-padding-right">操作</span>
  254. <span></span>
  255. </th>
  256. </tr>
  257. <tbody>
  258. <tr>
  259. <td colspan="9">
  260. {php echo $account->typeName}应用
  261. </td>
  262. </tr>
  263. {loop $account_buy_modules $module}
  264. {if $module['goods_id']}
  265. <tr>
  266. <td>
  267. <img src="{$module['logo']}" class="img-responsive icon" alt="" style="width:50px;height:50px;">
  268. </td>
  269. <td>
  270. {$module['title']}
  271. </td>
  272. <td>
  273. {php $expire_week = strtotime('-1 week', $module['expire_time']);}
  274. {if $module['expire_time'] > TIMESTAMP && $expire_week < TIMESTAMP}
  275. <span class="text text-error">即将到期</span>
  276. {/if}
  277. </td>
  278. <td colspan="5">
  279. {if $module['expire_time'] < TIMESTAMP}
  280. 已到期
  281. {else}
  282. {php echo date('Y-m-d', $module['expire_time'])}
  283. {/if}
  284. {if permission_check_account_user('see_account_post_modules_tpl_edit_store_endtime')}
  285. <a href="javascript:;" class="color-default" data-toggle="modal" ng-click="editEndTime('{php echo date('Y-m-d', $module['expire_time'])}', {$module['order_id']})">修改</a>
  286. {/if}
  287. </td>
  288. <td class="we7-padding-right color-default">
  289. {if permission_check_account_user('see_modules_recharge')}
  290. <a href="{php echo url('site/entry/goodsbuyer', array('direct' => 1, 'operate' => 'goods_info', 'm' => 'store', 'goods' => $module['goods_id']))}">续费</a>
  291. {/if}
  292. {if permission_check_account_user('see_modules_deactivate')}
  293. <a href="{php echo url('site/entry/deactivateOrder', array('direct' => 1, 'm' => 'store', 'order_id' => $module['order_id'], 'goods_id' => $module['goods_id'], 'uniacid' => $uniacid, 'type' => $_GPC['account_type']))}">删除</a>
  294. {/if}
  295. </td>
  296. </tr>
  297. {/if}
  298. {/loop}
  299. </tbody>
  300. </table>
  301. {/if}
  302. <div class="modal fade" id="endtime" role="dialog">
  303. <div class="we7-modal-dialog modal-dialog we7-form">
  304. <div class="modal-content">
  305. <div class="modal-header">
  306. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  307. <div class="modal-title">设置到期时间</div>
  308. </div>
  309. <div class="modal-body">
  310. <div class="form-group">
  311. {php echo tpl_form_field_date('endtime', '');}
  312. </div>
  313. </div>
  314. <div class="modal-footer">
  315. <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="httpChange()">确定</button>
  316. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. {/if}
  324. </div>
  325. <script>
  326. angular.module('accountApp').value('config', {
  327. owner: {php echo !empty($owner) ? json_encode($owner) : 'null'},
  328. packagelist: {php echo !empty($account_buy_package) ? json_encode($account_buy_package) : 'null'},
  329. modules_tpl: {php echo !empty($modules_tpl) ? json_encode($modules_tpl) : 'null'},
  330. user_extend_modules: {php echo !empty($user_extend_modules) ? json_encode($user_extend_modules) : 'null'},
  331. extend: {php echo !empty($extend) ? json_encode($extend) : 'null'},
  332. uni_groups: {php echo !empty($uni_groups) ? json_encode($uni_groups) : 'null'},
  333. links: {
  334. postModulesTpl: "{php echo url('account/post/modules_tpl', array('acid' => $acid, 'uniacid' => $uniacid))}",
  335. },
  336. modules: {php echo !empty($modules) ? json_encode($modules) : 'null'},
  337. templates: {php echo !empty($templates) ? json_encode($templates) : 'null'},
  338. account_type_sign: '{php echo $account->typeSign}',
  339. });
  340. angular.bootstrap($('#js-account-manage-modules-tpl'), ['accountApp']);
  341. </script>
  342. {template 'common/footer'}