智慧画屏客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.7 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <view class="main_container">
  3. <Header></Header>
  4. <view class="login-bind">
  5. <view class="login">
  6. <image class="logo" src="/static/logo.png"></image>
  7. <form @submit="loginSubmit">
  8. <view class="uni-form-item uni-column">
  9. <input class="uni-input" v-model="phone" name="phone" type="number" placeholder="登录账号" />
  10. </view>
  11. <view class="uni-form-item uni-column">
  12. <input class="uni-input" v-model="password" name="password" placeholder="密码" password="true" />
  13. </view>
  14. <view class="uni-btn-v"><button class="uni-login-btn" form-type="submit"> </button></view>
  15. </form>
  16. </view>
  17. </view>
  18. <view class="login_bg"></view>
  19. </view>
  20. </template>
  21. <script>
  22. import Header from '@/pages/header.vue';
  23. import {isvalidPhone} from '@/utils/validate.js';
  24. import {login} from '@/network/login.js';
  25. export default {
  26. name:'Login',
  27. components: {
  28. Header
  29. },
  30. data() {
  31. return {
  32. phone:'',
  33. password:''
  34. };
  35. },
  36. methods: {
  37. // 登录接口
  38. // login(config){
  39. // login(config).then(res=>{
  40. // const code = res.data.code;
  41. // if (code === 100) {
  42. // uni.showToast({
  43. // title: '登录成功'
  44. // })
  45. // window.localStorage.setItem("token", res.data.data.token);
  46. // uni.switchTab({
  47. // url: '../bind/bind'
  48. // })
  49. // } else {
  50. // uni.showToast({
  51. // title: res.data.msg
  52. // })
  53. // }
  54. // }).catch(err=>{
  55. // console.log(err)
  56. // })
  57. // },
  58. // 提交表单
  59. // goPath(validateForm) {
  60. // this.$refs[validateForm].validate(valid => {
  61. // if (!valid) {
  62. // this.login(this.loginForm);
  63. // }
  64. // })
  65. // },
  66. // 提交表单
  67. loginSubmit: function(e) {
  68. // console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value));
  69. if (!this.phone) {
  70. uni.showToast({
  71. title: '请输入登录账号',
  72. icon: 'none'
  73. })
  74. return;
  75. } else if (!isvalidPhone(this.phone)) {
  76. uni.showToast({
  77. title: '请输入正确的11位登录账号',
  78. icon: 'none'
  79. })
  80. return;
  81. }
  82. if (!this.password) {
  83. uni.showToast({
  84. title: '请输入密码',
  85. icon: 'none'
  86. })
  87. return;
  88. }
  89. var formdata = e.detail.value;
  90. // this.login(formdata);
  91. uni.navigateTo({
  92. url: '../bind/bind'
  93. });
  94. }
  95. }
  96. };
  97. </script>
  98. <style scoped>
  99. .login{
  100. display: flex;
  101. flex-direction: column;
  102. align-items: center;
  103. justify-content: center;
  104. }
  105. .logo {
  106. width: 278rpx;
  107. height: 52rpx;
  108. margin-bottom: 69.44rpx;
  109. }
  110. .login .uni-input {
  111. width: 520rpx;
  112. height: 86rpx;
  113. margin-bottom: 41.66rpx;
  114. font-size: 30.55rpx;
  115. text-align: center;
  116. border: 1px solid #cbcbcb;
  117. border-radius: 86rpx;
  118. background-color: #f6f6f6;
  119. }
  120. .fouce_txt{
  121. border-color: #363538;
  122. }
  123. </style>