publish.php 19 KB

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