email.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <form class="login-form">
  3. <view class="form-item">
  4. <input class="form-input" v-model="formData.user_string" name="user_string"
  5. placeholder-class="form-input-place" placeholder="请输入您的邮箱地址" />
  6. </view>
  7. <view class="form-item">
  8. <input type="password" class="form-input" v-model="formData.password" name="password"
  9. placeholder-class="form-input-place" placeholder="请输入您的登录密码" />
  10. </view>
  11. <!-- <view class="form-agreement">
  12. <view class="agreement-confirm">
  13. <text class="confirm-icon iconfont">&#xe6c5;</text>
  14. </view>
  15. <text>我已阅读并同意</text>
  16. <text class="agreement-name">《用户协议》</text>
  17. </view> -->
  18. <view class="form-btn" style="margin-top: 28rpx;" @click.stop="formSubmit">
  19. 登录
  20. </view>
  21. <slider-verify ref="sliderVerifyRef" />
  22. </form>
  23. </template>
  24. <script>
  25. import {
  26. reverseBack
  27. } from "@/utils/common.js"
  28. import {
  29. Api_userLogin
  30. } from "@/api/index.js"
  31. export default {
  32. data() {
  33. return {
  34. formData: {
  35. // user_string: '14100000001',
  36. // password: '123456'
  37. }
  38. };
  39. },
  40. methods: {
  41. selectAreaCode() {
  42. uni.navigateTo({
  43. url: '/pages/login/area-code'
  44. })
  45. },
  46. formSubmit() {
  47. Api_userLogin(this.formData).then(res => {
  48. // setToken(res)
  49. if (res) {
  50. this.$store.dispatch("app/setToken", res)
  51. uni.showToast({
  52. title: '登录成功',
  53. icon: 'none'
  54. });
  55. setTimeout(() => {
  56. reverseBack()
  57. }, 1500)
  58. }
  59. })
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. @import "~./../common.scss"
  66. </style>