zhangwei
2024-09-11 4eef04aa662cf4f8fbde60ca99c0011b6203c558
src/pages/mine/index.vue
@@ -80,6 +80,7 @@
            </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">
@@ -92,6 +93,8 @@
               <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"
@@ -119,17 +122,15 @@
      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: '完善资料',
@@ -152,7 +153,8 @@
            ],
            isLogin: false,
            userInfo: {},
            balance: '0.00'
            balance: '0.00',
            isAdmin: false
         };
      },
      onLoad: function() {
@@ -183,19 +185,23 @@
         // 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'
               }
            }