login.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <!-- 登录页面 -->
  3. <div class="login">
  4. <!-- <div class="loginBc">
  5. <img src="@/assets/img/login-bg-autumn.jpg" class="loginImg" alt="">
  6. </div> -->
  7. <!-- 切换语言框 -->
  8. <div class="loginContentLang">
  9. <div style="font-size: 15px;">
  10. Language:
  11. </div>
  12. <div class="loginContentLangSelect">
  13. <select v-model="value">
  14. <option value="" selected:disabled style="display:none">简体中文</option>
  15. <option v-for="(i,index) in language" :label="i.label" :key="index" :value="i.values" placeholder="jianyi"></option>
  16. </select>
  17. </div>
  18. </div>
  19. <!-- 切换语言框结束 -->
  20. <!-- 登录框logo开始 -->
  21. <div class="loginLogo">
  22. <img src="@/assets/img/login-logo.png" alt="">
  23. </div>
  24. <!-- 登录框logo结束 -->
  25. <!-- 登录框-->
  26. <div class="loginContent">
  27. <div class="loginTab1">
  28. <div class="loginTab1way">
  29. <div @click="zhLog" ref="tet1" class="loginTab1way1 color1">账号登陆</div>
  30. <div @click="dtmLog" ref="tet2" class="loginTab1way1 color2">动态码登陆</div>
  31. </div>
  32. <!-- 账户登录 -->
  33. <div class="loginTab1wayContent" v-show="isShow==1">
  34. <div class="loginTab1wayContentInp">
  35. <div class="loginTab1InpContentLeft"></div>
  36. <div>
  37. <input v-model="form.account" class="input1" placeholder="学号/职工号"/>
  38. </div>
  39. </div>
  40. <div class="loginTab1wayContentInp">
  41. <div class="loginTab1InpContentLeft2"></div>
  42. <div>
  43. <input v-model="form.pwd" type="password" class="input1" placeholder="密码"/>
  44. </div>
  45. </div>
  46. <p class="loginTab1ContentText">
  47. <a href="">忘记绑定邮箱、手机号,请点击提示</a>
  48. </p>
  49. <el-button type="success" class="btn" @click="login">登录</el-button>
  50. <p class="loginTab1ContentText">
  51. <a href="">忘记密码?</a>
  52. </p>
  53. <el-divider style="color:#999999">社交账号登陆</el-divider>
  54. <div class="loginTab1ContentQqWei">
  55. <p>
  56. <a href=""><img src="@/assets/img/qq.png" alt=""></a>
  57. <a href=""><img src="@/assets/img/weixin.png" alt=""></a>
  58. </p>
  59. </div>
  60. </div>
  61. <!-- 账户登录结束 -->
  62. <!-- 动态码登录 -->
  63. <div class="loginTab1wayContent" v-show="isShow==2">
  64. <div class="loginTab1wayContentInp">
  65. <div class="loginTab1InpContentLeft"></div>
  66. <div>
  67. <input v-model="form.account" class="input1" placeholder="学号/职工号"/>
  68. </div>
  69. </div>
  70. <div style="display: flex;">
  71. <div class="loginTab1wayContentInp2">
  72. <div class="loginTab1InpContentLeft2"></div>
  73. <div>
  74. <input v-model="form.pwd" class="input2" placeholder="动态码"/>
  75. </div>
  76. </div>
  77. <div class="loginTab1wayContentInp2btn">获取动态码</div>
  78. </div>
  79. <el-button type="success" class="btn" @click="login1" style="margin-bottom: 20px;">登录</el-button>
  80. </div>
  81. <!-- 动态码登录结束 -->
  82. </div>
  83. </div>
  84. <!-- 登录框 -->
  85. </div>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. isShow:1,
  92. value:'' ,//语言切换
  93. language:[
  94. {
  95. label:'简体中文',
  96. values:0,
  97. },
  98. {
  99. label:'English',
  100. values:1
  101. }
  102. ],
  103. form:{
  104. account:'',
  105. pwd:''
  106. }
  107. }
  108. },
  109. methods:{
  110. login(){
  111. let param =
  112. {
  113. username:this.form.account,
  114. password:this.form.pwd
  115. };
  116. console.log(param);
  117. // console.log(param);
  118. // this.ajax
  119. // .post("/login",param)
  120. // .then((res)=>{
  121. // // console.log(res.data);
  122. // const q=res.data.data[0]
  123. // if (res.data.status==0) {
  124. // this.$message.success(res.data.message);
  125. // this.$store.dispatch("UpdateUser",{name:q.name,tel:q.username,school:q.school,id:q.id})
  126. // sessionStorage.setItem('state',JSON.stringify({user:{name:q.name,tel:q.username,school:q.school,id:q.id}}))
  127. // this.$router.push({path:"Class"}); //页面路由跳转
  128. this.$router.push('/projectApplication')
  129. // }else{
  130. // this.$message.error(res.data.message);
  131. // }
  132. // },(error)=>{
  133. // console.log(error);
  134. // })
  135. // }
  136. },
  137. login1(){
  138. },
  139. zhLog(){
  140. this.$refs.tet1.classList.remove('color2')
  141. this.$refs.tet1.classList.add('color1')
  142. this.$refs.tet2.classList.remove('color1')
  143. this.$refs.tet2.classList.add('color2')
  144. this.isShow=1?1:1;
  145. },
  146. dtmLog(){
  147. this.$refs.tet2.classList.remove('color2')
  148. this.$refs.tet2.classList.add('color1')
  149. this.$refs.tet1.classList.remove('color1')
  150. this.$refs.tet1.classList.add('color2')
  151. this.isShow=2?2:2;
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="less">
  157. .login{
  158. width: 100%;
  159. height: 98%;
  160. position: relative;
  161. background: url(@/assets/img/login-bg-autumn.jpg) no-repeat 0 0/100% 100%;
  162. .loginContent{ //登录框
  163. position: absolute;
  164. width: 960px;
  165. margin: 20px auto;
  166. top: 10%;
  167. right: 15%;
  168. font-family: 'Microsoft YaHei';
  169. font-size: 13px;
  170. color: #676A6C;
  171. .loginTab1{
  172. background:rgba(255, 255, 255, .9);
  173. width: 420px;
  174. height: auto;
  175. margin-top: 110px;
  176. float: right;
  177. .loginTab1way{
  178. display: flex;
  179. font-size: 19px;
  180. color: #676A6C;
  181. cursor: pointer;
  182. .loginTab1way1{
  183. width: 50%;
  184. height: 48px;
  185. text-align: center;
  186. line-height: 48px;
  187. }
  188. .color1{
  189. background: rgba(255, 255, 255, .9);
  190. }
  191. .color2{
  192. background: #8c969f;
  193. color: #ffffff;
  194. }
  195. }
  196. .loginTab1wayContent{
  197. margin: 25px 35px;
  198. color: #676A6C;
  199. // 账号登录样式
  200. .loginTab1wayContentInp{
  201. width: 100%;
  202. height: 38px;
  203. margin-bottom: 17px;
  204. display: flex;
  205. border: 1px #ccc solid;
  206. .loginTab1InpContentLeft{
  207. width: 33px;
  208. height: 38px;
  209. border-right: 1px solid #ccc;
  210. background: #f2f2f2 url(@/assets/img/icons.png) 6px -73px no-repeat;
  211. }
  212. .loginTab1InpContentLeft2{
  213. width: 33px;
  214. height: 38px;
  215. // background:rgba(138, 138, 137, .8) ;
  216. border-right: 1px solid #ccc;
  217. background: #f2f2f2 url(@/assets/img/icons.png) -128px -43px no-repeat;
  218. }
  219. .input1{
  220. width: 292px;
  221. height: 18px;
  222. padding: 10px 12px;
  223. outline: none;
  224. border: none;
  225. }
  226. .input2{
  227. width: 112px;
  228. height: 18px;
  229. padding: 10px 12px;
  230. outline: none;
  231. border: none;
  232. }
  233. }
  234. .loginTab1wayContentInp2{
  235. // background: #1ab394;
  236. width: 170px;
  237. height: 38px;
  238. margin-bottom: 57px;
  239. display: flex;
  240. border: 1px #ccc solid;
  241. .loginTab1InpContentLeft{
  242. width: 33px;
  243. height: 38px;
  244. border-right: 1px solid #ccc;
  245. background: #f2f2f2 url(@/assets/img/icons.png) 6px -73px no-repeat;
  246. }
  247. .loginTab1InpContentLeft2{
  248. width: 33px;
  249. height: 38px;
  250. // background:rgba(138, 138, 137, .8) ;
  251. border-right: 1px solid #ccc;
  252. background: #f2f2f2 url(@/assets/img/icons.png) -128px -43px no-repeat;
  253. }
  254. .input1{
  255. width: 292px;
  256. height: 18px;
  257. padding: 10px 12px;
  258. outline: none;
  259. border: none;
  260. }
  261. .input2{
  262. width: 112px;
  263. height: 18px;
  264. padding: 10px 12px;
  265. outline: none;
  266. border: none;
  267. }
  268. }
  269. .loginTab1wayContentInp2btn{
  270. width: 100px;height: 38px;
  271. line-height: 38px;
  272. text-align: center;
  273. background: #EBDC99;
  274. margin-left: 80px;
  275. }
  276. }
  277. .loginTab1ContentText{
  278. margin-bottom: 10px;
  279. a{
  280. text-decoration: none;color: #676A6C;
  281. }
  282. }
  283. .btn{
  284. width: 100%;
  285. background: #1ab394;
  286. margin-bottom: 7px;
  287. }
  288. .loginTab1ContentQqWei{
  289. width: 100%;
  290. display: flex;
  291. justify-content:center;
  292. a{
  293. margin-right: 15px;
  294. }
  295. }
  296. }
  297. }
  298. .loginLogo{
  299. position: absolute;
  300. top: 5%;
  301. left: 25%;
  302. width: 30%;
  303. padding: 0;
  304. font-family: 'Microsoft YaHei';
  305. font-size: 13px;
  306. color: #676A6C;
  307. display: block;
  308. img{
  309. width: 100%;
  310. height: 100%;
  311. }
  312. }
  313. .loginContentLang{
  314. position: absolute;
  315. top: 40px;
  316. right: 40px;
  317. display: flex;
  318. font-size: 17px;
  319. .loginContentLangSelect{
  320. margin-left: 10px;
  321. border-radius: 5px;
  322. }
  323. }
  324. }
  325. </style>