Login.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class="container">
  3. <div class="log-paper">
  4. <img src="../assets/img/Land_sbg.png">
  5. </div>
  6. <div class="log-container">
  7. <img class="log-icon" src="../assets/img/log.png">
  8. <div class="log-text">欢迎登陆私塾家在线人员管理后台</div>
  9. <div @click="WxLoginCtl" class="log-qrcode">
  10. <div id="login_container"></div>
  11. <!-- <img class="log-qrcode-image" src="../assets/img/ssj_qrcode.png"> -->
  12. <div class="log-qrcode-text">请使用微信扫码登陆</div>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. // import { mapActions } from "vuex";
  19. // import wx from 'weixin-js-sdk'
  20. // import $ from 'jquery'
  21. export default {
  22. name: "login",
  23. data() {
  24. return {};
  25. },
  26. watch: {},
  27. created() {
  28. // this.getTKByUnionid()
  29. },
  30. methods: {
  31. WxLoginCtl() {
  32. // this.$util.messageMethod("success", "前去微信登陆扫码授权");
  33. this.$router.push({
  34. path: "/aikmt/Redirect_uri",
  35. query: {
  36. unionid: "oPHg8wXraekgH5YKVHvD3H7Ujynw",
  37. prince: "6666666666666"
  38. }
  39. });
  40. },
  41. // async getTKByUnionid() {
  42. // if (window.location.href.indexOf("unionid") >= 0) {
  43. // // 如果url中包含code,则保存到store中
  44. // let unionid = window.location.href.split("?")[1];
  45. // unionid = unionid.substring(8, code.indexOf("&"));
  46. // let WxCode = unionid;
  47. // this.WxCode = WxCode;
  48. // this.$store.dispatch("UnionidLogin", {
  49. // unionid: this.WxCode
  50. // });
  51. // }
  52. // return
  53. // }
  54. },
  55. mounted() {
  56. var obj = new WxLogin({
  57. self_redirect: false,
  58. id: "login_container",
  59. appid: "wxd18ca9555a939281",
  60. scope: "snsapi_login",
  61. redirect_uri: encodeURI(
  62. "https://kmt.sharingschool.com/aijia/index.html#/aikmt/Redirect_uri"
  63. // "https://t.sharingschool.com/upload/ceshi/index.html"
  64. ),
  65. state: "",
  66. style: "width: 250px",
  67. href: ""
  68. });
  69. }
  70. };
  71. </script>
  72. <style scoped>
  73. body {
  74. /* background-image: url(../assets/img/Land_bg.png); */
  75. background-size: 100% auto;
  76. }
  77. .container {
  78. position: absolute;
  79. top: 50%;
  80. left: 50%;
  81. -webkit-transform: translate(-50%, -50%);
  82. -moz-transform: translate(-50%, -50%);
  83. -ms-transform: translate(-50%, -50%);
  84. -o-transform: translate(-50%, -50%);
  85. transform: translate(-50%, -50%);
  86. max-width: 70%;
  87. background: #ffffff;
  88. -webkit-box-shadow: 0 0 20px 0 rgba(50, 103, 0, 0.2);
  89. -webkit-border-radius: 4px;
  90. box-shadow: 0 0 20px 0 rgba(50, 103, 0, 0.2);
  91. border-radius: 4px;
  92. padding: 5%;
  93. }
  94. .log-paper {
  95. width: 45%;
  96. margin-right: 5%;
  97. float: left;
  98. }
  99. .log-paper img {
  100. width: 90%;
  101. }
  102. .log-container {
  103. width: 50%;
  104. margin-left: 5%;
  105. float: right;
  106. text-align: center;
  107. }
  108. .log-icon {
  109. width: 40%;
  110. }
  111. .log-text {
  112. font-size: 1.8em;
  113. color: #52cc60;
  114. margin: 0.5rem auto;
  115. }
  116. .log-qrcode {
  117. width: 80%;
  118. background: #ffffff;
  119. -webkit-box-shadow: 0 2px 10px 0 rgba(157, 166, 195, 0.3);
  120. box-shadow: 0 2px 10px 0 rgba(157, 166, 195, 0.3);
  121. padding: 10%;
  122. margin: 5% 10%;
  123. }
  124. .log-qrcode-image {
  125. width: 100%;
  126. }
  127. *,
  128. ::after,
  129. ::before {
  130. box-sizing: content-box;
  131. }
  132. .log-qrcode-text {
  133. margin-top: 1.5rem;
  134. font-size: 1em;
  135. color: #808080;
  136. }
  137. @media (min-width: 0px) and (max-width: 767px) {
  138. .container {
  139. width: 750px;
  140. }
  141. .log-paper {
  142. width: 0%;
  143. }
  144. .log-container {
  145. width: 100%;
  146. }
  147. }
  148. @media (min-width: 768px) and (max-width: 991px) {
  149. .container {
  150. width: 750px;
  151. }
  152. .log-paper {
  153. width: 45%;
  154. margin-top: 5%;
  155. }
  156. .log-container {
  157. width: 40%;
  158. }
  159. }
  160. @media (min-width: 992px) {
  161. .container {
  162. width: 970px;
  163. }
  164. .log-paper {
  165. width: 45%;
  166. }
  167. .log-container {
  168. width: 40%;
  169. }
  170. }
  171. @media (min-width: 1200px) {
  172. .container {
  173. width: 1170px;
  174. }
  175. }
  176. body {
  177. background: #f6f7fb;
  178. -webkit-font-smoothing: subpixel-antialiased;
  179. }
  180. .color-green {
  181. color: #52cc60 !important;
  182. }
  183. .color-purple {
  184. color: #612d00 !important;
  185. }
  186. .fontweight {
  187. font-weight: bold;
  188. }
  189. .text-indent {
  190. text-indent: 2.6rem;
  191. }
  192. .nodata {
  193. text-align: center;
  194. padding: 250px 20px !important;
  195. }
  196. .nodata p {
  197. padding-top: 50px;
  198. font-size: 18px;
  199. color: #65b800;
  200. }
  201. /* 适应1366 */
  202. /* @media screen and (max-width: 1366px) {
  203. .isShow1 {
  204. display: none;
  205. }
  206. .isShow2 {
  207. display: block;
  208. }
  209. .isShow3 {
  210. display: none;
  211. }
  212. .isShow4 {
  213. display: block;
  214. }
  215. } */
  216. </style>