| | |
| | | |
| | | <!-- <view class="statistics"><u-button text="发运统计" type="primary" @click="statistics"></u-button></view> --> |
| | | <view class="utils-button"> |
| | | <!-- <view class="utils"><u-button text="修改密码" |
| | | <view class="utils"><u-button text="修改密码" |
| | | type="primary" |
| | | @click="modifyPwd"></u-button></view> |
| | | <view class="utils"><u-button text="重置密码" |
| | | <!-- <view class="utils"><u-button text="重置密码" |
| | | type="primary" |
| | | @click="initPwd"></u-button></view> --> |
| | | <view class="utils"><u-button text="退出登录" |
| | |
| | | modifyPwdShow: false, |
| | | passwordModified: '', |
| | | // 用户信息对象 |
| | | userEntity: {}, |
| | | userInfo: {}, |
| | | }; |
| | | }, |
| | | onLoad() { |
| | |
| | | methods: { |
| | | init() { |
| | | this.getFleet(); |
| | | this.getUserEntity() |
| | | }, |
| | | // 获取用户信息 |
| | | getUserEntity() { |
| | | this.$reqGet('getUserEntity').then(res => { |
| | | this.userEntity = res.data; |
| | | }); |
| | | this.getUserEntity(); |
| | | }, |
| | | // 获取车队 |
| | | getFleet() { |
| | | // this.$reqGet('getFleet', { wxUserId: this.addGroupForm.wxUserId }).then(res => { |
| | | this.$reqGet('getFleet').then(res => { |
| | | console.log('货代1车队', res); |
| | | this.fleetData = res.data; |
| | | }); |
| | | }, |
| | | getUserEntity() { |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }); |
| | | this.$reqGet('getUserEntity').then(res => { |
| | | uni.hideLoading() |
| | | this.userInfo = res.data; |
| | | }) |
| | | }, |
| | | // 添加车队 |
| | | addFleet() { |
| | |
| | | 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 |
| | | }, |
| | | modifyPwdConfirm() { |
| | | if (this.passwordModified.length === 0) { |
| | | return this.$u.toast('密码不能为空') |
| | | } |
| | | this.modifyPwdShow = false |
| | | this.userEntity.password = this.passwordModified |
| | | this.updateInfo() |
| | | }, |
| | | modifyPwdCancel() { |
| | | this.modifyPwdShow = false |
| | | this.$store.commit('changeisLogin', false) |
| | | this.$store.dispatch('websocketOnClose') |
| | | uni.reLaunch({ |
| | | url: `/pages/login/resetPassword/resetPassword?phone=${this.userInfo.phone}&idCard=${this.userInfo.idCard}` |
| | | }) |
| | | }, |
| | | logout() { |
| | | this.logoutShow = true; |