BaseUser.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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. <br class="visible-xs">
  266. <span>大小<i><?php echo formatsize($_var_1["in_size"]); ?></i></span>
  267. </dd>
  268. <?php
  269. if ($_var_1["in_type"] == "2") {
  270. ?> <dd class="clearfix">
  271. <span class="add-notes-wrap fl">
  272. <span class="add-notes clearfix">
  273. <span class="fl"><a href="javascript:void(0);" data-toggle="modal"
  274. data-target="#adhocUDIDBox">内测设备查看</a></span>
  275. </span>
  276. </span>
  277. </dd>
  278. <?php
  279. }
  280. ?>
  281. </dl>
  282. <div class="fr d-right">
  283. <!-- <?php
  284. if (!$_var_1["in_applock"]) {
  285. if ($this->action == "apps" && IN_DIST_ON || $this->action == "sign" && IN_SIGN || $this->action == "super" && IN_SUPER) {
  286. ?> <a title="上传新版本" href="<?php echo IN_PATH; ?>index/publish/<?php echo $this->action; ?>?id=<?php echo bees_encrypt($_var_1["in_id"]); ?>"
  287. class="ms-btn details-upload-new-version">
  288. <span class="iconfont icon-upload1"></span>
  289. <span class="text">上传新版本</span>
  290. </a>
  291. <?php
  292. }
  293. ?> -->
  294. <a title="上传新版本" href="<?php echo IN_PATH; ?>index/publish/<?php echo $this->action; ?>?id=<?php echo bees_encrypt($_var_1["in_id"]); ?>"
  295. class="ms-btn details-upload-new-version">
  296. <span class="iconfont icon-upload1"></span>
  297. <span class="text">上传新版本</span>
  298. </a>
  299. <a title="预览" href="<?php echo getlink($_var_1["in_id"]); ?>" target="_blank"
  300. class="ms-btn ml10 details-preview">
  301. <span class="iconfont icon-preview"></span>
  302. <span class="text">预览</span>
  303. </a>
  304. <?php
  305. if ($_var_1["in_kid"]) {
  306. ?> <button title="取消合并" app_id="<?php echo bees_encrypt($_var_1["in_id"]); ?>"
  307. class="ms-btn ml10 details-merge cancel_merge" data-toggle="modal"
  308. data-target="#myModal2">
  309. <span class="iconfont icon-merge"></span>
  310. <span class="text">取消合并</span>
  311. </button>
  312. <?php
  313. } else {
  314. ?> <button title="合并应用" class="ms-btn ml10 details-merge btn-success" data-toggle="modal"
  315. data-target="#myModal"
  316. app_id="<?php echo bees_encrypt($_var_1["in_id"]); ?>">
  317. <span class="iconfont icon-merge"></span>
  318. <span class="text">合并应用</span>
  319. </button>
  320. <?php
  321. }
  322. }
  323. ?> </div>
  324. </div>
  325. <?php
  326. }
  327. function publish_app_list()
  328. {
  329. $id = bees_decrypt(SafeRequest("id", "get"));
  330. ?>
  331. <link rel="stylesheet" href="/static/index/css/apps-info-top.css" />
  332. <link rel="stylesheet" href="/static/index/css/apps-aside.css" />
  333. <div class="col-sm-2 hidden-xs">
  334. <aside class="aside-left">
  335. <div class="aside-app-list-tilte">我的应用</div>
  336. <ul class="aside-app-list">
  337. <?php
  338. // 根据不同的action过滤应用列表
  339. $where_conditions = [["in_uid", "=", $this->userid]];
  340. if ($this->action == "sign" && IN_SIGN) {
  341. $where_conditions[] = ["in_sign_type", "=", "1"];
  342. } elseif ($this->action == "super" && IN_SUPER) {
  343. $where_conditions[] = ["in_sign_type", "=", "2"];
  344. } else {
  345. $where_conditions[] = ["in_sign_type", "=", "0"];
  346. }
  347. $app_list = db("appid")->where($where_conditions)->order("in_applock desc,in_addtime desc")->select();
  348. foreach ($app_list as $app) {
  349. $app_id = bees_encrypt($app['in_id']);
  350. $is_active = ($app['in_id'] == $id) ? "active" : "";
  351. ?>
  352. <li title="<?php echo $app['in_name']; ?>" class="<?php echo $is_active; ?>">
  353. <a href="/index/publish_detail/<?php echo $this->action; ?>?id=<?php echo $app_id; ?>">
  354. <span class="app-img"
  355. style="background-image: url(<?php echo geticon($app['in_icon']); ?>);"></span>
  356. <div class="app-info">
  357. <p class="app-name-text"><?php echo $app['in_name']; ?></p>
  358. <p class="app-form-text"><?php echo $app['in_form']; ?></p>
  359. </div>
  360. </a>
  361. </li>
  362. <?php
  363. }
  364. ?>
  365. </ul>
  366. </aside>
  367. </div>
  368. <?php
  369. }
  370. function user_left()
  371. {
  372. ?> <div class="col-sm-2">
  373. <aside class="aside-left">
  374. <ul>
  375. <li title="账号信息" class="<?php echo $this->module == "user_profile" ? "active" : ""; ?>">
  376. <a href="<?php echo IN_PATH; ?>index/user_profile">
  377. <span class="iconfont icon-user1"></span>账号信息
  378. </a>
  379. </li>
  380. <li title="我的订单" class="<?php echo $this->module == "user_order" ? "active" : ""; ?>">
  381. <a href="<?php echo IN_PATH; ?>index/user_order">
  382. <span class="iconfont icon-028"></span>我的订单
  383. </a>
  384. </li>
  385. <li title="账户记录" class="<?php echo $this->module == "user_aclog" ? "active" : ""; ?>">
  386. <a href="<?php echo IN_PATH; ?>index/user_aclog">
  387. <span class="iconfont icon-fapiao"></span>账户记录
  388. </a>
  389. </li>
  390. <?php
  391. if (IN_PROMOTE) {
  392. ?> <li title="代理推广" class="<?php echo $this->module == "user_promote" ? "active" : ""; ?>">
  393. <a href="<?php echo IN_PATH; ?>index/user_promote">
  394. <span class="iconfont icon-team"></span>代理推广
  395. </a>
  396. </li>
  397. <?php
  398. }
  399. ?> <li title="提现记录" class="<?php echo $this->module == "user_cash" ? "active" : ""; ?>">
  400. <a href="<?php echo IN_PATH; ?>index/user_cash">
  401. <span class="iconfont icon-008"></span>提现记录
  402. </a>
  403. </li>
  404. </ul>
  405. </aside>
  406. </div>
  407. <?php
  408. }
  409. function webview_left()
  410. {
  411. ?> <div class="col-sm-2">
  412. <aside class="aside-left">
  413. <ul>
  414. <li title="标准封装" class="<?php echo $this->module == "webview" ? "active" : ""; ?>">
  415. <a href="/index/webview">
  416. <span class="iconfont icon-xiangzi font18 icon-fz"></span>标准封装
  417. </a>
  418. </li>
  419. <li title="苹果免签封装" class="<?php echo $this->module == "webview2" ? "active" : ""; ?>">
  420. <a href="/index/webview2">
  421. <span class="iconfont icon-xiangzi font18 icon-fzmianqian"></span>苹果免签封装
  422. </a>
  423. </li>
  424. <li title="封装记录" class="<?php echo $this->module == "webview_log" ? "active" : ""; ?>">
  425. <a href="/index/webview_log">
  426. <span class="iconfont icon-xiangzi font18 icon-fzjilu"></span>封装记录
  427. </a>
  428. </li>
  429. <div class="details-top clearfix"></div>
  430. </ul>
  431. </aside>
  432. </div>
  433. <?php
  434. }
  435. }