publish_detail.php 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  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. <link rel="stylesheet" href="/static/index/css/apps.css">
  43. <div class="release-app-wrap">
  44. <div class="container">
  45. <div class="release-app2">
  46. <div class="crumbs">
  47. <a href="/index/apps/apps">我的应用</a>
  48. <span>/</span>
  49. <a href="/index/apps/apps">应用列表</a>
  50. <span>/</span>
  51. <?php echo $row["in_name"]; ?>
  52. </div>
  53. <div class="row clearfix">
  54. <?php
  55. $this->publish_app_list();
  56. ?> <div class="col-sm-10">
  57. <div class="aside-right">
  58. <div class="app-details app-details2">
  59. <?php
  60. $this->publish_top($row);
  61. ?> <div class="app-information">
  62. <hr class="hidden-xs">
  63. <hr class="visible-xs" style="
  64. margin-left: -50%;
  65. width: 200%;
  66. ">
  67. <div class="details-bottom">
  68. <div class="d-table-wrap">
  69. <div class="table-responsive hidden-xs">
  70. <table>
  71. <tr>
  72. <th><span class="th-line">包名(BundleID)</span></th>
  73. <th><span class="th-line">状态</span></th>
  74. <th><span class="th-line">下载链接</span></th>
  75. </tr>
  76. <tr>
  77. <td>
  78. <span id="copy" class="bundle-length bundle-length1"
  79. data-container="body" data-toggle="popover"
  80. data-placement="bottom"
  81. data-content="<?php echo $row["in_bid"]; ?>"
  82. data-trigger="hover"><?php echo $row["in_bid"]; ?></span>
  83. <span class="copy top-5" data-clipboard-action="copy"
  84. data-clipboard-target="#copy">复制</span>
  85. </td>
  86. <td>
  87. <div>
  88. <?php echo [-1 => "审核中", "正常", "封禁"][$row["in_applock"]]; ?> </div>
  89. </td>
  90. <td>
  91. <?php if (!$row["in_applock"]) { ?>
  92. <div class="test-download clearfix">
  93. <a href="<?php echo $durl; ?>"
  94. target="_blank"
  95. class="fl link bundle-length1"
  96. data-container="body" data-toggle="popover"
  97. data-placement="bottom"
  98. data-content="<?php echo $durl; ?>"
  99. data-trigger="hover"><?php echo $durl; ?></a>
  100. <span class="copy top-5" data-clipboard-text="<?php echo $durl; ?>">复制</span>
  101. </div>
  102. <?php } else { ?>
  103. <?php echo [-1 => "审核中", "正常", "封禁"][$row["in_applock"]]; ?>
  104. <?php } ?>
  105. </td>
  106. </tr>
  107. </table>
  108. <?php
  109. if ($row["in_form"] == "iOS" && strstr($row["in_app"], "ipa") && $this->action != "super") {
  110. ?> <table>
  111. <tr>
  112. <th>
  113. <span class="th-line" title="苹果企业证书公司名称">公司名称</span>
  114. </th>
  115. <th>
  116. <span class="th-line" title="苹果企业证书集团信息">集团信息</span>
  117. </th>
  118. <th>
  119. <span class="th-line">下载二维码</span>
  120. </th>
  121. </tr>
  122. <tr>
  123. <td>
  124. <span id="copy1" class="bundle-length bundle-length1"
  125. data-container="body" data-toggle="popover"
  126. data-placement="bottom"
  127. data-content="<?php echo $row["in_nick"]; ?>"
  128. data-trigger="hover"><?php echo $row["in_nick"]; ?></span>
  129. <span class="copy top-5"
  130. data-clipboard-action="copy"
  131. data-clipboard-target="#copy1">复制</span>
  132. </td>
  133. <td>
  134. <span id="copy2" class="bundle-length bundle-length1"
  135. data-container="body" data-toggle="popover"
  136. data-placement="bottom"
  137. data-content="<?php echo $row["in_team"]; ?>"
  138. data-trigger="hover"><?php echo $row["in_team"]; ?></span>
  139. <span class="copy top-5"
  140. data-clipboard-action="copy"
  141. data-clipboard-target="#copy2">复制</span>
  142. </td>
  143. <td>
  144. <span href="javascript:;" class="more-wrap">
  145. <a class="more">&nbsp;</a>
  146. <img src="/qrcode?link=<?php echo $durl; ?>">
  147. </span>
  148. </td>
  149. </tr>
  150. </table>
  151. <?php
  152. }
  153. ?> <table>
  154. <tr>
  155. <th>
  156. <span class="th-line" title="当前app下载次数">下载次数</span>
  157. </th>
  158. <th>
  159. <span class="th-line">下载扣除</span>
  160. </th>
  161. <?php
  162. if (IN_SIGN && $row["in_form"] == "iOS") {
  163. ?> <th>
  164. <span class="th-line">签名期限</span>
  165. </th>
  166. <?php
  167. } else {
  168. ?><th></th>
  169. <?php } ?>
  170. </td>
  171. </tr>
  172. <tr>
  173. <td>
  174. <div class="bundle-length bundle-length2"
  175. data-container="body"
  176. data-toggle="popover" data-placement="bottom"
  177. data-content="已下载<?php echo $row["in_downloads"]; ?>次"
  178. data-trigger="hover">
  179. <?php echo $row["in_downloads"]; ?> </div>
  180. </td>
  181. <td>
  182. <div class="bundle-length bundle-length2"
  183. data-container="body"
  184. data-toggle="popover" data-placement="bottom"
  185. data-content="单次下载扣除<?php echo $fnum; ?><?php echo $ftype; ?>"
  186. data-trigger="hover">
  187. <?php echo $fnum; ?><?php echo $ftype; ?> </div>
  188. </td>
  189. <?php
  190. if (IN_SIGN && $row["in_form"] == "iOS") {
  191. ?> <td>
  192. <div class="test-download clearfix">
  193. <a href="/index/publish_sign?id=<?php echo bees_encrypt($row["in_id"]); ?>"
  194. class="fl link bundle-length1"
  195. data-container="body"
  196. data-toggle="popover"
  197. data-placement="bottom"
  198. data-content="<?php echo $row["in_sign"] ? date("Y-m-d H:i:s", $row["in_sign"]) : "未开通在线签名"; ?>"
  199. data-trigger="hover"><?php echo $row["in_sign"] ? date("Y-m-d H:i:s", $row["in_sign"]) : "未开通在线签名"; ?></a>
  200. </div>
  201. </td>
  202. <?php
  203. } else {
  204. ?><th></th>
  205. <?php } ?>
  206. </tr>
  207. </table>
  208. </div>
  209. <div class="table-responsive visible-xs">
  210. <!-- 第一行:包名 + 公司名称 -->
  211. <div class="info-container">
  212. <div class="info-group" style="width: 55%;">
  213. <span class="info-label">包名(BundleID)</span>
  214. <span class="info-value"
  215. id="copy-bid"
  216. data-popover="true"
  217. data-content="<?= htmlspecialchars($row['in_bid']) ?>">
  218. <?= htmlspecialchars($row['in_bid']) ?>
  219. </span>
  220. <button class="info-copy"
  221. data-target="#copy-bid">复制</button>
  222. </div>
  223. <?php if ($row["in_form"] == "iOS" && strstr($row["in_app"], "ipa") && $this->action != "super"): ?>
  224. <div class="info-group" style="width: 45%;">
  225. <span class="info-label" title="苹果企业证书公司名称">公司名称</span>
  226. <span class="info-value"
  227. id="copy-nick"
  228. data-popover="true"
  229. data-content="<?= htmlspecialchars($row['in_nick']) ?>">
  230. <?= htmlspecialchars($row['in_nick']) ?>
  231. </span>
  232. <button class="info-copy"
  233. data-target="#copy-nick">复制</button>
  234. </div>
  235. <?php endif; ?>
  236. </div>
  237. <!-- 第二行:下载次数 + 状态 + 集团信息 -->
  238. <div class="info-container">
  239. <div class="info-group" style="width: 30%;">
  240. <span class="info-label" title="当前app下载次数">下载次数</span>
  241. <span class="info-value"
  242. data-popover="true"
  243. data-content="已下载<?php echo $row["in_downloads"]; ?>次">
  244. <?php echo $row["in_downloads"]; ?>
  245. </span>
  246. </div>
  247. <div class="info-group" style="width: 25%;">
  248. <span class="info-label">状态</span>
  249. <span class="info-value">
  250. <?php echo [-1 => "审核中", "正常", "封禁"][$row["in_applock"]]; ?>
  251. </span>
  252. </div>
  253. <?php if ($row["in_form"] == "iOS" && strstr($row["in_app"], "ipa") && $this->action != "super"): ?>
  254. <div class="info-group" style="width: 45%;">
  255. <span class="info-label" title="苹果企业证书集团信息">集团信息</span>
  256. <span class="info-value"
  257. id="copy-team"
  258. data-popover="true"
  259. data-content="<?= htmlspecialchars($row['in_team']) ?>">
  260. <?= htmlspecialchars($row['in_team']) ?>
  261. </span>
  262. <button class="info-copy"
  263. data-target="#copy-team">复制</button>
  264. </div>
  265. <?php endif; ?>
  266. </div>
  267. <!-- 第三行:签名期限 + 下载扣除 -->
  268. <div class="info-container">
  269. <?php if (IN_SIGN && $row["in_form"] == "iOS"): ?>
  270. <div class="info-group" style="width: 55%;">
  271. <span class="info-label">签名期限</span>
  272. <span class="info-value">
  273. <a href="/index/publish_sign?id=<?php echo bees_encrypt($row["in_id"]); ?>"
  274. data-popover="true"
  275. data-content="<?php echo $row["in_sign"] ? date("Y-m-d H:i:s", $row["in_sign"]) : "未开通在线签名"; ?>">
  276. <?php echo $row["in_sign"] ? date("Y-m-d H:i:s", $row["in_sign"]) : "未开通在线签名"; ?>
  277. </a>
  278. </span>
  279. </div>
  280. <?php endif; ?>
  281. <div class="info-group" style="width: <?php echo (IN_SIGN && $row["in_form"] == "iOS") ? '45%' : '100%'; ?>;">
  282. <span class="info-label">下载扣除</span>
  283. <span class="info-value"
  284. data-popover="true"
  285. data-content="单次下载扣除<?php echo $fnum; ?><?php echo $ftype; ?>">
  286. <?php echo $fnum; ?><?php echo $ftype; ?>
  287. </span>
  288. </div>
  289. </div>
  290. <div class="info-container">
  291. <div class="info-group" style="width: 100%;">
  292. <span class="info-label">下载链接</span>
  293. <span class="info-value">
  294. <?php if (!$row["in_applock"]): ?>
  295. <a href="<?php echo $durl; ?>"
  296. target="_blank"
  297. data-popover="true"
  298. data-content="<?php echo $durl; ?>">
  299. <?php echo $durl; ?>
  300. </a>
  301. <button class="info-copy"
  302. data-clipboard-text="<?php echo $durl; ?>">复制</button>
  303. <?php else: ?>
  304. <?php echo [-1 => "审核中", "正常", "封禁"][$row["in_applock"]]; ?>
  305. <?php endif; ?>
  306. </span>
  307. </div>
  308. </div>
  309. <!-- 第五行:下载二维码 -->
  310. <?php if (!$row["in_applock"] && $row["in_form"] == "iOS" && strstr($row["in_app"], "ipa") && $this->action != "super"): ?>
  311. <div class="info-container">
  312. <div class="info-group" style="width: 100%;">
  313. <span class="info-label">下载二维码</span>
  314. <span class="info-value">
  315. <span href="javascript:;" class="more-wrap">
  316. <a class="more">&nbsp;</a>
  317. <img src="/qrcode?link=<?php echo $durl; ?>">
  318. </span>
  319. </span>
  320. </div>
  321. </div>
  322. <?php endif; ?>
  323. </div>
  324. </div>
  325. </div>
  326. </div>
  327. <!-- 应用版本 基本设置 高级设置 模板设置 下载明细 -->
  328. <div class="tabs">
  329. <ul class="nav nav-tabs" role="tablist">
  330. <li role="presentation" class="<?php echo ($tab == 'version') ? 'active' : ''; ?>">
  331. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=version" aria-controls="tab-version" role="tab">应用版本</a>
  332. </li>
  333. <li role="presentation" class="<?php echo ($tab == 'basic') ? 'active' : ''; ?>">
  334. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=basic" aria-controls="tab-basic" role="tab">基本设置</a>
  335. </li>
  336. <li role="presentation" class="<?php echo ($tab == 'advanced') ? 'active' : ''; ?>">
  337. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=advanced" aria-controls="tab-advanced" role="tab">高级设置</a>
  338. </li>
  339. <li role="presentation" class="<?php echo ($tab == 'template') ? 'active' : ''; ?>">
  340. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=template" aria-controls="tab-template" role="tab">模板设置</a>
  341. </li>
  342. <li role="presentation" class="<?php echo ($tab == 'download') ? 'active' : ''; ?>">
  343. <a href="?id=<?php echo bees_encrypt($id); ?>&tab=download" aria-controls="tab-download" role="tab">下载明细</a>
  344. </li>
  345. </ul>
  346. <div class="tab-content">
  347. <?php if ($tab == 'version'): ?>
  348. <div role="tabpanel" class="tab-pane active" id="tab-version">
  349. <?php include_once 'publish_tab_version.php'; ?>
  350. </div>
  351. <?php endif; ?>
  352. <?php if ($tab == 'basic'): ?>
  353. <div role="tabpanel" class="tab-pane active" id="tab-basic">
  354. <?php include_once 'publish_tab_basic.php'; ?>
  355. </div>
  356. <?php endif; ?>
  357. <?php if ($tab == 'advanced'): ?>
  358. <div role="tabpanel" class="tab-pane active" id="tab-advanced">
  359. <?php include_once 'publish_tab_advanced.php'; ?>
  360. </div>
  361. <?php endif; ?>
  362. <?php if ($tab == 'template'): ?>
  363. <div role="tabpanel" class="tab-pane active" id="tab-template">
  364. <?php include_once 'publish_tab_template.php'; ?>
  365. </div>
  366. <?php endif; ?>
  367. <?php if ($tab == 'download'): ?>
  368. <div role="tabpanel" class="tab-pane active" id="tab-download">
  369. <?php include_once 'publish_tab_download.php'; ?>
  370. </div>
  371. <?php endif; ?>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. </div>
  381. <div class="modal fade" id="adhocUDIDBox" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  382. aria-hidden="true">
  383. <div class="modal-dialog">
  384. <div class="modal-content">
  385. <div class="modal-header">
  386. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  387. aria-hidden="true">&times;</span>
  388. </button>
  389. <h4 class="modal-title" id="myModalLabel">UDIDs</h4>
  390. </div>
  391. <div class="modal-body">
  392. <code><?php
  393. $row["in_udids"] = str_replace(",", "</code><br /><code>", $row["in_udids"]);
  394. ?><?php echo $row["in_udids"]; ?></code><br />
  395. </div>
  396. </div>
  397. </div>
  398. </div>
  399. <div class="modal fade" role="dialog" id="updateModal">
  400. <div class="modal-dialog" role="document">
  401. <div class="modal-content">
  402. <div class="modal-header">
  403. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
  404. </button>
  405. <h4>版本编辑</h4>
  406. </div>
  407. <div class="modal-body">
  408. <div class="app-details-update">
  409. <div class="form-group clearfix">
  410. <label class="col-sm-2 control-label">更新说明</label>
  411. <div class="col-sm-10">
  412. <textarea rows="6" name="desc" class="form-control"></textarea>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. <div class="modal-footer">
  418. <button type="button" class="ms-btn ms-btn-primary w120 plugin-save mr20" data-dismiss="modal">
  419. 保存
  420. </button>
  421. </div>
  422. </div>
  423. </div>
  424. </div>
  425. <?php
  426. $this->inc_merge();
  427. ?> <script src="/static/index/js/clipboard.min.js"></script>
  428. <script>
  429. var clipboard = new ClipboardJS('.copy-btn');
  430. clipboard.on('success', function(e) {
  431. alert('复制成功');
  432. });
  433. clipboard.on('error', function(e) {
  434. alert('复制失败');
  435. });
  436. var app_id = '<?php echo bees_encrypt($id); ?>';
  437. $('.icon-fabu').click(function() {
  438. var history_id = $(this).parent().find('input').val();
  439. $.post('/index/ajax_profile/setUseHistory', {
  440. id: history_id,
  441. app_id: app_id
  442. }, function(data) {
  443. if (data.code == 200) {
  444. alert('发布版本成功', function() {
  445. window.location.reload();
  446. });
  447. return true;
  448. }
  449. }, 'json');
  450. });
  451. $('.icon-shanchu').click(function() {
  452. var history_id = $(this).parent().find('input').val();
  453. alert('<b>你确定要删除该版本信息吗?</b><br/>删除后将无法恢复!', function() {
  454. $.post('/index/ajax_profile/delHistory', {
  455. 'id': history_id,
  456. app_id: app_id
  457. }, function(data) {
  458. if (data.code == 200) {
  459. alert('删除版本成功', function() {
  460. window.location.reload();
  461. });
  462. return true;
  463. } else {
  464. alert(data.msg);
  465. }
  466. }, 'json');
  467. }, function() {}, 'center', '删除', '取消');
  468. });
  469. $('.icon-edit').click(function() {
  470. var history_id = $(this).parent().find('input').val();
  471. $.get('/index/ajax_profile/getHistory?id=' + history_id + '&app_id=' + app_id, function(data) {
  472. if (data.code != 200) {
  473. alert('系统繁忙,请稍后重试');
  474. return true;
  475. }
  476. $("#updateModal textarea[name='desc']").val('').val(data.data.desc);
  477. $('#updateModal').modal('show');
  478. $('#updateModal .ms-btn-primary').unbind().click(function() {
  479. var desc = $("#updateModal textarea[name='desc']").val();
  480. alert(desc);
  481. $.post('/index/ajax_profile/updateHistory', {
  482. 'id': history_id,
  483. app_id: app_id,
  484. desc: desc
  485. }, function(data) {
  486. if (data.code == 200) {
  487. alert('更新说明操作成功', function() {
  488. window.location.reload();
  489. });
  490. return true;
  491. }
  492. }, 'json');
  493. })
  494. }, 'json');
  495. });
  496. //自动删除版本
  497. var del_vid = <?php echo $del_vid; ?>;
  498. if (del_vid > 0) {
  499. $.post('/index/ajax_profile/delHistory', {
  500. 'id': del_vid,
  501. app_id: app_id
  502. }, function(data) {
  503. if (data.code == 200) {
  504. return true;
  505. } else {
  506. console.log(data.msg);
  507. }
  508. }, 'json');
  509. }
  510. </script>
  511. <?php
  512. $this->footer();
  513. ?>
  514. </body>
  515. </html>
  516. <?php
  517. }
  518. }