From d5eda30ce461195932a063dec52e2f3a26dbe4c5 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Thu, 14 Jul 2022 10:14:28 +0800 Subject: [PATCH] no message --- pages/device-production-info/index.vue | 2 +- pages/mine/index.vue | 89 ++++++++++++++------------ store/index.js | 2 + 3 files changed, 52 insertions(+), 41 deletions(-) diff --git a/pages/device-production-info/index.vue b/pages/device-production-info/index.vue index ff35219..da47f3d 100644 --- a/pages/device-production-info/index.vue +++ b/pages/device-production-info/index.vue @@ -4,7 +4,7 @@ 分享 - + diff --git a/pages/mine/index.vue b/pages/mine/index.vue index c7adc99..270b7f3 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -115,6 +115,7 @@ import { go2, loginGo2, exit } from '@/utils/hook.js' import { fddEnterpriseStatus, fsAuditStatus, orderStatusEnum, enterpriseType } from '@/enums/index.js' import { getVerifyUrl, getFsCredit, getBaseInfo, getFeisuanUrl, cancelAccount } from '@/apis/commonApi.js' import { getDeviceStatistics } from '@/apis/mineApi' +import { getMachinList } from '@/apis/factoryApi' export default { data() { @@ -160,37 +161,37 @@ export default { }, // 企业法大大实名认证 certifyCompany() { - if (!this.hasCompany) { - uni.showToast({ - title: '您还没有企业信息,请先完善企业信息', - icon: 'none' - }) - return - } - if ( - [fddEnterpriseStatus.UNCERTIFIED, fddEnterpriseStatus.CERTIFIED_ING, fddEnterpriseStatus.CERTIFIED_FAIL].includes(this.userInfo.fddEnterpriseStatus) - ) { - getVerifyUrl({ enterpriseId: this.$store.state.companyInfo.id }).then((res) => { - if (res) { - console.log('res:', res) - // #ifdef APP-PLUS - go2('page-view', { - title: '实名认证', - url: encodeURIComponent(res) - }) - // #endif - // #ifdef H5 - window ? (window.location.href = res) : '' - // #endif - } - }) - } - if (this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.UNCERTIFIED) { - uni.showToast({ - title: '认证中,请稍后~', - icon: 'none' - }) - } + // if (!this.hasCompany) { + // uni.showToast({ + // title: '您还没有企业信息,请先完善企业信息', + // icon: 'none' + // }) + // return + // } + // if ( + // [fddEnterpriseStatus.UNCERTIFIED, fddEnterpriseStatus.CERTIFIED_ING, fddEnterpriseStatus.CERTIFIED_FAIL].includes(this.userInfo.fddEnterpriseStatus) + // ) { + // getVerifyUrl({ enterpriseId: this.$store.state.companyInfo.id }).then((res) => { + // if (res) { + // console.log('res:', res) + // // #ifdef APP-PLUS + // go2('page-view', { + // title: '实名认证', + // url: encodeURIComponent(res) + // }) + // // #endif + // // #ifdef H5 + // window ? (window.location.href = res) : '' + // // #endif + // } + // }) + // } + // if (this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.UNCERTIFIED) { + // uni.showToast({ + // title: '认证中,请稍后~', + // icon: 'none' + // }) + // } }, go2, applyForFinance() { @@ -223,11 +224,11 @@ export default { return null }, jumpEnterpriseEdit() { - if (!this.hasCompany) { - loginGo2('enterprise-info') - } else { - loginGo2('enterprise-info-edit') - } + // if (!this.hasCompany) { + // loginGo2('enterprise-info') + // } else { + // loginGo2('enterprise-info-edit') + // } } }, computed: { @@ -261,7 +262,7 @@ export default { this.hasCompany = true this.userInfo = { avatar: this.$store.state.userInfo.avatar || '', - name: this.$store.state.userInfo.name || this.$store.state.userInfo.mobile || '', + name: this.$store.state.userInfo.realName || this.$store.state.userInfo.mobile || '', companyName, fddEnterpriseStatus: this.$store.state.companyInfo.fddEnterpriseStatus || 1 } @@ -273,9 +274,17 @@ export default { this.fsInfo = res } }) - getDeviceStatistics().then((res) => { - if (res) { - this.deviceInfo = res + getMachinList({ factoryId: this.factoryId, pageSize: 1000 }).then((res) => { + if (res && res.records) { + var deviceInfo = { totalNum: 0, workingNum: 0, freeNum: 0 } + for (let i = 0; i < res.records.length; i++) { + if(res.records[i].workingStatus == 1){ + deviceInfo.workingNum ++ + } + } + deviceInfo.totalNum = res.records.length + deviceInfo.freeNum = res.records.length - deviceInfo.workingNum + this.deviceInfo = deviceInfo } }) } diff --git a/store/index.js b/store/index.js index d1681dd..61a3cb2 100644 --- a/store/index.js +++ b/store/index.js @@ -82,6 +82,8 @@ if (!store) { removeUecToken(state) { try { uni.removeStorageSync('uecToken') + uni.removeStorageSync('factoryId') + uni.removeStorageSync('organizationId') state.uecToken = '' } catch (e) { console.warn('删除uecToken失败:', e)