login.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="normal-login-container">
  3. <view class="logo-content">
  4. <!-- <image src="../../static/jnImage/loginPage/logo.png">
  5. </image> -->
  6. <view class="logoTit">
  7. <view class="titleZN">晋能控股电力集团</view>
  8. <view class="titleZN">清洁能源有限公司</view>
  9. <view class="titleEN">发电场站生产实时运营管理平台</view>
  10. </view>
  11. </view>
  12. <view class="login-form-content">
  13. <view class="input-item flex align-center">
  14. <image src="../../static/jnImage/loginPage/userName.png">
  15. <input v-model="loginForm.username" class="input" type="text" placeholder="用户名" maxlength="30" />
  16. </view>
  17. <view class="input-item flex align-center">
  18. <image src="../../static/jnImage/loginPage/locked.png">
  19. <input v-model="loginForm.password" type="password" class="input" placeholder="密码" maxlength="20" />
  20. </view>
  21. <view class="action-btn">
  22. <button @click="handleLogin" class="login-btn">登录</button>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: 'Login',
  30. data() {
  31. return {
  32. captchaEnabled: false, // 验证码开关 TODO 芋艿:需要抽到配置里
  33. globalConfig: getApp().globalData.config,
  34. loginForm: {
  35. username: "admin",
  36. password: "admin123"
  37. }
  38. }
  39. },
  40. methods: {
  41. // 登录方法
  42. handleLogin(params) {
  43. // if (this.loginForm.username === "") {
  44. // this.$modal.msgError("请输入您的账号")
  45. // } else if (this.loginForm.password === "") {
  46. // this.$modal.msgError("请输入您的密码")
  47. // } else {
  48. // // await this.pwdLogin({})
  49. // uni.navigateTo({
  50. // url: '/pages/power/index'
  51. // });
  52. // }
  53. let that = this
  54. that.$tab.switchTab('/pages/home/index')
  55. },
  56. // 密码登录
  57. async pwdLogin() {
  58. // this.$modal.loading("登录中,请耐心等待...")
  59. // 执行登录
  60. // this.$store.dispatch('Login', this.loginForm).then(() => {
  61. // this.$modal.closeLoading()
  62. // this.loginSuccess()
  63. // })
  64. this.loginSuccess()
  65. },
  66. // 登录成功后,处理函数
  67. loginSuccess(result) {
  68. // 设置用户信息
  69. // this.$store.dispatch('GetInfo').then(res => {
  70. // this.$tab.reLaunch('/pages/index')
  71. // })
  72. // this.$tab.reLaunch('/pages/index')
  73. uni.navigateTo({
  74. url: '/pages/index',
  75. success: res => {},
  76. fail: () => {},
  77. complete: () => {}
  78. });
  79. // this.$tab.navigateTo('/pages/index')
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. page {
  86. background-color: #202246;
  87. }
  88. .normal-login-container {
  89. background: url('../../static/jnImage/loginPage/loginBac.png');
  90. background-size: cover;
  91. width: 100%;
  92. hieght: 100vh;
  93. .logo-content {
  94. width: 100%;
  95. font-size: 21px;
  96. text-align: center;
  97. padding-top: 45%;
  98. // image {
  99. // border-radius: 4px;
  100. // margin-top: 40px;
  101. // width: 80px;
  102. // height: 60px;
  103. // }
  104. .logoTit {
  105. color: #fff;
  106. .titleZN {
  107. font-size: 60upx;
  108. font-family: FZZhengHeiS-M-GB;
  109. font-weight: 500;
  110. color: #FFFFFF;
  111. letter-spacing: 3px;
  112. }
  113. .titleEN {
  114. margin-top: 5px;
  115. font-size: 26upx;
  116. color: #E5E9F2;
  117. letter-spacing: 5px;
  118. }
  119. }
  120. }
  121. .login-form-content {
  122. text-align: center;
  123. margin: 20px auto;
  124. margin-top: 50%;
  125. width: 80%;
  126. .input-item {
  127. margin: 20px auto;
  128. // background-color: #f5f6f7;
  129. height: 45px;
  130. border-bottom: 1px solid #f5f6f7;
  131. image {
  132. width: 20px;
  133. height: 23px;
  134. }
  135. .input {
  136. color: #fff;
  137. width: 100%;
  138. font-size: 14px;
  139. line-height: 20px;
  140. text-align: left;
  141. padding-left: 15px;
  142. .uni-input-wrapper {
  143. .input-placeholder {
  144. color: #fff;
  145. font-size: 16px;
  146. }
  147. }
  148. }
  149. }
  150. .login-btn {
  151. margin-top: 30px;
  152. height: 40px;
  153. color: #fff;
  154. background: #4287FF;
  155. border-radius: 10px;
  156. letter-spacing: 10px;
  157. line-height: 40px;
  158. }
  159. }
  160. .easyinput {
  161. width: 100%;
  162. }
  163. }
  164. .login-code-img {
  165. height: 45px;
  166. }
  167. </style>