login.vue 12 KB

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