publish_detail.php 39 KB

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