Showing
8 changed files
with
60 additions
and
45 deletions
| @@ -23,32 +23,12 @@ export const API_CONST = { | @@ -23,32 +23,12 @@ export const API_CONST = { | ||
| 23 | method: 'POST' | 23 | method: 'POST' |
| 24 | } | 24 | } |
| 25 | }, | 25 | }, |
| 26 | - monthCar: { | ||
| 27 | - initPay: { | ||
| 28 | - url: `/qx-api/qx-apaas-customize/wxpay/initPay`, | ||
| 29 | - method: 'POST' | ||
| 30 | - }, | ||
| 31 | - getOpenId: { | ||
| 32 | - url: `/open/wx-mini-program/sns/jscode2session?corpCode=${minaEnv.corpCode}`, | ||
| 33 | - method: 'GET' | ||
| 34 | - }, | ||
| 35 | - batchQuery: { | ||
| 36 | - url: `/qx-api/qx-apaas-lowcode/runtime/property/t65xp/all/page/actionPay/Search`, | ||
| 37 | - method: 'GET' | ||
| 38 | - }, | ||
| 39 | - processPay: { | ||
| 40 | - url: `/open/qx-apaas-lowcode/dataflowFeign/startDataProcess/pay?corpCode=${minaEnv.corpCode}`, | ||
| 41 | - method: 'POST' | ||
| 42 | - }, | ||
| 43 | - changePay: { | ||
| 44 | - url: `/open/qx-apaas-lowcode/dataflowFeign/startDataProcess/carChange?corpCode=${minaEnv.corpCode}`, | ||
| 45 | - method: 'POST' | ||
| 46 | - }, | ||
| 47 | - orderQuery: { | ||
| 48 | - url: `/qx-api/qx-apaas-customize/wxpay/orderQuery`, | ||
| 49 | - method: 'GET' | 26 | + home: { |
| 27 | + miniData: { | ||
| 28 | + url: `/open/qx-apaas-custom/hczd/index`, | ||
| 29 | + method: "POST"//参数:{"corpCode": "default"} | ||
| 50 | } | 30 | } |
| 51 | - }, | 31 | + } |
| 52 | 32 | ||
| 53 | } | 33 | } |
| 54 | 34 |
| @@ -4,20 +4,31 @@ Component({ | @@ -4,20 +4,31 @@ Component({ | ||
| 4 | * 组件的属性列表 | 4 | * 组件的属性列表 |
| 5 | */ | 5 | */ |
| 6 | properties: { | 6 | properties: { |
| 7 | - | 7 | + deviceInfo: { |
| 8 | + type: Object, | ||
| 9 | + value: {} | ||
| 10 | + } | ||
| 8 | }, | 11 | }, |
| 9 | 12 | ||
| 10 | /** | 13 | /** |
| 11 | * 组件的初始数据 | 14 | * 组件的初始数据 |
| 12 | */ | 15 | */ |
| 13 | data: { | 16 | data: { |
| 14 | - | 17 | + onlinePercent: 0 |
| 15 | }, | 18 | }, |
| 16 | 19 | ||
| 17 | /** | 20 | /** |
| 18 | * 组件的方法列表 | 21 | * 组件的方法列表 |
| 19 | */ | 22 | */ |
| 20 | methods: { | 23 | methods: { |
| 24 | + }, | ||
| 21 | 25 | ||
| 22 | - } | 26 | + lifetimes: { |
| 27 | + attached: function () { | ||
| 28 | + | ||
| 29 | + }, | ||
| 30 | + detached: function () { | ||
| 31 | + // 在组件实例被从页面节点树移除时执行 | ||
| 32 | + }, | ||
| 33 | + }, | ||
| 23 | }) | 34 | }) |
| @@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
| 2 | <view class="circle_main_left"> | 2 | <view class="circle_main_left"> |
| 3 | <view class="circle_left_show"> | 3 | <view class="circle_left_show"> |
| 4 | 4 | ||
| 5 | - <van-circle value="{{ 30 }}" clockwise="{{ false }}" stroke-width="17" size="120" layer-color="#F3F3F3" color="#46B3FD"> | 5 | + <van-circle value="{{ (deviceInfo.inactiveCount / deviceInfo.deviceTotal) * 100 }}" clockwise="{{ false }}" stroke-width="17" size="120" layer-color="#F3F3F3" color="#46B3FD"> |
| 6 | <view class="deviceText"> | 6 | <view class="deviceText"> |
| 7 | <view class="deviceNum"> | 7 | <view class="deviceNum"> |
| 8 | - 98% | 8 | + {{(deviceInfo.inactiveCount / deviceInfo.deviceTotal) * 100}}% |
| 9 | </view> | 9 | </view> |
| 10 | <view class="deviceCont"> | 10 | <view class="deviceCont"> |
| 11 | 在线率 | 11 | 在线率 |
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | <view class="circle_left_content"> | 17 | <view class="circle_left_content"> |
| 18 | <view class="left_content"> | 18 | <view class="left_content"> |
| 19 | <view class="left_content_num"> | 19 | <view class="left_content_num"> |
| 20 | - 126 | 20 | + {{deviceInfo.deviceTotal}} |
| 21 | </view> | 21 | </view> |
| 22 | <view class="left_content_text"> | 22 | <view class="left_content_text"> |
| 23 | 设备总数(台) | 23 | 设备总数(台) |
| @@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
| 25 | </view> | 25 | </view> |
| 26 | <view class="right_content"> | 26 | <view class="right_content"> |
| 27 | <view class="right_content_num"> | 27 | <view class="right_content_num"> |
| 28 | - 0 | 28 | + {{deviceInfo.ararmCount}} |
| 29 | </view> | 29 | </view> |
| 30 | <view class="right_content_text"> | 30 | <view class="right_content_text"> |
| 31 | 变量报警(次) | 31 | 变量报警(次) |
| @@ -37,16 +37,16 @@ | @@ -37,16 +37,16 @@ | ||
| 37 | <view class="circle_right_show"> | 37 | <view class="circle_right_show"> |
| 38 | <view class="all_num_text"> | 38 | <view class="all_num_text"> |
| 39 | <text class="status_num_total">在线</text> | 39 | <text class="status_num_total">在线</text> |
| 40 | - <text class="num_total">122</text> | 40 | + <text class="num_total">{{deviceInfo.inactiveCount}}</text> |
| 41 | <text class="num_total_str">/</text> | 41 | <text class="num_total_str">/</text> |
| 42 | - <text class="status_num_total">共126 </text> | 42 | + <text class="status_num_total">共 {{deviceInfo.deviceTotal}}</text> |
| 43 | </view> | 43 | </view> |
| 44 | 44 | ||
| 45 | </view> | 45 | </view> |
| 46 | <view class="circle_left_content"> | 46 | <view class="circle_left_content"> |
| 47 | <view class="left_content"> | 47 | <view class="left_content"> |
| 48 | <view class="left_content_num"> | 48 | <view class="left_content_num"> |
| 49 | - 126 | 49 | + {{deviceInfo.inactiveCount}} |
| 50 | </view> | 50 | </view> |
| 51 | <view class="left_content_text"> | 51 | <view class="left_content_text"> |
| 52 | 在线设备(台) | 52 | 在线设备(台) |
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | </view> | 54 | </view> |
| 55 | <view class="right_content"> | 55 | <view class="right_content"> |
| 56 | <view class="right_content_num offLine"> | 56 | <view class="right_content_num offLine"> |
| 57 | - 0 | 57 | + {{deviceInfo.offlineCount}} |
| 58 | </view> | 58 | </view> |
| 59 | <view class="right_content_text"> | 59 | <view class="right_content_text"> |
| 60 | 离线设备(台) | 60 | 离线设备(台) |
| 1 | // pages/monitor/monitor.ts | 1 | // pages/monitor/monitor.ts |
| 2 | + | ||
| 3 | +import { API_CONST } from "./../../api/smartElectric"; | ||
| 4 | +import { HTTPService as HTTP } from "./../../services/HTTPService"; | ||
| 2 | Page({ | 5 | Page({ |
| 3 | 6 | ||
| 4 | /** | 7 | /** |
| @@ -6,6 +9,7 @@ Page({ | @@ -6,6 +9,7 @@ Page({ | ||
| 6 | */ | 9 | */ |
| 7 | data: { | 10 | data: { |
| 8 | currentIndex: 0, | 11 | currentIndex: 0, |
| 12 | + allData: {},//接口请求的所有数据 | ||
| 9 | monitorTabList: [ | 13 | monitorTabList: [ |
| 10 | { | 14 | { |
| 11 | name: "首页", | 15 | name: "首页", |
| @@ -537,7 +541,7 @@ Page({ | @@ -537,7 +541,7 @@ Page({ | ||
| 537 | * 生命周期函数--监听页面加载 | 541 | * 生命周期函数--监听页面加载 |
| 538 | */ | 542 | */ |
| 539 | onLoad() { | 543 | onLoad() { |
| 540 | - | 544 | + this.__getOpenQxCustomHczdInde() |
| 541 | }, | 545 | }, |
| 542 | 546 | ||
| 543 | /** | 547 | /** |
| @@ -595,5 +599,22 @@ Page({ | @@ -595,5 +599,22 @@ Page({ | ||
| 595 | this.setData({ | 599 | this.setData({ |
| 596 | currentIndex: Number(idx) | 600 | currentIndex: Number(idx) |
| 597 | }) | 601 | }) |
| 602 | + }, | ||
| 603 | + __getOpenQxCustomHczdInde() { | ||
| 604 | + HTTP.POST({ | ||
| 605 | + ...API_CONST.home.miniData, | ||
| 606 | + payload: { | ||
| 607 | + corpCode: "default" | ||
| 608 | + } | ||
| 609 | + }).then((data: any) => { | ||
| 610 | + console.log(data, '-----------datat') | ||
| 611 | + this.setData({ | ||
| 612 | + allData: data.data | ||
| 613 | + }) | ||
| 614 | + const app = getApp(); | ||
| 615 | + | ||
| 616 | + app.globalData.allData = data.data; | ||
| 617 | + | ||
| 618 | + }) | ||
| 598 | } | 619 | } |
| 599 | }) | 620 | }) |
| @@ -12,7 +12,8 @@ | @@ -12,7 +12,8 @@ | ||
| 12 | 累计发电量 | 12 | 累计发电量 |
| 13 | </view> | 13 | </view> |
| 14 | <view class="electroc_money_num"> | 14 | <view class="electroc_money_num"> |
| 15 | - <text class="electroc_money_text_num">1008.55</text> | 15 | + <text class="electroc_money_text_num">{{allData.allPower |
| 16 | + }}</text> | ||
| 16 | <text class="electroc_money_text_unit">kwh</text> | 17 | <text class="electroc_money_text_unit">kwh</text> |
| 17 | </view> | 18 | </view> |
| 18 | 19 | ||
| @@ -22,7 +23,8 @@ | @@ -22,7 +23,8 @@ | ||
| 22 | 累计经济效益 | 23 | 累计经济效益 |
| 23 | </view> | 24 | </view> |
| 24 | <view class="electroc_money_num"> | 25 | <view class="electroc_money_num"> |
| 25 | - <text class="electroc_money_text_num">9008.55</text> | 26 | + <text class="electroc_money_text_num">{{allData.allAmount |
| 27 | + }}</text> | ||
| 26 | <text class="electroc_money_text_unit">万元</text> | 28 | <text class="electroc_money_text_unit">万元</text> |
| 27 | </view> | 29 | </view> |
| 28 | </view> | 30 | </view> |
| @@ -30,7 +32,7 @@ | @@ -30,7 +32,7 @@ | ||
| 30 | </view> | 32 | </view> |
| 31 | <view class="deviceStatistics"> | 33 | <view class="deviceStatistics"> |
| 32 | <topTitle topTitleName="设备统计"></topTitle> | 34 | <topTitle topTitleName="设备统计"></topTitle> |
| 33 | - <circularDiagram></circularDiagram> | 35 | + <circularDiagram wx:if="{{allData.deviceInfo}}" deviceInfo="{{allData.deviceInfo}}"></circularDiagram> |
| 34 | <deviceData deviceDataList="{{deviceDataList}}"></deviceData> | 36 | <deviceData deviceDataList="{{deviceDataList}}"></deviceData> |
| 35 | </view> | 37 | </view> |
| 36 | <view class="overallOperationStatus"> | 38 | <view class="overallOperationStatus"> |
| @@ -6,13 +6,13 @@ | @@ -6,13 +6,13 @@ | ||
| 6 | * 3: 现代物流uat环境 | 6 | * 3: 现代物流uat环境 |
| 7 | * 4: 现代物流正式环境 | 7 | * 4: 现代物流正式环境 |
| 8 | */ | 8 | */ |
| 9 | -const envLevel = 4; | 9 | +const envLevel = 0; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * 后台接口 | 12 | * 后台接口 |
| 13 | */ | 13 | */ |
| 14 | const serverUrlProduce = [ | 14 | const serverUrlProduce = [ |
| 15 | - "http://192.168.1.180", // http://192.168.1.180 | 15 | + "http://10.9.1.180", // http://10.9.1.180/open/qx-apaas-custom/hczd/index |
| 16 | "https://test.qgutech.com", | 16 | "https://test.qgutech.com", |
| 17 | "https://test.xdwl.qgutech.com", | 17 | "https://test.xdwl.qgutech.com", |
| 18 | "https://wanyouuat.m56.com.cn:4443", | 18 | "https://wanyouuat.m56.com.cn:4443", |
| @@ -20,7 +20,7 @@ const serverUrlProduce = [ | @@ -20,7 +20,7 @@ const serverUrlProduce = [ | ||
| 20 | ][envLevel]; | 20 | ][envLevel]; |
| 21 | 21 | ||
| 22 | const corpCode = [ | 22 | const corpCode = [ |
| 23 | - 'cheng', // cheng | 23 | + 'default', // cheng |
| 24 | 'xdwl', | 24 | 'xdwl', |
| 25 | 'xdwl', // xdwl | 25 | 'xdwl', // xdwl |
| 26 | 'xdwl', | 26 | 'xdwl', |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | interface IAppOption { | 3 | interface IAppOption { |
| 4 | globalData: { | 4 | globalData: { |
| 5 | - userInfo?: WechatMiniprogram.UserInfo, | 5 | + allData?: {}, |
| 6 | } | 6 | } |
| 7 | userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback, | 7 | userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback, |
| 8 | } | 8 | } |