phone.vue 1.7 KB

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