publish_detail.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. namespace app\index;
  4. class publish_detail extends BaseUser
  5. {
  6. function index()
  7. {
  8. $id = bees_decrypt(SafeRequest("id", "get"));
  9. $row = db("appid")->where("in_uid", $this->userid)->where("in_id", $id)->find();
  10. $row or exit(include_once dirname(__FILE__) . "/../pack/error/404.php");
  11. $page = SafeRequest("page", "get");
  12. $tab = SafeRequest("tab", "get");
  13. // 如果没有指定tab,默认显示应用版本tab
  14. if (empty($tab)) {
  15. $tab = "version";
  16. }
  17. $fnum = $this->action != "super" ? $row["in_deduct"] : 1;
  18. $ftype = $this->action != "super" ? IN_POINTNAME : "设备";
  19. $durl = getlink($row["in_id"], $this->action == "super");
  20. ?>
  21. <!DOCTYPE html>
  22. <html lang="">
  23. <head>
  24. <meta charset="utf-8">
  25. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" />
  26. <meta name="keywords" content="<?php echo IN_KEYWORDS; ?>" />
  27. <meta name="description" content="<?php echo IN_DESCRIPTION; ?>" />
  28. <title><?php echo $row["in_name"]; ?> - 应用详情 - <?php echo IN_NAME; ?></title>
  29. <?php
  30. $this->static_();
  31. ?>
  32. <link rel="stylesheet" href="/static/index/css/apps-detail.css" />
  33. </head>
  34. <body>
  35. <?php
  36. $this->header();
  37. ?>
  38. <link rel="stylesheet" href="/static/pack/font-awesome-4.7.0/css/font-awesome.css" />
  39. <link rel="stylesheet" type="text/css" href="/static/index/css/jquery.datetimepicker.css?20190530" />
  40. <script src="/static/index/js/jquery.form.js"></script>
  41. <script src="/static/index/js/jquery.datetimepicker.js?20190530"></script>
  42. <div class="release-app-wrap">
  43. <div class="container">
  44. <div class="release-app2">
  45. <div class="crumbs">
  46. <a href="/index/apps/apps">我的应用</a>
  47. <span>/</span>
  48. <a href="/index/apps/apps">应用列表</a>
  49. <span>/</span>
  50. <?php echo $row["in_name"]; ?>
  51. </div>
  52. <div class="row clearfix">
  53. <?php
  54. $this->publish_app_list();
  55. ?> <div class="col-sm-10">
  56. <div class="aside-right">
  57. <div class="app-details app-details2">
  58. <?php
  59. $this->publish_top($row);
  60. ?> <div class="app-information">
  61. <hr>
  62. <div class="details-bottom">
  63. <div class="d-table-wrap">
  64. <div class="table-responsive">
  65. <table>
  66. <tr>
  67. <th>
  68. <span class="th-line">包名(BundleID)</span>
  69. </th>
  70. <th>
  71. <span class="th-line">状态</span>
  72. </th>
  73. <th>
  74. <span class="th-line">下载链接</span>
  75. </th>
  76. </tr>
  77. <tr>
  78. <td>
  79. <span id="copy" class="bundle-length bundle-length1"
  80. data-container="body" data-toggle="popover"
  81. data-placement="bottom"
  82. data-content="<?php echo $row["in_bid"]; ?>"
  83. data-trigger="hover"><?php echo $row["in_bid"]; ?></span>
  84. <span class="copy top-5" data-clipboard-action="copy"
  85. data-clipboard-target="#copy">复制</span>
  86. </td>
  87. <td>
  88. <div>
  89. <?php echo [-1 => "审核中", "正常", "封禁"][$row["in_applock"]]; ?> </div>
  90. </td>
  91. <td>
  92. <?php
  93. if (!$row["in_applock"]) {
  94. ?> <div class="test-download clearfix">
  95. <a href="<?php echo $durl; ?>"
  96. target="_blank"
  97. class="fl link bundle-length1"
  98. data-container="body" data-toggle="popover"
  99. data-placement="bottom"
  100. data-content="<?php echo $durl; ?>"
  101. data-trigger="hover"><?php echo $durl; ?></a>
  102. <span class="copy top-5" data-clipboard-text="<?php echo $durl; ?>">复制</span>
  103. </div>
  104. <?php
  105. } else {
  106. ?><?php echo [-1 => "审核中", "正常", "封禁"][$row["in_applock"]]; ?><?php
  107. }
  108. ?> </td>
  109. </tr>
  110. </table>
  111. <?php
  112. if ($row["in_form"] == "iOS" && strstr($row["in_app"], "ipa") && $this->action != "super") {
  113. ?> <table>
  114. <tr>
  115. <th>
  116. <span class="th-line" title="苹果企业证书公司名称">公司名称</span>
  117. </th>
  118. <th>
  119. <span class="th-line" title="苹果企业证书集团信息">集团信息</span>
  120. </th>
  121. <th>
  122. <span class="th-line">下载二维码</span>
  123. </th>
  124. </tr>
  125. <tr>
  126. <td>
  127. <span id="copy1" class="bundle-length bundle-length1"
  128. data-container="body" data-toggle="popover"
  129. data-placement="bottom"
  130. data-content="<?php echo $row["in_nick"]; ?>"
  131. data-trigger="hover"><?php echo $row["in_nick"]; ?></span>
  132. <span class="copy top-5"
  133. data-clipboard-action="copy"
  134. data-clipboard-target="#copy1">复制</span>
  135. </td>
  136. <td>
  137. <span id="copy2" class="bundle-length bundle-length1"
  138. data-container="body" data-toggle="popover"
  139. data-placement="bottom"
  140. data-content="<?php echo $row["in_team"]; ?>"
  141. data-trigger="hover"><?php echo $row["in_team"]; ?></span>
  142. <span class="copy top-5"
  143. data-clipboard-action="copy"
  144. data-clipboard-target="#copy2">复制</span>
  145. </td>
  146. <td>
  147. <span href="javascript:;" class="more-wrap">
  148. <a class="more">&nbsp;</a>
  149. <img src="/qrcode?link=<?php echo $durl; ?>">
  150. </span>
  151. </td>
  152. </tr>
  153. </table>
  154. <?php
  155. }
  156. ?> <table>
  157. <tr>
  158. <th>
  159. <span class="th-line" title="当前app下载次数">下载次数</span>
  160. </th>
  161. <th>
  162. <span class="th-line">下载扣除</span>
  163. </th>
  164. <?php
  165. if (IN_SIGN && $row["in_form"] == "iOS") {
  166. ?> <th>
  167. <span class="th-line">签名期限</span>
  168. </th>
  169. <?php
  170. } else {
  171. ?><th></th>
  172. <?php } ?>
  173. </td>
  174. </tr>
  175. <tr>
  176. <td>
  177. <div class="bundle-length bundle-length2"
  178. data-container="body"
  179. data-toggle="popover" data-placement="bottom"
  180. data-content="已下载<?php echo $row["in_downloads"]; ?>次"
  181. data-trigger="hover">
  182. <?php echo $row["in_downloads"]; ?> </div>
  183. </td>
  184. <td>
  185. <div class="bundle-length bundle-length2"
  186. data-container="body"
  187. data-toggle="popover" data-placement="bottom"
  188. data-content="单次下载扣除<?php echo $fnum; ?><?php echo $ftype; ?>"
  189. data-trigger="hover">
  190. <?php echo $fnum; ?><?php echo $ftype; ?> </div>
  191. </td>
  192. <?php
  193. if (IN_SIGN && $row["in_form"] == "iOS") {
  194. ?> <td>
  195. <div class="test-download clearfix">
  196. <a href="/index/publish_sign?id=<?php echo bees_encrypt($row["in_id"]); ?>"
  197. class="fl link bundle-length1"
  198. data-container="body"
  199. data-toggle="popover"
  200. data-placement="bottom"
  201. data-content="<?php echo $row["in_sign"] ? date("Y-m-d H:i:s", $row["in_sign"]) : "未开通在线签名"; ?>"
  202. data-trigger="hover"><?php echo $row["in_sign"] ? date("Y-m-d H:i:s", $row["in_sign"]) : "未开通在线签名"; ?></a>
  203. </div>
  204. </td>
  205. <?php
  206. } else {
  207. ?><th></th>
  208. <?php } ?>
  209. </tr>
  210. </table>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. <!-- 应用版本 基本设置 高级设置 模板设置 下载明细 -->
  216. <div class="tabs">
  217. <ul class="nav nav-tabs" role="tablist">
  218. <li role="presentation" class="<?php echo ($tab == 'version') ? 'active' : ''; ?>">
  219. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=version" aria-controls="tab-version" role="tab">应用版本</a>
  220. </li>
  221. <li role="presentation" class="<?php echo ($tab == 'basic') ? 'active' : ''; ?>">
  222. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=basic" aria-controls="tab-basic" role="tab">基本设置</a>
  223. </li>
  224. <li role="presentation" class="<?php echo ($tab == 'advanced') ? 'active' : ''; ?>">
  225. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=advanced" aria-controls="tab-advanced" role="tab">高级设置</a>
  226. </li>
  227. <li role="presentation" class="<?php echo ($tab == 'template') ? 'active' : ''; ?>">
  228. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=template" aria-controls="tab-template" role="tab">模板设置</a>
  229. </li>
  230. <li role="presentation" class="<?php echo ($tab == 'download') ? 'active' : ''; ?>">
  231. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=download" aria-controls="tab-download" role="tab">下载明细</a>
  232. </li>
  233. </ul>
  234. <div class="tab-content">
  235. <?php if ($tab == 'version'): ?>
  236. <div role="tabpanel" class="tab-pane active" id="tab-version">
  237. <?php include_once 'publish_tab_version.php'; ?>
  238. </div>
  239. <?php endif; ?>
  240. <?php if ($tab == 'basic'): ?>
  241. <div role="tabpanel" class="tab-pane active" id="tab-basic">
  242. <?php include_once 'publish_tab_basic.php'; ?>
  243. </div>
  244. <?php endif; ?>
  245. <?php if ($tab == 'advanced'): ?>
  246. <div role="tabpanel" class="tab-pane active" id="tab-advanced">
  247. <?php include_once 'publish_tab_advanced.php'; ?>
  248. </div>
  249. <?php endif; ?>
  250. <?php if ($tab == 'template'): ?>
  251. <div role="tabpanel" class="tab-pane active" id="tab-template">
  252. <?php include_once 'publish_tab_template.php'; ?>
  253. </div>
  254. <?php endif; ?>
  255. <?php if ($tab == 'download'): ?>
  256. <div role="tabpanel" class="tab-pane active" id="tab-download">
  257. <?php include_once 'publish_tab_download.php'; ?>
  258. </div>
  259. <?php endif; ?>
  260. </div>
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. </div>
  266. </div>
  267. </div>
  268. </div>
  269. <div class="modal fade" id="adhocUDIDBox" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  270. aria-hidden="true">
  271. <div class="modal-dialog">
  272. <div class="modal-content">
  273. <div class="modal-header">
  274. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  275. aria-hidden="true">&times;</span>
  276. </button>
  277. <h4 class="modal-title" id="myModalLabel">UDIDs</h4>
  278. </div>
  279. <div class="modal-body">
  280. <code><?php
  281. $row["in_udids"] = str_replace(",", "</code><br /><code>", $row["in_udids"]);
  282. ?><?php echo $row["in_udids"]; ?></code><br />
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. <div class="modal fade" role="dialog" id="updateModal">
  288. <div class="modal-dialog" role="document">
  289. <div class="modal-content">
  290. <div class="modal-header">
  291. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
  292. </button>
  293. <h4>版本编辑</h4>
  294. </div>
  295. <div class="modal-body">
  296. <div class="app-details-update">
  297. <div class="form-group clearfix">
  298. <label class="col-sm-2 control-label">更新说明</label>
  299. <div class="col-sm-10">
  300. <textarea rows="6" name="desc" class="form-control"></textarea>
  301. </div>
  302. </div>
  303. </div>
  304. </div>
  305. <div class="modal-footer">
  306. <button type="button" class="ms-btn ms-btn-primary w120 plugin-save mr20" data-dismiss="modal">
  307. 保存
  308. </button>
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. <?php
  314. $this->inc_merge();
  315. ?> <script src="/static/index/js/clipboard.min.js"></script>
  316. <script>
  317. var clipboard = new ClipboardJS('.copy-btn');
  318. clipboard.on('success', function(e) {
  319. alert('复制成功');
  320. });
  321. clipboard.on('error', function(e) {
  322. alert('复制失败');
  323. });
  324. var app_id = '<?php echo bees_encrypt($id); ?>';
  325. $('.icon-fabu').click(function() {
  326. var history_id = $(this).parent().find('input').val();
  327. $.post('/index/ajax_profile/setUseHistory', {
  328. id: history_id,
  329. app_id: app_id
  330. }, function(data) {
  331. if (data.code == 200) {
  332. alert('发布版本成功', function() {
  333. window.location.reload();
  334. });
  335. return true;
  336. }
  337. }, 'json');
  338. });
  339. $('.icon-shanchu').click(function() {
  340. var history_id = $(this).parent().find('input').val();
  341. alert('<b>你确定要删除该版本信息吗?</b><br/>删除后将无法恢复!', function() {
  342. $.post('/index/ajax_profile/delHistory', {
  343. 'id': history_id,
  344. app_id: app_id
  345. }, function(data) {
  346. if (data.code == 200) {
  347. alert('删除版本成功', function() {
  348. window.location.reload();
  349. });
  350. return true;
  351. } else {
  352. alert(data.msg);
  353. }
  354. }, 'json');
  355. }, function() {}, 'center', '删除', '取消');
  356. });
  357. $('.icon-edit').click(function() {
  358. var history_id = $(this).parent().find('input').val();
  359. $.get('/index/ajax_profile/getHistory?id=' + history_id + '&app_id=' + app_id, function(data) {
  360. if (data.code != 200) {
  361. alert('系统繁忙,请稍后重试');
  362. return true;
  363. }
  364. $("#updateModal textarea[name='desc']").val('').val(data.data.desc);
  365. $('#updateModal').modal('show');
  366. $('#updateModal .ms-btn-primary').unbind().click(function() {
  367. var desc = $("#updateModal textarea[name='desc']").val();
  368. alert(desc);
  369. $.post('/index/ajax_profile/updateHistory', {
  370. 'id': history_id,
  371. app_id: app_id,
  372. desc: desc
  373. }, function(data) {
  374. if (data.code == 200) {
  375. alert('更新说明操作成功', function() {
  376. window.location.reload();
  377. });
  378. return true;
  379. }
  380. }, 'json');
  381. })
  382. }, 'json');
  383. });
  384. //自动删除版本
  385. var del_vid = <?php echo $del_vid; ?>;
  386. if (del_vid > 0) {
  387. $.post('/index/ajax_profile/delHistory', {
  388. 'id': del_vid,
  389. app_id: app_id
  390. }, function(data) {
  391. if (data.code == 200) {
  392. return true;
  393. } else {
  394. console.log(data.msg);
  395. }
  396. }, 'json');
  397. }
  398. </script>
  399. <?php
  400. $this->footer();
  401. ?>
  402. </body>
  403. </html>
  404. <?php
  405. }
  406. }