| | |
| | | </view> |
| | | </view> --> |
| | | <view class="nav-box" v-if="identity=='enterprise'"> |
| | | <view class="" v-if="isAdmin"> |
| | | <view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e" |
| | | v-for="(item, index) in navList" :key="item.name"> |
| | | <view class="nav-title"> |
| | |
| | | <view class="iconfont iconarrow"></view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="nav-box" v-else> |
| | | <view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e" |
| | |
| | | data() { |
| | | return { |
| | | identity: '', |
| | | navList: [ |
| | | // { |
| | | // icon: 'icon-huabanfuben', |
| | | // name: '工人打卡记录', |
| | | // cb: function() { |
| | | // uni.navigateTo({ |
| | | // url: '/pages/company/index' |
| | | // }); |
| | | // } |
| | | // }, |
| | | ], |
| | | navList: [{ |
| | | icon: 'icon-huabanfuben', |
| | | name: '员工管理', |
| | | cb: function() { |
| | | uni.navigateTo({ |
| | | url: '/pages/company/staff' |
| | | }); |
| | | } |
| | | }, ], |
| | | navList1: [{ |
| | | icon: 'icon-wanshanxinxi', |
| | | name: '完善资料', |
| | |
| | | ], |
| | | isLogin: false, |
| | | userInfo: {}, |
| | | balance: '0.00' |
| | | balance: '0.00', |
| | | isAdmin: false |
| | | }; |
| | | }, |
| | | onLoad: function() { |
| | |
| | | // this.userInfo = this.$db.get('userInfo') ? JSON.parse(this.$db.get('userInfo')) : {} |
| | | // this.token = this.$db.get('userToken') ? this.$db.get('userToken') : '' |
| | | this.isLogin = this.token ? true : false; |
| | | this.isAdmin = this.userInfo.userCompany ? this.userInfo.userCompany.isAdmin : false |
| | | }, |
| | | onPullDownRefresh() { |
| | | this.$api.getUser().then(res => { |
| | | this.$db.set('userInfo', JSON.stringify(res.data)) |
| | | this.userInfo = res.data |
| | | this.isAdmin = this.userInfo.userCompany ? this.userInfo.userCompany.isAdmin : false |
| | | if (this.identity == 'worker') { |
| | | if (this.userInfo.userWorker) { |
| | | this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, 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 : |
| | | this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany |
| | | .chongZhiYue : |
| | | '0.00' |
| | | } |
| | | } |