main.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $content string */
  4. use yii\helpers\Html;
  5. use yii\helpers\Url;
  6. use yii\web\YiiAsset;
  7. YiiAsset::register($this);
  8. ?>
  9. <?php $this->beginPage() ?>
  10. <!DOCTYPE html>
  11. <html lang="<?= Yii::$app->language ?>">
  12. <head>
  13. <meta charset="<?= Yii::$app->charset ?>">
  14. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  15. <meta name="viewport" content="width=device-width, initial-scale=1">
  16. <?= Html::csrfMetaTags() ?>
  17. <title><?= Html::encode($this->title) ?></title>
  18. <?php $this->head() ?>
  19. <link href="<?= STATIC_URL ?>/ui/css/bootstrap.min.css" rel="stylesheet">
  20. <link href="<?= STATIC_URL ?>/ui/font-awesome/css/font-awesome.css" rel="stylesheet">
  21. <link href="<?= STATIC_URL ?>/ui/css/animate.css" rel="stylesheet">
  22. <link href="<?= STATIC_URL ?>/ui/css/style.css" rel="stylesheet">
  23. <link href="<?= STATIC_URL ?>/ui/css/plugins/iCheck/custom.css" rel="stylesheet">
  24. <link href="<?= STATIC_URL ?>/ui/css/plugins/toastr/toastr.min.css" rel="stylesheet">
  25. <link href="<?= STATIC_URL ?>/ui/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
  26. <link href="<?= STATIC_URL ?>/ui/css/plugins/select2/select2.min.css" rel="stylesheet">
  27. <style>
  28. #datatables tr.selected {
  29. background: #1ab394;
  30. color: #FFF;
  31. }
  32. .ibox-title {
  33. border-width: 1px 0 0;
  34. }
  35. @media (min-width: 1366px) {
  36. .container {
  37. width: 1170px;
  38. }
  39. }
  40. @media (min-width: 1440px) {
  41. .container {
  42. width: 1170px;
  43. }
  44. }
  45. @media (min-width: 1600px) {
  46. .container {
  47. width: 1170px;
  48. }
  49. }
  50. @media (min-width: 1920px) {
  51. .container {
  52. width: 1170px;
  53. }
  54. }
  55. </style>
  56. <!--[if lt IE 9]>
  57. <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  58. <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  59. <![endif]-->
  60. <?= isset($this->blocks['header_script']) ? trim($this->blocks['header_script']) : '' ?>
  61. </head>
  62. <body class="top-navigation">
  63. <?php $this->beginBody() ?>
  64. <div id="wrapper">
  65. <div id="page-wrapper" class="gray-bg">
  66. <div class="row border-bottom white-bg">
  67. <nav class="navbar navbar-static-top" role="navigation">
  68. <div class="container">
  69. <?php if ($this->context->module instanceof \yii\web\Application): ?>
  70. <div class="navbar-header">
  71. <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
  72. <i class="fa fa-reorder"></i>
  73. </button>
  74. <a href="<?= Url::home() ?>" class="navbar-brand"><b>X</b>Trader</a>
  75. </div>
  76. <div class="navbar-collapse collapse" id="navbar">
  77. <ul class="nav navbar-nav">
  78. <li>
  79. <a href="<?= Url::to(['/account/open']) ?>">真实账户申请</a>
  80. </li>
  81. <!--<li>
  82. <a href="<?= Url::to(['/account/opendemo']) ?>">模拟账户申请</a>
  83. </li>-->
  84. </ul>
  85. <ul class="nav navbar-nav navbar-right">
  86. <!--<li id="navhelp">
  87. <a href="javascript:">在线客服</a>
  88. </ul>
  89. </div>
  90. <?php elseif ($this->context->module->id == 'user'): ?>
  91. <div class="navbar-header">
  92. <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
  93. <i class="fa fa-reorder"></i>
  94. </button>
  95. <a href="<?= Url::to(['/user/dashboard']) ?>" class="navbar-brand"><b>X</b>Trader</a>
  96. </div>
  97. <div class="navbar-collapse collapse" id="navbar">
  98. <ul class="nav navbar-nav">
  99. <li id="navdashboard">
  100. <a href="<?= Url::to(['/user/dashboard']) ?>">首页</a>
  101. </li>
  102. <li id="navnotice">
  103. <a href="<?= Url::to(['/user/notice']) ?>">公告
  104. <span class="label label-danger" id="findNotReadCount"></span>
  105. </a>
  106. </li>
  107. <li id="navbankdeposit">
  108. <a href="<?= Url::to(['/user/bankdeposit']) ?>">入金</a>
  109. </li>
  110. <li id="navdw">
  111. <a href="<?= Url::to(['/user/bankwithdraw']) ?>">出金</a>
  112. </li>
  113. <!--<li id="navsameaccount">
  114. <a href="<?= Url::to(['/user/sameaccount']) ?>">同名账号</a>
  115. </li>
  116. <li id="navtransfer">
  117. <a href="<?= Url::to(['/user/transfer']) ?>">同名转账</a>
  118. </li>
  119. <li id="navlever">
  120. <a href="<?= Url::to(['/user/lever']) ?>">修改杠杆</a>
  121. </li>
  122. <li id="navhelp">
  123. <a href="<?= Url::to(['/user/help']) ?>">常见问题</a>
  124. </li>
  125. <li id="navhelp">
  126. <a href="javascript:">在线客服</a>
  127. </li>-->
  128. </ul>
  129. <ul class="nav navbar-nav navbar-right">
  130. <li id="navsetting" class="dropdown">
  131. <a aria-expanded="false" role="button" href="#" class="dropdown-toggle" data-toggle="dropdown">
  132. <?= Yii::$app->getUser()->getIdentity(false)->username ?> <span class="caret"></span>
  133. </a>
  134. <ul role="menu" class="dropdown-menu">
  135. <li><a href="<?= Url::to(['/user/info']) ?>">基本资料</a></li>
  136. <li><a href="<?= Url::to(['/user/password']) ?>">修改密码</a></li>
  137. <li><a href="<?= Url::to(['/account/logout']) ?>">退出</a></li>
  138. </ul>
  139. </li>
  140. </ul>
  141. </div>
  142. <?php endif; ?>
  143. </div>
  144. </nav>
  145. </div>
  146. <div class="wrapper wrapper-content">
  147. <div class="container">
  148. <?= $content ?>
  149. </div>
  150. </div>
  151. <br>
  152. <div class="footer">
  153. <div class="container">
  154. <div class="pull-right">V2.0</div>
  155. <div><strong>Copyright</strong> &copy; <?= date('Y') ?></div>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  161. <div class="modal-dialog" role="document">
  162. <div class="modal-content">
  163. <div class="modal-header">
  164. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  165. <h4 class="modal-title" id="myModalLabel"><a href="javascript:;" class="modal-title-a" target="_blank"></a></h4>
  166. </div>
  167. <div class="modal-body"></div>
  168. <div class="modal-footer">
  169. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <?php $this->endBody() ?>
  175. <!-- Mainly scripts -->
  176. <script src="<?= STATIC_URL ?>/ui/js/bootstrap.min.js"></script>
  177. <script src="<?= STATIC_URL ?>/ui/js/plugins/metisMenu/jquery.metisMenu.js"></script>
  178. <script src="<?= STATIC_URL ?>/ui/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  179. <script src="<?= STATIC_URL ?>/ui/js/inspinia.js"></script>
  180. <script src="<?= STATIC_URL ?>/ui/js/plugins/pace/pace.min.js"></script>
  181. <script src="<?= STATIC_URL ?>/ui/js/plugins/toastr/toastr.min.js"></script>
  182. <script src="<?= STATIC_URL ?>/ui/js/plugins/datapicker/bootstrap-datepicker.js"></script>
  183. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/jquery.validate.min.js"></script>
  184. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/additional-methods.min.js"></script>
  185. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/messages.cn.js"></script>
  186. <!-- iCheck -->
  187. <script src="<?= STATIC_URL ?>/ui/js/plugins/iCheck/icheck.min.js"></script>
  188. <script src="<?= STATIC_URL ?>/ui/js/plugins/select2/select2.full.min.js"></script>
  189. <script>
  190. $(document).ready(function () {
  191. $('.i-checks').iCheck({
  192. checkboxClass: 'icheckbox_square-green',
  193. radioClass: 'iradio_square-green'
  194. });
  195. $('.data').datepicker({
  196. startView: 1,
  197. todayBtn: "linked",
  198. keyboardNavigation: true,
  199. forceParse: false,
  200. autoclose: true,
  201. format: "yyyy-mm-dd"
  202. });
  203. $(".select2").select2();
  204. $("#kefu").click(function () {
  205. window.open('http://crm2.qq.com/page/portalpage/wpa.php?uin=800800642&aty=1&a=0&curl=&ty=1', '_blank', 'width=760,height=430,top=0px,left=0px');
  206. });
  207. findNotReadCount();
  208. showLastUnreadNotice();
  209. });
  210. function findNotReadCount() {
  211. $.ajax({
  212. type: "GET",
  213. url: "<?= Url::to(['/user/notice/find-not-read-count']) ?>",
  214. data: $('#form').serialize(),
  215. dataType: "text",
  216. beforeSend: function () {
  217. },
  218. success: function (data) {
  219. if (data != "0") {
  220. $("#findNotReadCount").html(data + "未读");
  221. }
  222. },
  223. complete: function (XMLHttpRequest, textStatus) {
  224. },
  225. error: function () {
  226. }
  227. });
  228. }
  229. function showLastUnreadNotice() {
  230. if (location.pathname === '/user/notice' || location.pathname.indexOf('/user/notice/') === 0) {
  231. return;
  232. }
  233. $.get('<?= Url::to(['notice/last-unread-notice']) ?>', {}, function (response) {
  234. if (response.code == 1 && response.data.notice) {
  235. $('#myModal .modal-title-a').html(response.data.notice.title);
  236. $('#myModal .modal-title-a').attr('href', '/user/notice/nview?id=' + response.data.notice.id);
  237. $('#myModal .modal-body').html(response.data.notice.content);
  238. $('#myModal').modal();
  239. $('#myModal .modal-title-a').on('click', function () {
  240. $('#myModal').modal('hide');
  241. });
  242. }
  243. }, 'json');
  244. }
  245. </script>
  246. <script>
  247. var url = location.href;
  248. if (url.indexOf("/dashboard") != -1) {
  249. $("#navdashboard").addClass("active");
  250. } else if (url.indexOf("/dw") != -1) {
  251. $("#navdw").addClass("active");
  252. } else if (url.indexOf("/lever") != -1) {
  253. $("#navlever").addClass("active");
  254. } else if (url.indexOf("/transfer") != -1) {
  255. $("#navtransfer").addClass("active");
  256. } else if (url.indexOf("/bankdeposit") != -1) {
  257. $("#navbankdeposit").addClass("active");
  258. } else if (url.indexOf("/notice") != -1) {
  259. $("#navnotice").addClass("active");
  260. } else if (url.indexOf("/nview") != -1) {
  261. $("#navnotice").addClass("active");
  262. } else if (url.indexOf("/help") != -1) {
  263. $("#navhelp").addClass("active");
  264. } else if (url.indexOf("/sameaccount") != -1) {
  265. $("#navsameaccount").addClass("active");
  266. }else if (url.indexOf("/bankwithdraw") != -1) {
  267. $("#navdw").addClass("active");
  268. }
  269. </script>
  270. <script>
  271. // 对Date的扩展,将 Date 转化为指定格式的String
  272. // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
  273. // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
  274. // 例子:
  275. // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
  276. // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
  277. Date.prototype.Format = function (fmt) { //author: meizz
  278. var o = {
  279. "M+": this.getMonth() + 1, //月份
  280. "d+": this.getDate(), //日
  281. "h+": this.getHours(), //小时
  282. "m+": this.getMinutes(), //分
  283. "s+": this.getSeconds(), //秒
  284. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  285. "S": this.getMilliseconds() //毫秒
  286. };
  287. if (/(y+)/.test(fmt))
  288. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  289. for (var k in o)
  290. if (new RegExp("(" + k + ")").test(fmt))
  291. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  292. return fmt;
  293. };
  294. function timeStamp2String(time) {
  295. time += new Date().getTimezoneOffset() * 60 * 1000;
  296. var datetime = new Date();
  297. datetime.setTime(parseInt(time));
  298. var year = datetime.getFullYear();
  299. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  300. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  301. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  302. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  303. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  304. return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
  305. }
  306. function timeStamp2StringForEcharts(time) {
  307. time += new Date().getTimezoneOffset() * 60 * 1000;
  308. var datetime = new Date();
  309. datetime.setTime(parseInt(time));
  310. var year = datetime.getFullYear();
  311. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  312. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  313. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  314. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  315. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  316. //return year + "/" + month + "/" + date + " " + hour + ":" + minute + ":" + second;
  317. return month + "/" + date + " " + hour + ":" + minute;
  318. }
  319. function timeStamp2StringMin(time) {
  320. time += new Date().getTimezoneOffset() * 60 * 1000;
  321. var datetime = new Date();
  322. datetime.setTime(parseInt(time));
  323. var year = datetime.getFullYear();
  324. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  325. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  326. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  327. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  328. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  329. //return hour + ":" + minute + ":" + second;
  330. return hour + ":" + minute;
  331. }
  332. </script>
  333. <?= isset($this->blocks['left_menu_script']) ? trim($this->blocks['left_menu_script']) : '' ?>
  334. <?= isset($this->blocks['footer_script']) ? trim($this->blocks['footer_script']) : '' ?>
  335. </body>
  336. </html>
  337. <?php $this->endPage() ?>