login.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="login">
  3. <view class="login-title">法务仲裁系统</view>
  4. <view class="login-content">
  5. <view class="login-username">
  6. <i class="el-icon-user"></i>
  7. <input type="text" placeholder="请输入账号" v-model="phone">
  8. </view>
  9. <view class="login-password">
  10. <i class="el-icon-key"></i>
  11. <input type="safe-password" name="" id="" placeholder="请输入密码" v-model="password">
  12. </view>
  13. </view>
  14. <view class="button"><button @click="onsubmit">登录</button></view>
  15. <view class="login-botton">
  16. <view class="login-password" @click="findPassword">找回密码</view>
  17. <span>|</span>
  18. <view class="login-zhuce" @click="Registration">注册账号</view>
  19. </view>
  20. <!-- 其他的登录方式 -->
  21. <!-- <view class="login-other">
  22. <view class="login-top">
  23. 其他的登录方式
  24. </view>
  25. <view class="login-icon">
  26. <image src="../../static/index/QQ.png" mode="widthFix"></image>
  27. <image src="../../static/index/weixin.png" mode="widthFix"></image>
  28. </view>
  29. </view> -->
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. mapMutations
  35. } from 'vuex';
  36. export default {
  37. data() {
  38. return {
  39. phone: '',
  40. password: '',
  41. rules: {
  42. phone: [{
  43. required: true,
  44. message: '请输入手机号',
  45. rule: '/^1[23456789]\d{9}$/'
  46. }],
  47. password: [{
  48. required: true,
  49. message: '请输入密码',
  50. trigger: 'blur'
  51. }]
  52. }
  53. };
  54. },
  55. methods: {
  56. // ...mapMutations(['user_Login']),
  57. //登录
  58. onsubmit() {
  59. if (this.phone == '' || this.password == '') {
  60. uni.showToast({
  61. title: "内容不能为空哦!",
  62. icon: "none"
  63. })
  64. } else {
  65. let data = {
  66. phone: this.phone,
  67. password: this.password
  68. }
  69. if(this.phone == 'admin' && this.password == 'abc123456'){
  70. uni.switchTab({
  71. url: '/pages/home/index'
  72. })
  73. }
  74. }
  75. },
  76. Registration() {
  77. console.log('hah ');
  78. uni.navigateTo({
  79. url: '../../pages/login/registration'
  80. });
  81. },
  82. // 找回密码
  83. findPassword() {
  84. // console.log('hah ');
  85. // this.$router.push('/pages/login/findPassword');
  86. },
  87. // 其他方式登录
  88. loginOther() {
  89. // uni.share({
  90. // provider: "weixin",
  91. // scene: "WXSceneSession",
  92. // type: 1,
  93. // summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
  94. // success: function(res) {
  95. // console.log("success:" + JSON.stringify(res));
  96. // },
  97. // fail: function(err) {
  98. // console.log("fail:" + JSON.stringify(err));
  99. // }
  100. // });
  101. }
  102. }
  103. };
  104. </script>
  105. <style lang="less">
  106. .login {
  107. // background-color: #fff;
  108. // background-image: url('../../static/zhongcai.png');
  109. width: 100%;
  110. background-position: center;
  111. background-size: cover;
  112. // background-color: #464646;
  113. margin: 0px;
  114. background-size: 100% 100%;
  115. background-attachment: fixed;
  116. height: calc(100vh - 150rpx);
  117. .login-title {
  118. padding-top: 150rpx;
  119. display: flex;
  120. justify-content: flex-start;
  121. margin-left: 50rpx;
  122. font-weight: 700;
  123. font-size: 40rpx;
  124. color: #d11c1c;
  125. letter-spacing: 5rpx;
  126. margin-bottom: 50rpx;
  127. }
  128. .login-content {
  129. .login-username {
  130. display: flex;
  131. align-items: center;
  132. margin: 0 50rpx;
  133. border-bottom: 1rpx solid gainsboro;
  134. input {
  135. padding: 10rpx;
  136. height: 60rpx;
  137. width: 80%;
  138. }
  139. i {
  140. color: #d11c1c;
  141. padding-right: 20rpx;
  142. font-size: 50rpx;
  143. }
  144. }
  145. .login-password {
  146. display: flex;
  147. align-items: center;
  148. margin: 0 50rpx;
  149. border-bottom: 1rpx solid gainsboro;
  150. margin-top: 50rpx;
  151. input {
  152. padding: 10rpx;
  153. height: 60rpx;
  154. width: 80%;
  155. }
  156. i {
  157. color: #d11c1c;
  158. padding-right: 20rpx;
  159. font-size: 50rpx;
  160. }
  161. }
  162. }
  163. .button {
  164. margin-top: 120rpx;
  165. button {
  166. background-color: #d11c1c;
  167. width: 90%;
  168. height: 85rpx;
  169. text-align: center;
  170. line-height: 85rpx;
  171. color: #fff;
  172. }
  173. }
  174. .login-botton {
  175. display: flex;
  176. justify-content: center;
  177. margin-top: 100rpx;
  178. .login-password {
  179. padding: 0 15rpx;
  180. color: #d11c1c;
  181. }
  182. .login-zhuce {
  183. padding: 0 15rpx;
  184. color: #d11c1c;
  185. }
  186. }
  187. .login-other {
  188. position: absolute;
  189. bottom: 100rpx;
  190. left: 37%;
  191. display: flex;
  192. flex-direction: column;
  193. justify-content: center;
  194. .login-top {
  195. text-align: center;
  196. }
  197. .login-icon {
  198. display: flex;
  199. justify-content: space-between;
  200. margin-top: 50rpx;
  201. image {
  202. width: 80rpx;
  203. }
  204. }
  205. }
  206. }
  207. </style>