| | |
| | | return uni.getStorageSync('roleType'); |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.getAllHuoDaiByCustomerId(); |
| | | this.getFleet(); |
| | | this.getUserEntity(); |
| | | }, |
| | | // 获取用户信息 |
| | | getUserEntity() { |
| | | this.$reqGet('getUserEntity').then(res => { |
| | | this.userEntity = res.data; |
| | | }); |
| | | }, |
| | | // 获取货代列表 |
| | | getAllHuoDaiByCustomerId() { |
| | |
| | | uni.navigateTo({ |
| | | url: `/pages/customer-page/fleet-management/fleet-management?id=${id}` |
| | | }); |
| | | }, |
| | | updateInfo() { |
| | | this.$reqPost('updateUser', this.userEntity, 'json').then(res => { |
| | | uni.hideLoading() |
| | | if (res.code == 0) { |
| | | uni.showToast({ |
| | | title: '重置成功', |
| | | duration: 2000, |
| | | icon: 'success' |
| | | }) |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '修改失败'); |
| | | } |
| | | }).catch(err => { |
| | | this.$u.toast('修改失败'); |
| | | }); |
| | | }, |
| | | initPwd() { |
| | | this.initPwdShow = true |
| | | }, |
| | | initPwdConfirm() { |
| | | this.initPwdShow = false |
| | | uni.showLoading({ |
| | | title: '加载中' |
| | | }) |
| | | this.userEntity.password = '123456' |
| | | this.updateInfo() |
| | | }, |
| | | initPwdCancel() { |
| | | this.initPwdShow = false |
| | | }, |
| | | modifyPwd() { |
| | | this.modifyPwdShow = true |
| | | this.passwordModified = '' |
| | | }, |
| | | modifyPwdConfirm() { |
| | | if (this.passwordModified.length === 0) { |
| | | return this.$u.toast('密码不能为空') |
| | | } |
| | | this.modifyPwdShow = false |
| | | this.userEntity.password = this.passwordModified |
| | | this.updateInfo() |
| | | }, |
| | | modifyPwdCancel() { |
| | | this.modifyPwdShow = false |
| | | }, |
| | | logout() { |
| | | this.logoutShow = true; |