publish.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <?php
  2. namespace app\index;
  3. class publish extends BaseUser
  4. {
  5. function index()
  6. {
  7. $_var_0 = $_var_1 = $_var_2 = "";
  8. if (SafeRequest("id", "get")) {
  9. $_var_0 = SafeRequest("id", "get");
  10. $_var_3 = db("appid")->where("in_uid", $this->userid)->where("in_id", bees_decrypt($_var_0))->find();
  11. $_var_3 || exit(header("location:" . IN_PATH));
  12. $_var_1 = $_var_3["in_bid"];
  13. $_var_2 = $_var_3["in_form"] == "Android" ? "apk" : "ipa";
  14. }
  15. ?>
  16. <!DOCTYPE html>
  17. <html lang="">
  18. <head>
  19. <meta charset="utf-8">
  20. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" />
  21. <meta name="keywords" content="<?php echo IN_KEYWORDS; ?>" />
  22. <meta name="description" content="<?php echo IN_DESCRIPTION; ?>" />
  23. <title>上传app - <?php echo IN_NAME; ?> - 免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发</title>
  24. <?php
  25. $this->static_();
  26. ?>
  27. <style>
  28. .upload-file .upload-btn .iconfont.icon-upload {
  29. position: relative;
  30. padding-left: 20px;
  31. }
  32. .upload-file .iconfont.icon-upload::before {
  33. content: '';
  34. position: absolute;
  35. top: 4px;
  36. left: 0;
  37. width: 20px;
  38. height: 20px;
  39. background: url(/static/index/image/my-app/icon-upload.png) center/100% no-repeat;
  40. }
  41. #_drop1, #_drop2 {
  42. color: rgba(21, 21, 21, 1);
  43. font-family: Source Han Sans SC;
  44. font-weight: 400;
  45. font-size: 16px;
  46. line-height: 25px;
  47. }
  48. #_drop2 span {
  49. color: rgba(33, 104, 251, 1);
  50. }
  51. .release-app2 .qq-upload-button-selector {
  52. margin-top: 0 !important;
  53. }
  54. .release-app2 .warn-prompt-wrap {
  55. color: rgba(143, 149, 159, 1);
  56. font-family: Source Han Sans SC;
  57. font-weight: 500;
  58. font-size: 13px;
  59. line-height: 20px;
  60. margin-top: 14px;
  61. }
  62. .release-app2 .warn-prompt-wrap span {
  63. color: rgba(33, 104, 251, 1);
  64. }
  65. .release-app2 .warn-prompt-wrap {
  66. padding-bottom: 167px;
  67. }
  68. .upload-app-icon img {
  69. border: 1px solid rgba(221, 221, 221, 1);
  70. width: 100px;
  71. height: 100px;
  72. border-radius: 24px;
  73. }
  74. .qq-upload-list-selector {
  75. margin-top: 12px !important;
  76. }
  77. .release-app2 .qq-upload-list li {
  78. padding: 0;
  79. }
  80. .app-name {
  81. margin-bottom: 12px;
  82. color: rgba(0, 0, 0, 1);
  83. font-family: Source Han Sans SC;
  84. font-weight: 700;
  85. font-size: 16px;
  86. line-height: 25px;
  87. margin-bottom: 12px;
  88. }
  89. .tips {
  90. color: rgba(0, 0, 0, 1);
  91. font-family: Source Han Sans SC;
  92. font-weight: 400;
  93. font-size: 14px;
  94. line-height: 25px;
  95. margin-bottom: 20px;
  96. }
  97. .release-app .progress {
  98. margin-top: 20px !important;
  99. width: 854px;
  100. height: 20px !important;
  101. margin: 0 auto;
  102. background-color: rgba(234, 236, 239, 1);
  103. border-radius: 0;
  104. margin-bottom: 20px;
  105. max-width: 80%;
  106. }
  107. .release-app .progress .progress-bar {
  108. background-color: rgba(33, 104, 251, 1) !important;
  109. border-radius: 0;
  110. height: 100% !important;
  111. animation: unset;
  112. background-image: unset;
  113. }
  114. .qq-upload-size {
  115. color: rgba(143, 149, 159, 1);
  116. font-family: Source Han Sans SC;
  117. font-weight: 400;
  118. font-size: 16px;
  119. line-height: 25px;
  120. margin-bottom: 30px;
  121. }
  122. #changest {
  123. width: 62px;
  124. height: 34px;
  125. border-radius: 4px;
  126. font-family: Source Han Sans SC;
  127. font-weight: 500;
  128. font-size: 16px;
  129. line-height: 34px;
  130. background-color: rgba(33, 104, 251, 1);
  131. color: rgba(255, 255, 255, 1);
  132. border: unset;
  133. padding: 0 10px;
  134. }
  135. .release-app2 .tag-box-v5 {
  136. margin: 0;
  137. }
  138. #container {
  139. height: 450px !important;
  140. position: relative;
  141. display: flex;
  142. justify-content: center;
  143. align-items: center;
  144. height: 100%;
  145. }
  146. .qq-uploader-selector {
  147. margin-bottom: 20px;
  148. height: auto!important;
  149. }
  150. </style>
  151. </head>
  152. <body>
  153. <?php
  154. $this->header();
  155. $_var_4 = $this->action == "apps" && IN_REMOTE && (IN_MANDATORY_REMOTE || $this->user["in_svip"] > 0);
  156. ?>
  157. <link rel="stylesheet" href="/static/index/css/fineuploader.css" />
  158. <div class="release-app-wrap">
  159. <div class="container">
  160. <div class="release-app2 ">
  161. <div class="crumbs">
  162. <a href="/index/apps/apps">我的应用</a><span>/</span>上传应用
  163. </div>
  164. <div class="row clearfix">
  165. <?php
  166. $this->left();
  167. ?> <div class="col-sm-10">
  168. <div class="aside-right">
  169. <div class="release-app">
  170. <div class="upload-file">
  171. <div class="row tag-box tag-box-v5" id="container"
  172. style="height: 450px !important;">
  173. <div class="span12" style="max-width: 100%;">
  174. <div id="bootstrapped-fine-uploader">
  175. </div>
  176. <div class="qq-uploader-selector qq-uploader span12">
  177. <div id="upprocess" style="display: none;">
  178. <span class="qq-drop-processing-selector qq-drop-processing">
  179. <span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
  180. </span>
  181. <div class="upload-app-icon" id="loading">
  182. <img src="<?php echo IN_PATH; ?>static/index/image/loadicon.png">
  183. </div>
  184. <div class="loadend">
  185. </div>
  186. <ul class="qq-upload-list-selector qq-upload-list">
  187. <li>
  188. <div class="app-name">
  189. <span id="upload-app-name">正在解析...</span>
  190. </div>
  191. <div class="tips">
  192. 正在上传中,请不要关闭浏览器
  193. </div>
  194. <div class="qq-progress-bar-container-selector progress progress-striped active">
  195. <div class="growing qq-progress-bar-selector progress-bar progress-bar-warning"
  196. role="progressbar">
  197. </div>
  198. </div>
  199. <span class="qq-upload-spinner-selector qq-upload-spinner alreadyup"
  200. style="width: auto;font-size: 14px"></span>
  201. <span class="qq-upload-file-selector qq-upload-file"></span>
  202. <span class="qq-upload-size-selector qq-upload-size tolsize"
  203. style="width: auto;font-size: 14px"
  204. id="speed-uploadify"></span>
  205. <br />
  206. <br />
  207. <a class="turbo-upload qq-upload-cancel-selector btn-u btn-u-default ms-btn ms-btn-default"
  208. href="javascript:;" id="changest"
  209. style="display: none;">暂停上传</a>
  210. <span class="qq-upload-status-text-selector qq-upload-status-text"></span>
  211. <div id="retry" style="display:none; margin-top:20px;">
  212. <a class="btn-u btn-u-default"
  213. href="javascript:void(0);"
  214. onclick="javascript:retry();">重新上传</a>
  215. </div>
  216. </li>
  217. </ul>
  218. </div>
  219. <div class="col-md-12" id="upbtn">
  220. <div class="qq-upload-button-selector">
  221. <button class="ms-btn ms-btn-primary upload-btn"
  222. id="uploadstart"
  223. style="padding: 0px; font-size: 18px; line-height: 50px; z-index: 1; width: 148px; height: 50px; border-radius: 4px; background-color: rgba(33, 104, 251, 1);">
  224. <span class="iconfont icon-upload"></span>
  225. <span class="text" style="top: -5px; font-size: 18px; font-family: Source Han Sans SC">立即上传</span>
  226. </button>
  227. <div style="width: 120px;margin:20px auto">
  228. <?php
  229. if ($_var_4 && $this->action == "apps" && !IN_MANDATORY_REMOTE) {
  230. ?> <label onclick="change_remote()">
  231. <span class="icon icon-radio" id="cdnradio"></span>
  232. <span class="">开启CDN加速</span>
  233. </label>
  234. <?php
  235. }
  236. ?>
  237. </div>
  238. <div id="_drop1">点击按钮选择应用的安装包,或拖拽文件到此区域</div>
  239. <div id="_drop2">
  240. 支持<?php echo $this->action == "apps" ? "{ipa,apk,mobileconfig}" : "{ipa}"; ?> 文件,单个文件最大支持
  241. <span><?php echo get_user_in_filesize($this->user, true); ?></span>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. <div class="warn-prompt-wrap clearfix">
  254. <dl class="clearfix fr warn-prompt-1">
  255. <dt class="fl">提示:</dt>
  256. <dd>请您确认上传的APP,符合
  257. 《<a href="/index/about/specification" target="_blank"
  258. class="color-hover"><?php echo IN_NAME; ?>应用审核规范</a>》,如违反规范,APP将做删除处理,屡次上传将被封禁账号。
  259. <br />根据最新审核规范,不接受如下APP上传本平台:色情类、直播类、金融类、区块链虚拟币等。如已上传,将做删除处理。
  260. </dd>
  261. </dl>
  262. </div>
  263. </div>
  264. </div>
  265. </div>
  266. <script src="/static/index/js/publish/app-info-parser.min.js"></script>
  267. <script src="/static/index/js/publish/plupload.full.min.js"></script>
  268. <?php
  269. if ($_var_4 && IN_REMOTE == 1) {
  270. ?> <script src="/static/index/js/publish/qiniu.min.js"></script>
  271. <?php
  272. }
  273. ?> <script src="/static/index/js/publish/packageParser.js"></script>
  274. <script>
  275. var allowsize = <?php echo get_user_in_spacetotal($this->user) - $this->user["in_spaceuse"]; ?>; //存储空间剩余
  276. var singlesize = <?php echo get_user_in_filesize($this->user); ?>; //单文件上传限制
  277. var iLocalId = "<?php echo $_var_0; ?>"; //更新应用ID
  278. var mandatory = <?php echo IN_VERIFY; ?>; //强制认证状态
  279. var certification = <?php echo $this->user["in_verify"]; ?>; //实名认证状态
  280. let bundleId = "<?php echo $_var_1; ?>"; //更新应用包名
  281. let ext = "<?php echo $_var_2; ?>"; //更新应用类型
  282. var remote = <?php echo $_var_4 ? IN_REMOTE : 0; ?>;
  283. var in_sign_type = "<?php echo $this->action == "apps" ? 0 : ($this->action == "sign" ? 1 : 2); ?>";
  284. var IN_SIGNMETHOD = "<?php echo IN_SIGNMETHOD; ?>";
  285. var IN_API = "<?php echo IN_API; ?>";
  286. var IN_SECRET = "<?php echo IN_SECRET; ?>";
  287. var IN_MANDATORY_REMOTE = <?php echo intval(IN_MANDATORY_REMOTE && IN_REMOTE && $this->action == "apps"); ?>;
  288. var uploader;
  289. var parser_config = {
  290. qndomain: "<?php echo IN_REMOTEDK; ?>",
  291. upload: "/upload/index/saveinfo",
  292. autoClickUploadStart: iLocalId, //应用id更新
  293. postField: {
  294. iLocalId: iLocalId,
  295. in_sign_type
  296. },
  297. parseCallback: function(file, appInfo) {
  298. if (file.size > singlesize) {
  299. throw new Error("单文件大小,超过" + Math.floor((singlesize / 1024 / 1024) * 100) / 100 + "MB,请开通或升级会员。");
  300. } else {
  301. if (file.size > allowsize) {
  302. throw new Error('应用空间容量不足,请开通或升级会员。');
  303. }
  304. }
  305. if (iLocalId && (bundleId != appInfo.packageName || ext != appInfo.ext)) {
  306. throw new Error('不是同一个应用无法更新');
  307. }
  308. if (mandatory == 1 && certification != 1) {
  309. throw new Error('未进行实名认证或认证审核中');
  310. }
  311. },
  312. saveCallback: function(ret) {
  313. if (ret.code == 1) {
  314. window.location.href = "/index/publish_success?id=" + ret.data.id;
  315. } else {
  316. if (ret.msg) {
  317. Modal.determineModal({
  318. iconClass: "icon-modal-error2", // success: icon-modal-success1, error: icon-modal-error2
  319. title: data.msg,
  320. align: 'left',
  321. btnText: '确定'
  322. });
  323. } else {
  324. alert('上传文件失败,请稍后重试');
  325. }
  326. }
  327. },
  328. };
  329. function parser_init(remote) {
  330. if (uploader) {
  331. uploader.destroy()
  332. }
  333. parser = new packageParser(uploader);
  334. parser_config.remote = remote || 0;
  335. parser.init(parser_config);
  336. }
  337. //初始化
  338. parser_init(IN_MANDATORY_REMOTE ? remote : 0);
  339. function change_remote() {
  340. $('#cdnradio').toggleClass('icon-radio-checked');
  341. if ($('#cdnradio').hasClass('icon-radio-checked')) {
  342. parser_init(remote);
  343. } else {
  344. parser_init(0);
  345. }
  346. }
  347. </script>
  348. <?php
  349. $this->footer();
  350. ?> <script>
  351. window.onload = checkIsBanned;
  352. </script>
  353. </body>
  354. </html>
  355. <?php
  356. }
  357. }