|
@@ -8,11 +8,11 @@
|
|
labelAlign="left"
|
|
labelAlign="left"
|
|
labelPosition="top"
|
|
labelPosition="top"
|
|
>
|
|
>
|
|
- <u-form-item prop="mobile" label="手机号">
|
|
|
|
|
|
+ <u-form-item prop="loginName" label="手机号">
|
|
<view class="input-line">
|
|
<view class="input-line">
|
|
<u-input
|
|
<u-input
|
|
placeholder="请输入手机号"
|
|
placeholder="请输入手机号"
|
|
- v-model="model.mobile"
|
|
|
|
|
|
+ v-model="model.loginName"
|
|
border="none"
|
|
border="none"
|
|
type="number"
|
|
type="number"
|
|
maxlength="11"
|
|
maxlength="11"
|
|
@@ -35,83 +35,38 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import {login} from '@/common/request/apis/login'
|
|
export default{
|
|
export default{
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
model:{
|
|
model:{
|
|
- mobile:'',
|
|
|
|
|
|
+ loginName:'',
|
|
password:''
|
|
password:''
|
|
},
|
|
},
|
|
- rules:{
|
|
|
|
- mobile: [
|
|
|
|
- {
|
|
|
|
- required: true,
|
|
|
|
- errorMessage: '请输入手机号',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- validateFunction: function (rule, value, data, callback) {
|
|
|
|
- if (!test.mobile(value)) {
|
|
|
|
- callback('手机号码格式不正确');
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- password: [
|
|
|
|
- {
|
|
|
|
- required: true,
|
|
|
|
- errorMessage: '请输入密码',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
accountLoginSubmit() {
|
|
accountLoginSubmit() {
|
|
- if(!uni.$u.test.mobile(this.model.mobile)){
|
|
|
|
- return uni.$u.toast("请输入正确手机号");
|
|
|
|
- }
|
|
|
|
|
|
+ // if(!uni.$u.test.mobile(this.model.mobile)){
|
|
|
|
+ // return uni.$u.toast("请输入正确手机号");
|
|
|
|
+ // }
|
|
if(!this.model.password) {
|
|
if(!this.model.password) {
|
|
return uni.$u.toast("请输入密码");
|
|
return uni.$u.toast("请输入密码");
|
|
}
|
|
}
|
|
uni.$u.toast("登录成功!");
|
|
uni.$u.toast("登录成功!");
|
|
- setTimeout(()=>{
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url:'/pages/index/index'
|
|
|
|
- })
|
|
|
|
- },1000)
|
|
|
|
|
|
+ login(this.model)
|
|
|
|
+ .then(res=>{
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ // setTimeout(()=>{
|
|
|
|
+ // uni.redirectTo({
|
|
|
|
+ // url:'/pages/index/index'
|
|
|
|
+ // })
|
|
|
|
+ // },1000)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// import { computed, watch, ref, reactive, unref } from "vue";
|
|
|
|
-// import sheep from "@/sheep";
|
|
|
|
-// import { mobile, password } from "@/sheep/validate/form";
|
|
|
|
-// import { showAuthModal, closeAuthModal } from "@/sheep/hooks/useModal";
|
|
|
|
-// import { Base64 } from "js-base64";
|
|
|
|
-
|
|
|
|
-// const accountLoginRef = ref(null);
|
|
|
|
-
|
|
|
|
-// const props = defineProps({
|
|
|
|
-// agreeStatus: {
|
|
|
|
-// type: Boolean,
|
|
|
|
-// default: false,
|
|
|
|
-// },
|
|
|
|
-// });
|
|
|
|
-// // 数据
|
|
|
|
-// const state = reactive({
|
|
|
|
-// model: {
|
|
|
|
-// mobile: "", // 账号
|
|
|
|
-// password: "", // 密码
|
|
|
|
-// },
|
|
|
|
-// rules: {
|
|
|
|
-// mobile,
|
|
|
|
-// password,
|
|
|
|
-// },
|
|
|
|
-// });
|
|
|
|
|
|
|
|
-// defineExpose({
|
|
|
|
-// accountLoginSubmit,
|
|
|
|
-// });
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|