Selaa lähdekoodia

feat: 新增阀门系统详情页和设备控制功能

refactor: 统一设备ID和名称的显示逻辑
fix: 修复设备控制指令下发逻辑
style: 优化页面样式和布局
docs: 更新页面文档和注释
allen 18 tuntia sitten
vanhempi
commit
05ea768f26

+ 13 - 2
pages.json

@@ -3,7 +3,7 @@
 		"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [{
-			"path": "pages/index/index2",
+			"path": "pages/index/index",
 			"style": {
 				"enablePullDownRefresh": false,
 				"navigationBarTitleText": "首页",
@@ -311,6 +311,17 @@
 				}
 			}]
 		},
+    {
+			"root": "pages/fmSys",
+			"pages": [{
+				"path": "details",
+				"style": {
+					"navigationBarTitleText": "阀门",
+					"enablePullDownRefresh": false,
+					"navigationStyle": "custom"
+				}
+			}]
+    },
 		{
 			"root": "pages/warning",
 			"pages": [{
@@ -1425,7 +1436,7 @@
 		"selectedColor": "#018B3F",
 		"borderStyle": "white",
 		"list": [{
-				"pagePath": "pages/index/index2",
+				"pagePath": "pages/index/index",
 				"iconPath": "static/images/tabBar/shouye.png",
 				"selectedIconPath": "static/images/tabBar/shouyesel.png",
 				"text": "首页"

+ 6 - 6
pages/cb/sy/detail.vue

@@ -2,12 +2,12 @@
 	<view>
 		<view :class="['info',equipInfo.is_online==1?'on':'off']">
 			<view class="" @click="copy(equipInfo)">
-				设备ID:{{equipInfo.imei||equipInfo.device_id}}
+				设备ID:{{equipInfo.imei||equipInfo.device_id ||equipInfo.id }}
 				<image :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'" mode="" class="tishi">
 				</image>
 			</view>
 			<view class="">
-				设备名称:{{equipInfo.device_name==""?"无":equipInfo.device_name}}
+				设备名称:{{equipInfo.device_name || equipInfo.name }}
 			</view>
 			<view class="">
 				设备类型:病虫害可视监测
@@ -105,12 +105,12 @@
 		methods: {
 			tophoto() {
 				uni.navigateTo({
-					url: "./imgList?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id
+					url: "./imgList?device_id=" + (this.equipInfo.imei || this.equipInfo.device_id || this.equipInfo.id) + "&d_id=" + this.equipInfo.d_id
 				})
 			},
 			tohis() {
 				uni.navigateTo({
-					url: "./history?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id
+					url: "./history?device_id=" + (this.equipInfo.imei || this.equipInfo.device_id || this.equipInfo.id) + "&d_id=" + this.equipInfo.d_id
 				})
 			},
 			simRouter() {
@@ -121,7 +121,7 @@
 			copy(item) {
 				console.log(item)
 				uni.setClipboardData({
-					data: item.imei || item.device_id,
+					data: item.imei || item.device_id || item.id,
 					success: function() {
 						console.log('success');
 					}
@@ -131,7 +131,7 @@
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.worm_lamp.color_attract_data',
           data: {
-            device_id: this.equipInfo.imei,
+            device_id: this.equipInfo.imei || this.equipInfo.device_id || this.equipInfo.id,
 					}
 				})
 				console.log(res)

+ 3 - 3
pages/cb/xy2.0/particulars.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="">
-			<view :class="['info',equipInfo.is_online==1?'on':'off']">
+			<view :class="['info',equipInfo.status==1?'on':'off']">
 				<p @click="copy(newState.device_id || newState.imei || newState.id)">设备ID:{{newState.device_id || newState.imei || newState.id}}<image :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'" mode="" class="tishi"></image></p>
 				<p>设备名称:{{newState.device_name==""?"无":newState.device_name}}</p>
 				<p>最新上报时间:{{newState.uptime | timeFormat}}</p>
@@ -208,7 +208,7 @@
 			},
 			toggle(){
 				uni.navigateTo({
-					url:"./historydatas?device_id="+this.equipInfo.device_id + "&d_id=" + this.equipInfo.d_id
+					url:"./historydatas?device_id="+(this.equipInfo.device_id || this.equipInfo.imei || this.equipInfo.id) + "&d_id=" + this.equipInfo.d_id
 				})
 			},
 			addxy(){
@@ -256,7 +256,7 @@
 			},
 			repairs(){
 				uni.navigateTo({
-					url: "../../afterSale/addafter?device_id="+ this.newState.device_id +"&device_type="+ 10
+					url: "../../afterSale/addafter?device_id="+ (this.newState.device_id || this.newState.imei || this.newState.id) +"&device_type="+ 10
 				})
 			},
 			async Chistory(device_id) { //历史数据列表折线图

+ 6 - 5
pages/cb/xylps/detail/detail.vue

@@ -3,13 +3,13 @@
 		<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" active-color="#14A478"></u-tabs>
 		<view class="currentBox">
 			<view v-if="current == 0" class="infoBox">
-				<view :class="['info',equipInfo.is_online==1?'on':'off']">
-					<p @click="copy(equipInfo.imei)">设备ID:{{equipInfo.imei}}
+				<view :class="['info',equipInfo.status==1?'on':'off']">
+					<p @click="copy(equipInfo.imei || equipInfo.device_id || equipInfo.id)">设备ID:{{equipInfo.imei || equipInfo.device_id || equipInfo.id}}
 						<image :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'" mode=""
 							class="tishi">
 						</image>
 					</p>
-					<p>设备名称:{{equipInfo.device_name==""?"无":equipInfo.device_name}}</p>
+					<p>设备名称:{{equipInfo.device_name || equipInfo.name}}</p>
 					<p>最新上报时间:{{equipInfo.addtime | timeFormat}}</p>
 					<p>最新地址:{{equipInfo.address}}</p>
 					<p class="fillin">诱芯名称:{{equipInfo.decoy}}</p>
@@ -515,8 +515,9 @@
 					}
 				}
 			})
-			this.equipInfoImei = JSON.parse(option.detail).imei;
-			this.equipInfo_d_id = JSON.parse(option.detail).d_id;
+			const detail = JSON.parse(option.detail);
+			this.equipInfoImei = detail.imei || detail.device_id || detail.id;
+			this.equipInfo_d_id = detail.d_id;
 			this.getEquipInfo();
 			// console.log(this.equipInfo);
 			this.getData();

+ 1 - 1
pages/cbd/components/DeviceCard.vue

@@ -36,7 +36,7 @@ export default {
   methods: {
     copyDeviceId() {
       uni.setClipboardData({
-        data: this.deviceId,
+        data: this.dataSource.id,
         success: () => {
           uni.showToast({
             title: '复制成功',

+ 3 - 0
pages/cbd/components/photoImage.vue

@@ -27,6 +27,9 @@
         </view>
       </view>
     </view>
+    <view v-else>
+      <u-empty text="暂无图片"></u-empty>
+    </view>
   </view>
 </template>
 

+ 9 - 0
pages/cbd/detail.vue

@@ -63,6 +63,9 @@
         <PestArchive
           :pest_info="pestInfo"
         />
+        <view v-if="!pests.length">
+          <u-empty text="暂无数据"></u-empty>
+        </view>
       </view>
       <view v-if="activeTab === 'viewImage'">
         <photoImage
@@ -132,6 +135,7 @@ export default {
       page_size:24,
       pestList:[],
       pest_names:'',
+      pests:[],
       polylineList:[],
       deviceHistoryList:[],
       deviceStatic:{}
@@ -298,8 +302,13 @@ export default {
       });
       const pest_order = res?.pest_order;
       let total = 0;
+      this.pests = [];
       for(let key in pest_order){
         total += pest_order[key] || 0;
+        this.pests.push({
+          name: key,
+          percent: (pest_order[key] / total) * 100
+        })
       }
       this.pest_order = pest_order;
       this.day = res?.day || [];

+ 2 - 0
pages/deviceDetails/weatherStation/index.vue

@@ -669,6 +669,7 @@ export default {
     border-radius: 16rpx;
     padding: 32rpx;
     margin-bottom: 24rpx;
+    height: 400rpx;
     .device-control {
       position: relative;
       z-index: 3;
@@ -727,6 +728,7 @@ export default {
       .params-right {
         position: absolute;
         right: 0;
+        top:0;
         .device-img {
           width: 150rpx;
         }

+ 8 - 8
pages/environment/equipment-new.vue

@@ -11,11 +11,11 @@
 						:src="eqinfo.item.is_online==1?$imageURL+'/bigdata_app/image/cb/onBg.png':$imageURL+'/bigdata_app/image/cb/offBg.png'"
 						mode="" class="bgi"></image>
 					<p style="font-size: 32rpx;" @click="copy(eqinfo.item)">设备
-						ID:{{eqinfo.item.imei}}
+						ID:{{eqinfo.item.imei || eqinfo.item.device_id || eqinfo.item.id}}
 						<image :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'" mode=""
 							class="tishi"></image>
 					</p>
-					<p>设备名称:{{eqinfo.item.device_name?eqinfo.item.device_name:"无"}}</p>
+					<p>设备名称:{{eqinfo.item.name || eqinfo.item.device_name || "无"}}</p>
 					<p>最近上报时间:<span v-if="eqinfo.item.uptime">{{eqinfo.item.uptime|timeFormat()}}</span><span
 							v-else>{{eqinfo.item.addtime|timeFormat()}}</span></p>
 					<p>地址:{{eqinfo.item.address||"--"}}</p>
@@ -132,7 +132,7 @@
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=greenhouse.env_first.recent_data',
 					data: {
-						device_id: this.eqinfo.item.imei || this.eqinfo.item.equip_id
+						device_id: this.eqinfo.item.imei || this.eqinfo.item.equip_id || this.eqinfo.item.id
 					}
 				})
 				this.dataloadingtf = false
@@ -151,7 +151,7 @@
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=weather.weather.qxz_data_chart',
 					data: {
-						device_id: this.eqinfo.item.imei || this.eqinfo.item.device_id,
+						device_id: this.eqinfo.item.imei || this.eqinfo.item.device_id || this.eqinfo.item.id,
 						begin: parseInt(oldtime - 24 * 60 * 60),
 						end: parseInt(newtime - 24 * 60 * 60)
 					}
@@ -162,11 +162,11 @@
 			control() { //设备控制
 			console.log(this.eqinfo.item)
 				uni.navigateTo({
-					url: "./contros?id=" + this.eqinfo.item.d_id+'&device_type_id=38'+'&device_id='+this.eqinfo.item.imei
+					url: "./contros?id=" + this.eqinfo.item.d_id+'&device_type_id=38'+'&device_id='+(this.eqinfo.item.imei || this.eqinfo.item.device_id || this.eqinfo.item.id)
 				})
 			},
 			charts() { //历史数据
-				var device_id = this.eqinfo.item.imei || this.eqinfo.item.device_id
+				var device_id = this.eqinfo.item.imei || this.eqinfo.item.device_id || this.eqinfo.item.id
 				uni.navigateTo({
 					url: "./history-new?device_id=" + device_id+'&device_type_id=38'
 				})
@@ -185,7 +185,7 @@
 			},
 			copy(item) {
 				uni.setClipboardData({
-					data: item.imei || item.device_id,
+					data: item.imei || item.device_id || item.id,
 					success: function() {
 						console.log('success');
 					}
@@ -193,7 +193,7 @@
 			},
 			repairs() {
 				console.log(this.eqinfo.item)
-				var device_id = this.eqinfo.item.imei || this.eqinfo.item.device_id
+				var device_id = this.eqinfo.item.imei || this.eqinfo.item.device_id || this.eqinfo.item.id
 				uni.navigateTo({
 					url: "../afterSale/addafter?device_id=" + device_id + "&device_type=" + 38
 				})

+ 11 - 6
pages/equipList2/index.vue

@@ -347,7 +347,7 @@
 						break;
 					case 29:
 						uni.navigateTo({
-							url: `../cb/nlNewXy/nlNewXy?imei=${item.id}&showId=${item.only_for_show}`,
+							url: `../cb/nlNewXy/nlNewXy?imei=${item.id}&showId=${item.d_id}`,
 						});
 						break;
 					case 24:
@@ -502,7 +502,7 @@
 					case 25:
 						item.addtime = item.uptime;
 						uni.navigateTo({
-							url: '../cb/xylps/detail?detail=' + JSON.stringify(item),
+							url: '../cb/xylps/detail/detail?detail=' + JSON.stringify(item),
 						});
 						break;
 					case 40:
@@ -557,14 +557,19 @@
 			},
 			scroll() {},
 		},
-		onShow() {
+		watch:{
+			pur_id(){
+				setTimeout(() => {
+					this.getUserlogin();
+				}, 100);
+			},
+		},
+		onLoad() {
 			const that = this;
 			uni.$on('purId', (purId) => {
 				that.pur_id = purId;
 			});
-			setTimeout(() => {
-				this.getUserlogin();
-			}, 100);
+			this.getUserlogin();
 		},
 		onTabItemTap(e) {
 		},

+ 862 - 0
pages/fmSys/details.vue

@@ -0,0 +1,862 @@
+<template>
+	<view class="fm-page">
+		<!-- <view class="status_bar"></view> -->
+		<uni-nav-bar left-icon="back" background-color='rgba(0,0,0,0)' title="闸门" @clickLeft="clickLeft">
+			<!-- 	<view class="self-title">标题栏</view>
+			<template v-slot:left><view class="self-back"><uni-icons type="arrowleft" size="24"></uni-icons></view></template>
+		 -->
+		</uni-nav-bar>
+		<view class="fm-content">
+			<view class="info">
+				<view class="device-id" @click="copy(equipInfo)">
+					<image class="logo"
+						:src="`${$imageURL}/bigdata_pc/equipdistribute/${equipInfo.type}.png`" mode="">
+					</image>
+					{{equipInfo.imei||equipInfo.device_id || equipInfo.id}}
+					<image :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'" mode=""
+						class="tishi">
+					</image>
+					<view
+						:class="['float-right','yficonfont',equipInfo.is_online==1?'on icon-zaixian':'off icon-lixian']">
+						{{equipInfo.status==1?'在线':'离线'}}
+					</view>
+				</view>
+				<view class="info-list">
+					<span class="float-left">设备名称:</span> <span class="float-right">{{equipInfo.device_name || equipInfo.name}}</span>
+				</view>
+				<view class="info-list">
+					<span class="float-left">上报时间:</span> <span
+						class="float-right">{{equipInfo.addtime||equipInfo.uptime | timeFormat}}</span>
+				</view>
+				<view class="info-list">
+					<span class="float-left">设备地址:</span> <span
+						class="float-right">{{equipInfo.address?equipInfo.address:"--"}}</span>
+				</view>
+
+
+				<u-calendar v-model="calendar_show" mode="date" :max-date="date" @change="timeChange($event)">
+				</u-calendar>
+				<u-toast ref="toast" />
+			</view>
+			<view class="title"></view>
+			<view class="newState">
+				<view class="top">
+					<view class="left">
+						<image class="img" 
+						:src="$imageURL+'/bigdata_app/image/irrigate/fm.png'"
+						></image>
+						<view>
+							<p> <span class="num">{{deviceData.nowHeight}}</span> mm</p>
+							<p>{{deviceData.deviceStatus}}</p>
+						</view>
+
+					</view>
+					<view class="btn" style="width:170rpx">
+						<u-button text="设置开度" size="mini" @click="kdShow = true">设置开度</u-button>
+					</view>
+					<view class="right btn">
+						<u-button text="刷新" size="mini" @click="zfControl('refresh')">刷新</u-button>
+					</view>
+				</view>
+				<view class="up-down">
+					<view class="bottom">
+						<view class="opt">
+							<image 
+							:src="$imageURL+'/bigdata_app/image/irrigate/fm-up.png'"
+							></image>
+							<!-- <p class="num">到位</p>
+						<p>顶到位</p> -->
+						</view>
+						<view class="btn">
+							<u-button text="上升" size="mini" @click="zfControl('up')">上升</u-button>
+						</view>
+					</view>
+					<view class="bottom">
+						<view class="opt">
+							<image :src="$imageURL+'/bigdata_app/image/irrigate/fm-down.png'"
+							></image>
+							<!-- <p class="num">未到位</p>
+						<p>底到位</p> -->
+						</view>
+						<view class="btn">
+							<u-button class="active" text="下降" size="mini" @click="zfControl('down')">下降</u-button>
+						</view>
+					</view>
+				</view>
+				<view class="btn">
+					<button text="停止" @click="zfControl('stop')">停止</button>
+				</view>
+			</view>
+
+			<!-- 操作记录 -->
+			<view class="consoleList">
+				<view class="title">操作记录</view>
+				<view class="histimeBox">
+					<u-icon name="calendar" color="#C1C1C1" size="24"></u-icon>
+					<view class="time" @click="consoleshow = true">
+						{{consoleTime.startDate ? consoleTime.startDate : '开始'}}
+					</view>
+					<view class="">至</view>
+					<view class="time" @click="consoleshow = true">{{consoleTime.endDate ? consoleTime.endDate : '结束'}}
+					</view>
+					<u-icon name="close-circle" color="#C1C1C1" size="28" @click="clearContime"
+						v-if="consoleTime.startDate"></u-icon>
+				</view>
+				<u-calendar  @maxDate="maxDate" v-model="consoleshow" mode="range" @change="changeConsoleDate"></u-calendar>
+				<view class="tableList tableTitle">
+
+					<view>时间</view>
+					<view>操作内容</view>
+					<view>操作结果</view>
+					<view>操作人</view>
+				</view>
+				<view class="tableList" v-for="(item, index) in tableData" :key="item.addtime + index">
+					<view>{{item.addtime}}</view>
+					<view :class="item.status=='成功' ? 'success' : 'error'">{{item.order}}</view>
+					<view>{{item.status}}</view>
+					<view>{{item.user}}</view>
+				</view>
+				<u-loadmore style="margin-top: 16rpx;" :status="status" />
+			</view>
+			<u-popup v-model="kdShow" mode="center" width="600rpx">
+				<view style="padding: 40rpx;">
+					<slider style="margin-top: 20rpx;" :value="kdValue" show-value="true" :min="0" :max="1000"
+						block-color="#57C878" activeColor="#57C878" step="1" />
+					<view class="btn-box">
+						<u-button @click="kdSubmit" size="mini" type="success">确定</u-button>
+					</view>
+				</view>
+
+			</u-popup>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		QueryPermission,
+		getPermissionById,
+		getUserPermission
+	} from "@/util/QueryPermission.js"
+	export default {
+		data() {
+			return {
+				maxDate: '2050-12-31',
+				city: "",
+				type: null, //设备类型
+				device_status: null,
+				equipInfo: {},
+				cbd: [
+
+				],
+				newState: {}, //设备最新状态
+				setTimeShow: false,
+				calendar_show: false,
+				culErr: '',
+
+				decoy: '',
+				newtishitf: false, //暂无数据提示
+				dataloadingtf: true, //加载中提示
+				date: "", //日历最大可选日期
+				operateType: '',
+				status: '', //是否加载更多
+				page: 1,
+				tableData: [],
+				deviceData: {},
+				consoleshow: false,
+				consoleTime: {},
+				kdValue: 0,
+				kdShow: false
+			}
+		},
+		computed: {
+
+
+
+		},
+		filters: {
+			equipType(type) {
+				switch (type) {
+					case 3:
+						return "虫情测报灯";
+					case 7:
+						return "孢子仪";
+					case 4:
+						return "性诱测报"
+
+				}
+			},
+			formatValue(val, a1, a2) {
+				if (a2 == 4 && a1 == "电池状态") {
+					switch (Number(val)) {
+						case 0:
+							return '正常';
+							break;
+						case 1:
+							return '欠压';
+							break;
+						case 2:
+							return '过压';
+							break;
+					}
+				} else {
+
+					return val ? val : '无'
+				}
+			}
+		},
+		onReachBottom() {
+			if (this.status == 'loadmore') {
+				this.page++;
+				this.getEquipcontroldata()
+			}
+		},
+		onLoad(option) {
+
+			this.equipInfo = JSON.parse(option.info)
+			console.log(this.equipInfo,'equipInfoequipInfo')
+			this.getEquipcontroldata()
+			this.getDeviceList()
+			// 		this.getDeviceStatus()
+			// 		this.type = Number(this.equipInfo.type) || Number(this.equipInfo.equip_type) || Number(this.equipInfo
+			// 			.device_type_id)
+			// 		this.equipInfo.type = this.type
+
+
+			// 		this.getState()
+
+			// 		// this.selectaddress(Number(this.equipInfo.lat), Number(this.equipInfo.lng))
+			// 		var times = new Date()
+			// 		this.date = times.getFullYear() + 1 + "-" + Number(times.getMonth() + 1) + "-" + times.getDate()
+		},
+		methods: {
+			clickLeft() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			kdSubmit() {
+				this.kdShow = false
+				this.zfControl('value')
+			},
+			// 指令下发
+			zfControl(cmd) {
+
+				this.$myRequest({
+					method: 'POST',
+					url: '/api/api_gateway?method=hran.view.hran_order',
+					data: {
+						d_id: this.equipInfo.d_id,
+						order: cmd,
+						controlValue: this.kdValue
+					}
+				}).then((res) => {
+					console.log('指令', res)
+					if (res == true) {
+						uni.showToast({
+							title: '指令下发成功!',
+							duration: 2000,
+						});
+						setTimeout(() => {
+							this.tableData = [];
+							this.page = 1;
+							this.getEquipcontroldata()
+						}, 2000)
+					} else {
+						uni.showToast({
+							title: '指令下发失败!',
+							duration: 2000,
+						});
+					}
+				})
+			},
+			changeConsoleDate(e) {
+				console.log(e)
+				this.consoleTime = e;
+				this.tableData = [];
+				this.page = 1;
+				this.getEquipcontroldata();
+			},
+			clearContime() {
+				this.consoleTime = {};
+				this.tableData = [];
+				this.page = 1;
+				this.getEquipcontroldata();
+			},
+			//操作记录
+			async getEquipcontroldata() {
+				uni.showLoading({
+					title: '加载中'
+				});
+				const {
+					consoleTime
+				} = this;
+				let begin = consoleTime.startDate ? new Date(consoleTime.startDate+ ' 00:00:00').getTime() / 1000 : '';
+				let end = consoleTime.endDate ? new Date(consoleTime.endDate+ ' 23:59:59').getTime() / 1000 : '';
+				//操作记录
+				let res = await this.$myRequest({
+					method: "POST",
+					url: "/api/api_gateway?method=hran.view.hran_order_list",
+					data: {
+						d_id: this.equipInfo.d_id,
+						page: this.page,
+						page_size: 15,
+						start: begin,
+						end: end
+					},
+				})
+				console.log(res)
+				uni.hideLoading();
+				// this.tableData = [];
+				const record = res.data;
+				this.tableData = [...this.tableData, ...record];
+				this.total = res.total;
+				if (this.page * 15 > this.total) {
+					this.status = 'nomore'
+				} else {
+					this.status = 'loadmore'
+				}
+				// console.log(this.tableData);
+			},
+			// 获取设备数据
+			getDeviceList() {
+				this.devicetf = true
+				const {
+					consoleTime
+				} = this;
+				let begin = consoleTime.startDate ? new Date(consoleTime.startDate+ ' 00:00:00').getTime() / 1000 : '';
+				let end = consoleTime.endDate ? new Date(consoleTime.endDate+ ' 23:59:59').getTime() / 1000 : '';
+				try {
+					this.$myRequest({
+						method: 'POST',
+						url: '/api/api_gateway?method=hran.view.hran_data',
+						data: {
+							d_id: this.equipInfo.d_id,
+							start: begin,
+							end: end,
+							page: 1,
+							page_size: 1
+						}
+					}).then((res) => {
+						this.devicetf = false
+						console.log('设备数据', res)
+
+						if (res.data.length > 0) {
+							const {
+								data,
+								title
+							} = res
+							// console.log(data, title, total)
+							this.deviceData = data[0]
+							// this.deviceTitle = title
+						} else {
+							this.deviceData = {}
+						}
+
+					})
+				} catch (error) {
+					console.log('+++++', error)
+				}
+			},
+			async getDeviceStatus() {
+
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.devices_list',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.imei || this.equipInfo.device_id || this.equipInfo.id,
+						page: 1,
+						size: 999
+					}
+				})
+				let newRes = res.device[0]
+				this.equipInfo = {
+					...this.equipInfo,
+					...newRes
+				}
+				console.log('响应', this.equipInfo)
+			},
+			async getState() {
+				this.dataloadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.device_status',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.d_id
+					}
+				})
+				this.newState = res
+				this.dataloadingtf = false
+				console.log('res', res)
+			},
+
+			partClick(path) {
+				console.log(path)
+				var device_id = this.equipInfo.device_id || this.equipInfo.imei || this.equipInfo.id;
+				uni.navigateTo({
+					url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + device_id + "&device_type=" + this
+						.type
+				});
+			},
+
+
+			operate(type) {
+				this.calendar_show = true
+				this.operateType = type
+			},
+			timeChange(e, filed) {
+				// // 根据type_id,执行相应的操作
+
+				// let typeId = this.equipInfo.type
+				// let postData = {}
+				// if(typeId===32){
+				// 	// 添加诱芯
+				// }else if(typeId === 33){
+				// 	// 添加诱芯,更换色板
+				// 	this.sbSubmit(e.result)
+				// }else if(typeId === 34){
+				// 	// 添加诱芯,更换卷带
+				// 	this.jdSubmit(e.result)
+				// }
+				this.yxSubmit(e.result)
+			},
+
+			async yxSubmit(time) {
+				let {
+					title,
+					url,
+					field
+				} = this.operateOptions[this.operateType]
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写' + title + '到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				let postData = {
+					device_type_id: this.equipInfo.type,
+					id: this.equipInfo.device_id
+				}
+				postData[field] = +new Date(time) / 1000
+				const res = await this.$myRequest({
+					url: url,
+					data: postData
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: title + '时间设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+
+				}
+			},
+			// 色板
+			async sbSubmit(time) {
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写色板到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.sban',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.device_id,
+						sban_expire_time: +new Date(time) / 1000
+					}
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: '设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+
+				}
+			},
+			async jdSubmit(time) {
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写卷带到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.syone_jd',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.device_id,
+						jd_expire_time: +new Date(time) / 1000
+					}
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: '设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+
+				}
+			},
+			selectaddress(lat, lng) { //获取分布位置
+				uni.request({
+					type: "GET",
+					url: "https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + lng + "," + lat +
+						"&key=27273b81090f78759e4057f94474516f&radius=1000&extensions=all",
+					dataType: "json",
+					complete: res => {
+						console.log(res)
+						this.city = res.data.regeocode.formatted_address
+					}
+				});
+			},
+			copy(item) {
+				console.log(item)
+				uni.setClipboardData({
+					data: item.imei || item.device_id || item.id,
+					success: function() {
+						console.log('success');
+					}
+				});
+			}
+		},
+	}
+</script>
+
+<style lang='scss'>
+	page {
+		height: 100%;
+
+		.fm-page {
+			width: 100%;
+			min-height: 100%;
+			background: linear-gradient(180deg, #f5f6fa00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
+			padding-top: 44rpx;
+		}
+
+		.fm-content {
+			padding: 0rpx 32rpx;
+			box-sizing: border-box;
+		}
+
+		.title {
+			color: #999999;
+			margin: 32rpx 0;
+		}
+
+		.logo {
+			width: 36rpx;
+			height: 36rpx;
+			margin-right: 12rpx;
+			position: relative;
+			top: 8rpx;
+		}
+
+		.device-id {
+			height: 60rpx;
+			line-height: 60rpx;
+			margin-bottom: 18rpx;
+			color: #5C5C5C;
+
+			.float-right {
+				float: right;
+				width: 88px;
+				height: 30px;
+				text-align: center;
+				position: absolute;
+				top: 0;
+				right: 0;
+				border-top-right-radius: 24rpx;
+			}
+		}
+
+		.on {
+			background-image: url('/static/images/cb/online.png');
+			color: #fff;
+		}
+
+		.off {
+			background-image: url('/static/images/cb/outline.png');
+			color: #999999;
+		}
+
+		.info {
+			position: relative;
+			padding: 8rpx 32rpx 32rpx 32rpx;
+
+			line-height: 50rpx;
+			font-size: 26rpx;
+			border-radius: 24rpx;
+
+			background-color: #fff;
+
+			box-sizing: border-box;
+			width: 100%;
+
+			.info-list {
+				overflow: hidden;
+				font-size: 12px;
+
+				.float-right {
+					float: right;
+					color: #666;
+
+					.arrow {
+						margin-left: 10rpx;
+					}
+				}
+
+				.float-left {
+					float: left;
+					color: #999;
+				}
+
+			}
+
+			.tishi {
+				width: 28rpx;
+				height: 28rpx;
+				margin: 0rpx 0 0 12rpx;
+				position: relative;
+				top: 6rpx;
+			}
+		}
+
+		.tit {
+			font-weight: 800;
+			height: 50rpx;
+			font-size: 30rpx;
+			margin-bottom: 20rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.span {
+				color: #6e6c76;
+				font-size: 24rpx;
+				display: flex;
+				justify-content: space-between;
+				/* margin-top: 12rpx; */
+			}
+		}
+
+
+		.newState {
+			padding: 32rpx;
+			border-radius: 16rpx;
+			background: #FFF;
+
+			.top {
+				height: 112rpx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+
+				.left {
+					width: 40%;
+					display: flex;
+					align-items: center;
+				}
+
+				.right {
+					width: 160rpx;
+				}
+
+				.img {
+					float: left;
+					width: 110rpx;
+					height: 110rpx;
+					margin-right: 32rpx;
+				}
+
+				p:nth-child(2) {
+					color: #687A74;
+				}
+
+				.num {
+					font-size: 40rpx;
+					font-weight: 700;
+					color: #042118;
+				}
+			}
+
+			.up-down {
+				height: 222rpx;
+				margin: 32rpx 0;
+				display: flex;
+				gap: 18rpx;
+				justify-content: space-between;
+			}
+
+			.bottom {
+				box-sizing: border-box;
+				height: 100%;
+				display: flex;
+				padding: 32rpx 0;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				gap: 30rpx;
+				flex: 1 0 0;
+				border-radius: 16rpx;
+				background: linear-gradient(180deg, #14a4781a 0%, #14a47800 100%), #FFF;
+
+				.opt {
+					width: 70rpx;
+					height: 70rpx;
+					font-size: 24rpx;
+					color: #687A74;
+
+					image {
+						width: 64rpx;
+						height: 64rpx;
+						float: left;
+						margin-right: 16rpx;
+					}
+
+					.num {
+						color: #042118;
+						font-weight: 700;
+						font-size: 28rpx;
+					}
+				}
+			}
+
+			.btn {
+				button {
+					font-size: 28rpx;
+					width: 100%;
+					background: #EEF0F8;
+					height: 63rpx;
+					line-height: 63rpx;
+					border: none;
+					outline: none;
+					border-radius: 16rpx;
+
+					&:after {
+						border: none;
+					}
+
+					&.active {
+						color: #fff;
+						background: #14A478;
+					}
+				}
+			}
+
+		}
+
+
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+
+	.red {
+		color: rgb(235, 103, 101);
+	}
+
+	.consoleList {
+		padding: 32rpx;
+		background: #fff;
+		border-radius: 16rpx;
+		margin-top: 32rpx;
+		min-height: calc(100vh - 1020rpx);
+
+		.title {
+			margin: 0;
+			margin-bottom: 16rpx;
+			color: #042118;
+			font-weight: 600;
+		}
+
+		.histimeBox {
+			margin: 32rpx 0;
+		}
+
+
+
+		.tableList {
+			font-size: 28rpx;
+			height: 93rpx;
+			color: #042118;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			border-bottom: 2rpx solid var(--neutral-color-border-base, #DCE6E3);
+
+			view {
+				text-align: center;
+			}
+
+			.success {
+				color: #14A478;
+			}
+
+			.error {
+				color: #FF5951;
+			}
+
+			view:nth-child(1) {
+				width: 160rpx;
+				text-align: left;
+			}
+
+			view:nth-child(2) {
+				width: 170rpx;
+			}
+
+			view:nth-child(3) {
+				width: 120rpx;
+			}
+		}
+
+		.tableTitle {
+			/* background: #E8F3F0; */
+			color: #042118;
+			font-weight: 500;
+			height: 78rpx;
+		}
+	}
+
+	.histimeBox {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		height: 56rpx;
+		padding: 6rpx 24rpx;
+		box-sizing: border-box;
+		border-radius: 8rpx;
+		margin-top: 54rpx;
+		border: 2rpx solid var(--neutral-color-border-light, #e4edea);
+
+		.u-icon {
+			z-index: 10;
+		}
+
+		.time {
+			width: 280rpx;
+			color: #c1c1c1;
+		}
+
+		view {
+			color: #333333;
+			text-align: center;
+		}
+
+	}
+
+	.btn-box {
+		text-align: center;
+	}
+</style>

+ 952 - 0
pages/index/index copy 2.vue

@@ -0,0 +1,952 @@
+<template>
+  <view>
+    <view class="weather">
+      <image
+        :src="
+          'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/weather/' +
+          weatherinfo.wea +
+          '.png'
+        "
+        mode=""
+        class="weaimg"
+      ></image>
+      <view class="weatext">
+        <view class="weatext_title">
+          {{ hello }}
+        </view>
+        <view class="">
+          {{ $isneutral ? '欢迎登录云飞智控' : '欢迎登录智控' }}
+        </view>
+      </view>
+    </view>
+    <view class="weatherinfo">
+      <view class="weatherinfo_item">
+        <image
+          :src="$imageURL + '/bigdata_app/newindex/weizhi.png'"
+          mode=""
+          class="weaimg"
+        ></image>
+        <view class="textbox">
+          {{ weatherinfo.district }}
+        </view>
+      </view>
+      <view class="weatherinfo_item">
+        <image
+          :src="$imageURL + '/bigdata_app/newindex/wendu.png'"
+          mode=""
+          class="weaimg"
+        ></image>
+        <view class="textbox"> {{ weatherinfo.at }}℃ </view>
+      </view>
+      <view class="weatherinfo_item">
+        <image
+          :src="$imageURL + '/bigdata_app/newindex/shidu.png'"
+          mode=""
+          class="weaimg"
+        ></image>
+        <view class="textbox">
+          {{ weatherinfo.ah }}
+        </view>
+      </view>
+      <view class="weatherinfo_item">
+        <view class="first_item"> PM2.5 </view>
+        <view class="textbox">
+          {{ weatherinfo.air_pm25 }}
+        </view>
+      </view>
+    </view>
+    <view class="functionbox">
+      <view class="functionbox_title"> 功能应用 </view>
+      <view class="functionbox_text">
+        <view
+          class="functionbox_text_item"
+          v-if="jurisdiction.sqtf"
+          @click="tabfunction(0)"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/base.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 四情基地 </view>
+        </view>
+        <view class="functionbox_text_item" @click="tabfunction(1)">
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/worm.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 病虫识别 </view>
+        </view>
+        <view
+          class="functionbox_text_item"
+          v-if="jurisdiction.zjtf"
+          @click="tabfunction(2)"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/knowledge.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 知识百科 </view>
+        </view>
+        <view class="functionbox_text_item" @click="tabfunction(3)">
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/aftersale.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 售后服务 </view>
+        </view>
+      </view>
+    </view>
+    <view class="facilitybox">
+      <view class="facilitybox_title"> 系统设备 </view>
+      <view class="facilitybox_itembox">
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.cbtf"
+          @click="tabequipment('../cb/index/index')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/cb.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 测报系统 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.cbyj"
+          @click="tabequipment('../cbqxyj/cbwarn')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/cbyj.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 测报预警 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.fztf"
+          @click="tabequipment('../prevention/index')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/fz.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 防治系统 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.jktf"
+          @click="tabequipment('../monitor/index')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/jk.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 监控系统 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.hjtf"
+          @click="tabequipment('../environment/index')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/hj.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 环境监测 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.qxz"
+          @click="tabequipment('../qxzyj/cbwarn', '5')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/qxyj.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 气象预警 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.sq"
+          @click="tabequipment('../qxzyj/cbwarn', '15')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/sqyj.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 墒情预警 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.ggtf"
+          @click="tabequipment('../irrigate/index')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/guangai.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 智能灌溉 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.sbtf"
+          @click="tabequipment('../equipMange/index/index')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/user.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 用户管理 </view>
+        </view>
+        <view
+          class="facilitybox_item"
+          v-if="jurisdiction.sbtf"
+          @click="tabequipment('../warning/index')"
+        >
+          <image
+            :src="$imageURL + '/bigdata_app/newindex/cb.png'"
+            mode=""
+            class="itemimg"
+          >
+          </image>
+          <view class=""> 预警列表 </view>
+        </view>
+      </view>
+    </view>
+    <view class="insectattack">
+      <view class="insectattack_title" @click="worm">
+        <view class=""> 虫情百科 </view>
+        <view class="iconbox">
+          <u-icon name="arrow-right"></u-icon>
+        </view>
+      </view>
+      <view class="insectattack_listbox">
+        <view class="insectattack_list">
+          <view class="list_box list_box1" @click="introduce(79, '虫情百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 小地老虎 </view>
+              <view class="list_box_info_text">
+                该虫能危害百余种植物,是对农、林木幼苗危害很大的地下害虫,
+                在东北主要危害落叶松、红松、水曲柳、核桃楸等苗木
+              </view>
+            </view>
+          </view>
+          <view class="list_box list_box2" @click="introduce(369, '虫情百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 草地贪夜蛾 </view>
+              <view class="list_box_info_text">
+                草地贪夜蛾被认为是世界上最具破坏性的害虫之一,其巨大的破坏性主要源于其“贪”的本性——贪吃、贪育、贪婪、广适、耐药。
+              </view>
+            </view>
+          </view>
+          <view class="list_box list_box3" @click="introduce(6, '虫情百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 棉铃虫 </view>
+              <view class="list_box_info_text">
+                棉铃虫具有高度多食性,可以为害20余科200多种植物,但比较喜食禾本科、锦葵科、茄科和豆科植物的花蕾和果实等繁殖器官。
+              </view>
+            </view>
+          </view>
+          <view class="list_box list_box4" @click="introduce(67, '虫情百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 稻纵卷叶螟 </view>
+              <view class="list_box_info_text">
+                生命潜能强,寿命长,产卵期长,产卵量也多。各代雌、雄蛾比例几乎各占半数。蛾子有强烈的趋荫蔽栖息习性
+              </view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="insectattack">
+      <view class="insectattack_title" @click="virus">
+        <view class=""> 病害百科 </view>
+        <view class="iconbox">
+          <u-icon name="arrow-right"></u-icon>
+        </view>
+      </view>
+      <view class="insectattack_listbox">
+        <view class="insectattack_list">
+          <view class="list_box list_box5" @click="introduce(267, '病害百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 小麦赤霉病 </view>
+              <view class="list_box_info_text">
+                小麦赤霉病从苗期到穗期均可发生,引起苗腐、茎基腐、秆腐和穗腐,以穗腐危害最大。湿度大时,病部均可见粉红色霉层。
+              </view>
+            </view>
+          </view>
+          <view class="list_box list_box6" @click="introduce(320, '病害百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 大豆根腐病 </view>
+              <view class="list_box_info_text">
+                初期茎基部或胚根表皮出现淡红褐色不规则的小斑,后变红褐色凹陷坏死斑,绕根茎扩展致根皮枯死
+              </view>
+            </view>
+          </view>
+          <view class="list_box list_box7" @click="introduce(292, '病害百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 玉米大斑病 </view>
+              <view class="list_box_info_text">
+                玉米大斑病主要为害叶片,严重时也为害叶鞘和苞叶。植株下部叶片先发病,然后向上扩展。
+              </view>
+            </view>
+          </view>
+          <view class="list_box list_box8" @click="introduce(278, '病害百科')">
+            <view class="list_box_xiang">
+              <view class="list_box_xiang_click"> 详情 </view>
+            </view>
+            <view class="list_box_info">
+              <view class="list_box_info_name"> 水稻稻瘟病 </view>
+              <view class="list_box_info_text">
+                发生于三叶前,由种子带菌所致。病苗基部灰黑,上部变褐,卷缩而死,湿度较大时病部产生大量灰黑色霉层。
+              </view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <u-modal
+      v-model="show"
+      :mask-close-able="true"
+      title=""
+      :show-cancel-button="true"
+      confirm-text="拍病害"
+      cancel-text="拍虫害"
+      cancel-color="#4BB85F"
+      content="拍照识别病虫害"
+      @confirm="confirm"
+      @cancel="cancel"
+    ></u-modal>
+    <kps-image-cutter
+      @ok="onok"
+      @cancel="oncancle"
+      :url="url"
+      :fixed="false"
+      :blob="true"
+      :maxWidth="500"
+      :maxHeight="380"
+      :height="380"
+    ></kps-image-cutter>
+    <view class="loading" v-if="loadTF" @touchmove.stop.prevent="moveHandle">
+      <u-loading mode="flower" size="100" :show="true"></u-loading>
+    </view>
+  </view>
+</template>
+
+<script>
+import kpsImageCutter from '@/components/ksp-image-cutter/ksp-image-cutter.vue';
+import jsencrypt from '@/components/jsencrypt/jsencrypt.vue';
+export default {
+  components: {
+    kpsImageCutter,
+  },
+  data() {
+    return {
+      weatherinfo: {
+        wea: '晴',
+      },
+      hello: '',
+      jurisdiction: {
+        cbtf: false,
+        jktf: false,
+        hjtf: false,
+        fztf: false,
+        sytf: false,
+        sbtf: false,
+        sqtf: false,
+        zjtf: false,
+        sftf: false,
+        ggtf: false,
+        qxz: false,
+        sq: false,
+        cbyj: false,
+      },
+      show: false,
+      url: '',
+      loadTF: false,
+    };
+  },
+  watch: {
+    url(news) {
+      if (news != '') {
+        uni.pageScrollTo({
+          scrollTop: 0,
+          duration: 500,
+        });
+      }
+    },
+  },
+  methods: {
+    moveHandle() {
+      return;
+    },
+    async getcity(lng, lat) {
+      const res = await this.$myRequest({
+        url: '/api/api_gateway?method=device.device_manage.weathers',
+        data: {
+          lng: lng,
+          lat: lat,
+        },
+      });
+      console.log(res);
+      this.weatherinfo = res[0];
+    },
+    async getUserlogin() {
+      const res = await this.$myRequest({
+        url: '/api/api_gateway?method=user.login.user_login_info',
+      });
+      uni.setStorage({
+        key: 'jurisdiction',
+        data: JSON.stringify(res.children),
+      });
+      uni.setStorage({
+        key: 'myuser_type',
+        data: JSON.stringify(res.myuser_type),
+      });
+      uni.setStorage({
+        key: 'myuid',
+        data: JSON.stringify(res.myuid),
+      });
+      let QueryPermission = (id) => {
+        let list = res.children;
+        for (var i = 0; i < list.length; i++) {
+          if (list[i].children) {
+            var data = list[i].children;
+            for (var j = 0; j < data.length; j++) {
+              if (data[j].children) {
+                var item = data[j].children;
+                for (var k = 0; k < item.length; k++) {
+                  if (item[k].pur_id == id) {
+                    return true;
+                  }
+                }
+              }
+            }
+          }
+        }
+        return false;
+      };
+      this.jurisdiction = {
+        cbtf: false,
+        jktf: false,
+        hjtf: false,
+        fztf: false,
+        sytf: false,
+        sbtf: false,
+        sqtf: false,
+        zjtf: false,
+        qxz: QueryPermission(242),
+        sq: QueryPermission(284),
+        cbyj: QueryPermission(243),
+      };
+      // console.log(res.children)
+      for (var i = 0; i < res.children.length; i++) {
+        switch (res.children[i].pur_id) {
+          case 36:
+            this.jurisdiction.cbtf = true; //"测报系统"
+            break;
+          case 42:
+            this.jurisdiction.jktf = true; //"可视农业"
+            break;
+          case 40:
+            this.jurisdiction.hjtf = true; //"环境监测系统"
+            break;
+          case 44:
+            this.jurisdiction.fztf = true; //"防治系统"
+            break;
+          case 58:
+            this.jurisdiction.sytf = true; //"溯源系统"
+            break;
+          case 28:
+            this.jurisdiction.sbtf = true; //"系统管理"
+            break;
+          case 25:
+            this.jurisdiction.sqtf = true; //"四情基地"
+            break;
+          case 124:
+            this.jurisdiction.zjtf = true; //"专家诊断"
+            break;
+          case 202:
+            this.jurisdiction.ggtf = true; //"灌溉控制系统"
+            break;
+        }
+      }
+    },
+    tabfunction(index) {
+      if (index == 0) {
+        uni.navigateTo({
+          url: '../fourBase/index',
+        });
+      } else if (index == 1) {
+        var that = this;
+        this.show = true;
+      } else if (index == 2) {
+        uni.navigateTo({
+          url: '../expertDiagnosis/index',
+        });
+      } else if (index == 3) {
+        uni.navigateTo({
+          url: '../afterSale/index',
+        });
+      }
+    },
+    tabequipment(url, type) {
+      console.log(url);
+      uni.navigateTo({
+        url: `${url}${type ? `?typeId=${type}` : ''}`,
+      });
+    },
+    onok(ev) {
+      this.path = this.url;
+      console.log(ev);
+      this.loadTF = true;
+      uni.showLoading({
+        mask: true,
+        success: function () {
+          console.log(999);
+        },
+      });
+      // var encrypt = new jsencrypt();
+      var publiukey = `-----BEGIN PUBLIC KEY-----
+				MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
+				4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
+				whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
+				34Fy4/yEz4qEzkzBuwIDAQAB
+				-----END PUBLIC KEY-----`;
+      var time = +new Date();
+      var str2 = 'YuNfEi' + time + 'YuNfEi';
+      var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
+      // encrypt.setPublicKey(str);
+      // var time = +new Date();
+      // var str2 = 'YuNfEi' + time + 'YuNfEi'
+      // var encrypted = encrypt.encrypt(str2);
+      console.log(pubblicData);
+      if (this.flag == 2) {
+        console.log('111');
+        // pest.pests.insect_discern 虫害
+        uni.uploadFile({
+          // url: 'http://dev.hnyfwlw.com/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+          url: 'https://web.hnyfwlw.com/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
+          filePath: ev.path,
+          name: 'img_file',
+          formData: {
+            user: 'test',
+            sign: pubblicData,
+          },
+          success: (uploadFileRes) => {
+            console.log(JSON.parse(uploadFileRes.data));
+            this.loadTF = false;
+            uni.navigateTo({
+              url:
+                '../disandpests/index?datas=' +
+                uploadFileRes.data +
+                '&path=' +
+                ev.path,
+            });
+          },
+        });
+      } else if (this.flag == 1) {
+        //pest.pests.insect_discern病害识别
+        uni.showLoading({
+          title: '加载中',
+        });
+        uni.uploadFile({
+          // url: 'http://dev.hnyfwlw.com/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+          url: 'https://web.hnyfwlw.com/api/api_gateway?method=pest.pests.plant_discern',
+          filePath: ev.path,
+          name: 'img_file',
+          formData: {
+            user: 'test',
+            sign: pubblicData,
+          },
+          success: (uploadFileRes) => {
+            console.log(JSON.parse(uploadFileRes.data));
+            this.loadTF = false;
+            uni.navigateTo({
+              url:
+                '../disandpests/index?datas=' +
+                uploadFileRes.data +
+                '&path=' +
+                ev.path,
+            });
+          },
+        });
+      }
+      this.url = '';
+    },
+    oncancle() {
+      // url设置为空,隐藏控件
+      this.url = '';
+    },
+    confirm() {
+      this.flag = 1;
+      uni.chooseImage({
+        count: 1, //默认9
+        // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+        sourceType: ['camera', 'album'], //从相册选择
+        success: (res) => {
+          this.url = res.tempFilePaths[0];
+        },
+      });
+      console.log(1);
+    },
+    cancel() {
+      this.flag = 2;
+      uni.chooseImage({
+        count: 1, //默认9
+        // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+        sourceType: ['camera', 'album'], //从相册选择
+        success: (res) => {
+          console.log(1);
+          this.url = res.tempFilePaths[0];
+        },
+      });
+    },
+    worm() {
+      uni.navigateTo({
+        url: '../expertDiagnosis/wormcase?name=虫情百科',
+      });
+    },
+    virus() {
+      uni.navigateTo({
+        url: '../expertDiagnosis/wormcase?name=病害百科',
+      });
+    },
+    introduce(id, title) {
+      uni.navigateTo({
+        url: '../expertDiagnosis/introduce?id=' + id + '&title=' + title,
+      });
+    },
+  },
+  onLoad() {
+    // console.log(this.$QueryPermission(242))
+
+    var time = new Date();
+    var hours = time.getHours();
+    if (hours < 12) {
+      this.hello = '上午好!';
+    } else {
+      this.hello = '下午好!';
+    }
+    uni.getLocation({
+      type: 'wgs84 ',
+      success: (res) => {
+        this.getcity(res.longitude, res.latitude);
+      },
+    });
+  },
+  onShow() {
+    this.loadTF = false;
+    this.getUserlogin();
+  },
+};
+</script>
+
+<style lang="less">
+page {
+  background-image: url(../../static/images/newindex/bg.png);
+  background-size: 100%;
+  background-repeat: no-repeat;
+  background-color: #f9f9f9;
+}
+
+.weather {
+  display: flex;
+  width: 85%;
+  margin: 0 auto;
+  padding-top: 40rpx;
+
+  .weaimg {
+    width: 296rpx;
+    height: 296rpx;
+  }
+
+  .weatext {
+    width: 300rpx;
+    text-align: center;
+    font-size: 36rpx;
+    color: #fff;
+    padding-top: 60rpx;
+    margin-left: 60rpx;
+
+    .weatext_title {
+      font-size: 80rpx;
+      margin-bottom: 30rpx;
+    }
+  }
+}
+
+.weatherinfo {
+  display: flex;
+  background-color: rgba(255, 255, 255, 0.2);
+  width: 85%;
+  margin: 60rpx auto;
+  padding: 30rpx;
+  justify-content: space-around;
+  border-radius: 170rpx;
+
+  .weatherinfo_item {
+    text-align: center;
+
+    .first_item {
+      height: 50rpx;
+      margin-bottom: 10rpx;
+      color: #fff;
+      line-height: 50rpx;
+    }
+
+    .weaimg {
+      width: 50rpx;
+      height: 50rpx;
+    }
+
+    .textbox {
+      text-align: center;
+      color: #fff;
+    }
+  }
+}
+
+.functionbox {
+  width: 85%;
+  margin: 0 auto;
+  padding: 30rpx;
+  // box-sizing: border-box;
+  background-color: #fff;
+  border-radius: 30rpx;
+
+  .functionbox_title {
+    padding-left: 20rpx;
+    font-size: 34rpx;
+  }
+
+  .functionbox_text {
+    display: flex;
+    justify-content: space-around;
+    margin-top: 30rpx;
+
+    .functionbox_text_item {
+      text-align: center;
+      color: #616666;
+
+      .itemimg {
+        width: 60rpx;
+        height: 60rpx;
+        margin-bottom: 20rpx;
+      }
+    }
+  }
+}
+
+.facilitybox {
+  width: 90%;
+  margin: 0 auto;
+  padding: 30rpx;
+
+  .facilitybox_title {
+    font-size: 34rpx;
+    // padding-left: 20rpx;
+  }
+
+  .facilitybox_itembox {
+    display: flex;
+    // justify-content: space-around;
+    flex-wrap: wrap;
+    margin-top: 30rpx;
+
+    .facilitybox_item {
+      width: 25%;
+      text-align: center;
+      color: #616666;
+      margin-bottom: 20rpx;
+
+      .itemimg {
+        width: 100rpx;
+        height: 100rpx;
+        margin-bottom: 20rpx;
+      }
+    }
+  }
+}
+
+.insectattack {
+  width: 90%;
+  margin: 0 auto;
+  padding: 30rpx;
+
+  .insectattack_title {
+    font-size: 34rpx;
+    // padding-left: 20rpx;
+    display: flex;
+    justify-content: space-between;
+
+    .iconbox {
+      width: 40rpx;
+      height: 40rpx;
+      background-color: #cfd6d6;
+      color: #909696;
+      border-radius: 40rpx;
+      line-height: 40rpx;
+      text-align: center;
+      font-size: 20rpx;
+    }
+  }
+
+  .insectattack_listbox {
+    // padding: 0 20rpx;
+    overflow-x: auto;
+
+    .insectattack_list {
+      width: 1104rpx;
+      display: flex;
+      margin-top: 30rpx;
+
+      flex-wrap: wrap;
+
+      .list_box {
+        // background-color: #f00;
+        background-size: 100% 100%;
+        width: 246rpx;
+        height: 324rpx;
+        margin-right: 30rpx;
+        border-radius: 20rpx;
+
+        .list_box_xiang {
+          width: 95%;
+          margin-top: 0rpx auto;
+          display: flex;
+          justify-content: flex-end;
+          padding-top: 20rpx;
+
+          .list_box_xiang_click {
+            padding: 8rpx 15rpx;
+            background-color: rgba(0, 0, 0, 0.2);
+            color: #fff;
+            font-size: 20rpx;
+            border-radius: 52rpx;
+          }
+        }
+
+        .list_box_info {
+          width: 90%;
+          margin: 130rpx auto 0;
+          height: 120rpx;
+          border-radius: 10rpx;
+          background-image: linear-gradient(
+            to right,
+            #ffffff,
+            rgba(255, 255, 255, 0.44)
+          );
+          padding: 10rpx;
+          box-sizing: border-box;
+
+          .list_box_info_name {
+            font-weight: 700;
+          }
+
+          .list_box_info_text {
+            font-size: 18rpx;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            display: -webkit-box;
+            -webkit-box-orient: vertical;
+            -webkit-line-clamp: 2;
+          }
+        }
+      }
+
+      .list_box1 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/cao.png);
+      }
+
+      .list_box2 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/yee.jpg);
+      }
+
+      .list_box3 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/lingc.jpg);
+      }
+
+      .list_box4 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/ming.png);
+      }
+
+      .list_box5 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/mai.png);
+      }
+
+      .list_box6 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/dadou.jpg);
+      }
+
+      .list_box7 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/yumi.png);
+      }
+
+      .list_box8 {
+        background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/dao.png);
+      }
+    }
+  }
+}
+
+.loading {
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 100;
+  width: 100%;
+  height: 100vh;
+  background-color: rgba(0, 0, 0, 0.5);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+</style>

+ 839 - 0
pages/index/index copy.vue

@@ -0,0 +1,839 @@
+<template>
+	<view>
+		<view class="weather">
+			<image :src="
+          'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/weather/' +
+          weatherinfo.wea +
+          '.png'
+        " mode="" class="weaimg"></image>
+			<view class="weatext">
+				<view class="weatext_title">
+					{{ hello }}
+				</view>
+				<view class=""> 欢迎登录云飞智控 </view>
+			</view>
+		</view>
+		<view class="weatherinfo">
+			<view class="weatherinfo_item">
+				<image :src="$imageURL+'/bigdata_app/newindex/weizhi.png'" mode="" class="weaimg">
+				</image>
+				<view class="textbox">
+					{{ weatherinfo.district || '-' }}
+				</view>
+			</view>
+			<view class="weatherinfo_item">
+				<image :src="$imageURL+'/bigdata_app/newindex/wendu.png'" mode="" class="weaimg"></image>
+				<view class="textbox"> {{ weatherinfo.at || '-' }}℃ </view>
+			</view>
+			<view class="weatherinfo_item">
+				<image :src="$imageURL+'/bigdata_app/newindex/shidu.png'" mode="" class="weaimg"></image>
+				<view class="textbox"> {{ weatherinfo.ah || '-' }} </view>
+			</view>
+			<view class="weatherinfo_item">
+				<view class="first_item"> PM2.5 </view>
+				<view class="textbox">
+					{{ weatherinfo.air_pm25 || '-' }}
+				</view>
+			</view>
+		</view>
+		<view class="functionbox">
+			<view class="functionbox_title"> 功能应用 </view>
+			<view class="functionbox_text">
+				<view class="functionbox_text_item" v-if="jurisdiction.sqtf" @click="tabfunction(0)">
+					<image :src="$imageURL+'/bigdata_app/newindex/base.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 四情基地 </view>
+				</view>
+				<view class="functionbox_text_item" @click="tabfunction(1)">
+					<image :src="$imageURL+'/bigdata_app/newindex/worm.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 田间随识 </view>
+				</view>
+				<view class="functionbox_text_item" v-if="jurisdiction.zjtf" @click="tabfunction(2)">
+					<image :src="$imageURL+'/bigdata_app/newindex/knowledge.png'" mode=""
+						class="itemimg"></image>
+					<view class=""> 知识百科 </view>
+				</view>
+				<view class="functionbox_text_item" @click="tabfunction(3)">
+					<image :src="$imageURL+'/bigdata_app/newindex/aftersale.png'" mode=""
+						class="itemimg"></image>
+					<view class=""> 售后服务 </view>
+				</view>
+			</view>
+		</view>
+		<view class="facilitybox">
+			<view class="facilitybox_title"> 系统设备 </view>
+			<view class="facilitybox_itembox">
+				<view class="facilitybox_item" v-if="jurisdiction.cbtf" @click="tabequipment('../cb/index/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/cb.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 测报系统 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.cbyj" @click="tabequipment('../cbqxyj/cbwarn')">
+					<image :src="$imageURL+'/bigdata_app/newindex/cbyj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 测报预警 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.fztf" @click="tabequipment('../prevention/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/fz.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 防治系统 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.jktf" @click="tabequipment('../monitor/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/jk.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 监控系统 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.hjtf" @click="tabequipment('../environment/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/hj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 环境监测 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.qxz" @click="tabequipment('../qxzyj/cbwarn', 5)">
+					<image :src="$imageURL+'/bigdata_app/newindex/qxyj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 气象预警 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.sq" @click="tabequipment('../qxzyj/cbwarn', '15')">
+					<image :src="$imageURL+'/bigdata_app/newindex/sqyj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 墒情预警 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.ggtf" @click="tabequipment('../irrigate/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/guangai.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 智能灌溉 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.sbtf"
+					@click="tabequipment('../equipMange/index/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/user.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 用户管理 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.sbtf"
+					@click="tabequipment('../warning/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/cb.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 预警列表 </view>
+				</view>
+			</view>
+		</view>
+		<view class="insectattack">
+			<view class="insectattack_title" @click="worm">
+				<view class=""> 虫情百科 </view>
+				<view class="iconbox">
+					<u-icon name="arrow-right"></u-icon>
+				</view>
+			</view>
+			
+		</view>
+		<view class="insectattack">
+			<view class="insectattack_title" @click="virus">
+				<view class=""> 病害百科 </view>
+				<view class="iconbox">
+					<u-icon name="arrow-right"></u-icon>
+				</view>
+			</view>
+			
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		// // 分享给朋友
+		// onShareAppMessage() {
+		//   return {
+		//     title: '云飞智控', // 分享标题
+		//     path: 'pages/index/index', // 分享路径,通常包含页面参数
+		//     imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg', // 分享图片,可选
+		//     success: (res) => {
+		//       // 分享成功回调
+		//       uni.showToast({
+		//         title: '分享成功',
+		//         icon: 'success'
+		//       })
+		//     },
+		//     fail: (err) => {
+		//       // 分享失败回调
+		//       console.log('分享失败', err)
+		//     }
+		//   }
+		// },
+		// // 分享到朋友圈(基础库2.11.3+)
+		// onShareTimeline() {
+		//   return {
+		//     title:  '云飞智控', // 分享标题
+		//     query: 'id=123', // 页面参数,不同于分享给朋友的path,这里用query
+		//     imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg' // 分享图片,可选
+		//   }
+		// },
+		data() {
+			return {
+				weatherinfo: {
+					wea: '晴',
+				},
+				hello: '',
+				jurisdiction: {
+					cbtf: false,
+					jktf: false,
+					hjtf: false,
+					fztf: false,
+					sytf: false,
+					sbtf: false,
+					sqtf: false,
+					zjtf: false,
+					ggtf: false,
+					qxz: false,
+					sq: false,
+					cbyj: false,
+				},
+				show: false,
+				url: '',
+				loadTF: false
+			};
+		},
+		watch: {
+			url(news) {
+				if (news != '') {
+					uni.pageScrollTo({
+						scrollTop: 0,
+						duration: 500,
+					});
+				}
+			},
+		},
+		methods: {
+			moveHandle() {
+				return;
+			},
+			async getcity(lng, lat) {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_manage.weathers',
+					data: {
+						lng: lng,
+						lat: lat,
+					},
+				});
+				// uni.showToast({
+				// 	title: JSON.stringify(res[0]),
+				// 	duration: 20000,
+				// 	icon:'none'
+				// });
+				//    console.log(res);
+				this.weatherinfo = res[0];
+			},
+			async getUserlogin() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=user.login.user_login_info',
+					method: 'POST',
+				});
+				// this.jurisdiction = {
+				// 	cbtf: false,
+				// 	jktf: false,
+				// 	hjtf: false,
+				// 	fztf: false,
+				// 	sytf: false,
+				// 	sbtf: false,
+				// 	sqtf: false,
+				// 	zjtf: false,
+				// }
+				uni.setStorage({
+					key: 'jurisdiction',
+					data: JSON.stringify(res.children),
+				});
+				uni.setStorage({
+					key: 'myuser_type',
+					data: JSON.stringify(res.myuser_type),
+				});
+				uni.setStorage({
+					key: 'myuid',
+					data: JSON.stringify(res.myuid),
+				});
+				let QueryPermission = (id) => {
+					let list = res.children;
+					for (var i = 0; i < list.length; i++) {
+						if (list[i].children) {
+							var data = list[i].children;
+							for (var j = 0; j < data.length; j++) {
+								if (data[j].children) {
+									var item = data[j].children;
+									for (var k = 0; k < item.length; k++) {
+										if (item[k].pur_id == id) {
+											return true;
+										}
+									}
+								}
+							}
+						}
+					}
+					return false;
+				};
+				this.jurisdiction = {
+					cbtf: false,
+					jktf: false,
+					hjtf: false,
+					fztf: false,
+					sytf: false,
+					sbtf: false,
+					sqtf: false,
+					zjtf: false,
+					qxz: QueryPermission(242),
+					sq: QueryPermission(284),
+					cbyj: QueryPermission(243),
+				};
+				console.log(res.children);
+				for (var i = 0; i < res.children.length; i++) {
+					switch (res.children[i].pur_id) {
+						case 36:
+							this.jurisdiction.cbtf = true; //"测报系统"
+							break;
+						case 42:
+							this.jurisdiction.jktf = true; //"可视农业"
+							break;
+						case 40:
+							this.jurisdiction.hjtf = true; //"环境监测系统"
+							break;
+						case 44:
+							this.jurisdiction.fztf = true; //"防治系统"
+							break;
+						case 58:
+							this.jurisdiction.sytf = true; //"溯源系统"
+							break;
+						case 28:
+							this.jurisdiction.sbtf = true; //"系统管理"
+							break;
+						case 25:
+							this.jurisdiction.sqtf = true; //"四情基地"
+							break;
+						case 124:
+							this.jurisdiction.zjtf = true; //"专家诊断"
+							break;
+							// case "灌溉控制系统":
+							// 	this.jurisdiction.sftf = true
+							// 	break;
+						case 202:
+							this.jurisdiction.ggtf = true; //"灌溉控制系统"
+							break;
+					}
+				}
+			},
+			tabfunction(index) {
+				if (index == 0) {
+					uni.navigateTo({
+						url: '../fourBase/index',
+					});
+				} else if (index == 1) {
+					// var that = this
+					// this.show = true
+					uni.navigateTo({
+						url: '/pages/identifyPest/identifyPest',
+					});
+				} else if (index == 2) {
+					uni.navigateTo({
+						url: '../expertDiagnosis/index',
+					});
+				} else if (index == 3) {
+					uni.navigateTo({
+						url: '../afterSale/index',
+					});
+				}
+			},
+			tabequipment(url, type) {
+				console.log(url);
+				uni.navigateTo({
+					url: `${url}${type ? `?typeId=${type}` : ''}`,
+				});
+			},
+			// onok(ev) {
+			//   this.path = this.url;
+			//   console.log(ev);
+			//   this.loadTF = true;
+			//   uni.showLoading({
+			//     mask: true,
+			//     success: function () {
+			//       console.log(999);
+			//     },
+			//   });
+			//   var publiukey = `-----BEGIN PUBLIC KEY-----
+			// MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
+			// 4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
+			// whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
+			// 34Fy4/yEz4qEzkzBuwIDAQAB
+			// -----END PUBLIC KEY-----`;
+			//   var time = +new Date();
+			//   var str2 = 'YuNfEi' + time + 'YuNfEi';
+			//   var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
+			//   if (this.flag == 2) {
+			//     console.log('111');
+			//     // pest.pests.insect_discern 虫害
+			//     uni.uploadFile({
+			//       // url: 'http://dev.hnyfwlw.com/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+			//       url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
+			//       filePath: ev.path,
+			//       name: 'img_file',
+			//       formData: {
+			//         user: 'test',
+			//         sign: pubblicData,
+			//       },
+			//       success: (uploadFileRes) => {
+			//         this.loadTF = false;
+			//         console.log(JSON.parse(uploadFileRes.data));
+			//         uni.navigateTo({
+			//           url:
+			//             '../disandpests/index?datas=' +
+			//             uploadFileRes.data +
+			//             '&path=' +
+			//             ev.path,
+			//         });
+			//       },
+			//       fail(res) {
+			//         console.log(res);
+			//       },
+			//     });
+			//   } else if (this.flag == 1) {
+			//     //pest.pests.insect_discern病害识别
+			//     // uni.showLoading({
+			//     // 	title: '加载中'
+			//     // });
+			//     uni.uploadFile({
+			//       // url: 'http://dev.hnyfwlw.com/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+			//       url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
+			//       filePath: ev.path,
+			//       name: 'img_file',
+			//       formData: {
+			//         user: 'test',
+			//         sign: pubblicData,
+			//       },
+			//       success: (uploadFileRes) => {
+			//         this.loadTF = false;
+			//         console.log(JSON.parse(uploadFileRes.data));
+			//         uni.navigateTo({
+			//           url:
+			//             '../disandpests/index?datas=' +
+			//             uploadFileRes.data +
+			//             '&path=' +
+			//             ev.path,
+			//         });
+			//       },
+			//     });
+			//   }
+			//   this.url = '';
+			// },
+			// oncancle() {
+			//   // url设置为空,隐藏控件
+			//   this.url = '';
+			// },
+			// confirm() {
+			//   this.flag = 1;
+			//   uni.chooseImage({
+			//     count: 1, //默认9
+			//     // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+			//     sourceType: ['camera', 'album'], //从相册选择
+			//     success: (res) => {
+			//       this.url = res.tempFilePaths[0];
+			//     },
+			//   });
+			//   console.log(1);
+			// },
+			// cancel() {
+			//   this.flag = 2;
+			//   uni.chooseImage({
+			//     count: 1, //默认9
+			//     // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+			//     sourceType: ['camera', 'album'], //从相册选择
+			//     success: (res) => {
+			//       console.log(1);
+			//       this.url = res.tempFilePaths[0];
+			//     },
+			//   });
+			// },
+			worm() {
+				uni.navigateTo({
+					url: '../expertDiagnosis/wormcase?name=虫情百科',
+				});
+			},
+			virus() {
+				uni.navigateTo({
+					url: '../expertDiagnosis/wormcase?name=病害百科',
+				});
+			},
+			introduce(id, title) {
+				uni.navigateTo({
+					url: '../expertDiagnosis/introduce?id=' + id + '&title=' + title,
+				});
+			},
+			checkLocationPermission(isTest) {
+				let session_key = uni.getStorageSync('session_key');
+				let _this = this;
+				// 当用户登录之后再弹位置权限框
+				if (session_key) {
+					uni.getSetting({
+						success(res) {
+							console.log(res);
+							if (res.authSetting['scope.userLocation']) {
+								uni.getLocation({
+									type: 'wgs84 ',
+									success: (res) => {
+										// console.log(res, 'loacation');
+										// uni.showToast({
+										// 	title: `${res.longitude}, ${res.longitude}`,
+										// 	duration: 20000,
+										// 	icon:'none'
+										// });
+										_this.getcity(res.longitude, res.latitude);
+									},
+									fail(e) {
+										// uni.showModal({
+										// 	title: '提示',
+										// 	content: JSON.stringify(e),
+										// 	success: function (res) {
+										// 		if (res.confirm) {
+										// 			console.log('用户点击确定');
+										// 		} else if (res.cancel) {
+										// 			console.log('用户点击取消');
+										// 		}
+										// 	}
+										// });
+										uni.showToast({
+											title: '系统未开启定位或未授权微信定位',
+											duration: 5000,
+											icon: 'none'
+										});
+									}
+								});
+							} else {
+								uni.authorize({
+									scope: 'scope.userLocation',
+									success: () => {
+										// 用户已授权
+										uni.getLocation({
+											type: 'wgs84 ',
+											success: (res) => {
+												console.log(res, 'loacation');
+												_this.getcity(res.longitude, res.latitude);
+											},
+										});
+									},
+									fail: () => {
+										// 用户拒绝授权,可引导用户至设置页手动开启
+										if (isTest) {
+											uni.showModal({
+												title: '需要授权',
+												content: '天气功能需要获取您的地理位置,请在设置中打开位置权限',
+												success: (modalRes) => {
+													if (modalRes.confirm) {
+														uni.openSetting()
+													} else {
+														uni.showToast({
+															title: '您拒绝了授权,将无法查看天气信息',
+															duration: 2000,
+															icon: 'none'
+														});
+													}
+												},
+											})
+										}
+									},
+								})
+							}
+						}
+					})
+				}
+			}
+		},
+		onLoad() {
+		
+			console.log(this.$imageURL)
+			var time = new Date();
+			var hours = time.getHours();
+			if (hours < 12) {
+				this.hello = '上午好!';
+			} else {
+				this.hello = '下午好!';
+			}
+			this.getUserlogin();
+			this.checkLocationPermission(true); // 首次加载弹框提醒
+		},
+		onShow() {
+			this.loadTF = false;
+			this.getUserlogin();
+			this.checkLocationPermission();
+		},
+	};
+</script>
+
+<style lang="less">
+	page {
+		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/bg.png);
+		background-size: 100%;
+		background-repeat: no-repeat;
+		background-color: #f9f9f9;
+	}
+
+	.weather {
+		display: flex;
+		width: 85%;
+		margin: 0 auto;
+		padding-top: 40rpx;
+
+		.weaimg {
+			width: 296rpx;
+			height: 296rpx;
+		}
+
+		.weatext {
+			width: 300rpx;
+			text-align: center;
+			font-size: 36rpx;
+			color: #fff;
+			padding-top: 60rpx;
+			margin-left: 60rpx;
+
+			.weatext_title {
+				font-size: 80rpx;
+				margin-bottom: 30rpx;
+			}
+		}
+	}
+
+	.weatherinfo {
+		display: flex;
+		background-color: rgba(255, 255, 255, 0.2);
+		width: 85%;
+		margin: 60rpx auto;
+		padding: 30rpx;
+		justify-content: space-around;
+		border-radius: 170rpx;
+
+		.weatherinfo_item {
+			text-align: center;
+
+			.first_item {
+				height: 50rpx;
+				margin-bottom: 10rpx;
+				color: #fff;
+				line-height: 50rpx;
+			}
+
+			.weaimg {
+				width: 50rpx;
+				height: 50rpx;
+			}
+
+			.textbox {
+				text-align: center;
+				color: #fff;
+			}
+		}
+	}
+
+	.functionbox {
+		width: 85%;
+		margin: 0 auto;
+		padding: 30rpx;
+		// box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 30rpx;
+
+		.functionbox_title {
+			padding-left: 20rpx;
+			font-size: 34rpx;
+		}
+
+		.functionbox_text {
+			display: flex;
+			justify-content: space-around;
+			margin-top: 30rpx;
+
+			.functionbox_text_item {
+				text-align: center;
+				color: #616666;
+
+				.itemimg {
+					width: 60rpx;
+					height: 60rpx;
+					margin-bottom: 20rpx;
+				}
+			}
+		}
+	}
+
+	.facilitybox {
+		width: 90%;
+		margin: 0 auto;
+		padding: 30rpx;
+
+		.facilitybox_title {
+			font-size: 34rpx;
+			// padding-left: 20rpx;
+		}
+
+		.facilitybox_itembox {
+			display: flex;
+			// justify-content: space-around;
+			flex-wrap: wrap;
+			margin-top: 30rpx;
+
+			.facilitybox_item {
+				width: 25%;
+				text-align: center;
+				color: #616666;
+				margin-bottom: 20rpx;
+
+				.itemimg {
+					width: 100rpx;
+					height: 100rpx;
+					margin-bottom: 20rpx;
+				}
+			}
+		}
+	}
+
+	.insectattack {
+		width: 90%;
+		margin: 0 auto;
+		padding: 30rpx;
+
+		.insectattack_title {
+			font-size: 34rpx;
+			// padding-left: 20rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.iconbox {
+				width: 40rpx;
+				height: 40rpx;
+				background-color: #cfd6d6;
+				color: #909696;
+				border-radius: 40rpx;
+				line-height: 40rpx;
+				text-align: center;
+				font-size: 20rpx;
+			}
+		}
+
+		.insectattack_listbox {
+			// padding: 0 20rpx;
+			overflow-x: auto;
+
+			.insectattack_list {
+				width: 1104rpx;
+				display: flex;
+				margin-top: 30rpx;
+
+				flex-wrap: wrap;
+
+				.list_box {
+					// background-color: #f00;
+					background-size: 100% 100%;
+					width: 246rpx;
+					height: 324rpx;
+					margin-right: 30rpx;
+					border-radius: 20rpx;
+					position: relative;
+
+					.list_boxbg {
+						width: 100%;
+						height: 100%;
+						position: absolute;
+						top: 0;
+						left: 0;
+						z-index: -1;
+
+						.list_boxbg_img {
+							width: 100%;
+							height: 100%;
+						}
+					}
+
+					.list_box_xiang {
+						width: 95%;
+						margin-top: 0rpx auto;
+						display: flex;
+						justify-content: flex-end;
+						padding-top: 20rpx;
+
+						.list_box_xiang_click {
+							padding: 8rpx 15rpx;
+							background-color: rgba(0, 0, 0, 0.2);
+							color: #fff;
+							font-size: 20rpx;
+							border-radius: 52rpx;
+						}
+					}
+
+					.list_box_info {
+						width: 90%;
+						margin: 130rpx auto 0;
+						height: 120rpx;
+						border-radius: 10rpx;
+						background-image: linear-gradient(to right,
+								#ffffff,
+								rgba(255, 255, 255, 0.44));
+						padding: 10rpx;
+						box-sizing: border-box;
+
+						.list_box_info_name {
+							font-weight: 700;
+						}
+
+						.list_box_info_text {
+							font-size: 18rpx;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							display: -webkit-box;
+							-webkit-box-orient: vertical;
+							-webkit-line-clamp: 2;
+						}
+					}
+				}
+
+				// .list_box1 {
+				// 	background-image: url(../../static/images/newindex/cao.png);
+				// }
+
+				// .list_box2 {
+				// 	background-image: url(../../static/images/newindex/yee.jpg);
+				// }
+
+				// .list_box3 {
+				// 	background-image: url(../../static/images/newindex/lingc.jpg);
+				// }
+
+				// .list_box4 {
+				// 	background-image: url(../../static/images/newindex/ming.png);
+				// }
+
+				// .list_box5 {
+				// 	background-image: url(../../static/images/newindex/mai.png);
+				// }
+
+				// .list_box6 {
+				// 	background-image: url(../../static/images/newindex/dadou.jpg)
+				// }
+
+				// .list_box7 {
+				// 	background-image: url(../../static/images/newindex/yumi.png);
+				// }
+
+				// .list_box8 {
+				// 	background-image: url(../../static/images/newindex/dao.png);
+				// }
+			}
+		}
+	}
+
+	.loading {
+		position: absolute;
+		top: 0;
+		left: 0;
+		z-index: 100;
+		width: 100%;
+		height: 100vh;
+		background-color: rgba(0, 0, 0, 0.5);
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+</style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 405 - 497
pages/index/index.vue


+ 0 - 740
pages/index/index2.vue

@@ -1,740 +0,0 @@
-<template>
-	<view class="home">
-		<view class="welcom">{{ hello }} 欢迎登录</view>
-		<view class="weather-bg">
-			<view class="weather-box">
-				<view class="weather">
-					<view class="weatext">
-						<view>今天<span class="text-span">{{weatherinfo.air_level}}</span></view>
-						<view class="text-value">{{weatherinfo.at}}℃</view>
-					</view>
-					<view class="weatext">
-						<image :src="
-							'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/weather/' +weatherinfo.wea +'.png'
-						" mode="" class="weaimg"
-						></image>
-
-						<view class="weatext_title">
-							{{ weatherinfo.wea }}
-						</view>
-
-					</view>
-				</view>
-				<view class="weather">
-					<view class="weatext">
-						<view>湿度<span class="text-span">{{weatherinfo.ah | ahFilter}}</span></view>
-						<view class="text-value">{{weatherinfo.ah}}%</view>
-					</view>
-					<view class="weatext">
-						<view>PM2.5</view>
-						<view class="textbox">
-							{{ weatherinfo.air_pm25 }}
-						</view>
-
-					</view>
-				</view>
-
-			</view>
-			<view class="weather-warning" v-if="weatherinfo.alarm_content">
-				<image class="weather-alert" :src="$imageURL+'/bigdata_app/newImg/home/weather-alert.png'" mode=""></image>
-			{{weatherinfo.alarm_content}}
-			</view>
-
-		</view>
-		<view class="ai-box">
-			<view class="ai-content" @click="tabfunction(4)">
-				<image :src="$imageURL+'/bigdata_app/newImg/home/ai-bot.png'" class="float-left" mode=""></image>
-				<view class="ai-text">
-					<view class="ai-text-title">我是千耘农业种植大模型</view>
-					<view class="ai-text-subtitle">耕耘千百变,智慧一点通</view>
-				</view>
-				<view class="float-right">
-					问一问
-				</view>
-			</view>
-		</view>
-		<view class="functionbox">
-			
-			<view class="functionbox_text">
-				<view class="functionbox_text_item" @click="tabfunction(0,item)" v-if="index < 9" v-for="(item,index) in menuList" :key="index">
-					<image :src="item.app_menu_icon" mode="" class="itemimg">
-					</image>
-					<view class=""> {{ item.purview_name }} </view>
-				</view>
-				<view class="functionbox_text_item" @click="tabfunction(9)" v-if="menuList.length >= 9">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
-					<view class=""> 更多功能 </view>
-				</view>
-			</view>
-		</view>
-		<view class="facilitybox">
-			<view class="facilitybox-content">
-				<view class="facilitybox_title"> 智慧助手 </view>
-				<view style="display: flex;flex-direction: column;">
-					<view class="facilitybox_itembox">
-						<view class="facilitybox_item facilitybox-zhuanjia"
-							@click="tabfunction(2)">
-							<image :src="$imageURL+'/bigdata_app/newImg/home/zjhk.png'" mode="" class="itemimg">
-							</image>
-							<view class="facilitybox_span">
-								<text> 专家库 </text>
-								<view class="text">农业相关博士、教授、研究员</view>
-							</view>
-						</view>
-						<view class="facilitybox_item" style="display: flex; flex-direction: column;gap: 24rpx;">
-							<view class="facilitybox-suishi"
-								@click="tabfunction(1)">
-								<image style="width: 72rpx;height:72rpx;margin-right: 10rpx;"
-									:src="$imageURL+'/bigdata_app/newImg/home/tjss.png'" mode=""
-									class="itemimg float-right">
-								</image>
-								<view class="facilitybox_span"> 田间随识 </view>
-							</view>
-							<view class="facilitybox-bchk"
-								@click="worm">
-								<image :src="$imageURL+'/bigdata_app/newImg/home/cshk.png'" mode="" class="itemimg">
-								</image>
-								<view style="width: 69%;" class="facilitybox_span"> 病虫草鼠害库 </view>
-							</view>
-						</view>
-					</view>
-					<!-- <view class="facilitybox_itembox">
-						<view class="facilitybox_item facilitybox-jwjy"
-							@click="tabequipment('../prevention/index')">
-							<image :src="$imageURL+'/bigdata_app/newImg/home/jwjy.png'" mode="" class="itemimg">
-							</image>
-							<view class="facilitybox_span"> 积温积雨 </view>
-						</view>
-						<view class="facilitybox_item facilitybox-jgqs"
-							@click="tabequipment('../monitor/index')">
-							<image :src="$imageURL+'/bigdata_app/newImg/home/jgqs.png'" mode="" class="itemimg">
-							</image>
-							<view class="facilitybox_span"> 价格趋势 </view>
-						</view>
-					</view> -->
-				</view>
-			</view>
-			<view class="banner-ad">
-			<view class="ad-text">
-				<view class="title">
-					松墨天牛拍照性诱智能监测
-				</view>
-				<view class="sub-title">
-					AI慧眼识天牛    智守青山护松林
-				</view>
-				<!-- <view class="btn">
-					查看详情
-				</view> -->
-			</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		// // 分享给朋友
-		// onShareAppMessage() {
-		//   return {
-		//     title: '云飞智控', // 分享标题
-		//     path: 'pages/index/index', // 分享路径,通常包含页面参数
-		//     imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg', // 分享图片,可选
-		//     success: (res) => {
-		//       // 分享成功回调
-		//       uni.showToast({
-		//         title: '分享成功',
-		//         icon: 'success'
-		//       })
-		//     },
-		//     fail: (err) => {
-		//       // 分享失败回调
-		//       console.log('分享失败', err)
-		//     }
-		//   }
-		// },
-		// // 分享到朋友圈(基础库2.11.3+)
-		// onShareTimeline() {
-		//   return {
-		//     title:  '云飞智控', // 分享标题
-		//     query: 'id=123', // 页面参数,不同于分享给朋友的path,这里用query
-		//     imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg' // 分享图片,可选
-		//   }
-		// },
-		filters:{
-			ahFilter(value){
-				if(value>70){
-					return"湿润"
-				}else if(value<30){
-					return'干燥'
-				}else{
-					return'正常'
-				}
-			}
-		},
-		data() {
-			return {
-        menuList:[],
-				indicatorDots: true,
-				autoplay: false,
-				interval: 2000,
-				duration: 500,
-				weatherinfo: {
-					wea: '-',
-					air_level: '-',
-					at: '-',
-					air_pm25: '-',
-					ah: '-',
-					alarm_content: ''
-				},
-				hello: '',
-				show: false,
-				url: '',
-				loadTF: false
-			};
-		},
-		watch: {
-			url(news) {
-				if (news != '') {
-					uni.pageScrollTo({
-						scrollTop: 0,
-						duration: 500,
-					});
-				}
-			},
-		},
-		methods: {
-			async getcity(lng, lat) {
-				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=device.device_manage.weathers',
-					data: {
-						lng: lng,
-						lat: lat,
-					},
-				});
-
-				this.weatherinfo = res[0];
-				console.log(this.weatherinfo,'weatherinfo')
-			},
-			async getUserlogin() {
-				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=user.login.user_login_info',
-          data: {
-            is_app: 1,
-          }
-				});
-        const menuList = [];
-        res.forEach(item =>{
-          if(item.children){
-            menuList.push(...item.children);
-          }
-        })
-        this.menuList = menuList || [];
-			},
-			tabfunction(index,item) {
-				if (index == 0) {
-					uni.switchTab({
-						url: '/pages/equipList2/index',
-          success: () => {
-            setTimeout(() => {
-              uni.$emit('purId',item.pur_id);
-            }, 50);
-          }
-					});
-				} else if (index == 1) {
-					uni.navigateTo({
-						url: '/pages/identifyPest/identifyPest',
-					});
-				} else if (index == 2) {
-					uni.navigateTo({
-						url: '../expertDiagnosis/index',
-					});
-				} else if (index == 3) {
-					uni.navigateTo({
-						url: '../afterSale/index',
-					});
-				} else if(index == 4){
-					uni.navigateTo({
-						url: '/pages/index/developing',
-					});
-				}else if (index == 9) {
-					uni.navigateTo({
-						url: '/pages/server/index',
-					});
-        }
-			},
-			tabequipment(url, type) {
-				console.log(url);
-				uni.navigateTo({
-					url: `${url}${type ? `?typeId=${type}` : ''}`,
-				});
-			},
-			worm() {
-				uni.navigateTo({
-					url: '../expertDiagnosis/wormcase?name=虫情百科',
-				});
-			},
-			checkLocationPermission(isTest) {
-				let session_key = uni.getStorageSync('session_key');
-				console.log(session_key,'session_key');
-				let _this = this;
-				// 当用户登录之后再弹位置权限框
-				if (session_key) {
-					uni.getSetting({
-						success(res) {
-							console.log(res,'resres');
-							if (res.authSetting['scope.userLocation']) {
-								uni.getLocation({
-									type: 'wgs84 ',
-									success: (res) => {
-										_this.getcity(res.longitude, res.latitude);
-									},
-									fail(e) {
-										uni.showToast({
-											title: '系统未开启定位或未授权微信定位',
-											duration: 5000,
-											icon: 'none'
-										});
-									}
-								});
-							} else {
-								uni.authorize({
-									scope: 'scope.userLocation',
-									success: () => {
-										// 用户已授权
-										uni.getLocation({
-											type: 'wgs84 ',
-											success: (res) => {
-												console.log(res, 'loacation');
-												_this.getcity(res.longitude, res.latitude);
-											},
-										});
-									},
-									fail: () => {
-										// 用户拒绝授权,可引导用户至设置页手动开启
-										if (isTest) {
-											uni.showModal({
-												title: '需要授权',
-												content: '天气功能需要获取您的地理位置,请在设置中打开位置权限',
-												success: (modalRes) => {
-													if (modalRes.confirm) {
-														uni.openSetting()
-													} else {
-														uni.showToast({
-															title: '您拒绝了授权,将无法查看天气信息',
-															duration: 2000,
-															icon: 'none'
-														});
-													}
-												},
-											})
-										}
-									},
-								})
-							}
-						}
-					})
-				}
-			}
-		},
-		onLoad() {
-			var time = new Date();
-			var hours = time.getHours();
-			if (hours < 12) {
-				this.hello = '上午好!';
-			} else {
-				this.hello = '下午好!';
-			}
-			this.getUserlogin();
-			this.checkLocationPermission(true); // 首次加载弹框提醒
-		},
-		onShow() {
-			this.loadTF = false;
-			this.getUserlogin();
-			this.checkLocationPermission();
-		},
-	};
-</script>
-
-<style lang="less">
-	page {
-		background: linear-gradient(180deg, #1FC676 11.72%, #1FC676 11.52%, #D5F9E7 29.83%, #F5F6FA 36.96%), #FFF;
-		background-size: 100%;
-		background-repeat: no-repeat;
-		background-color: #f9f9f9;
-	}
-	.home {
-		width: 100%;
-		height: 100%;
-		padding-top: 94rpx;
-		box-sizing: border-box;
-	}
-	.welcom {
-		height: 64rpx;
-		line-height: 64rpx;
-		padding-left: 16rpx;
-		font-size: 40rpx;
-		color: #fff;
-	}
-	.weather-bg {
-		width: 100%;
-		height: 212rpx;
-		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/banner-bg.png);
-		background-size: 100% 100%;
-		background-repeat: no-repeat;
-	}
-	.weather-box {
-		display: flex;
-		margin: 24rpx 0 16rpx 0;
-	}
-	.weather:nth-child(1) {
-		border-right: 1px solid rgba(255, 255, 255, 0.6);
-	}
-	.weather {
-		flex: 1;
-		display: flex;
-		.weaimg {
-			width: 42rpx;
-			height: 42rpx;
-		}
-		.weatext {
-			gap: 8rpx;
-			flex: 1;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			font-size: 24rpx;
-			color: rgba(255, 255, 255, 0.8);
-		}
-		.weatext_title {
-			font-size: 24rpx;
-			color: #fff;
-		}
-		.text-span {
-			color: #0BBC58;
-			margin-left: 16rpx;
-			padding: 0 2px;
-			border-radius: 4px;
-			background: rgba(255, 255, 255, 0.6);
-		}
-		.text-value {
-			font-size: 48rpx;
-			color: #fff;
-		}
-	}
-	.weather-warning {
-		margin: 20rpx 0;
-		padding: 0 40rpx;
-		color: #fff;
-		.weather-alert{
-			width:30rpx;
-			height: 30rpx;
-			margin-right: 10rpx;
-		}
-	}
-	.ai-box {
-		width: 100%;
-		padding: 0 40rpx;
-		box-sizing: border-box;
-		height: 128rpx;
-		margin-bottom: 12rpx;
-		position: relative;
-		top: -20rpx;
-		.ai-content {
-			box-sizing: border-box;
-			height: 100%;
-			border-radius: 8px;
-			border: 1.5px solid #FFF;
-			background: linear-gradient(180deg, #ffffffa3 0%, #FFF 100%);
-			padding: 24rpx;
-			image {
-				width: 80rpx;
-				height: 80rpx;
-				float: left;
-				margin-right: 16rpx;
-			}
-			.float-right {
-				float: right;
-				padding: 4px 12px;
-				color: #fff;
-				border-radius: 28px;
-				background: #0BBC58;
-				margin: 12rpx 0;
-			}
-			.ai-text {
-				float: left;
-			}
-			.ai-text-title {
-				color: #333834;
-				line-height: 40rpx;
-				font-size: 28rpx;
-				font-weight: 700;
-			}
-			.ai-text-subtitle {
-				color: #7b9783;
-				line-height: 40rpx;
-				font-size: 20rpx;
-				font-weight: 400;
-			}
-		}
-	}
-	.functionbox {
-		width: 100%;
-		padding: 0rpx 32rpx 0 32rpx;
-		box-sizing: border-box;
-		margin-bottom: 16rpx;
-		.swiper {
-			height: 208rpx;
-		}
-		.functionbox_title {
-			padding-left: 20rpx;
-			font-size: 34rpx;
-		}
-		.functionbox_text {
-			display: flex;
-			flex-wrap: wrap;
-			margin-top: 30rpx;
-			.functionbox_text_item {
-				width:20%;
-				text-align: center;
-				color: #616666;
-				font-size: 24rpx;
-				margin-bottom: 32rpx;
-				.itemimg {
-					width: 80rpx;
-					height: 80rpx;
-					margin-bottom: 16rpx;
-				}
-			}
-		}
-	}
-	.facilitybox {
-		width: 100%;
-		padding: 0 32rpx;
-		box-sizing: border-box;
-		background: #F5F6FA;
-		.facilitybox-content {
-			border-radius: 16rpx;
-			background: #FFF;
-			padding: 32rpx;
-		}
-		.facilitybox_title {
-			font-size: 30rpx;
-			color: #333;
-			margin-bottom: 24rpx;
-		}
-		.facilitybox_itembox {
-			display: flex;
-			gap: 32rpx;
-			.facilitybox_item {
-				flex: 1;
-				color: #616666;
-				.facilitybox_span {
-					padding: 16rpx 24rpx;
-					width: 50%;
-					color: #0B3F5D;
-					font-weight: 500;
-					font-size: 28rpx;
-					.text {
-						font-size: 20rpx;
-						color: #4E916E;
-						font-weight: 400;
-						margin-top: 9rpx;
-					}
-				}
-				.itemimg {
-					width: 90rpx;
-					height: 90rpx;
-					float: right;
-					margin: 7rpx 0;
-				}
-			}
-			.facilitybox-zhuanjia {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #D3FBE6 0%, #F5F7FA 100%);
-				position: relative;
-				.itemimg {
-					width: 112rpx;
-					height: 146rpx;
-					position: absolute;
-					bottom: 0;
-					right: 16rpx;
-				}
-				text {
-					color: #003318;
-					font-weight: 500;
-					font-size: 28rpx;
-				}
-			}
-			.facilitybox-suishi {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #CAECFF 0%, #F5F7FA 99.89%);
-				padding: 9rpx 0;
-				.facilitybox_span {
-					color: #0B3F5D;
-				}
-			}
-			.facilitybox-bchk {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #EEE5F6 0%, #F5F7FA 95.65%);
-				padding: 10rpx 0;
-				.facilitybox_span {
-					color: #3E2B50;
-				}
-				.itemimg {
-					width: 78rpx;
-					height: 72rpx;
-					margin-right: 10rpx;
-				}
-			}
-			.facilitybox-jgqs {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #D2E5FF 0%, #F5F7FA 95.65%);
-				.facilitybox_span {
-					color: #0D2E5B;
-				}
-			}
-			.facilitybox-jwjy {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #FFF4D2 0%, #F5F7FA 95.65%);
-				.facilitybox_span {
-					color: #3D4012;
-				}
-			}
-		}
-	}
-	.banner-ad {
-		margin: 32rpx 0;
-		height: 224rpx;
-		border-radius: 8px;
-		background-size: 100% 100%;
-		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/ad-banner.png);
-		.ad-text{
-			height: 100%;
-			display: flex;
-			flex-direction: column;
-			justify-content: space-around;
-			padding: 40rpx;
-			box-sizing: border-box;
-			.title{
-				 color: #333333;
-				 font-size: 28rpx;
-				 font-style: normal;
-				 font-weight: 700;
-				 line-height: normal;
-			}
-			.sub-title{
-				 color: #666666;
-				 font-size: 20rpx;
-				 font-style: normal;
-				 font-weight: 500;
-				 line-height: normal;
-			}
-			.btn{
-				text-align: center;
-				width: 112rpx;
-				color:#fff;
-				padding: 4px 0px;
-				font-size: 20rpx;
-				border-radius: 4px;
-				background: linear-gradient(106deg, #0BBC58 2.6%, #7CE6FB 86.51%);
-			}
-		}
-	}
-	.insectattack {
-		width: 90%;
-		margin: 0 auto;
-		padding: 30rpx;
-		.insectattack_title {
-			font-size: 34rpx;
-			display: flex;
-			justify-content: space-between;
-			.iconbox {
-				width: 40rpx;
-				height: 40rpx;
-				background-color: #cfd6d6;
-				color: #909696;
-				border-radius: 40rpx;
-				line-height: 40rpx;
-				text-align: center;
-				font-size: 20rpx;
-			}
-		}
-		.insectattack_listbox {
-			overflow-x: auto;
-			.insectattack_list {
-				width: 1104rpx;
-				display: flex;
-				margin-top: 30rpx;
-				flex-wrap: wrap;
-				.list_box {
-					background-size: 100% 100%;
-					width: 246rpx;
-					height: 324rpx;
-					margin-right: 30rpx;
-					border-radius: 20rpx;
-					position: relative;
-					.list_boxbg {
-						width: 100%;
-						height: 100%;
-						position: absolute;
-						top: 0;
-						left: 0;
-						z-index: -1;
-						.list_boxbg_img {
-							width: 100%;
-							height: 100%;
-						}
-					}
-					.list_box_xiang {
-						width: 95%;
-						margin-top: 0rpx auto;
-						display: flex;
-						justify-content: flex-end;
-						padding-top: 20rpx;
-						.list_box_xiang_click {
-							padding: 8rpx 15rpx;
-							background-color: rgba(0, 0, 0, 0.2);
-							color: #fff;
-							font-size: 20rpx;
-							border-radius: 52rpx;
-						}
-					}
-					.list_box_info {
-						width: 90%;
-						margin: 130rpx auto 0;
-						height: 120rpx;
-						border-radius: 10rpx;
-						background-image: linear-gradient(to right,
-								#ffffff,
-								rgba(255, 255, 255, 0.44));
-						padding: 10rpx;
-						box-sizing: border-box;
-						.list_box_info_name {
-							font-weight: 700;
-						}
-						.list_box_info_text {
-							font-size: 18rpx;
-							overflow: hidden;
-							text-overflow: ellipsis;
-							display: -webkit-box;
-							-webkit-box-orient: vertical;
-							-webkit-line-clamp: 2;
-						}
-					}
-				}
-			}
-		}
-	}
-	.loading {
-		position: absolute;
-		top: 0;
-		left: 0;
-		z-index: 100;
-		width: 100%;
-		height: 100vh;
-		background-color: rgba(0, 0, 0, 0.5);
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	}
-</style>

+ 2 - 3
pages/prevention/equipmentdetails.vue

@@ -8,7 +8,7 @@
 			<view class="info">
 				<view class="info_item">
 					<image
-						:src="eqinfo.item.is_online==1?$imageURL+'/bigdata_app/image/cb/onBg.png':$imageURL+'/bigdata_app/image/cb/offBg.png'"
+						:src="eqinfo.item.status==1?$imageURL+'/bigdata_app/image/cb/onBg.png':$imageURL+'/bigdata_app/image/cb/offBg.png'"
 						mode="" class="bgi"></image>
 					<p style="font-size: 32rpx;" @click="copy(eqinfo.item.imei || eqinfo.item.device_id || eqinfo.item.id)">设备
 						ID:{{eqinfo.item.imei || eqinfo.item.device_id || eqinfo.item.id}}
@@ -203,7 +203,6 @@
 				})
 			},
 			repairs() {
-				console.log(this.eqinfo.item)
 				var device_id = this.eqinfo.item.equip_id || this.eqinfo.item.device_id || this.eqinfo.item.id
 				uni.navigateTo({
 					url: "../afterSale/addafter?device_id=" + device_id + "&device_type=" + 2
@@ -243,7 +242,7 @@
 		onLoad(option) {
 			this.$forceUpdate()
 			this.eqinfo.item = JSON.parse(option.shebei)
-			console.log(JSON.parse(option.shebei))
+			console.log(JSON.parse(option.shebei),'22222')
 			this.history()
 			// this.eqlist(JSON.parse(option.shebei).device_id || JSON.parse(option.shebei).imei)
 			this.selectaddress(this.eqinfo.item.lat, this.eqinfo.item.lng)