main.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. </li>-->
  89. </ul>
  90. </div>
  91. <?php elseif ($this->context->module->id == 'user'): ?>
  92. <div class="navbar-header">
  93. <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
  94. <i class="fa fa-reorder"></i>
  95. </button>
  96. <a href="<?= Url::to(['/user/dashboard']) ?>" class="navbar-brand"><b>X</b>Trader</a>
  97. </div>
  98. <div class="navbar-collapse collapse" id="navbar">
  99. <ul class="nav navbar-nav">
  100. <li id="navdashboard">
  101. <a href="<?= Url::to(['/user/dashboard']) ?>">首页</a>
  102. </li>
  103. <li id="navnotice">
  104. <a href="<?= Url::to(['/user/notice']) ?>">公告
  105. <span class="label label-danger" id="findNotReadCount"></span>
  106. </a>
  107. </li>
  108. <li id="navbankdeposit">
  109. <a href="<?= Url::to(['/user/bankdeposit']) ?>">入金</a>
  110. </li>
  111. <li id="navdw">
  112. <a href="<?= Url::to(['/user/bankwithdraw']) ?>">出金</a>
  113. </li>
  114. <!--<li id="navsameaccount">
  115. <a href="<?= Url::to(['/user/sameaccount']) ?>">同名账号</a>
  116. </li>
  117. <li id="navtransfer">
  118. <a href="<?= Url::to(['/user/transfer']) ?>">同名转账</a>
  119. </li>
  120. <li id="navlever">
  121. <a href="<?= Url::to(['/user/lever']) ?>">修改杠杆</a>
  122. </li>
  123. <li id="navhelp">
  124. <a href="<?= Url::to(['/user/help']) ?>">常见问题</a>
  125. </li>
  126. <li id="navhelp">
  127. <a href="javascript:">在线客服</a>
  128. </li>-->
  129. </ul>
  130. <ul class="nav navbar-nav navbar-right">
  131. <li id="navsetting" class="dropdown">
  132. <a aria-expanded="false" role="button" href="#" class="dropdown-toggle" data-toggle="dropdown">
  133. <?= Yii::$app->getUser()->getIdentity(false)->username ?> <span class="caret"></span>
  134. </a>
  135. <ul role="menu" class="dropdown-menu">
  136. <li><a href="<?= Url::to(['/user/info']) ?>">基本资料</a></li>
  137. <li><a href="<?= Url::to(['/user/password']) ?>">修改密码</a></li>
  138. <li><a href="<?= Url::to(['/account/logout']) ?>">退出</a></li>
  139. </ul>
  140. </li>
  141. </ul>
  142. </div>
  143. <?php endif; ?>
  144. </div>
  145. </nav>
  146. </div>
  147. <div class="wrapper wrapper-content">
  148. <div class="container">
  149. <?= $content ?>
  150. </div>
  151. </div>
  152. <br>
  153. <div class="footer">
  154. <div class="container">
  155. <div class="pull-right">V2.0</div>
  156. <div><strong>Copyright</strong> &copy; <?= date('Y') ?></div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  162. <div class="modal-dialog" role="document">
  163. <div class="modal-content">
  164. <div class="modal-header">
  165. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  166. <h4 class="modal-title" id="myModalLabel"><a href="javascript:;" class="modal-title-a" target="_blank"></a></h4>
  167. </div>
  168. <div class="modal-body"></div>
  169. <div class="modal-footer">
  170. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <?php $this->endBody() ?>
  176. <!-- Mainly scripts -->
  177. <script src="<?= STATIC_URL ?>/ui/js/bootstrap.min.js"></script>
  178. <script src="<?= STATIC_URL ?>/ui/js/plugins/metisMenu/jquery.metisMenu.js"></script>
  179. <script src="<?= STATIC_URL ?>/ui/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  180. <script src="<?= STATIC_URL ?>/ui/js/inspinia.js"></script>
  181. <script src="<?= STATIC_URL ?>/ui/js/plugins/pace/pace.min.js"></script>
  182. <script src="<?= STATIC_URL ?>/ui/js/plugins/toastr/toastr.min.js"></script>
  183. <script src="<?= STATIC_URL ?>/ui/js/plugins/datapicker/bootstrap-datepicker.js"></script>
  184. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/jquery.validate.min.js"></script>
  185. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/additional-methods.min.js"></script>
  186. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/messages.cn.js"></script>
  187. <!-- iCheck -->
  188. <script src="<?= STATIC_URL ?>/ui/js/plugins/iCheck/icheck.min.js"></script>
  189. <script src="<?= STATIC_URL ?>/ui/js/plugins/select2/select2.full.min.js"></script>
  190. <script>
  191. $(document).ready(function () {
  192. $('.i-checks').iCheck({
  193. checkboxClass: 'icheckbox_square-green',
  194. radioClass: 'iradio_square-green'
  195. });
  196. $('.data').datepicker({
  197. startView: 1,
  198. todayBtn: "linked",
  199. keyboardNavigation: true,
  200. forceParse: false,
  201. autoclose: true,
  202. format: "yyyy-mm-dd"
  203. });
  204. $(".select2").select2();
  205. $("#kefu").click(function () {
  206. 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');
  207. });
  208. findNotReadCount();
  209. showLastUnreadNotice();
  210. });
  211. function findNotReadCount() {
  212. $.ajax({
  213. type: "GET",
  214. url: "<?= Url::to(['/user/notice/find-not-read-count']) ?>",
  215. data: $('#form').serialize(),
  216. dataType: "text",
  217. beforeSend: function () {
  218. },
  219. success: function (data) {
  220. if (data != "0") {
  221. $("#findNotReadCount").html(data + "未读");
  222. }
  223. },
  224. complete: function (XMLHttpRequest, textStatus) {
  225. },
  226. error: function () {
  227. }
  228. });
  229. }
  230. function showLastUnreadNotice() {
  231. if (location.pathname === '/user/notice' || location.pathname.indexOf('/user/notice/') === 0) {
  232. return;
  233. }
  234. $.get('<?= Url::to(['notice/last-unread-notice']) ?>', {}, function (response) {
  235. if (response.code == 1 && response.data.notice) {
  236. $('#myModal .modal-title-a').html(response.data.notice.title);
  237. $('#myModal .modal-title-a').attr('href', '/user/notice/nview?id=' + response.data.notice.id);
  238. $('#myModal .modal-body').html(response.data.notice.content);
  239. $('#myModal').modal();
  240. $('#myModal .modal-title-a').on('click', function () {
  241. $('#myModal').modal('hide');
  242. });
  243. }
  244. }, 'json');
  245. }
  246. </script>
  247. <script>
  248. var url = location.href;
  249. if (url.indexOf("/dashboard") != -1) {
  250. $("#navdashboard").addClass("active");
  251. } else if (url.indexOf("/dw") != -1) {
  252. $("#navdw").addClass("active");
  253. } else if (url.indexOf("/lever") != -1) {
  254. $("#navlever").addClass("active");
  255. } else if (url.indexOf("/transfer") != -1) {
  256. $("#navtransfer").addClass("active");
  257. } else if (url.indexOf("/bankdeposit") != -1) {
  258. $("#navbankdeposit").addClass("active");
  259. } else if (url.indexOf("/notice") != -1) {
  260. $("#navnotice").addClass("active");
  261. } else if (url.indexOf("/nview") != -1) {
  262. $("#navnotice").addClass("active");
  263. } else if (url.indexOf("/help") != -1) {
  264. $("#navhelp").addClass("active");
  265. } else if (url.indexOf("/sameaccount") != -1) {
  266. $("#navsameaccount").addClass("active");
  267. }else if (url.indexOf("/bankwithdraw") != -1) {
  268. $("#navdw").addClass("active");
  269. }
  270. </script>
  271. <script>
  272. // 对Date的扩展,将 Date 转化为指定格式的String
  273. // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
  274. // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
  275. // 例子:
  276. // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
  277. // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
  278. Date.prototype.Format = function (fmt) { //author: meizz
  279. var o = {
  280. "M+": this.getMonth() + 1, //月份
  281. "d+": this.getDate(), //日
  282. "h+": this.getHours(), //小时
  283. "m+": this.getMinutes(), //分
  284. "s+": this.getSeconds(), //秒
  285. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  286. "S": this.getMilliseconds() //毫秒
  287. };
  288. if (/(y+)/.test(fmt))
  289. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  290. for (var k in o)
  291. if (new RegExp("(" + k + ")").test(fmt))
  292. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  293. return fmt;
  294. };
  295. function timeStamp2String(time) {
  296. time += new Date().getTimezoneOffset() * 60 * 1000;
  297. var datetime = new Date();
  298. datetime.setTime(parseInt(time));
  299. var year = datetime.getFullYear();
  300. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  301. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  302. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  303. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  304. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  305. return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
  306. }
  307. function timeStamp2StringForEcharts(time) {
  308. time += new Date().getTimezoneOffset() * 60 * 1000;
  309. var datetime = new Date();
  310. datetime.setTime(parseInt(time));
  311. var year = datetime.getFullYear();
  312. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  313. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  314. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  315. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  316. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  317. //return year + "/" + month + "/" + date + " " + hour + ":" + minute + ":" + second;
  318. return month + "/" + date + " " + hour + ":" + minute;
  319. }
  320. function timeStamp2StringMin(time) {
  321. time += new Date().getTimezoneOffset() * 60 * 1000;
  322. var datetime = new Date();
  323. datetime.setTime(parseInt(time));
  324. var year = datetime.getFullYear();
  325. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  326. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  327. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  328. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  329. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  330. //return hour + ":" + minute + ":" + second;
  331. return hour + ":" + minute;
  332. }
  333. </script>
  334. <?= isset($this->blocks['left_menu_script']) ? trim($this->blocks['left_menu_script']) : '' ?>
  335. <?= isset($this->blocks['footer_script']) ? trim($this->blocks['footer_script']) : '' ?>
  336. </body>
  337. </html>
  338. <?php $this->endPage() ?>