From d020108d738223ed5fb67d4006721fa6496d0ae2 Mon Sep 17 00:00:00 2001 From: mo-bai <1873032855@qq.com> Date: Thu, 7 Apr 2022 17:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/mineApi.js | 4 ++-- pages/mine/index.vue | 18 +++++++++++++++--- pages/paper-details/index.vue | 14 ++++++++------ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/apis/mineApi.js b/apis/mineApi.js index 9bf44b2..c01c4b2 100644 --- a/apis/mineApi.js +++ b/apis/mineApi.js @@ -6,9 +6,9 @@ import http from '../utils/http/index.js' * @returns 订单统计 * swagger:http://api-ops-uec-test.qniao.cn/uec/swagger-ui/index.html?urls.primaryName=CustomerApi#/%E7%99%BB%E5%BD%95%E8%AE%A4%E8%AF%81/authorizeByCaptchaUsingPOST */ -export const getOrderStatistics = (data) => { +export const getDeviceStatistics = (data) => { return http.get({ - url: '/base-paper-trading/get/supplier/income-statistics', + url: '/base-paper-trading/get/my/mechanical-equipment/statistics', data }) } diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 1197574..0da7f1c 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -38,15 +38,15 @@ - 20 + {{ deviceInfo.totalNum }} 设备总数(台) - 14 + {{ deviceInfo.workingNum }} 工作中(台) - 6 + {{ deviceInfo.freeNum }} 空闲(台) @@ -113,6 +113,7 @@ import { exit, go2, loginGo2 } 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' export default { data() { @@ -124,6 +125,11 @@ export default { usedCreditLine: 0, creditLine: 0 }, + deviceInfo: { + totalNum: 0, + workingNum: 0, + freeNum: 0 + }, fsAuditStatus: Object.freeze(fsAuditStatus), orderStatusEnum: Object.freeze(orderStatusEnum) } @@ -254,6 +260,12 @@ export default { }) this.hasLogin && getBaseInfo({}, true) !this.hasLogin && (this.fsInfo.status = -1) + this.hasLogin && + getDeviceStatistics().then((res) => { + if (res) { + this.deviceInfo = res + } + }) } } diff --git a/pages/paper-details/index.vue b/pages/paper-details/index.vue index 844a060..2397783 100644 --- a/pages/paper-details/index.vue +++ b/pages/paper-details/index.vue @@ -230,12 +230,6 @@ export default { this.params.productId = option.paperId if (this.hasLogin) { this.queryData() - // 获取企业信息 - getCompanyInfoById({ enterpriseId: this.$store.state.companyInfo.id }).then((res) => { - if (res) { - this.companyInfo = res - } - }) } else { this.$store.commit('setNextPage', { name: 'paper-details', data: { paperId: option.paperId } }) go2('login', {}, true) @@ -250,6 +244,14 @@ export default { }) } }, + onShow() { + // 获取企业信息 + getCompanyInfoById({ enterpriseId: this.$store.state.companyInfo.id }).then((res) => { + if (res) { + this.companyInfo = res + } + }) + }, computed: { buyTon() { let num = 0