auth.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {extend name="public/container"}
  2. {block name='head'}
  3. <style>
  4. [v-cloak] {
  5. display: none;
  6. }
  7. .layui-card-header {
  8. font-weight: bold;
  9. font-size: 16px;
  10. }
  11. .layui-card-header .layui-icon-auz {
  12. margin-right: 5px;
  13. vertical-align: bottom;
  14. }
  15. .layui-card-body {
  16. font-size: 16px;
  17. line-height: 1.6;
  18. color: #515a6e;
  19. }
  20. .layui-card-body img {
  21. display: block;
  22. width: 100%;
  23. margin-bottom: 30px;
  24. pointer-events: none;
  25. }
  26. .button-section {
  27. margin-top: 25px;
  28. text-align: center;
  29. }
  30. .banner {
  31. padding-top: 50px;
  32. padding-bottom: 50px;
  33. background: url("{__FRAME_PATH}img/auth.jpg") center/cover no-repeat;
  34. }
  35. .banner .title {
  36. font-weight: bold;
  37. font-size: 32px;
  38. text-align: center;
  39. color: #fff;
  40. }
  41. .banner .info {
  42. margin-top: 25px;
  43. font-size: 16px;
  44. text-align: center;
  45. color: #fff;
  46. }
  47. .auth-section {
  48. text-align: center;
  49. }
  50. .auth-content {
  51. display: inline-block;
  52. padding: 60px 0 10px;
  53. background: url("{__FRAME_PATH}img/auth-icon.png") center 10px/26px 40px no-repeat;
  54. text-align: left;
  55. }
  56. .auth-content div ~ div {
  57. margin-top: 10px;
  58. }
  59. .auth-content span {
  60. color: #868686;
  61. }
  62. </style>
  63. {/block}
  64. {block name="content"}
  65. <div v-cloak id="app" class="layui-fluid">
  66. <div class="layui-row layui-col-space15">
  67. <div class="layui-col-md12">
  68. <div class="layui-card">
  69. <div class="layui-card-header"><i class="layui-icon layui-icon-auz"></i>商业授权</div>
  70. <div class="layui-card-body">
  71. <div class="banner">
  72. <div class="title">商业使用授权证书,保护您的合法权益</div>
  73. <div class="info">您的支持是我们不断进步的动力,商业授权更多是一个保障和附加的增值服务,让您优先享受新版本的强大功能和安全保障</div>
  74. </div>
  75. <div class="auth-section">
  76. <div class="auth-content">
  77. <div><span>授权状态:</span>{{ status ? '授权通过' : statusText }}</div>
  78. <div><span>授权期限:</span>{{ authTime ? authTime + '天' : '永久' }}</div>
  79. <div><span>授权码:</span>{{ authCode }}</div>
  80. </div>
  81. </div>
  82. <div class="button-section">
  83. <button type="button" class="layui-btn layui-btn-normal" @click="goQuery">查询授权</button>
  84. <button type="button" class="layui-btn layui-btn-normal" @click="goAuth">获取授权</button>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  92. {/block}
  93. {block name="script"}
  94. <script>
  95. require(['vue', 'axios'], function (Vue, axios) {
  96. new Vue({
  97. el: "#app",
  98. data: {
  99. status: false,
  100. statusText: '---',
  101. authTime: '---',
  102. authCode: '---',
  103. errorCode: '---'
  104. },
  105. created: function () {
  106. this.init();
  107. },
  108. methods: {
  109. init: function () {
  110. Promise.all([this.checkAuth(), this.authInfo()]).then(function (res) {
  111. if (res[0].data.code === 200) {
  112. if (res[0].data.data.status === 1) {
  113. this.status = true;
  114. }
  115. } else {
  116. }
  117. if (res[1].data.code === 200) {
  118. this.statusText = res[1].data.data.msg;
  119. this.authTime = res[1].data.data.day;
  120. this.authCode = res[1].data.data.authCode;
  121. } else {
  122. }
  123. }.bind(this));
  124. },
  125. checkAuth: function () {
  126. return axios.get("{:Url('check_auth')}");
  127. },
  128. authInfo: function () {
  129. return axios.get("{:Url('auth_data')}");
  130. },
  131. goAuth: function (params) {
  132. window.open('http://www.crmeb.com/web/auth/apply.html');
  133. },
  134. goQuery: function () {
  135. window.open('http://www.crmeb.com/web/auth/query.html');
  136. }
  137. }
  138. });
  139. });
  140. </script>
  141. {/block}