| | |
| | | // this.token = this.$db.get('userToken') ? this.$db.get('userToken') : '' |
| | | this.isLogin = this.token ? true : false; |
| | | }, |
| | | onPullDownRefresh() { |
| | | this.$api.getUser().then(res => { |
| | | this.$db.set('userInfo', JSON.stringify(res.data)) |
| | | this.userInfo = res.data |
| | | if (this.identity == 'worker') { |
| | | if (this.userInfo.userWorker) { |
| | | this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo.userWorker |
| | | .yiTiXianJine) |
| | | } |
| | | } else { |
| | | if (this.userInfo.userCompany) { |
| | | this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany.chongZhiYue : |
| | | '0.00' |
| | | } |
| | | } |
| | | }) |
| | | uni.stopPullDownRefresh(); |
| | | }, |
| | | methods: { |
| | | tologin() { |
| | | if (this.isLogin) { |
| | |
| | | }, |
| | | toOrder() { |
| | | if (!this.userInfo.userCompany) { |
| | | uni.navigateTo({ |
| | | url: '/pages/enterprise/enterprise' |
| | | }); |
| | | this.$util.showToast({ |
| | | title: '请先完善企业资料!' |
| | | }) |
| | |
| | | }, |
| | | toRelease() { |
| | | if (!this.userInfo.userCompany) { |
| | | uni.navigateTo({ |
| | | url: '/pages/enterprise/enterprise' |
| | | }); |
| | | this.$util.showToast({ |
| | | title: '请先完善企业资料!' |
| | | }) |
| | |
| | | }, |
| | | toWorkerRecord() { |
| | | if (!this.userInfo.userCompany) { |
| | | uni.navigateTo({ |
| | | url: '/pages/enterprise/enterprise' |
| | | }); |
| | | this.$util.showToast({ |
| | | title: '请先完善企业资料!' |
| | | }) |
| | |
| | | }, |
| | | toMyWork() { |
| | | if (!this.userInfo.userWorker) { |
| | | uni.navigateTo({ |
| | | url: '/pages/mine/apply' |
| | | }); |
| | | this.$util.showToast({ |
| | | title: '请先完善资料!' |
| | | }) |
| | |
| | | }, |
| | | toMyRecord(){ |
| | | if (!this.userInfo.userWorker) { |
| | | uni.navigateTo({ |
| | | url: '/pages/mine/apply' |
| | | }); |
| | | this.$util.showToast({ |
| | | title: '请先完善资料!' |
| | | }) |