فهرست منبع

fix(equip-detail): 修复诱芯更新时间显示格式问题

fix(api): 更新API基础URL配置

feat(cbd): 添加disableShow属性控制图片显示

fix(disease): 增加设备名称显示备选字段

refactor(photoImage): 优化图片显示控制逻辑

feat(index): 调整banner广告点击区域

style(banner): 优化返回按钮样式和布局

fix(weatherStation): 调整图表显示条件和样式

fix(environment): 修改历史数据时间字段

feat(deviceData): 添加设备拍照功能及样式优化
allen 2 روز پیش
والد
کامیت
020421eb25

+ 7 - 2
pages/banner/index.vue

@@ -1,11 +1,13 @@
 <template>
   <view class="banner-ad">
-    <view class="device-detail__header">
+    <view
+      class="device-detail__header"
+      @click="handleBack"
+    >
       <u-icon
         size="36"
         class="arrow-left"
         name="arrow-left"
-        @click="handleBack"
       ></u-icon>
     </view>
     <image :src="bannerURL" mode="" class="banner-image"></image>
@@ -35,8 +37,11 @@ export default {
     position: absolute;
     top: 32rpx;
     left: 32rpx;
+    width:88rpx;
+    height: 48rpx;
     z-index: 999;
     color:#fff;
+    margin-top: 64rpx;
   }
   .banner-image{
     width: 100%;

+ 1 - 1
pages/cb/equip-detail/equip-detail.vue

@@ -37,7 +37,7 @@
 			</view>
 			<view v-if="type==4">
 				<text space="emsp">诱芯更新时间</text>
-				<text style="margin: 0 10px;">{{equipInfo.xy_uptime}}</text>
+				<text style="margin: 0 10px;">{{formatTime(equipInfo.xy_uptime * 1000)}}</text>
 			</view>
 			<view v-if="type==4">
 				<text space="emsp">诱芯到期时间</text>

+ 82 - 12
pages/cbd/components/deviceData.vue

@@ -60,7 +60,7 @@
         </view>
         <view class="data-column-right">
           <view class="device-image-container">
-            <image class="device-image" src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/cbd.png" mode="aspectFit"></image>
+            <image class="device-image" :src="formatDevImg" mode="aspectFit"></image>
           </view>
         </view>
       </view>
@@ -86,7 +86,7 @@
       <view class="chart-content">
         <view class="chart-canvas-container" v-if="!show" :key="chartKey">
           <!-- <div id="tempChart" class="chart-canvas"></div> -->
-		      <qiun-data-charts type="line" :chartData="chartData" :canvas2d="true" :inScrollView="true" :opts="opts" :ontouch="true"/>
+		      <qiun-data-charts type="line" :chartData="chartData" :canvas2d="true" :inScrollView="true" :opts="opts" :ontouch="true" v-show="xData.length"/>
         </view>
       </view>
     </view>
@@ -189,7 +189,7 @@
           </view>
           <view class="sim-item">
             <text class="sim-label">已使用:</text>
-            <text class="sim-value"><text style="color: #0BBC58">{{ deviceInfoStatic.used }}</text>/{{ deviceInfoStatic.total }}</text>
+            <text class="sim-value"><text style="color: #0BBC58">{{ deviceInfoStatic.used || ''}}</text>/{{ deviceInfoStatic.total || '' }}</text>
           </view>
           <view class="sim-item">
             <text class="sim-value">
@@ -221,15 +221,18 @@
       </view>
       <view slot="expanded">
         <view class="general-images">
-          <view class="general-image edit-border" @click="editData">
+          <view class="general-image edit-border" :class="{'edit-border2':isShowPhoto}" @click="editData">
             <image :src="editBorder" class="image-icon"></image>
           </view>
-          <view class="general-image sim-border" @click="simData">
+          <view class="general-image sim-border" :class="{'sim-border2':isShowPhoto}" @click="simData">
             <image :src="simBorder" class="image-icon"></image>
           </view>
-          <view class="general-image setting-border" @click="openSettings">
+          <view class="general-image setting-border" :class="{'setting-border2':isShowPhoto}" @click="openSettings">
             <image :src="settingBorder" class="image-icon"></image>
           </view>
+          <view class="general-image photo-border" @click="openPhoto" v-if="isShowPhoto">
+            <image :src="photoBorder" class="image-icon"></image>
+          </view>
         </view>
       </view>
     </floatButton>
@@ -246,6 +249,7 @@ import general from '../assets/general.png';
 import editBorder from '../assets/editBorder.png';
 import settingBorder from '../assets/settingBorder.png';
 import simBorder from '../assets/simBorder.png';
+import photoBorder from '../assets/photoBorder.png';
 let chartInstance = null;
 
 export default {
@@ -283,22 +287,22 @@ export default {
   components: {
     floatButton,
   },
-  computed:{
-    totalPages(){
-      return Math.ceil(this.totalPage / this.page_size)
-    }
-  },
   data() {
     return {
       setting,
       general,
       editBorder,
       settingBorder,
+      photoBorder,
       simBorder,
+      devImage:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/cbd.png',
+      baseDevice:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image',
+      devImg:'',
       activeTab: 0,
       edit,
       sim,
       show:false,
+      isShowPhoto:false,
       show1:true,
       equipStateDict:{},
       chartTabs: [
@@ -352,6 +356,14 @@ export default {
   mounted(){
     this.equipStateDict = Circulation
   },
+  computed: {
+    totalPages(){
+      return Math.ceil(this.totalPage / this.page_size) || 1
+    },
+    formatDevImg() {
+      return `https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/${this.devImg}.png`;
+    },
+  },
   watch:{
     polylineList:{
       handler(newVal, oldVal){
@@ -364,6 +376,31 @@ export default {
       deep:true,
       immediate:true,
     },
+    deviceInfo:{
+      handler(newVal, oldVal){
+        if (newVal.device_model == '11'){
+          this.devImg = 'cbd4.1'
+          this.isShowPhoto = true
+        } else if(newVal.device_model == '12'){
+          this.devImg = 'cbd1'
+          this.isShowPhoto = false
+        } else if(newVal.device_model == '13'){
+          this.devImg = 'cbd5'
+          this.isShowPhoto = true
+        } else if(newVal.device_model == '14'){
+          this.devImg = 'cbd6'
+          this.isShowPhoto = true
+        } else if(newVal.device_model == '15'){
+          this.devImg = 'gkcbd1'
+          this.isShowPhoto = false
+        } else{
+          this.devImg = 'cbd'
+          this.isShowPhoto = true
+        }
+      },
+      deep:true,
+      immediate:true,
+    },
     deviceHistoryList:{
       handler(newVal, oldVal){
         this.historyData = []
@@ -378,6 +415,20 @@ export default {
     },
   },
   methods: {
+    async openPhoto(){
+       const res = await this.$myRequest({
+        url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
+        method: 'POST',
+        data: {
+          device_type_id: this.deviceInfo.type,
+          d_id: this.deviceInfo.d_id,
+          cmd: 'takephoto',
+        },
+      });
+      if(res){
+        this.$u.toast('拍照成功')
+      }
+    },
     editData(){
       uni.navigateTo({
         url: '/pages/afterSale/addafter?d_id=' + this.deviceInfo.d_id +'&device_id='+this.deviceInfo.id + '&device_type=' + this.deviceInfo.type,
@@ -631,8 +682,9 @@ export default {
       });
     },
     updateChartsData(){
+      const categories = this.xData.length ? this.xData : [];
       const lineData = {
-        categories: this.xData,
+        categories,
         series: [
           {
             name: this.chartTabs[this.activeChartTab].name,
@@ -727,6 +779,7 @@ export default {
   display: flex;
   align-items: center;
   justify-content: center;
+  background: #ffffff;
   transition: all 0.3s ease;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
   .general-icon{
@@ -745,6 +798,7 @@ export default {
     width: 80rpx;
     height: 80rpx;
     border-radius: 50%;
+    background: #ffffff;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     display:flex;
     align-items: center;
@@ -766,6 +820,22 @@ export default {
     top: -40rpx;
     left: -180rpx;
   }
+  .edit-border2{
+    top: 60rpx;
+    left: -70rpx;
+  }
+  .sim-border2{
+    top: -75rpx;
+    left: -150rpx;
+  }
+  .setting-border2{
+    top: 20rpx;
+    left: -150rpx;
+  }
+  .photo-border{
+    top: -135rpx;
+    left: -70rpx;
+  }
 }
 /* 主要数据面板 */
 .main-data-panel {

+ 8 - 1
pages/cbd/components/photoImage.vue

@@ -1,6 +1,9 @@
 <template>
   <view class="photo-image">
-    <view class="photo-image__tabs">
+    <view
+      class="photo-image__tabs"
+      v-if="disableShow"
+    >
       <view
         class="photo-image__tab"
         v-for="(pest, index) in pestList"
@@ -36,6 +39,10 @@
 <script>
 export default {
   props:{
+    disableShow:{
+      type: Boolean,
+      default: true
+    },
     pestList:{
       type: Array,
       default: () => []

+ 2 - 0
pages/cbd/detail.vue

@@ -69,6 +69,7 @@
       </view>
       <view v-if="activeTab === 'viewImage'">
         <photoImage
+          :disableShow="disableShow"
           :images="imageList"
           :pestList="pestList"
           @changeTab="changeTab"
@@ -183,6 +184,7 @@ export default {
         this.disableShow = false;
         if(showStatus){
           this.activeTab = 'viewImage';
+          this.handleTabClick('viewImage');
         }
       }else{
         this.disableShow = true;

+ 7 - 1
pages/deviceDetails/weatherStation/eleDetail.vue

@@ -73,6 +73,7 @@
 
       <view class="chart-container" v-if="hasData">
         <canvas
+          v-show="!show"
           canvas-id="temperatureChart"
           id="temperatureChart"
           class="chart"
@@ -506,7 +507,9 @@ export default {
   padding: 0 32rpx;
   padding-top: 98rpx;
 }
-
+.nav-title{
+  text-align: center;
+}
 .date-picker {
   display: flex;
   align-items: center;
@@ -606,6 +609,7 @@ export default {
       padding-left: 16rpx;
       margin-left: 16rpx;
       cursor: pointer;
+      display: none;
     }
   }
   /* 展开后的要素容器样式 */
@@ -648,6 +652,8 @@ export default {
     position: relative;
     padding: 10rpx;
     overflow: hidden;
+    height: 336rpx;
+    z-index:0;
     .chart {
       width: 100%;
       height: 336rpx;

+ 1 - 1
pages/disease/cmb.vue

@@ -13,7 +13,7 @@
 						<image :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'" mode=""
 							class="tishi"></image>
 					</p>
-					<p>设备名称:{{ eqinfo.device_name || eqinfo.name || "无" }}</p>
+					<p>设备名称:{{ eqinfo.device_name || eqinfo.name || eqinfo.equip_name || "无" }}</p>
 					<p>
 						最近上报时间:<span v-if="eqinfo.uptime">{{ eqinfo.uptime == 0 ? '无' : eqinfo.uptime | timeFormat()
             }}</span><span v-else>{{eqinfo.uptime == 0 ? '无' : eqinfo.uptime | timeFormat() }}</span>

+ 2 - 2
pages/environment/gshistory.vue

@@ -41,7 +41,7 @@
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
 						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
-							<td class="td">{{items.uptime|timeFormat()}}</td>
+							<td class="td">{{items.upl_time|timeFormat()}}</td>
 							<td class="td">{{items.ats}}</td>
 							<td class="td">{{items.at}}</td>
 							<td class="td" v-for="(item,index) in items.temp" :key="'c'+index">{{item}}</td>
@@ -141,7 +141,7 @@
 				var arr3 = []
 				var k = 0
 				for (var i = 0; i < res.dat_char.length; i++) {
-					var times = new Date(res.dat_char[i].uptime * 1000)
+					var times = new Date(res.dat_char[i].upl_time * 1000)
 					xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times
 						.getMinutes())
 					arr1.unshift(res.dat_char[i].at == "" ? "0" : res.dat_char[i].at) //空气温度

+ 5 - 2
pages/index/index.vue

@@ -114,7 +114,7 @@
 					</view> -->
 				</view>
 			</view>
-			<view class="banner-ad">
+			<view class="banner-ad" @click="tabs">
 				<view class="ad-text">
 					<view class="title">
 						<!-- 松墨天牛拍照性诱智能监测 -->
@@ -122,7 +122,7 @@
 					<view class="sub-title">
 						<!-- AI慧眼识天牛    智守青山护松林 -->
 					</view>
-					<view class="btn" @click="tabs">
+					<view class="btn">
 						查看详情
 					</view>
 				</view>
@@ -212,6 +212,9 @@
 			},
 		},
 		methods: {
+			handlePopupClose(){
+				console.log('弹窗已关闭')
+			},
 			tabs(){
 				uni.navigateTo({
 					url: '/pages/banner/index'

+ 2 - 2
util/api.js

@@ -1,7 +1,7 @@
 // let BASE_URL = 'http://114.55.0.7:8002';
 // const BASE_URL='http://8.136.98.49:8002'
-let BASE_URL = 'http://218.28.198.186:10505'
-// let BASE_URL = 'https://wx.hnyfwlw.com'
+// let BASE_URL = 'http://218.28.198.186:10505'
+let BASE_URL = 'https://wx.hnyfwlw.com'
 // let BASE_URL = 'http://192.168.1.107:8000';
 // let BASE_URL = 'http://218.28.198.186:10508';
 // let BASE_URL = 'https://uat.hnyfwlw.com'