meeAccount.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <form action="">
  3. <div class="f-row row-user">
  4. <input type="text" :placeholder="$t('login.loginTipAccount')" autocomplete>
  5. </div>
  6. <div class="f-row row-psw">
  7. <input type="password" :placeholder="$t('login.loginTipPsw')" autocomplete>
  8. </div>
  9. <el-button type="primary" class="login-btn" @click="handleLogin">{{$t('login.login')}}</el-button>
  10. </form>
  11. </template>
  12. <script>
  13. import Vue from 'vue'
  14. import { Button } from 'element-ui'
  15. import { mapState } from 'vuex'
  16. Vue.component(Button.name, Button)
  17. export default {
  18. name: 'loginBox',
  19. created () {
  20. },
  21. computed: {
  22. ...mapState([
  23. 'account',
  24. 'scatter'
  25. ]),
  26. isLogin () {
  27. return this.$store.state.chat.isLogin
  28. }
  29. },
  30. methods: {
  31. async handleLogin () {
  32. try {
  33. await this.$store.dispatch('doScatterLogin', this.$router)
  34. await this.$store.dispatch('doContractLogin')
  35. this.$store.commit('chatAppLogin', true)
  36. this.$store.commit('toApp', true)
  37. } catch (error) {
  38. this.$store.commit('chatAppLogin', false)
  39. }
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .c-loginBox{
  46. position: absolute;
  47. top: 50%;
  48. left: 50%;
  49. margin: -358px 0 0 -477px;
  50. border-radius: 4px;
  51. background-color: #e4e8eb;
  52. width: 954px;
  53. height: 717px;
  54. box-shadow: 0 2px 10px #999;
  55. text-align: center;
  56. overflow: hidden;
  57. }
  58. .logo{
  59. margin: 100px 0 40px;
  60. height: 38px;
  61. background: url(./img/logo.png) center no-repeat;
  62. }
  63. .f-row{
  64. width: 212px;
  65. padding-left: 85px;
  66. border-bottom: 1px solid rgba(#000,0.1);
  67. margin: 20px auto 0;
  68. input{
  69. width: 212px;
  70. height: 54px;
  71. line-height: 54px;
  72. border: 0;
  73. font-size: 14px;
  74. outline: none;
  75. background: transparent;
  76. }
  77. }
  78. .row-user{
  79. background: url(./img/icon-user.png) 20px center no-repeat;
  80. }
  81. .row-psw{
  82. background: url(./img/icon-psw.png) 20px center no-repeat;
  83. }
  84. .login-btn{
  85. margin: 60px 0 80px;
  86. width: 174px;
  87. font-size: 20px;
  88. padding: 14px;
  89. }
  90. .tip{
  91. display: block;
  92. color: #f93c3c;
  93. font-size: 12px;
  94. }
  95. .mini-wrap,.h5-wrap{
  96. .f-row{
  97. padding-left: 45px;
  98. width: auto;
  99. input{
  100. height: 36px;
  101. line-height: 36px;
  102. width: 100%;
  103. }
  104. }
  105. .row-user{
  106. background: url(./img/icon-meechat.png) 12px center /18px no-repeat;
  107. }
  108. .row-psw{
  109. background-position: 12px center;
  110. }
  111. .login-btn{
  112. display: block;
  113. margin: 40px auto 40px;
  114. }
  115. }
  116. .h5-wrap{
  117. .f-row{
  118. margin-top: 30px;
  119. }
  120. .login-btn{
  121. font-size: px2rem(32);
  122. width: px2rem(380);
  123. }
  124. }
  125. </style>