Browse Source

no message

devlop
xpz2018 3 years ago
parent
commit
d5eda30ce4
3 changed files with 52 additions and 41 deletions
  1. 2
      pages/device-production-info/index.vue
  2. 89
      pages/mine/index.vue
  3. 2
      store/index.js

2
pages/device-production-info/index.vue

@ -4,7 +4,7 @@
<view slot="right"><text class="text_4" @click="popupShow">分享</text></view> <view slot="right"><text class="text_4" @click="popupShow">分享</text></view>
</uni-nav-bar> </uni-nav-bar>
<view class="flex-col items-center group_1" v-if="info.hlsUrl || (info.imgUrlList && info.imgUrlList[0])"> <view class="flex-col items-center group_1" v-if="info.hlsUrl || (info.imgUrlList && info.imgUrlList[0])">
<image v-if="info.hlsUrl" src="/static/imgs/digital-workshops/camera-tip-bg.png" class="image_2" @click="go2('video-play', { url: info.hlsUrl })" />
<image v-if="info.hlsUrl" src="/static/imgs/digital-workshops/camera-tip-bg.png" class="image_2" @click="go2('video-play', { url: encodeURIComponent(info.hlsUrl) })" />
<image v-else :src="info.imgUrlList[0].url" class="image_2" /> <image v-else :src="info.imgUrlList[0].url" class="image_2" />
</view> </view>
<view class="flex-col group_6"> <view class="flex-col group_6">

89
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 { fddEnterpriseStatus, fsAuditStatus, orderStatusEnum, enterpriseType } from '@/enums/index.js'
import { getVerifyUrl, getFsCredit, getBaseInfo, getFeisuanUrl, cancelAccount } from '@/apis/commonApi.js' import { getVerifyUrl, getFsCredit, getBaseInfo, getFeisuanUrl, cancelAccount } from '@/apis/commonApi.js'
import { getDeviceStatistics } from '@/apis/mineApi' import { getDeviceStatistics } from '@/apis/mineApi'
import { getMachinList } from '@/apis/factoryApi'
export default { export default {
data() { data() {
@ -160,37 +161,37 @@ export default {
}, },
// //
certifyCompany() { 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
// </span><span class="err"> pan> }
// })
// }
// if (this.userInfo.fddEnterpriseStatus === fddEnterpriseStatus.UNCERTIFIED) {
// uni.showToast({
// title: '~',
// icon: 'none'
// })
// }
}, },
go2, go2,
applyForFinance() { applyForFinance() {
@ -223,11 +224,11 @@ export default {
return null return null
}, },
jumpEnterpriseEdit() { jumpEnterpriseEdit() {
if (!this.hasCompany) {
loginGo2('enterprise-info')
} else {
loginGo2('enterprise-info-edit')
}
// if (!this.hasCompany) {
// loginGo2('enterprise-info')
// } else {
// loginGo2('enterprise-info-edit')
// }
} }
}, },
computed: { computed: {
@ -261,7 +262,7 @@ export default {
this.hasCompany = true this.hasCompany = true
this.userInfo = { this.userInfo = {
avatar: this.$store.state.userInfo.avatar || '', 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, companyName,
fddEnterpriseStatus: this.$store.state.companyInfo.fddEnterpriseStatus || 1 fddEnterpriseStatus: this.$store.state.companyInfo.fddEnterpriseStatus || 1
} }
@ -273,9 +274,17 @@ export default {
this.fsInfo = res 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
} }
}) })
} }

2
store/index.js

@ -82,6 +82,8 @@ if (!store) {
removeUecToken(state) { removeUecToken(state) {
try { try {
uni.removeStorageSync('uecToken') uni.removeStorageSync('uecToken')
uni.removeStorageSync('factoryId')
uni.removeStorageSync('organizationId')
state.uecToken = '' state.uecToken = ''
} catch (e) { } catch (e) {
console.warn('删除uecToken失败:', e) console.warn('删除uecToken失败:', e)

Loading…
Cancel
Save