publish.php 20 KB

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