This commit is contained in:
闫晓茹 2023-10-24 16:45:50 +08:00
parent ef9ec2d8ff
commit 0caee43f6d
2 changed files with 84 additions and 20 deletions

View File

@ -4,6 +4,13 @@
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},{
"path" : "pages/taskReturn/taskReturn",
"style" :
{
@ -21,7 +28,24 @@
}
},
{
"path" : "pages/Changepassword/Changepassword",
"style" :
{
"navigationBarTitleText": "修改密码",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/Modifyphonenumber/Modifyphonenumber",
"style" :
{
"navigationBarTitleText": "修改手机号",
"enablePullDownRefresh": false
}
},
{
"path": "pages/myinformation/myinformation",
@ -38,14 +62,7 @@
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#4ac4ab"
}
}, {
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
},

View File

@ -6,7 +6,7 @@
</view>
<view class="body">
<view class="login">
<view class="logins">
<view class="logins" @tap="pwdlogin">
登录
</view>
<view class="border">
@ -14,27 +14,33 @@
</view>
<view class="name">
<u-form :model="form" ref="uForm" label-width="110">
<u-form-item label="用户名:"><u-input placeholder="请输入用户名" /></u-form-item>
<u-form-item label="用户名:"><u-input placeholder="请输入用户名" maxlength="11" v-model="personAccount" /></u-form-item>
<u-form-item label="密码:">
<u-input placeholder="请输入密码" :password-icon="true" type="password" />
<u-input placeholder="请输入密码" :password-icon="true" type="password" v-model="personPassword" />
<!-- <span class="pwd">忘记密码</span> -->
</u-form-item>
</u-form>
</view>
<view class="loginsubmit" @tap="gohomepage">
<view class="loginsubmit" @tap="login">
登录
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
appLogin,
createMobileToken
} from '@/api/login/index.js'
export default {
data() {
return {
title: 'Hello',
personAccount: '',
personPassword: '',
form: {
name: '',
@ -44,15 +50,56 @@
// onReady() {
// this.$refs.uForm.setRules(this.rules);
// },
onLoad() {
},
//
// onLoad(options) {
// if (options.phonenumber && options.password) {
// this.phonenumber = options.phonenumber
// this.password = options.password
// }
// },
methods: {
gohomepage() {
uni.redirectTo({
url: '/pages/homepage/homepage'
login() {
var that = this
appLogin(this.personAccount, this.personPassword).then(res => {
if (res.data.code == 200) {
uni.setStorageSync("id", res.data.data.id)
uni.setStorageSync("status", res.data.data.status)
// uni.setStorageSync("nursePersonName", res.data.nursePersonName)
// uni.setStorageSync("nurseStationId", res.data.nurseStationId)
that.$refs.uToast.show({
title: '登录成功',
type: 'success',
duration: '1500'
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.reLaunch({
url: '/pages/homepage/homepage',
})
}, 1500)
} else {
that.$refs.uToast.show({
title: res.data.msg,
type: 'error'
})
}
})
},
//
pwdlogin() {
var that = this
createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token)
that.login();
})
},
// gohomepage() {
// uni.redirectTo({
// url: '/pages/homepage/homepage'
// })
// },
}
}
</script>
@ -173,4 +220,4 @@
}
}
</style>
</style>