BaseUser.php 21 KB

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