main.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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 id="kefu" href="javascript:">在线客服</a>
  88. </li>
  89. <li>
  90. <a href="<?= isset(Yii::$app->params['xcoqBaseUrl']) ? trim(Yii::$app->params['xcoqBaseUrl']) : '#' ?>">返回官网</a>
  91. </li>
  92. </ul>
  93. </div>
  94. <?php elseif ($this->context->module->id == 'user'): ?>
  95. <div class="navbar-header">
  96. <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
  97. <i class="fa fa-reorder"></i>
  98. </button>
  99. <a href="<?= Url::to(['/user/dashboard']) ?>" class="navbar-brand"><b>X</b>Trader</a>
  100. </div>
  101. <div class="navbar-collapse collapse" id="navbar">
  102. <ul class="nav navbar-nav">
  103. <li id="navdashboard">
  104. <a href="<?= Url::to(['/user/dashboard']) ?>">首页</a>
  105. </li>
  106. <li id="navnotice">
  107. <a href="<?= Url::to(['/user/notice']) ?>">公告
  108. <span class="label label-danger" id="findNotReadCount"></span>
  109. </a>
  110. </li>
  111. <li id="navbankdeposit">
  112. <a href="<?= Url::to(['/user/bankdeposit']) ?>">入金</a>
  113. </li>
  114. <li id="navdw">
  115. <a href="<?= Url::to(['/user/bankwithdraw']) ?>">出金</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 id="kefu" 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. <?php $this->endBody() ?>
  162. <!-- Mainly scripts -->
  163. <script src="<?= STATIC_URL ?>/ui/js/bootstrap.min.js"></script>
  164. <script src="<?= STATIC_URL ?>/ui/js/plugins/metisMenu/jquery.metisMenu.js"></script>
  165. <script src="<?= STATIC_URL ?>/ui/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  166. <script src="<?= STATIC_URL ?>/ui/js/inspinia.js"></script>
  167. <script src="<?= STATIC_URL ?>/ui/js/plugins/pace/pace.min.js"></script>
  168. <script src="<?= STATIC_URL ?>/ui/js/plugins/toastr/toastr.min.js"></script>
  169. <script src="<?= STATIC_URL ?>/ui/js/plugins/datapicker/bootstrap-datepicker.js"></script>
  170. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/jquery.validate.min.js"></script>
  171. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/additional-methods.min.js"></script>
  172. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/messages.cn.js"></script>
  173. <!-- iCheck -->
  174. <script src="<?= STATIC_URL ?>/ui/js/plugins/iCheck/icheck.min.js"></script>
  175. <script src="<?= STATIC_URL ?>/ui/js/plugins/select2/select2.full.min.js"></script>
  176. <script>
  177. $(document).ready(function () {
  178. $('.i-checks').iCheck({
  179. checkboxClass: 'icheckbox_square-green',
  180. radioClass: 'iradio_square-green'
  181. });
  182. $('.data').datepicker({
  183. startView: 1,
  184. todayBtn: "linked",
  185. keyboardNavigation: true,
  186. forceParse: false,
  187. autoclose: true,
  188. format: "yyyy-mm-dd"
  189. });
  190. $(".select2").select2();
  191. $("#kefu").click(function () {
  192. 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');
  193. });
  194. findNotReadCount();
  195. });
  196. function findNotReadCount() {
  197. $.ajax({
  198. type: "GET",
  199. url: "<?= Url::to(['/user/notice/find-not-read-count']) ?>",
  200. data: $('#form').serialize(),
  201. dataType: "text",
  202. beforeSend: function () {
  203. },
  204. success: function (data) {
  205. if (data != "0") {
  206. $("#findNotReadCount").html(data + "未读");
  207. }
  208. },
  209. complete: function (XMLHttpRequest, textStatus) {
  210. },
  211. error: function () {
  212. }
  213. });
  214. }
  215. </script>
  216. <script>
  217. var url = location.href;
  218. if (url.indexOf("/dashboard") != -1) {
  219. $("#navdashboard").addClass("active");
  220. } else if (url.indexOf("/dw") != -1) {
  221. $("#navdw").addClass("active");
  222. } else if (url.indexOf("/lever") != -1) {
  223. $("#navlever").addClass("active");
  224. } else if (url.indexOf("/transfer") != -1) {
  225. $("#navtransfer").addClass("active");
  226. } else if (url.indexOf("/bankdeposit") != -1) {
  227. $("#navbankdeposit").addClass("active");
  228. } else if (url.indexOf("/notice") != -1) {
  229. $("#navnotice").addClass("active");
  230. } else if (url.indexOf("/nview") != -1) {
  231. $("#navnotice").addClass("active");
  232. } else if (url.indexOf("/help") != -1) {
  233. $("#navhelp").addClass("active");
  234. }
  235. </script>
  236. <script>
  237. // 对Date的扩展,将 Date 转化为指定格式的String
  238. // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
  239. // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
  240. // 例子:
  241. // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
  242. // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
  243. Date.prototype.Format = function (fmt) { //author: meizz
  244. var o = {
  245. "M+": this.getMonth() + 1, //月份
  246. "d+": this.getDate(), //日
  247. "h+": this.getHours(), //小时
  248. "m+": this.getMinutes(), //分
  249. "s+": this.getSeconds(), //秒
  250. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  251. "S": this.getMilliseconds() //毫秒
  252. };
  253. if (/(y+)/.test(fmt))
  254. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  255. for (var k in o)
  256. if (new RegExp("(" + k + ")").test(fmt))
  257. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  258. return fmt;
  259. };
  260. function timeStamp2String(time) {
  261. time += new Date().getTimezoneOffset() * 60 * 1000;
  262. var datetime = new Date();
  263. datetime.setTime(parseInt(time));
  264. var year = datetime.getFullYear();
  265. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  266. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  267. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  268. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  269. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  270. return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
  271. }
  272. function timeStamp2StringForEcharts(time) {
  273. time += new Date().getTimezoneOffset() * 60 * 1000;
  274. var datetime = new Date();
  275. datetime.setTime(parseInt(time));
  276. var year = datetime.getFullYear();
  277. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  278. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  279. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  280. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  281. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  282. //return year + "/" + month + "/" + date + " " + hour + ":" + minute + ":" + second;
  283. return month + "/" + date + " " + hour + ":" + minute;
  284. }
  285. function timeStamp2StringMin(time) {
  286. time += new Date().getTimezoneOffset() * 60 * 1000;
  287. var datetime = new Date();
  288. datetime.setTime(parseInt(time));
  289. var year = datetime.getFullYear();
  290. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  291. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  292. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  293. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  294. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  295. //return hour + ":" + minute + ":" + second;
  296. return hour + ":" + minute;
  297. }
  298. </script>
  299. <?= isset($this->blocks['left_menu_script']) ? trim($this->blocks['left_menu_script']) : '' ?>
  300. <?= isset($this->blocks['footer_script']) ? trim($this->blocks['footer_script']) : '' ?>
  301. </body>
  302. </html>
  303. <?php $this->endPage() ?>