BaseUser.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. namespace app\index;
  4. class BaseUser extends Base
  5. {
  6. function initialize()
  7. {
  8. parent::initialize();
  9. // 如果用户未登录,并且是apps、sign、super页面,则跳转到登录页面,并传递当前页面URL
  10. if (!$this->userlogined && ($this->action == "apps" || $this->action == "sign" || $this->action == "super")) {
  11. $current_url = $_SERVER['REQUEST_URI'];
  12. redirect('/index/login?redirect=' . urlencode($current_url));
  13. return;
  14. }else if (!$this->userlogined) {
  15. redirect("/index/login");
  16. }
  17. }
  18. function inc_merge()
  19. {
  20. ?> <div class="modal inmodal fade in" id="selApp" tabindex="-1" role="dialog" aria-hidden="false"
  21. style="display: none;">
  22. <div class="modal-dialog modal-lg">
  23. <div class="modal-content">
  24. <div class="modal-header task-sel-app-modal-header">
  25. <h4 class="modal-title">选择 App</h4>
  26. </div>
  27. <form id="selForm" novalidate="novalidate">
  28. <input id="appid" name="appid" value="20802" type="hidden">
  29. <input id="mType" name="mType" value="ipa" type="hidden">
  30. <div class="modal-body task-sel-app-modal-body">
  31. <div class="panel-body">
  32. <div class="tab-content" style="border: 0">
  33. <div id="tab-1" class="tab-pane active" mtype="app">
  34. <div class="row" style="height:340px; overflow-y:auto;overflow-x:hidden">
  35. <div class="wrapper wrapper-content" style="padding-bottom:0px;">
  36. <div id="loading" style="display: none;">
  37. <div class="sk-spinner sk-spinner-wandering-cubes">
  38. <div class="sk-cube1">
  39. </div>
  40. <div class="sk-cube2">
  41. </div>
  42. </div>
  43. </div>
  44. <div class="row" id="appContainer">
  45. </div>
  46. </div>
  47. </div>
  48. <input id="mAKey" name="mAKey" value="" type="hidden">
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="modal-footer">
  54. <p style="float:left;padding-top:10px;padding-left:10px;">
  55. 合并后的两个应用,进入任一个应用的单页,扫描二维码,会根据你的手机系统自动帮你下载相应的版本。</p>
  56. <button class="btn btn-info" data-dismiss="modal" href="javascript:void(0)">取消</button>
  57. <button type="button" id="btnMerge" class="btn btn-success">合并应用</button>
  58. </div>
  59. </form>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="modal inmodal fade in" id="cancel_dialog" tabindex="-1" role="dialog">
  64. <div class="modal-dialog modal-lg">
  65. <div class="modal-content">
  66. <div class="modal-header task-sel-app-modal-header">
  67. <h4 class="modal-title">解除合并</h4>
  68. </div>
  69. <div class="modal-body task-sel-app-modal-body">
  70. <div class="panel-body">
  71. <div id="cancel_container">
  72. </div>
  73. </div>
  74. </div>
  75. <div class="modal-footer">
  76. <button class="btn btn-info" data-dismiss="modal" href="javascript:void(0)"
  77. onclick="$('#myModal').modal('hide');">取消
  78. </button>
  79. <button type="button" id="btnCancel" class="btn btn-warning">取消合并</button>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <script>
  85. $('.cancel_merge').click(function(event) {
  86. event.preventDefault();
  87. var id = $(this).attr('app_id');
  88. $.get('/index/apps_cancelMerge?id=' + id, function(html) {
  89. $('#btnCancel').unbind();
  90. $('#cancel_container').html(html);
  91. $('#cancel_dialog').modal('show');
  92. $('#btnCancel').click(function() {
  93. $.post('/index/ajax_profile/each_del', {
  94. aid: id
  95. }, function(data) {
  96. if (data.code == 200) {
  97. $('#cancel_dialog').modal('hide');
  98. alert(data.msg, function() {
  99. window.location.reload();
  100. });
  101. return true;
  102. } else {
  103. alert(data.msg);
  104. }
  105. }, 'json');
  106. return true;
  107. });
  108. });
  109. });
  110. $('.btn-success').click(function(e) {
  111. e.preventDefault();
  112. var id = $(this).attr('app_id');
  113. $.get('/index/apps_merge?id=' + id, function(html) {
  114. $("#btnMerge").unbind();
  115. $('#appContainer').html(html);
  116. $('#appContainer .ibox').click(function() {
  117. $('#appContainer .ibox .caption').each(function() {
  118. $(this).hide();
  119. })
  120. $(this).find('.caption').show();
  121. });
  122. $('#selApp').modal('show');
  123. $('#btnMerge').click(function() {
  124. var kid = $("#appContainer .ibox .caption:visible").find('input').val();
  125. if (!kid) {
  126. alert('请选择要合并的应用');
  127. return false;
  128. }
  129. $.post('/index/ajax_profile/each_add', {
  130. aid: id,
  131. kid: kid
  132. }, function(data) {
  133. if (data.code == 200) {
  134. $('#selApp').modal('hide');
  135. alert(data.msg, function() {
  136. window.location.reload();
  137. });
  138. } else {
  139. alert(data.msg);
  140. }
  141. }, 'json');
  142. });
  143. });
  144. });
  145. </script>
  146. <?php
  147. }
  148. function left()
  149. {
  150. ?> <div class="col-sm-2">
  151. <aside class="aside-left">
  152. <ul>
  153. <?php
  154. if ($this->action == "apps" && IN_DIST_ON || $this->action == "sign" && IN_SIGN || $this->action == "super" && IN_SUPER) {
  155. ?> <li title="上传应用" class="<?php echo $this->module == "publish" || $this->module == "publish_update" ? "active" : ""; ?>">
  156. <a href="/index/publish/<?php echo $this->action; ?>"> <span
  157. class="iconfont icon-upload1"></span>上传应用</a>
  158. </li>
  159. <?php
  160. }
  161. ?> <li title="应用列表" class="<?php echo $this->module == "apps" ? "active" : ""; ?>">
  162. <a href="/index/apps/<?php echo $this->action; ?>"><span class="iconfont icon-41"></span>应用列表</a>
  163. </li>
  164. <?php
  165. if ($this->action == "apps") {
  166. ?> <li title="绑定域名" class="<?php echo $this->module == "domain" ? "active" : ""; ?>">
  167. <a href="/index/domain/<?php echo $this->action; ?>">
  168. <span class="iconfont icon-liulanqi"></span>绑定域名</a>
  169. </li>
  170. <?php
  171. }
  172. ?> <?php
  173. if (IN_SUPER && ($this->action == "super" || strstr($this->module, "super"))) {
  174. ?> <li title="授权码管理" class="<?php echo $this->module == "super_code" ? "active" : ""; ?>">
  175. <a href="/index/super_code/super"><span class="iconfont icon-pwd"></span>授权码管理</a>
  176. </li>
  177. <li title="开发者账号" class="<?php echo $this->module == "super_cert" ? "active" : ""; ?>">
  178. <a href="/index/super_cert/super"><span class="iconfont icon-gongju"></span>开发者账号</a>
  179. </li>
  180. <?php
  181. }
  182. ?>
  183. </ul>
  184. </aside>
  185. </div>
  186. <?php
  187. }
  188. function publish_left()
  189. {
  190. $_var_0 = SafeRequest("id", "get");
  191. ?> <div class="col-sm-2">
  192. <link rel="stylesheet" href="/static/index/css/apps-info-top.css" />
  193. <aside class="aside-left">
  194. <ul>
  195. <li title="应用详情" class="<?php echo $this->module == "publish_detail" ? "active" : ""; ?>">
  196. <a href="/index/publish_detail/<?php echo $this->action; ?>?id=<?php echo $_var_0; ?>">
  197. <span class="iconfont icon-41"></span>应用详情
  198. </a>
  199. </li>
  200. <li title="应用设置" class="<?php echo $this->module == "publish_setting" ? "active" : ""; ?>">
  201. <a href="/index/publish_setting/<?php echo $this->action; ?>?id=<?php echo $_var_0; ?>">
  202. <span class="iconfont icon-19"></span>应用设置
  203. </a>
  204. </li>
  205. <li title="下载明细" class="<?php echo $this->module == "publish_statistics" ? "active" : ""; ?>">
  206. <a href="/index/publish_statistics/<?php echo $this->action; ?>?id=<?php echo $_var_0; ?>">
  207. <span class="iconfont icon-download2"></span>下载明细
  208. </a>
  209. </li>
  210. <?php
  211. if ($this->action == "sign" && IN_SIGN) {
  212. ?> <li title="企业签名" class="<?php echo $this->module == "publish_sign" ? "active" : ""; ?>">
  213. <a href="/index/publish_sign/<?php echo $this->action; ?>?id=<?php echo $_var_0; ?>">
  214. <span class="iconfont icon-qianming"></span>企业签名</a>
  215. </li>
  216. <?php
  217. }
  218. ?> <?php
  219. if ($this->action == "super") {
  220. ?> <li title="签名记录" class="<?php echo $this->module == "publish_superlog" ? "active" : ""; ?>">
  221. <a href="/index/publish_superlog/<?php echo $this->action; ?>?id=<?php echo $_var_0; ?>">
  222. <span class="iconfont icon-qianming"></span>签名记录</a>
  223. </li>
  224. <?php
  225. }
  226. ?>
  227. </ul>
  228. </aside>
  229. </div>
  230. <?php
  231. }
  232. function publish_top($_var_1 = [])
  233. {
  234. ?> <div class="details-top clearfix my-apps-detail-top">
  235. <div class="fl upload-icon-common uploaded ">
  236. <img class="fl" src="<?php echo geticon($_var_1["in_icon"]); ?>" onerror="javascript:this.src='<?php echo IN_PATH; ?>static/index/image/<?php echo $_var_1["in_form"]; ?>.png'">
  237. <input type="file" class="thumbnail" name="icon" value="">
  238. <div class="text">
  239. 上传图标
  240. </div>
  241. <div class="reset">
  242. 重新上传
  243. </div>
  244. </div>
  245. <dl class="information fl">
  246. <dt>
  247. <span class="i-tit">
  248. <span class="text"><?php echo $_var_1["in_name"]; ?></span>
  249. <?php
  250. if ($_var_1["in_form"] == "iOS") {
  251. ?> <span class="version version-private"><span
  252. class="font10"><?php echo $this->action == "super" ? "超级版" : ($_var_1["in_type"] == 1 ? "企业版" : "内测版"); ?></span></span>
  253. <?php
  254. }
  255. ?>
  256. </span>
  257. </dt>
  258. <dd>
  259. <span>
  260. <span class="<?php echo $_var_1["in_form"] == "iOS" ? "iconfont icon-iphone" : "iconfont icon-android"; ?>"></span>
  261. 适用于<?php echo $_var_1["in_form"] == "iOS" ? "苹果" : "安卓"; ?><?php echo $_var_1["in_mnvs"]; ?>系统以上的设备
  262. </span>
  263. <br class="visible-xs">
  264. <span>版本<i><?php echo $_var_1["in_bsvs"]; ?> (Build <?php echo $_var_1["in_bvs"]; ?>)</i></span>
  265. <span>大小<i><?php echo formatsize($_var_1["in_size"]); ?></i></span>
  266. </dd>
  267. <?php
  268. if ($_var_1["in_type"] == "2") {
  269. ?> <dd class="clearfix">
  270. <span class="add-notes-wrap fl">
  271. <span class="add-notes clearfix">
  272. <span class="fl"><a href="javascript:void(0);" data-toggle="modal"
  273. data-target="#adhocUDIDBox">内测设备查看</a></span>
  274. </span>
  275. </span>
  276. </dd>
  277. <?php
  278. }
  279. ?>
  280. </dl>
  281. <div class="fr d-right">
  282. <!-- <?php
  283. if (!$_var_1["in_applock"]) {
  284. if ($this->action == "apps" && IN_DIST_ON || $this->action == "sign" && IN_SIGN || $this->action == "super" && IN_SUPER) {
  285. ?> <a title="上传新版本" href="<?php echo IN_PATH; ?>index/publish/<?php echo $this->action; ?>?id=<?php echo bees_encrypt($_var_1["in_id"]); ?>"
  286. class="ms-btn details-upload-new-version">
  287. <span class="iconfont icon-upload1"></span>
  288. <span class="text">上传新版本</span>
  289. </a>
  290. <?php
  291. }
  292. ?> -->
  293. <a title="上传新版本" href="<?php echo IN_PATH; ?>index/publish/<?php echo $this->action; ?>?id=<?php echo bees_encrypt($_var_1["in_id"]); ?>"
  294. class="ms-btn details-upload-new-version">
  295. <span class="iconfont icon-upload1"></span>
  296. <span class="text">上传新版本</span>
  297. </a>
  298. <a title="预览" href="<?php echo getlink($_var_1["in_id"]); ?>" target="_blank"
  299. class="ms-btn ml10 details-preview">
  300. <span class="iconfont icon-preview"></span>
  301. <span class="text">预览</span>
  302. </a>
  303. <?php
  304. if ($_var_1["in_kid"]) {
  305. ?> <button title="取消合并" app_id="<?php echo bees_encrypt($_var_1["in_id"]); ?>"
  306. class="ms-btn ml10 details-merge cancel_merge" data-toggle="modal"
  307. data-target="#myModal2">
  308. <span class="iconfont icon-merge"></span>
  309. <span class="text">取消</span>
  310. </button>
  311. <?php
  312. } else {
  313. ?> <button title="合并" class="ms-btn ml10 details-merge btn-success" data-toggle="modal"
  314. data-target="#myModal"
  315. app_id="<?php echo bees_encrypt($_var_1["in_id"]); ?>">
  316. <span class="iconfont icon-merge"></span>
  317. <span class="text">合并</span>
  318. </button>
  319. <?php
  320. }
  321. }
  322. ?> </div>
  323. </div>
  324. <?php
  325. }
  326. function publish_app_list()
  327. {
  328. $id = bees_decrypt(SafeRequest("id", "get"));
  329. ?>
  330. <link rel="stylesheet" href="/static/index/css/apps-info-top.css" />
  331. <link rel="stylesheet" href="/static/index/css/apps-aside.css" />
  332. <div class="col-sm-2 hidden-xs">
  333. <aside class="aside-left">
  334. <div class="aside-app-list-tilte">我的应用</div>
  335. <ul class="aside-app-list">
  336. <?php
  337. // 根据不同的action过滤应用列表
  338. $where_conditions = [["in_uid", "=", $this->userid]];
  339. if ($this->action == "sign" && IN_SIGN) {
  340. $where_conditions[] = ["in_sign_type", "=", "1"];
  341. } elseif ($this->action == "super" && IN_SUPER) {
  342. $where_conditions[] = ["in_sign_type", "=", "2"];
  343. } else {
  344. $where_conditions[] = ["in_sign_type", "=", "0"];
  345. }
  346. $app_list = db("appid")->where($where_conditions)->order("in_applock desc,in_addtime desc")->select();
  347. foreach ($app_list as $app) {
  348. $app_id = bees_encrypt($app['in_id']);
  349. $is_active = ($app['in_id'] == $id) ? "active" : "";
  350. ?>
  351. <li title="<?php echo $app['in_name']; ?>" class="<?php echo $is_active; ?>">
  352. <a href="/index/publish_detail/<?php echo $this->action; ?>?id=<?php echo $app_id; ?>">
  353. <span class="app-img"
  354. style="background-image: url(<?php echo geticon($app['in_icon']); ?>);"></span>
  355. <div class="app-info">
  356. <p class="app-name-text"><?php echo $app['in_name']; ?></p>
  357. <p class="app-form-text"><?php echo $app['in_form']; ?></p>
  358. </div>
  359. </a>
  360. </li>
  361. <?php
  362. }
  363. ?>
  364. </ul>
  365. </aside>
  366. </div>
  367. <?php
  368. }
  369. function user_left()
  370. {
  371. ?> <div class="col-sm-2">
  372. <aside class="aside-left">
  373. <ul>
  374. <li title="账号信息" class="<?php echo $this->module == "user_profile" ? "active" : ""; ?>">
  375. <a href="<?php echo IN_PATH; ?>index/user_profile">
  376. <span class="iconfont icon-user1"></span>账号信息
  377. </a>
  378. </li>
  379. <li title="我的订单" class="<?php echo $this->module == "user_order" ? "active" : ""; ?>">
  380. <a href="<?php echo IN_PATH; ?>index/user_order">
  381. <span class="iconfont icon-028"></span>我的订单
  382. </a>
  383. </li>
  384. <li title="账户记录" class="<?php echo $this->module == "user_aclog" ? "active" : ""; ?>">
  385. <a href="<?php echo IN_PATH; ?>index/user_aclog">
  386. <span class="iconfont icon-fapiao"></span>账户记录
  387. </a>
  388. </li>
  389. <?php
  390. if (IN_PROMOTE) {
  391. ?> <li title="代理推广" class="<?php echo $this->module == "user_promote" ? "active" : ""; ?>">
  392. <a href="<?php echo IN_PATH; ?>index/user_promote">
  393. <span class="iconfont icon-team"></span>代理推广
  394. </a>
  395. </li>
  396. <?php
  397. }
  398. ?> <li title="提现记录" class="<?php echo $this->module == "user_cash" ? "active" : ""; ?>">
  399. <a href="<?php echo IN_PATH; ?>index/user_cash">
  400. <span class="iconfont icon-008"></span>提现记录
  401. </a>
  402. </li>
  403. </ul>
  404. </aside>
  405. </div>
  406. <?php
  407. }
  408. function webview_left()
  409. {
  410. ?> <div class="col-sm-2">
  411. <aside class="aside-left">
  412. <ul>
  413. <li title="标准封装" class="<?php echo $this->module == "webview" ? "active" : ""; ?>">
  414. <a href="/index/webview">
  415. <span class="iconfont icon-xiangzi font18 icon-fz"></span>标准封装
  416. </a>
  417. </li>
  418. <li title="苹果免签封装" class="<?php echo $this->module == "webview2" ? "active" : ""; ?>">
  419. <a href="/index/webview2">
  420. <span class="iconfont icon-xiangzi font18 icon-fzmianqian"></span>苹果免签封装
  421. </a>
  422. </li>
  423. <li title="封装记录" class="<?php echo $this->module == "webview_log" ? "active" : ""; ?>">
  424. <a href="/index/webview_log">
  425. <span class="iconfont icon-xiangzi font18 icon-fzjilu"></span>封装记录
  426. </a>
  427. </li>
  428. <div class="details-top clearfix"></div>
  429. </ul>
  430. </aside>
  431. </div>
  432. <?php
  433. }
  434. }