Showing
8 changed files
with
60 additions
and
45 deletions
... | ... | @@ -23,32 +23,12 @@ export const API_CONST = { |
23 | 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 | 4 | * 组件的属性列表 |
5 | 5 | */ |
6 | 6 | properties: { |
7 | - | |
7 | + deviceInfo: { | |
8 | + type: Object, | |
9 | + value: {} | |
10 | + } | |
8 | 11 | }, |
9 | 12 | |
10 | 13 | /** |
11 | 14 | * 组件的初始数据 |
12 | 15 | */ |
13 | 16 | data: { |
14 | - | |
17 | + onlinePercent: 0 | |
15 | 18 | }, |
16 | 19 | |
17 | 20 | /** |
18 | 21 | * 组件的方法列表 |
19 | 22 | */ |
20 | 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 | 2 | <view class="circle_main_left"> |
3 | 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 | 6 | <view class="deviceText"> |
7 | 7 | <view class="deviceNum"> |
8 | - 98% | |
8 | + {{(deviceInfo.inactiveCount / deviceInfo.deviceTotal) * 100}}% | |
9 | 9 | </view> |
10 | 10 | <view class="deviceCont"> |
11 | 11 | 在线率 |
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | <view class="circle_left_content"> |
18 | 18 | <view class="left_content"> |
19 | 19 | <view class="left_content_num"> |
20 | - 126 | |
20 | + {{deviceInfo.deviceTotal}} | |
21 | 21 | </view> |
22 | 22 | <view class="left_content_text"> |
23 | 23 | 设备总数(台) |
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 | </view> |
26 | 26 | <view class="right_content"> |
27 | 27 | <view class="right_content_num"> |
28 | - 0 | |
28 | + {{deviceInfo.ararmCount}} | |
29 | 29 | </view> |
30 | 30 | <view class="right_content_text"> |
31 | 31 | 变量报警(次) |
... | ... | @@ -37,16 +37,16 @@ |
37 | 37 | <view class="circle_right_show"> |
38 | 38 | <view class="all_num_text"> |
39 | 39 | <text class="status_num_total">在线</text> |
40 | - <text class="num_total">122</text> | |
40 | + <text class="num_total">{{deviceInfo.inactiveCount}}</text> | |
41 | 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 | 43 | </view> |
44 | 44 | |
45 | 45 | </view> |
46 | 46 | <view class="circle_left_content"> |
47 | 47 | <view class="left_content"> |
48 | 48 | <view class="left_content_num"> |
49 | - 126 | |
49 | + {{deviceInfo.inactiveCount}} | |
50 | 50 | </view> |
51 | 51 | <view class="left_content_text"> |
52 | 52 | 在线设备(台) |
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 | </view> |
55 | 55 | <view class="right_content"> |
56 | 56 | <view class="right_content_num offLine"> |
57 | - 0 | |
57 | + {{deviceInfo.offlineCount}} | |
58 | 58 | </view> |
59 | 59 | <view class="right_content_text"> |
60 | 60 | 离线设备(台) | ... | ... |
1 | 1 | // pages/monitor/monitor.ts |
2 | + | |
3 | +import { API_CONST } from "./../../api/smartElectric"; | |
4 | +import { HTTPService as HTTP } from "./../../services/HTTPService"; | |
2 | 5 | Page({ |
3 | 6 | |
4 | 7 | /** |
... | ... | @@ -6,6 +9,7 @@ Page({ |
6 | 9 | */ |
7 | 10 | data: { |
8 | 11 | currentIndex: 0, |
12 | + allData: {},//接口请求的所有数据 | |
9 | 13 | monitorTabList: [ |
10 | 14 | { |
11 | 15 | name: "首页", |
... | ... | @@ -537,7 +541,7 @@ Page({ |
537 | 541 | * 生命周期函数--监听页面加载 |
538 | 542 | */ |
539 | 543 | onLoad() { |
540 | - | |
544 | + this.__getOpenQxCustomHczdInde() | |
541 | 545 | }, |
542 | 546 | |
543 | 547 | /** |
... | ... | @@ -595,5 +599,22 @@ Page({ |
595 | 599 | this.setData({ |
596 | 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 | }) |
\ No newline at end of file | ... | ... |
... | ... | @@ -12,7 +12,8 @@ |
12 | 12 | 累计发电量 |
13 | 13 | </view> |
14 | 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 | 17 | <text class="electroc_money_text_unit">kwh</text> |
17 | 18 | </view> |
18 | 19 | |
... | ... | @@ -22,7 +23,8 @@ |
22 | 23 | 累计经济效益 |
23 | 24 | </view> |
24 | 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 | 28 | <text class="electroc_money_text_unit">万元</text> |
27 | 29 | </view> |
28 | 30 | </view> |
... | ... | @@ -30,7 +32,7 @@ |
30 | 32 | </view> |
31 | 33 | <view class="deviceStatistics"> |
32 | 34 | <topTitle topTitleName="设备统计"></topTitle> |
33 | - <circularDiagram></circularDiagram> | |
35 | + <circularDiagram wx:if="{{allData.deviceInfo}}" deviceInfo="{{allData.deviceInfo}}"></circularDiagram> | |
34 | 36 | <deviceData deviceDataList="{{deviceDataList}}"></deviceData> |
35 | 37 | </view> |
36 | 38 | <view class="overallOperationStatus"> | ... | ... |
... | ... | @@ -6,13 +6,13 @@ |
6 | 6 | * 3: 现代物流uat环境 |
7 | 7 | * 4: 现代物流正式环境 |
8 | 8 | */ |
9 | -const envLevel = 4; | |
9 | +const envLevel = 0; | |
10 | 10 | |
11 | 11 | /** |
12 | 12 | * 后台接口 |
13 | 13 | */ |
14 | 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 | 16 | "https://test.qgutech.com", |
17 | 17 | "https://test.xdwl.qgutech.com", |
18 | 18 | "https://wanyouuat.m56.com.cn:4443", |
... | ... | @@ -20,7 +20,7 @@ const serverUrlProduce = [ |
20 | 20 | ][envLevel]; |
21 | 21 | |
22 | 22 | const corpCode = [ |
23 | - 'cheng', // cheng | |
23 | + 'default', // cheng | |
24 | 24 | 'xdwl', |
25 | 25 | 'xdwl', // xdwl |
26 | 26 | 'xdwl', | ... | ... |