租房小程序前端代码
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.

68 lines
1.7 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="se-p-30">
  3. <uv-form labelPosition="top" :model="form" :rules="rules" ref="form">
  4. <uv-form-item label="账号" prop="name" >
  5. <uv-input v-model="form.name" type="text" placeholder="请输入账号" customStyle="border-radius: 30px;margin-top:5px;background-color: #ffffff;padding:5px 20px;" border="none"></uv-input>
  6. </uv-form-item>
  7. <uv-form-item label="密码" prop="password">
  8. <uv-input v-model="form.password" type="password" placeholder="请输入密码" customStyle="border-radius: 30px;margin-top:5px;background-color: #ffffff;padding:5px 20px;" border="none"></uv-input>
  9. </uv-form-item>
  10. <uv-form-item>
  11. <uv-button type="primary" text="登录" customStyle="margin-top: 30px;background-color: #1EC7B6;border-radius: 30px;" @click="submit"></uv-button>
  12. </uv-form-item>
  13. </uv-form>
  14. </view>
  15. </template>
  16. <script>
  17. import { commonIndexLogin,commonIndexLoginByInviteCode } from "@/common/api.js"
  18. export default{
  19. data(){
  20. return{
  21. form:{
  22. name:"",
  23. password:""
  24. },
  25. rules:{
  26. name:[
  27. {
  28. type: 'string',
  29. required: true,
  30. message: '请输入账号',
  31. trigger: ['blur', 'change']
  32. }
  33. ],
  34. password:[
  35. {
  36. type: 'string',
  37. required: true,
  38. message: '请输入密码',
  39. trigger: ['blur', 'change']
  40. }
  41. ]
  42. }
  43. }
  44. },
  45. methods:{
  46. submit() {
  47. this.$refs.form.validate().then(res => {
  48. commonIndexLogin({username:this.form.name,password:this.form.password}).then(response=>{
  49. uni.navigateTo({
  50. url:"/pages_subpack/success/index?type=broker"
  51. })
  52. }).catch(error=>{
  53. })
  54. }).catch(errors => {
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style>
  61. page{
  62. background-color: #f5f5f5;
  63. }
  64. </style>