phone.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <form class="login-form">
  3. <view class="form-item">
  4. <view class="form-lable" @click.stop="selectAreaCode()"><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: '123456',
  40. password: 'Aa123456'
  41. }
  42. };
  43. },
  44. methods: {
  45. selectAreaCode(){
  46. uni.navigateTo({
  47. url:'/pages/login/area-code'
  48. })
  49. },
  50. formSubmit() {
  51. Api_userLogin(this.formData).then(res => {
  52. if (res) {
  53. this.$store.dispatch("app/setToken", res)
  54. uni.showToast({
  55. title: '登录成功',
  56. icon: 'none'
  57. });
  58. setTimeout(() => {
  59. reverseBack()
  60. }, 1500)
  61. }
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. @import "~./../common.scss"
  69. </style>