From d5eef829f2daf8bf021c9524e2c93312091ba58f Mon Sep 17 00:00:00 2001
From: zhugf <312353457@qq.com>
Date: 星期四, 23 三月 2023 11:58:21 +0800
Subject: [PATCH] 细节优化
---
common/request/fly.js | 19 ++++++++++++++-----
pages/login/login.vue | 8 ++++++--
pages/tabBar/general.vue | 2 +-
main.js | 3 +++
pages/tabBar/monitor.vue | 27 +++++++++++++--------------
5 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/common/request/fly.js b/common/request/fly.js
index 10a84c4..e188721 100644
--- a/common/request/fly.js
+++ b/common/request/fly.js
@@ -23,9 +23,7 @@
if(userinfo)
config.headers["X-Tenant-Id"] = userinfo.loginTenantId;
- }else{
- jumpToLogin();
- }
+ }
console.log('========================================== ')
console.log('== 璇锋眰鏁版嵁锛�' + JSON.stringify(config))
console.log('=========================================== ')
@@ -52,8 +50,19 @@
console.info(err)
uni.hideLoading()
//鐧诲綍瓒呮椂锛岄噸鏂扮櫥褰�
- if (err.response.status == 401) {
- jumpToLogin();
+ if (err.response && err.response.status == 401) {
+ uni.showToast({
+ title: "鐧诲綍鐘舵�佸凡澶辨晥锛岄噸鏂扮櫥褰�!",
+ icon: 'none',
+ mask: true,
+ complete: function (res) {
+ setTimeout(()=>{
+ jumpToLogin();
+ },1000)
+
+ },
+ });
+
}
//鍙戠敓缃戠粶閿欒鍚庝細璧板埌杩欓噷
//return Promise.resolve("ssss")
diff --git a/main.js b/main.js
index 1a62e98..d16dc74 100644
--- a/main.js
+++ b/main.js
@@ -20,6 +20,9 @@
// 鍏ㄥ眬鎸傝浇鍚庝娇鐢�
Vue.prototype.$lget = lget
+//鍏ㄥ眬鐩戞帶瀹氭椂鍣紙鍦ㄩ〉闈娇鐢ㄥ眬閮ㄥ畾鏃跺櫒浼氬嚭鐜版棤娉曞叧闂棶棰橈級
+Vue.prototype.$monitorTimer = null
+
Vue.config.productionTip = false
App.mpType = 'app'
diff --git a/pages/login/login.vue b/pages/login/login.vue
index a23d3c4..20d828c 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -95,9 +95,13 @@
uni.switchTab({
url: '/pages/tabBar/general'
})
+ }else {
+ uni.showToast({
+ title: res.message,
+ icon: 'none',
+ mask: true
+ });
}
-
-
}).catch((err) => {
diff --git a/pages/tabBar/general.vue b/pages/tabBar/general.vue
index 6ec0d22..d243264 100644
--- a/pages/tabBar/general.vue
+++ b/pages/tabBar/general.vue
@@ -382,7 +382,7 @@
getOrderList(date1,date2) {
let params = {
"orderTime_begin":date1 + " 00:00:00",
- "orderTime_end":date2 + " 00:00:00",
+ "orderTime_end":date2 + " 23:59:59",
}
this.$api.getOrderList(params).then((res) => {
if (res.success) {
diff --git a/pages/tabBar/monitor.vue b/pages/tabBar/monitor.vue
index 2326c22..900231a 100644
--- a/pages/tabBar/monitor.vue
+++ b/pages/tabBar/monitor.vue
@@ -66,10 +66,9 @@
<view class="scoreBox">
- <text class="text-green text-xl text-bold">{{$lget(model,'target')}}%<text
- class="text-gray text-sm">/鐩爣</text> </text>
- <text class="text-gray text-xl text-bold">{{$lget(model,'initial')}}%<text
- class="text-gray text-sm">/鍒濆</text> </text>
+ <text class="text-gray text-sm">鐩爣: <text class="text-green text-xl text-bold">{{$lget(model,'target')}}% </text> </text>
+ <text class="text-gray text-sm">鍒濆: <text class="text-gray text-xl text-bold">{{$lget(model,'initial')}}% </text></text>
+
<!-- <view class="text-yellow text-xs flex justify-around">
<uni-text class="text-yellow cuIcon-favorfill"></uni-text>
<uni-text class="text-yellow cuIcon-favorfill"></uni-text>
@@ -200,8 +199,8 @@
<view class="h-td">骞茬嚗鏃堕棿</view>
</view>
<view class="h-tr h-tr-2">
- <view class="h-td">{{$lget(model,'envTemp')}}鈩�</view>
- <view class="h-td">{{$lget(model,'envHum')}}%</view>
+ <view class="h-td">{{$lget(model,'envTemp') == "" ? "--" : $lget(model,'envTemp')}}鈩�</view>
+ <view class="h-td">{{$lget(model,'envHum') == "" ? "--" :$lget(model,'envHum') }}%</view>
<view class="h-td">{{$lget(model,'windTemp')}}鈩�</view>
<view class="h-td">{{$lget(model,'delay')}}ms</view>
<view class="h-td">{{$lget(model,'et')}}min</view>
@@ -330,7 +329,7 @@
</view>
</view>
<view class="chartsMain">
- <qiun-data-charts type="area" :opts="opts" :canvas2d="true" :ontouch="true" :chartData="chartData" />
+ <qiun-data-charts type="area" :opts="opts" :animation="false" :canvas2d="true" :ontouch="true" :chartData="chartData" />
</view>
@@ -378,7 +377,6 @@
}
},
notice: "2023-03-1812:00:001鍙锋満鍙颁綆娓╂姤璀�",
- timer: null,
model: {},
queryParam: {
machineid: "GM001",
@@ -398,10 +396,10 @@
onShow() {
console.info("鐩戞帶椤甸潰鏄剧ず")
this.getRealData()
- if (!this.timer) {
- this.timer = setInterval(() => {
+ if (!this.$monitorTimer) {
+ this.$monitorTimer = setInterval(() => {
console.info("瀹氭椂鍣ㄥ伐浣�")
- console.info(this.timer)
+ console.info(this.$monitorTimer)
this.getRealData()
}, 1000 * 12)
@@ -413,13 +411,14 @@
},
onHide() {
- clearInterval(this.timer)
+ clearInterval(this.$monitorTimer)
+ this.$monitorTimer = null
console.info("鐩戞帶椤甸潰闅愯棌")
console.info("瀹氭椂鍣ㄥ仠姝�")
- console.info(this.timer)
+ console.info(this.$monitorTimer)
},
onUnload() {
- clearInterval(this.timer)
+
},
mounted() {
--
Gitblit v1.9.3