From e86013cd8d4b88ca916067b01eeb452401b38c7b Mon Sep 17 00:00:00 2001
From: 朱桂飞 <18597012158>
Date: 星期二, 11 四月 2023 14:46:00 +0800
Subject: [PATCH] 修改首页草药名称过长UI错乱问题
---
/dev/null | 0
pages/tabBar/main.vue | 1
pages/tabBar/general.vue | 13 ++
pages.json | 2
pages/tabBar/monitor.vue | 176 +++++++++++++++++++++++++++-----------------
App.vue | 18 ----
6 files changed, 120 insertions(+), 90 deletions(-)
diff --git a/App.vue b/App.vue
index aea2117..40bd8c3 100644
--- a/App.vue
+++ b/App.vue
@@ -2,7 +2,7 @@
import Vue from 'vue'
export default {
globalData: {
- token: "aaa"
+ token: ""
},
onLaunch: function() {
uni.getSystemInfo({
@@ -39,25 +39,9 @@
//console.log('App Hide')
},
methods:{
-
},
mounted() {
- var i = 0;
- // setInterval(function() {
- // i++
- // if (i % 2 == 0) {
- // uni.showTabBarRedDot({
- // index: 1
- // })
- // } else {
- // uni.hideTabBarRedDot({
- // index: 1
- // })
- // }
- // }, 3000)
-
-
}
}
diff --git a/pages.json b/pages.json
index 929f77f..bdebaf3 100644
--- a/pages.json
+++ b/pages.json
@@ -102,7 +102,7 @@
],
"globalStyle": {
"navigationBarTextStyle": "white",
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "鍏板疂鏅鸿兘",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
diff --git a/pages/tabBar/general.vue b/pages/tabBar/general.vue
index 650a424..4322435 100644
--- a/pages/tabBar/general.vue
+++ b/pages/tabBar/general.vue
@@ -14,7 +14,7 @@
<cu-custom bgColor="bg-gradual-blue" :isBack="false">
<block slot="content">骞茬嚗璁惧鐩戞帶绯荤粺</block>
</cu-custom>
-
+ <u-toast ref="uToast"></u-toast>
<!-- <view class="card-box dynamic shadow cu-list menu">
<view class="title-box">
<view class="left">
@@ -177,7 +177,7 @@
<view class="flex">
<text>涓崏鑽�</text>
<text>涓�</text>
- <text>{{showValue(item.herbName)}}</text>
+ <text @click="showLongName(showValue(item.herbName))" class="text-cut flex-twice">{{showValue(item.herbName)}}</text>
<!-- <view class="margin-lr-sm">
<u-tag text="鎶ヨ涓�娆�" plain size="mini" type="warning"></u-tag>
</view> -->
@@ -363,7 +363,14 @@
this.getOrderList(day, day)
},
- methods: {
+ methods: {
+ showLongName(longName){
+ this.$refs.uToast.show({
+ type: 'default',
+ message: longName
+ })
+
+ },
dayChange(dayInfo) { // 鐐瑰嚮鏃ユ湡
this.model.date = dayInfo.date
console.log("鐐瑰嚮鏃ユ湡", JSON.parse(JSON.stringify(dayInfo)));
diff --git a/pages/tabBar/main.vue b/pages/tabBar/main.vue
index 81ed111..7d5f829 100644
--- a/pages/tabBar/main.vue
+++ b/pages/tabBar/main.vue
@@ -37,7 +37,6 @@
return {
current:0,
list: [
- '../../static/image/equ1.png',
'https://cdn.zebraui.com/zebra-ui/images/swipe-demo/swipe2.jpg',
'https://cdn.zebraui.com/zebra-ui/images/swipe-demo/swipe3.jpg',
'https://cdn.zebraui.com/zebra-ui/images/swipe-demo/swipe4.jpg',
diff --git a/pages/tabBar/monitor.vue b/pages/tabBar/monitor.vue
index f808d59..3b80b2e 100644
--- a/pages/tabBar/monitor.vue
+++ b/pages/tabBar/monitor.vue
@@ -5,8 +5,25 @@
<block slot="content">鏈哄彴鐩戞帶</block>
</cu-custom>
<!-- <u-notice-bar :text="notice" mode="closable" ></u-notice-bar> -->
- <!-- -->
- <view class="uni-padding-wrap">
+
+ <!-- <view class="nav uni-padding-wrap margin-bottom-xs">
+ <u--image v-if="runStatu" :showLoading="true" :fade="true" duration="450"
+ src="https://dev.shlanbao.cn:9999/fileTransfer/preview?userFileId=1645312976277106688&isMin=false&shareBatchNum=&extractionCode="
+ width="100%" height="200px" mode="aspectFit">
+ <template v-slot:loading>
+ <u-loading-icon></u-loading-icon>
+ </template>
+ </u--image>
+
+ <u--image v-else :showLoading="true" :fade="true" duration="450"
+ src="https://dev.shlanbao.cn:9999/fileTransfer/preview?userFileId=1645312976381964288&isMin=false&shareBatchNum=&extractionCode="
+ width="100%" height="200px" mode="aspectFit">
+ <template v-slot:loading>
+ <u-loading-icon></u-loading-icon>
+ </template>
+ </u--image>
+ </view> -->
+ <view class="uni-padding-wrap">
<view class="page-section swiper">
<view class="page-section-spacing">
<swiper class="swiper" style="height: 450rpx;" circular="true" indicator-dots="true" autoplay="true"
@@ -40,20 +57,23 @@
<view class="text-gray margin-top-xs">
<text class="margin-right-xs">鎶曟枡:</text>
- <text class="text-cyan">{{$lget(model,'feed')}} <text class="text-gray margin-left-xs">绛�</text></text>
-
- </view>
- <view class="text-gray margin-top-xs">
- <text class="margin-right-xs">閲嶉噺:</text>
- <text class="text-cyan margin-right-xs">{{$lget(model,'trendVo.weight')}}<text class="text-gray margin-left-xs">/</text></text>
- <text> <text class="text-line-through">{{$lget(model,'originWeight')}}</text> <text class="text-gray margin-left-xs">kg</text></text>
-
- </view>
-
- <view class="text-gray margin-top-xs">
- <text class="margin-right-xs">鐢ㄦ椂:</text>
- <text class="text-cyan">{{$lget(model,'trendVo.totalTime')}}<text class="text-gray margin-left-xs">min</text></text>
-
+ <text class="text-cyan">{{$lget(model,'feed')}} <text class="text-gray margin-left-xs">绛�</text></text>
+
+ </view>
+ <view class="text-gray margin-top-xs">
+ <text class="margin-right-xs">閲嶉噺:</text>
+ <text class="text-cyan margin-right-xs">{{$lget(model,'trendVo.weight')}}<text
+ class="text-gray margin-left-xs">/</text></text>
+ <text> <text class="text-line-through">{{$lget(model,'originWeight')}}</text> <text
+ class="text-gray margin-left-xs">kg</text></text>
+
+ </view>
+
+ <view class="text-gray margin-top-xs">
+ <text class="margin-right-xs">鐢ㄦ椂:</text>
+ <text class="text-cyan">{{$lget(model,'trendVo.totalTime')}}<text
+ class="text-gray margin-left-xs">min</text></text>
+
</view>
<view class="margin-tb-sm" style="position: relative;">
@@ -61,14 +81,16 @@
<text class="text-cyan text-bold text-xl margin-right-xs">{{ $lget(this.model, 'trendVo.moisture') }}%
</text>
<text class="text-gray text-df margin-right-xs">鐑:</text>
- <text class="text-cyan text-bold text-xl margin-right-xs">{{$lget(this.model, 'trendVo.bellowsTemp') }} 鈩�
+ <text class="text-cyan text-bold text-xl margin-right-xs">{{$lget(this.model, 'trendVo.bellowsTemp') }}鈩�
</text>
<view class="scoreBox">
- <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>
-
+ <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>
@@ -199,7 +221,7 @@
<view class="h-td">骞茬嚗鏃堕棿</view>
</view>
<view class="h-tr h-tr-2">
- <view class="h-td">{{$lget(model,'envTemp') == "" ? "--" : $lget(model,'envTemp')}}鈩�</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>
@@ -329,7 +351,8 @@
</view>
</view>
<view class="chartsMain">
- <qiun-data-charts type="area" :opts="opts" :animation="false" :canvas2d="true" :ontouch="true" :chartData="chartData" />
+ <qiun-data-charts type="area" :opts="opts" :animation="false" :canvas2d="true" :ontouch="true"
+ :chartData="chartData" />
</view>
@@ -407,6 +430,7 @@
},
+
onLoad(e) {
},
@@ -418,16 +442,16 @@
console.info(this.$monitorTimer)
},
onUnload() {
-
+
},
mounted() {
},
onReady() {
- //this.getServerData()
+ //this.getServerData()
},
- methods: {
+ methods: {
getServerData() {
//妯℃嫙浠庢湇鍔″櫒鑾峰彇鏁版嵁鏃剁殑寤舵椂
setTimeout(() => {
@@ -452,7 +476,9 @@
}, 500);
},
-
+ /**
+ * 缁勪欢鏁版嵁
+ */
createData() {
//娓╁害鏁版嵁 10s涓�娆�
let bellowsTemp = this.$lget(this.model, 'bellowsTemp');
@@ -462,23 +488,23 @@
let wmap = {} //鍙栧嚭鎵�鏈夐噸閲忔暟鎹�
let mmap = {} //鍙栧嚭鎵�鏈夋俯搴︽暟鎹�
let minW = null; //绗竴涓噸閲忔暟鎹�
- let minM = null; //绗竴涓俯搴︽暟鎹�
+ let minM = null; //绗竴涓俯搴︽暟鎹�
let maxW = null; //鏈�鍚庝竴涓噸閲忔暟鎹�
let maxM = null; //鏈�鍚庝竴涓俯搴︽暟鎹�
//鍙栧嚭閲嶉噺鍜屾箍搴︽暟鎹�
if (detailList && detailList.length > 0) {
for (var i = 0; i < detailList.length; i++) {
- let item = detailList[i]
+ let item = detailList[i]
//姣忎釜鏃堕棿鑺傜偣閲嶉噺鏁版嵁
wmap[item.totalTime] = item.weight
mmap[item.totalTime] = item.moisture
if (i == 0) {
minW = item.weight
minM = item.moisture
- }
- if (i == (detailList.length - 1)) {
- maxW = item.weight
- maxM = item.moisture
+ }
+ if (i == (detailList.length - 1)) {
+ maxW = item.weight
+ maxM = item.moisture
}
}
}
@@ -489,29 +515,29 @@
//鏍规嵁娓╁害鏁版嵁闀垮害锛岀敓鎴恱杞淬�侀噸閲忓拰婀垮害鏁扮粍绛�
for (let key in bellowsTemp) {
//console.log(key + '---' + bellowsTemp[key])
- tList.push(bellowsTemp[key])
- wList.push(wmap[key] || null)
- mList.push(mmap[key] || null)
- xList.push(key)
- }
- //濉厖铏氭嫙鏁版嵁 TODO 鍒犻櫎
- // for(let i = 1 ; i <= 10 ; i++){
- // tList.push(i*2)
- // wList.push(i*100)
- // mList.push(i*10)
- // xList.push(i)
- // }
-
- //d绗竴涓暟鎹负绌� 璁剧疆涓虹涓�娆$О閲嶆暟鎹紙娌℃湁绉伴噸鏁版嵁鍒欒缃负0锛�
- if (!wList[0]) {
- wList[0] = minW||0
- }
-
-
- if (!mList[0]) {
- mList[0] = minM||0
- }
-
+ tList.push(bellowsTemp[key])
+ wList.push(wmap[key] || null)
+ mList.push(mmap[key] || null)
+ xList.push(key)
+ }
+ //濉厖娴嬭瘯鏁版嵁 TODO 鍒犻櫎
+ // for(let i = 1 ; i <= 10 ; i++){
+ // tList.push(i*2)
+ // wList.push(i*100)
+ // mList.push(i*10)
+ // xList.push(i)
+ // }
+
+ //绗竴涓暟鎹负绌� 璁剧疆涓虹涓�娆$О閲嶆暟鎹紙娌℃湁绉伴噸鏁版嵁鍒欒缃负0锛�
+ if (!wList[0]) {
+ wList[0] = minW || 0
+ }
+
+
+ if (!mList[0]) {
+ mList[0] = minM || 0
+ }
+
//鏈�鍚庝竴涓暟鎹负绌� 璁剧疆涓烘渶鍚庝竴娆$О閲嶆暟鎹�
if (!wList[wList.length - 1]) {
wList[wList.length - 1] = maxW
@@ -540,19 +566,21 @@
color: '#1890ff'
}]
- console.error(wmap)
- console.error(mmap)
- console.error("============")
- console.error(wList)
- console.error(mList)
- console.error(tList)
+ // console.error(wmap)
+ // console.error(mmap)
+ // console.error("============")
+ // console.error(wList)
+ // console.error(mList)
+ // console.error(tList)
let res = {
categories: xList,
series: series
}
this.chartData = JSON.parse(JSON.stringify(res));
},
-
+ /**
+ * 鑾峰彇瀹炴椂鏁版嵁
+ */
getRealData() {
this.$api.getRealTimeData(this.queryParam).then((res) => {
if (res.success) {
@@ -574,7 +602,7 @@
computed: {
//杩愯鐘舵��
runStatu() {
- let stop = this.$lget(this.model, 'result.stop');
+ let stop = this.$lget(this.model, 'stop');
return !stop
},
@@ -606,10 +634,11 @@
return formula
},
//骞茬嚗寮�濮嬫椂闂�
- startTime() {
- if (this.model && this.model.detailList) {
- if (this.model.detailList.length > 0) {
- return this.model.detailList[0].tim
+ startTime() {
+ let detailList = this.$lget(this.model, 'detailList')
+ if (detailList) {
+ if (detailList.length > 0) {
+ return detailList[0].tim
}
}
return ""
@@ -706,4 +735,15 @@
width: 100%;
height: 300px;
}
-</style>
+
+ .nav {
+ background-color: white;
+ width: 100%;
+ height: 200px;
+
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/static/image/equ1.png b/static/image/equ1.png
deleted file mode 100644
index 9685464..0000000
--- a/static/image/equ1.png
+++ /dev/null
Binary files differ
--
Gitblit v1.9.3