修改后台提出的细节问题,地图,设备信息
This commit is contained in:
parent
54fbe9b3e9
commit
7ec7cea507
|
|
@ -48,7 +48,7 @@ http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
|
|||
'app-id' : uni.getAccountInfoSync().miniProgram.appId,
|
||||
"client-type" : "MA",
|
||||
'third-session' : uni.getStorageSync('third_session')||'123',
|
||||
'X-Tenant-Id' : '1001'
|
||||
'X-Tenant-Id' : '1002'
|
||||
}
|
||||
/*
|
||||
if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name" : "武乡面源污染监测平台",
|
||||
"name" : "吉县面源污染监测平台",
|
||||
"appid" : "__UNI__A58A5D7",
|
||||
"description" : "",
|
||||
"versionName" : "2.2.22",
|
||||
|
|
|
|||
|
|
@ -260,14 +260,12 @@
|
|||
},
|
||||
onLoad(options) {
|
||||
this.item = JSON.parse(decodeURIComponent(options.item));
|
||||
console.log("...........",this.item)
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
var pxToRpxScale = 750 / res.windowWidth
|
||||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -328,7 +326,6 @@
|
|||
})
|
||||
},
|
||||
tosjdetail(item,index){
|
||||
console.log(item,'gegwg')
|
||||
uni.navigateTo({
|
||||
url:'/packDetail/pages/Site/sjdetail?item=' + encodeURIComponent(JSON.stringify(item)) + '&stationCode='+this.details.stationCode + '&stationName=' + this.details.stationName
|
||||
})
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -144,27 +143,20 @@
|
|||
this.List[i].survDataCount = (this.List[i].survDataCount /100000000).toFixed(1) + '亿'
|
||||
}
|
||||
}
|
||||
console.log(this.List,'35415')
|
||||
if(res.data.data.total != 0){
|
||||
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
|
||||
console.log(this.allNum,'总页数')
|
||||
if(this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum,'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum)+1);
|
||||
console.log(this.allNum,'else')
|
||||
}
|
||||
console.log(this.pageNo,this.allNum,'156156')
|
||||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true','nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -176,7 +168,6 @@
|
|||
})
|
||||
},
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -186,7 +177,6 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num+1;
|
||||
},1000)
|
||||
console.log(this.intervalId,num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
|
|
@ -199,12 +189,10 @@
|
|||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
|
|||
|
|
@ -132,8 +132,6 @@
|
|||
value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2),
|
||||
dataDateTime:data[i].dataDateTime
|
||||
})
|
||||
console.log(data[i].codelist, '数据')
|
||||
console.log(data, '数据全部')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -141,26 +139,19 @@
|
|||
}
|
||||
// this.list = data
|
||||
this.list = this.list.concat(data)
|
||||
// console.log(this.list, '数据all')
|
||||
if(res.data.data.total != 0){
|
||||
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
|
||||
console.log(this.allNum,'总页数')
|
||||
if(this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum,'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum)+1);
|
||||
console.log(this.allNum,'else')
|
||||
}
|
||||
console.log(this.pageNo,this.allNum,'156156')
|
||||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true','nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -169,7 +160,6 @@
|
|||
})
|
||||
},
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -179,7 +169,6 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num+1;
|
||||
},1000)
|
||||
console.log(this.intervalId,num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pollutionCode = this.details.code
|
||||
|
|
@ -201,8 +190,6 @@
|
|||
value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2),
|
||||
dataDateTime:data[i].dataDateTime
|
||||
})
|
||||
console.log(data[i].codelist, '数据')
|
||||
console.log(data, '数据全部')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -214,12 +201,10 @@
|
|||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
|
|||
|
|
@ -178,7 +178,6 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -207,7 +206,6 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby3)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -217,17 +215,14 @@
|
|||
},
|
||||
// 选择养殖品种
|
||||
change1(e){
|
||||
console.log(e)
|
||||
this.details.breedVariety = e.detail.value
|
||||
},
|
||||
// 选择治污模式
|
||||
change2(e){
|
||||
console.log(e)
|
||||
this.details.controlMode = e.detail.value
|
||||
},
|
||||
// 选择利用模式
|
||||
change3(e){
|
||||
console.log(e)
|
||||
this.details.useMode = e.detail.value
|
||||
},
|
||||
// 提交
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -155,7 +154,6 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby3)
|
||||
}
|
||||
for(var i=0;i<this.hobby3.length;i++){
|
||||
if(this.details.useMode){
|
||||
|
|
|
|||
|
|
@ -179,7 +179,6 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -208,7 +207,6 @@
|
|||
text:res.data.data[i].itemText,
|
||||
value:res.data.data[i].itemValue
|
||||
})
|
||||
console.log(this.hobby3)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -218,17 +216,14 @@
|
|||
},
|
||||
// 选择养殖品种
|
||||
change1(e){
|
||||
console.log(e)
|
||||
this.details.breedVariety = e.detail.value
|
||||
},
|
||||
// 选择治污模式
|
||||
change2(e){
|
||||
console.log(e)
|
||||
this.details.controlMode = e.detail.value
|
||||
},
|
||||
// 选择利用模式
|
||||
change3(e){
|
||||
console.log(e)
|
||||
this.details.useMode = e.detail.value
|
||||
},
|
||||
// 提交
|
||||
|
|
|
|||
|
|
@ -129,7 +129,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 182
|
||||
}
|
||||
});
|
||||
|
|
@ -142,14 +141,12 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 182
|
||||
}
|
||||
});
|
||||
let pages = getCurrentPages();
|
||||
let currPage = pages[pages.length - 1]; //当前页面
|
||||
this.reload = currPage.data.reload
|
||||
console.log(this.reload,'Ge')
|
||||
if(this.reload){
|
||||
this.farmName = ''
|
||||
this.breedVariety = ''
|
||||
|
|
@ -175,7 +172,6 @@
|
|||
value:res.data.data[i].itemValue
|
||||
})
|
||||
this.array.push(res.data.data[i].itemText)
|
||||
console.log(this.array)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -210,24 +206,18 @@
|
|||
this.List = this.List.concat(data)
|
||||
if(res.data.data.total != 0){
|
||||
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
|
||||
console.log(this.allNum,'总页数')
|
||||
if(this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum,'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum)+1);
|
||||
console.log(this.allNum,'else')
|
||||
}
|
||||
console.log(this.pageNo,this.allNum,'156156')
|
||||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true','nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -240,7 +230,6 @@
|
|||
},
|
||||
// 分页加载
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -250,7 +239,6 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num+1;
|
||||
},1000)
|
||||
console.log(this.intervalId,num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
|
|
@ -266,12 +254,10 @@
|
|||
if(this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus='nomore'
|
||||
console.log(this.isLastpage,'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage,'false')
|
||||
}
|
||||
}else{
|
||||
this.isLastpage = true;
|
||||
|
|
@ -281,7 +267,6 @@
|
|||
})
|
||||
},
|
||||
bindPickerChange: function(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.index = e.detail.value
|
||||
this.breedVariety = this.arrays[this.index].value
|
||||
this.breedVariety1 = this.arrays[this.index].text
|
||||
|
|
@ -312,12 +297,10 @@
|
|||
},
|
||||
// 操作
|
||||
caozuo(item){
|
||||
console.log(item)
|
||||
var that = this
|
||||
uni.showActionSheet({
|
||||
itemList: ['编辑', '删除'],
|
||||
success: function (res) {
|
||||
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||
if((res.tapIndex + 1) == 1){
|
||||
uni.navigateTo({
|
||||
url:'/packDetail/pages/fwtz/edit?item='+ encodeURIComponent(JSON.stringify(item))
|
||||
|
|
@ -328,8 +311,6 @@
|
|||
content: '是否删除数据?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
console.log(item.id,1)
|
||||
that.$http.delete(that.deleteUrl+'?id='+item.id).then(res =>{
|
||||
if(res.data.code == 0){
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 武乡县农业农村局</text>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 吉县现代农业发展中心</text>
|
||||
<!-- <view class="loginpage">
|
||||
<image class="bigimg" src="../../static/dls.jpg" mode=""></image>
|
||||
<view class="padding text-center margin-top">
|
||||
|
|
@ -100,11 +100,9 @@ export default {
|
|||
var that = this
|
||||
uni.login({
|
||||
success: function (res) {
|
||||
console.log(res.code)
|
||||
that.code = res.code
|
||||
let params = {}
|
||||
params.jsCode = that.code
|
||||
console.log(params, 152)
|
||||
api.wxlogin(params).then(res => {
|
||||
let userInfo = res.data.data;
|
||||
uni.setStorageSync('third_session', userInfo.thirdSession);
|
||||
|
|
@ -146,7 +144,6 @@ export default {
|
|||
})
|
||||
},
|
||||
TypeInput(e) {
|
||||
console.log(e, 415)
|
||||
// 只能输入数字的验证;
|
||||
const inputType = /[\W]/g //想限制什么类型在这里换换正则就可以了
|
||||
this.$nextTick(function () {
|
||||
|
|
@ -154,7 +151,6 @@ export default {
|
|||
})
|
||||
},
|
||||
tologins() {
|
||||
console.log(this.userInfoLoginDTO.password, this.userInfoLoginDTO.userName, '密码用户')
|
||||
if (!this.userInfoLoginDTO.userName) {
|
||||
uni.showToast({
|
||||
title: '请输入账号',
|
||||
|
|
|
|||
|
|
@ -167,7 +167,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 120
|
||||
}
|
||||
});
|
||||
|
|
@ -199,21 +198,17 @@
|
|||
this.$set(item, 'checked', true)
|
||||
})
|
||||
this.checkList = this.alllist
|
||||
console.log(this.checkList,156)
|
||||
}
|
||||
|
||||
},
|
||||
checkSelectItem(e, item) {
|
||||
console.log(item,156)
|
||||
// 如果是取消选中,就把checked置为false,如果是选中,就给添加一个checked=true
|
||||
if (item.checked == true) {
|
||||
this.$set(item, 'checked', false)
|
||||
this.checkList = this.checkList.filter(items => (items.value !== item.value))
|
||||
console.log(this.checkList,'true')
|
||||
} else {
|
||||
this.$set(item, 'checked', true)
|
||||
this.checkList.push(item)
|
||||
console.log(this.checkList,'false')
|
||||
}
|
||||
// 过滤出数组中checked为true的项目,如果和原alllist长度相等,就全选显示
|
||||
let newArr = this.alllist.filter(item => (item.checked == true))
|
||||
|
|
@ -222,7 +217,6 @@
|
|||
} else {
|
||||
this.checkTrue = false;
|
||||
}
|
||||
console.log(this.checkList,41561456)
|
||||
},
|
||||
submit(){
|
||||
uni.navigateBack({
|
||||
|
|
|
|||
|
|
@ -938,8 +938,8 @@
|
|||
.zwsj {
|
||||
height: calc(100vh - 100rpx);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
}
|
||||
|
||||
.inzwsj {
|
||||
|
|
@ -947,8 +947,8 @@
|
|||
}
|
||||
|
||||
.zwsjimg {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
}
|
||||
|
||||
.zwsjtext {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@
|
|||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
this.contentheight = this.height - ktxStatusHeight - navigationHeight - 150
|
||||
console.log(this.contentheight,123132)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -105,7 +104,6 @@
|
|||
});
|
||||
},
|
||||
radioChange(value){
|
||||
console.log(value)
|
||||
this.constant.sex = value.detail.value
|
||||
},
|
||||
submit() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar :title="item.stationName"/>
|
||||
<uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar :title="item.deployDes"/>
|
||||
<view class="liebiaos">
|
||||
<view class="list_item">
|
||||
<view class="list_item_top">
|
||||
|
|
@ -128,7 +128,6 @@
|
|||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(JSON.parse(decodeURIComponent(options.item)))
|
||||
this.item = JSON.parse(decodeURIComponent(options.item));
|
||||
},
|
||||
onShow() {
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@
|
|||
var pxToRpxScale = 750 / res.windowWidth
|
||||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -102,8 +101,22 @@
|
|||
this.$http.get('/applet/survStationInfo/deviceList'),
|
||||
this.$http.get('/applet/survStationInfo/fdeviceList')
|
||||
]).then(([res1, res2]) => {
|
||||
// 合并两个数组
|
||||
this.list = res1.data.data.concat(res2.data.data);
|
||||
const data1 = res1?.data?.data || [];
|
||||
|
||||
// 安全获取第二个接口的数据
|
||||
let data2 = [];
|
||||
if (res2?.data?.data && Array.isArray(res2.data.data) && res2.data.data.length > 0) {
|
||||
data2 = res2.data.data[0] || [];
|
||||
}
|
||||
|
||||
// data2 有数据才合并
|
||||
this.list = data2.length > 0 ? data1.concat(data2) : data1;
|
||||
|
||||
// 可选:打印日志方便调试
|
||||
if (data2.length === 0) {
|
||||
console.log('第二个接口无数据,跳过合并');
|
||||
}
|
||||
|
||||
uni.hideLoading();
|
||||
}).catch(error => {
|
||||
console.error('请求失败:', error);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<image v-if="it[0].stationType == 'livestock'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
|
||||
<view class="item_right">
|
||||
<view class="right_top">
|
||||
{{it[0].stationName}}
|
||||
{{it[0].stationName?it[0].stationName:'无设备信息'}}
|
||||
</view>
|
||||
<view class="right_bot">
|
||||
<image src="../../static/shebei_icon_shebei.png" mode=""></image>
|
||||
|
|
@ -84,7 +84,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -101,7 +100,6 @@
|
|||
})
|
||||
},
|
||||
todetail(item,index){
|
||||
console.log(item,12)
|
||||
uni.navigateTo({
|
||||
url:'/packDetail/pages/vidio/detail?item=' + encodeURIComponent(JSON.stringify(item))
|
||||
})
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 64 KiB |
|
|
@ -23,7 +23,7 @@
|
|||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 武乡县农业农村局</text>
|
||||
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 吉县现代农业发展中心</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -112,6 +112,6 @@
|
|||
left: 50%;
|
||||
transform: translate(-50%);
|
||||
color: #999;
|
||||
width: 52%;
|
||||
width: 60%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale //将px 转换rpx
|
||||
console.log(this.height, ktxStatusHeight, navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -85,7 +84,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale //将px 转换rpx
|
||||
console.log(this.height, ktxStatusHeight, navigationHeight)
|
||||
this.scorllheight = this.height
|
||||
}
|
||||
});
|
||||
|
|
@ -112,24 +110,18 @@
|
|||
this.List = this.List.concat(data)
|
||||
if (data.length != 0) {
|
||||
this.allNum = Number(data.length) / Number(this.pageSize) + '';
|
||||
console.log(this.allNum, '总页数')
|
||||
if (this.allNum.indexOf('.') == -1) {
|
||||
this.allNum = this.allNum;
|
||||
console.log(this.allNum, 'if')
|
||||
} else {
|
||||
this.allNum = parseInt(Number(this.allNum) + 1);
|
||||
console.log(this.allNum, 'else')
|
||||
}
|
||||
console.log(this.pageNo, this.allNum, '156156')
|
||||
if (this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus = 'nomore'
|
||||
console.log(this.isLastpage, 'true', 'nomore')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage, 'false')
|
||||
}
|
||||
} else {
|
||||
this.isLastpage = true;
|
||||
|
|
@ -141,7 +133,6 @@
|
|||
})
|
||||
},
|
||||
lower() {
|
||||
console.log("最后一页了,取消下拉功能");
|
||||
// 最后一页了,取消下拉功能
|
||||
if (this.isLastpage) {
|
||||
return
|
||||
|
|
@ -151,7 +142,6 @@
|
|||
this.intervalId = setInterval(() => {
|
||||
num = num + 1;
|
||||
}, 1000)
|
||||
console.log(this.intervalId, num)
|
||||
this.pageNo = this.pageNo + 1;
|
||||
let params = {}
|
||||
params.pageNo = this.pageNo
|
||||
|
|
@ -166,12 +156,10 @@
|
|||
if (this.pageNo == this.allNum) {
|
||||
this.isLastpage = true;
|
||||
this.loadStatus = 'nomore'
|
||||
console.log(this.isLastpage, 'true')
|
||||
} else {
|
||||
this.isLastpage = false;
|
||||
// this.isLoadMore=true
|
||||
this.loadStatus = 'more'
|
||||
console.log(this.isLastpage, 'false')
|
||||
}
|
||||
} else {
|
||||
this.isLastpage = true;
|
||||
|
|
|
|||
|
|
@ -2326,7 +2326,6 @@
|
|||
uni.sendSocketMessage({
|
||||
data: JSON.stringify(param)
|
||||
});
|
||||
console.log('websocket发送给服务端的消息:', param);
|
||||
socketTask.close({
|
||||
code: 1000,
|
||||
success: (res) => {
|
||||
|
|
@ -2337,7 +2336,6 @@
|
|||
|
||||
// push
|
||||
pusherStateChange: function (e) {
|
||||
console.log('>>> live-pusher onPushStateChange:', e.detail.code);
|
||||
const code = e.detail.code;
|
||||
let content = '';
|
||||
switch (code) {
|
||||
|
|
@ -2440,13 +2438,11 @@
|
|||
},
|
||||
|
||||
stopPush() {
|
||||
console.log('停止推流');
|
||||
this.pushVideoContext.stop();
|
||||
this.pushVideo=false
|
||||
},
|
||||
|
||||
startPush() {
|
||||
console.log('开始推流,推流地址为:', this.pushUrl);
|
||||
uni.showToast({
|
||||
title: '开始推流,推流地址为:'
|
||||
});
|
||||
|
|
@ -2458,7 +2454,6 @@
|
|||
},
|
||||
|
||||
error(e) {
|
||||
console.log('live-player', e);
|
||||
console.error('live-player error:', e.detail.errMsg);
|
||||
if (e.detail.errCode == 10001) {
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -34,19 +34,13 @@
|
|||
var player = null;
|
||||
export default {
|
||||
created() {
|
||||
console.log(1111111111111111111111)
|
||||
// this.initPlayer()
|
||||
},
|
||||
mounted() {
|
||||
console.log('mounted...');
|
||||
|
||||
if (typeof window.EZUIKit !== 'undefined') {
|
||||
|
||||
console.log('defined EZUIKit...');
|
||||
this.initPlayer();
|
||||
} else {
|
||||
|
||||
console.log('undefined EZUIKit...');
|
||||
} else {
|
||||
// 动态引入较大类库避免影响页面展示
|
||||
const script = document.createElement('script')
|
||||
// view 层的页面运行在 www 根目录,其相对路径相对于 www 计算
|
||||
|
|
@ -62,7 +56,6 @@
|
|||
windowWidth,
|
||||
windowHeight
|
||||
} = uni.getSystemInfoSync();
|
||||
console.log('initPlayer...');
|
||||
return
|
||||
fetch('https://zy.sxzooh.com/zh-api/applet/ysyun/getYsToken')
|
||||
// .then(response => response.json())
|
||||
|
|
|
|||
|
|
@ -226,10 +226,8 @@ export default {
|
|||
},
|
||||
onLoad: function (options) {
|
||||
livePlayerContext = uni.createLivePlayerContext('livePlayer');
|
||||
console.log('获取参数', options);
|
||||
// 获取当前页面栈
|
||||
const currentPage = getCurrentPages();
|
||||
console.log(currentPage.nv_length);
|
||||
|
||||
// 获取url携带的参数
|
||||
const { accessToken, deviceSerial, channelNo, date, switch1Checked } = options;
|
||||
|
|
@ -238,7 +236,6 @@ export default {
|
|||
this.deviceSerial=deviceSerial,
|
||||
this.channelNo=channelNo,
|
||||
this.page=currentPage.nv_length
|
||||
console.log(date);
|
||||
// 通过分享今日指定日期
|
||||
if (date) {
|
||||
this.date=date,
|
||||
|
|
@ -261,10 +258,8 @@ export default {
|
|||
*/
|
||||
onShareAppMessage: function (res) {
|
||||
const { accessToken, deviceSerial, channelNo, date, switch1Checked } = this;
|
||||
console.log(switch1Checked);
|
||||
if (res.from === 'button') {
|
||||
// 来自页面内转发按钮
|
||||
console.log(res.target);
|
||||
this.panelStatus=0
|
||||
}
|
||||
return {
|
||||
|
|
@ -298,7 +293,6 @@ export default {
|
|||
|
||||
// 获取存储类型
|
||||
switch1Change: function (e) {
|
||||
console.log('当前存储类型', e.detail);
|
||||
if (e.detail.value == false) {
|
||||
this.switchText='云存储',
|
||||
this.switch1Checked=false,
|
||||
|
|
@ -327,10 +321,8 @@ export default {
|
|||
// 获取当前操作系统类型
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
console.log('当前操作系统:', res.system);
|
||||
const sys = res.system;
|
||||
type = sys.split(' ');
|
||||
console.log(type);
|
||||
if (type[0] == 'iOS') {
|
||||
that.toDay=date.replace(/\-/g, '/')
|
||||
} else {
|
||||
|
|
@ -351,7 +343,6 @@ export default {
|
|||
// 获取时间轴
|
||||
getTimeLine: function () {
|
||||
const { recType, date, accessToken, deviceSerial, channelNo, timelineTimer, currentTimer } = this;
|
||||
console.log('获取到的accessToken, accessToken', accessToken);
|
||||
var that = this;
|
||||
let currentDate = null;
|
||||
let timestampCurrent = null;
|
||||
|
|
@ -381,7 +372,6 @@ export default {
|
|||
},
|
||||
|
||||
success: (res) => {
|
||||
console.log('获取播放时间片段', res.data);
|
||||
if (res.data.code == 200) {
|
||||
if (res.data.data != null) {
|
||||
var result = res.data.data;
|
||||
|
|
@ -408,7 +398,6 @@ export default {
|
|||
et: et
|
||||
});
|
||||
}
|
||||
console.log('availArr:', availArr);
|
||||
this.dateLine=availArr
|
||||
} else {
|
||||
this.dialogNodataTitle='暂无数据',
|
||||
|
|
@ -447,7 +436,6 @@ export default {
|
|||
let stTime = e.detail.stTime;
|
||||
let etTime = e.detail.etTime;
|
||||
const { type, date, accessToken, deviceSerial, channelNo, videoSrc } = this;
|
||||
console.log('当前播放时间', stTime, etTime);
|
||||
let startTime = null;
|
||||
let stopTime = null;
|
||||
startTime = date + ' ' + stTime;
|
||||
|
|
@ -481,7 +469,6 @@ export default {
|
|||
},
|
||||
|
||||
success: (res) => {
|
||||
console.log('获取到的播放地址:', res.data);
|
||||
if (res.data.code == '200' && res.data.data && res.data.data.url) {
|
||||
const playUrl = res.data.data.url;
|
||||
this.videoSrc=playUrl
|
||||
|
|
@ -489,7 +476,6 @@ export default {
|
|||
this.handleStop();
|
||||
// 开始播放
|
||||
this.handlePlay();
|
||||
console.log('当前播放地址:', this.videoSrc);
|
||||
} else if (res.data.code == '20007') {
|
||||
debugger;
|
||||
this.dialogTitle='获取播放地址失败',
|
||||
|
|
@ -519,7 +505,6 @@ export default {
|
|||
this.dialogTitle='获取播放地址失败',
|
||||
this.dialogContent=res.data.msg,
|
||||
this.dialogShow=true
|
||||
console.log('获取rtmp播放地址失败');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -549,7 +534,6 @@ export default {
|
|||
_this.fullScreen=true
|
||||
}
|
||||
});
|
||||
console.log('开启全屏');
|
||||
},
|
||||
|
||||
unfullScreen() {
|
||||
|
|
@ -559,7 +543,6 @@ export default {
|
|||
_this.fullScreen=false
|
||||
}
|
||||
});
|
||||
console.log('开启全屏');
|
||||
},
|
||||
|
||||
ToggleObjectFit() {
|
||||
|
|
@ -576,7 +559,6 @@ export default {
|
|||
},
|
||||
|
||||
handlePlay(callback) {
|
||||
console.log('handelPlay', this.playVideo, this.isHD);
|
||||
this.checkNetWork();
|
||||
livePlayerContext.play({
|
||||
success: () => {
|
||||
|
|
@ -594,7 +576,6 @@ export default {
|
|||
title: '网络异常',
|
||||
icon: 'none'
|
||||
});
|
||||
console.log('开始播放失败');
|
||||
this.videoNetWorkError=true
|
||||
this.showVideoControls=false
|
||||
this.videoLoadingStatus=100
|
||||
|
|
@ -603,7 +584,6 @@ export default {
|
|||
},
|
||||
|
||||
handleStop(callback) {
|
||||
console.log('stop');
|
||||
const { list } = this;
|
||||
livePlayerContext.stop({
|
||||
success: () => {
|
||||
|
|
@ -622,7 +602,6 @@ export default {
|
|||
},
|
||||
|
||||
autoHideControl() {
|
||||
console.log('showHdSelect', this.showHDSelect);
|
||||
const _this = this;
|
||||
clearTimeout(this.autoHideTimer);
|
||||
this.autoHideTimer = setTimeout(() => {
|
||||
|
|
@ -640,7 +619,6 @@ export default {
|
|||
|
||||
handleHD(e) {
|
||||
var showHDSelect = this.showHDSelect;
|
||||
console.log('handleHD', showHDSelect);
|
||||
this.showHDSelect=!showHDSelect
|
||||
},
|
||||
|
||||
|
|
@ -658,7 +636,6 @@ export default {
|
|||
},
|
||||
|
||||
statechange(e) {
|
||||
console.log('live-player code:', e.detail.code, e.detail);
|
||||
const { code } = e.detail;
|
||||
let { videoLoadingStatus, list, panelStatus } = this;
|
||||
switch (code) {
|
||||
|
|
@ -726,7 +703,6 @@ export default {
|
|||
},
|
||||
|
||||
error(e) {
|
||||
console.log('live-player', e);
|
||||
console.error('live-player error:', e.detail.errMsg);
|
||||
if (e.detail.errCode == 10001) {
|
||||
uni.showToast({
|
||||
|
|
@ -738,7 +714,6 @@ export default {
|
|||
},
|
||||
|
||||
onVideoTap(e) {
|
||||
console.log('点击视频');
|
||||
const { deviceOffline, showVideoControls, panelStatus, videoNetWorkError } = this;
|
||||
if (deviceOffline || panelStatus === 4 || videoNetWorkError) {
|
||||
return false;
|
||||
|
|
@ -755,10 +730,8 @@ export default {
|
|||
screenShoot(e) {
|
||||
const { playVideo, videoLoadingStatus } = this;
|
||||
if (!playVideo || videoLoadingStatus != 100) {
|
||||
console.log('非播放状态下点击截图');
|
||||
return false;
|
||||
}
|
||||
console.log('开始截图');
|
||||
// livePlayerContext.snapshot('raw');
|
||||
let that = this;
|
||||
uni.getSetting({
|
||||
|
|
@ -786,13 +759,10 @@ export default {
|
|||
livePlayerContext
|
||||
.snapshot('raw')
|
||||
.then((data) => {
|
||||
console.log('data', data);
|
||||
if (data) {
|
||||
console.log(data);
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: data.tempImagePath,
|
||||
success(res) {
|
||||
console.log('保存成功', res);
|
||||
uni.showToast({
|
||||
title: '截图已保存至手机相册',
|
||||
icon: 'none'
|
||||
|
|
@ -850,7 +820,6 @@ export default {
|
|||
|
||||
// 时间选择器
|
||||
bindDateChange: function (e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value);
|
||||
this.date=e.detail.value
|
||||
this.getTimeLine();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -167,7 +167,6 @@
|
|||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
this.height = res.windowHeight * pxToRpxScale//将px 转换rpx
|
||||
console.log(this.height,ktxStatusHeight,navigationHeight)
|
||||
this.scorllheight = this.height - 120
|
||||
}
|
||||
});
|
||||
|
|
@ -199,21 +198,17 @@
|
|||
this.$set(item, 'checked', true)
|
||||
})
|
||||
this.checkList = this.alllist
|
||||
console.log(this.checkList,156)
|
||||
}
|
||||
|
||||
},
|
||||
checkSelectItem(e, item) {
|
||||
console.log(item,156)
|
||||
// 如果是取消选中,就把checked置为false,如果是选中,就给添加一个checked=true
|
||||
if (item.checked == true) {
|
||||
this.$set(item, 'checked', false)
|
||||
this.checkList = this.checkList.filter(items => (items.value !== item.value))
|
||||
console.log(this.checkList,'true')
|
||||
} else {
|
||||
this.$set(item, 'checked', true)
|
||||
this.checkList.push(item)
|
||||
console.log(this.checkList,'false')
|
||||
}
|
||||
// 过滤出数组中checked为true的项目,如果和原alllist长度相等,就全选显示
|
||||
let newArr = this.alllist.filter(item => (item.checked == true))
|
||||
|
|
@ -222,7 +217,6 @@
|
|||
} else {
|
||||
this.checkTrue = false;
|
||||
}
|
||||
console.log(this.checkList,41561456)
|
||||
},
|
||||
submit(){
|
||||
uni.navigateBack({
|
||||
|
|
|
|||
12
pages.json
12
pages.json
|
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "武乡小流域面源污染监测",
|
||||
"navigationBarTitleText": "吉县小流域面源污染监测",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
{
|
||||
"path": "pages/operations/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "站点运维",
|
||||
"navigationBarTitleText": "运维记录",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
{
|
||||
"path": "pages/operations/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "站点运维详情",
|
||||
"navigationBarTitleText": "运维记录详情",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
{
|
||||
"path": "pages/operations/add",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增站点运维",
|
||||
"navigationBarTitleText": "新增运维记录",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
{
|
||||
"path": "pages/operations/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑站点运维",
|
||||
"navigationBarTitleText": "编辑运维记录",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
{
|
||||
"path": "pages/sjdyj/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "智能告警",
|
||||
"navigationBarTitleText": "智能预警",
|
||||
"navigationStyle": "default",
|
||||
"navigationBarBackgroundColor":"#0F6EFF"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<uni-nav-bar :fixed="true" leftWidth="00rpx" rightWidth="0rpx" background-color="transparent" status-bar title="武乡县农业面源污染在线监测小程序" />
|
||||
<uni-nav-bar :fixed="true" leftWidth="00rpx" rightWidth="0rpx" background-color="transparent" status-bar title="吉县农业面源污染在线监测小程序" />
|
||||
<image src="../../static/home_top_bg.png" mode="" class="bgimg"></image>
|
||||
<scroll-view class="content" scroll-y="true" :style="{height:contentheight + 'rpx'}">
|
||||
<view class="top_address">
|
||||
|
|
@ -80,11 +80,8 @@
|
|||
<view class="bot_mid">
|
||||
<view class="bot_mid_left"
|
||||
:class="{'bot_mid_lefts':item.type == 2 || item.type == 0}">
|
||||
{{ item.value }}{{ item.unit }}
|
||||
{{ (item.value !== null && item.value !== undefined && item.value !== '' && !isNaN(item.value)) ? item.value + (item.unit || '') : '0' }}{{ item.unit }}
|
||||
</view>
|
||||
<!-- <image v-if="item.type == 1" src="../../static/home_shuju_shang.png" mode=""></image>
|
||||
<image v-if="item.type == 2" src="../../static/home_shuju_xia.png" mode=""></image>
|
||||
<view v-if="item.type == 0" class="" style="width: 42rpx;"> </view> -->
|
||||
</view>
|
||||
<view class="bot_rig" v-if="item.times">
|
||||
{{ item.times[0] }}
|
||||
|
|
@ -149,7 +146,6 @@
|
|||
// this.wrwlist = uni.getStorageSync('wrwlist')
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
console.log("getSystemInfo", res)
|
||||
var pxToRpxScale = 750 / res.windowWidth
|
||||
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
|
||||
var navigationHeight = 44 * pxToRpxScale
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ const indexData = {
|
|||
path: '/packDetail1/pages/device/index'
|
||||
},
|
||||
{
|
||||
name: '站点运维',
|
||||
name: '运维记录',
|
||||
img: require('../../static/home_icon_yunwei.png'),
|
||||
path: '/packDetail/pages/operations/index'
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,33 +1,34 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" scale="13" :markers="markers"
|
||||
longitude="112.83100231396601" latitude="36.872032399813556" show-location show-compass show-scale @markertap="markertap" >
|
||||
<map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" :scale="mapScale" :markers="markers"
|
||||
longitude="112.83100231396601" latitude="36.872032399813556" show-location show-compass show-scale
|
||||
@markertap="markertap">
|
||||
</map>
|
||||
<view class="zdxq">
|
||||
<view class="zdxqitem" @click="switch2Change('livestock')">
|
||||
<image src="../../static/zhandian_xuqin_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
畜禽污染监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('orient')">
|
||||
<view class="zdxqitem" @click="switch2Change('livestock')">
|
||||
<image src="../../static/zhandian_xuqin_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
畜禽污染监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('orient')">
|
||||
<image src="../../static/zhandian_nongtian_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
农田污染监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('watershed')">
|
||||
<image src="../../static/zhandian_xiaoliuyu_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
小流域监测站
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="zdxqitem" @click="switch2Change('watershed')">
|
||||
<image src="../../static/zhandian_xiaoliuyu_dingwei.png" mode=""></image>
|
||||
<view class="textss">
|
||||
小流域监测站
|
||||
</view>
|
||||
</view>
|
||||
<view class="zdxqitem" @click="switch2Change('soil')">
|
||||
<image src="../../static/iconsheturangzs.png" mode=""></image>
|
||||
<view class="textss">
|
||||
长期定位监测点
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -44,187 +45,326 @@
|
|||
latitude: 36.5,
|
||||
longitude: 111.7
|
||||
},
|
||||
scale: 14,
|
||||
mapScale: 13,
|
||||
markers: [],
|
||||
markersZIndex: 1,
|
||||
markersZIndex: 1,
|
||||
lastTap: '',
|
||||
stationList: [],
|
||||
stationList: [],
|
||||
cusLocationList: [],
|
||||
soilStationList: [],
|
||||
allStationList: [],
|
||||
allStationList: [],
|
||||
stationTwoList: [],
|
||||
mapCtx: null // 添加地图上下文
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
onLoad() {},
|
||||
onReady() {
|
||||
// 在onReady中初始化地图上下文
|
||||
this.mapCtx = uni.createMapContext('map', this);
|
||||
},
|
||||
onShow() {
|
||||
api.checkLogin(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
}, () => {
|
||||
uni.reLaunch({
|
||||
url:'/packDetail/pages/login/login'
|
||||
})
|
||||
})
|
||||
api.checkLogin(() => {
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
}, () => {
|
||||
uni.reLaunch({
|
||||
url: '/packDetail/pages/login/login'
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// kaihs
|
||||
getList() {
|
||||
this.markers = []
|
||||
this.stationList = []
|
||||
this.cusLocationList = []
|
||||
this.soilStationList = []
|
||||
this.allStationList = []
|
||||
|
||||
this.stationTwoList = []
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
|
||||
this.$http.get('/applet/survStationInfo/stationMap').then(res => {
|
||||
this.stationList = [...res.data.data.stationInfo];
|
||||
this.cusLocationList = [...res.data.data.cusLocation];
|
||||
this.soilStationList = [...res.data.data.deviceList];
|
||||
this.allStationList.push(...this.stationList);
|
||||
this.allStationList.push(...this.cusLocationList);
|
||||
this.allStationList.push(...this.soilStationList);
|
||||
// console.log("合并后的stationlist+++++", this.allStationList);
|
||||
// console.log("合并后的stationList+++++", this.stationList);
|
||||
// console.log("合并后的cusLocationList+++++", this.cusLocationList);
|
||||
// console.log("合并后的soilStationList+++++", this.soilStationList);
|
||||
//stationType: "orient" 农田
|
||||
//stationType: "livestock" 畜禽
|
||||
//stationType: "watershed" 小流域
|
||||
this.allStationList.forEach((item, index) => {
|
||||
item.id = index;
|
||||
});
|
||||
|
||||
this.issscd = false
|
||||
this.isssscd = false
|
||||
this.isSoilShow = false
|
||||
this.enterpriseRender();// 企业渲染
|
||||
this.stationRender();// 站点渲染
|
||||
this.monitorRender() // 监测点渲染
|
||||
|
||||
// 延迟执行以确保标记已经添加到地图
|
||||
setTimeout(() => {
|
||||
this.adjustMapToFitAllMarkers();
|
||||
}, 500);
|
||||
|
||||
uni.hideLoading();
|
||||
})
|
||||
this.markers = []
|
||||
this.stationList = []
|
||||
this.cusLocationList = []
|
||||
this.soilStationList = []
|
||||
this.allStationList = []
|
||||
this.stationTwoList = []
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
|
||||
this.$http.get('/applet/survStationInfo/stationMap').then(res => {
|
||||
// 处理数据
|
||||
this.stationList = [...res.data.data.stationInfo];
|
||||
this.cusLocationList = [...res.data.data.cusLocation];
|
||||
this.soilStationList = [...res.data.data.deviceList];
|
||||
this.allStationList.push(...this.stationList);
|
||||
this.allStationList.push(...this.cusLocationList);
|
||||
this.allStationList.push(...this.soilStationList);
|
||||
this.allStationList.forEach((item, index) => {
|
||||
item.id = index;
|
||||
});
|
||||
|
||||
this.issscd = false
|
||||
this.isssscd = false
|
||||
this.isSoilShow = false
|
||||
|
||||
// 渲染所有标记
|
||||
this.enterpriseRender();
|
||||
this.stationRender();
|
||||
this.monitorRender()
|
||||
|
||||
// 使用增强的视野调整方法
|
||||
this.ensureAllMarkersVisible();
|
||||
|
||||
uni.hideLoading();
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '数据加载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
console.error('加载地图数据失败:', err);
|
||||
})
|
||||
},
|
||||
enterpriseRender() {//企业点位地图渲染
|
||||
for (let i = 0; i < this.cusLocationList.length; i++) {
|
||||
const item = this.cusLocationList[i];
|
||||
item.iconPath = '/static/qiyeIcon.png';
|
||||
item.latitude = Number(item.stationLatitude);
|
||||
item.longitude = Number(item.stationLongitude);
|
||||
item.width = 35;
|
||||
item.height = 52;
|
||||
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: item.iconPath,
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude,
|
||||
width: item.width,
|
||||
height: item.height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false, //点聚合
|
||||
zIndex: this.markersZIndex,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
},
|
||||
stationRender() {// 站房点位置渲染
|
||||
// this.markers = this.markers.filter(item => item.stationType !== 'orient');
|
||||
if (!this.issscd) {
|
||||
for (let i = 0; i < this.stationList.length; i++) {
|
||||
const item = this.stationList[i];
|
||||
item.iconPath = this.baseUrl +'/'+ item.stationIcon;
|
||||
item.latitude = Number(item.stationLatitude);
|
||||
item.longitude = Number(item.stationLongitude);
|
||||
item.width = 239;
|
||||
item.height = 186;
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: item.iconPath,
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude,
|
||||
width: item.width,
|
||||
height: item.height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false, //点聚合
|
||||
zIndex: this.markersZIndex + 1,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
monitorRender() {// 监测点位渲染
|
||||
this.soilStationList.forEach((item, index) => {
|
||||
let iconPath = '';
|
||||
let width = 35;
|
||||
let height = 35;
|
||||
// 根据设备类型设置不同的图标
|
||||
switch(item.type) {
|
||||
case 'soil':
|
||||
iconPath = this.baseUrl + '/icon/device/soil.png';
|
||||
width = 32;
|
||||
height = 47;
|
||||
break;
|
||||
case 'camera':
|
||||
iconPath = this.baseUrl + '/icon/device/cam.png';
|
||||
width = 45;
|
||||
height = 45;
|
||||
break;
|
||||
default:
|
||||
iconPath = this.baseUrl + '/icon/device/default.png';
|
||||
}
|
||||
const markerItem = {
|
||||
id: item.id,
|
||||
iconPath: iconPath,
|
||||
latitude: Number(item.latitude),
|
||||
longitude: Number(item.longitude),
|
||||
width: width,
|
||||
height: height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: 'device',
|
||||
stationName: item.name,
|
||||
stationCode: item.ids,
|
||||
deviceType: item.type,
|
||||
joinCluster: false, //点聚合
|
||||
zIndex: this.markersZIndex,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
});
|
||||
ensureAllMarkersVisible() {
|
||||
// 确保地图上下文已初始化
|
||||
if (!this.mapCtx) {
|
||||
this.mapCtx = uni.createMapContext('map', this);
|
||||
}
|
||||
|
||||
// 过滤出有效的坐标点
|
||||
const validPoints = this.markers
|
||||
.filter(item => {
|
||||
const lat = Number(item.latitude);
|
||||
const lng = Number(item.longitude);
|
||||
return !isNaN(lat) && !isNaN(lng) && lat !== 0 && lng !== 0;
|
||||
})
|
||||
.map(item => ({
|
||||
latitude: Number(item.latitude),
|
||||
longitude: Number(item.longitude)
|
||||
}));
|
||||
|
||||
if (validPoints.length === 0) {
|
||||
console.warn('没有有效的坐标点');
|
||||
// 如果有默认坐标,使用默认坐标
|
||||
if (this.center.latitude && this.center.longitude) {
|
||||
this.mapCtx.moveToLocation({
|
||||
latitude: this.center.latitude,
|
||||
longitude: this.center.longitude,
|
||||
scale: 10
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('有效坐标点数量:', validPoints.length);
|
||||
|
||||
// 方法1:使用 includePoints(优先)
|
||||
try {
|
||||
this.mapCtx.includePoints({
|
||||
points: validPoints,
|
||||
padding: [80, 80, 80, 80], // 增加边距让点位不贴边
|
||||
success: () => {
|
||||
console.log('地图视野调整成功');
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('includePoints失败:', err);
|
||||
// 如果失败,使用备用方案
|
||||
this.fallbackAdjustMap(validPoints);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('调整地图视野异常:', e);
|
||||
this.fallbackAdjustMap(validPoints);
|
||||
}
|
||||
|
||||
// 方法2:延迟重试(确保地图完全渲染)
|
||||
setTimeout(() => {
|
||||
if (this.mapCtx) {
|
||||
try {
|
||||
this.mapCtx.includePoints({
|
||||
points: validPoints,
|
||||
padding: [80, 80, 80, 80]
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('第二次调整失败:', e);
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
|
||||
// 方法3:第三次重试(更长的延迟)
|
||||
setTimeout(() => {
|
||||
if (this.mapCtx) {
|
||||
try {
|
||||
this.mapCtx.includePoints({
|
||||
points: validPoints,
|
||||
padding: [120, 100, 100, 100]
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('第三次调整失败:', e);
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
fallbackAdjustMap(validPoints) {
|
||||
if (!validPoints || validPoints.length === 0) return;
|
||||
|
||||
try {
|
||||
// 计算所有点位的中心点和范围
|
||||
const lats = validPoints.map(p => p.latitude);
|
||||
const lngs = validPoints.map(p => p.longitude);
|
||||
|
||||
const minLat = Math.min(...lats);
|
||||
const maxLat = Math.max(...lats);
|
||||
const minLng = Math.min(...lngs);
|
||||
const maxLng = Math.max(...lngs);
|
||||
|
||||
// 计算中心点
|
||||
const centerLat = (minLat + maxLat) / 2;
|
||||
const centerLng = (minLng + maxLng) / 2;
|
||||
|
||||
// 计算合适的缩放级别
|
||||
const latDiff = maxLat - minLat;
|
||||
const lngDiff = maxLng - minLng;
|
||||
const maxDiff = Math.max(latDiff, lngDiff);
|
||||
|
||||
let scale = 13;
|
||||
if (maxDiff > 2) scale = 6;
|
||||
else if (maxDiff > 1) scale = 8;
|
||||
else if (maxDiff > 0.5) scale = 10;
|
||||
else if (maxDiff > 0.2) scale = 11;
|
||||
else if (maxDiff > 0.1) scale = 12;
|
||||
else scale = 13;
|
||||
|
||||
console.log('备用方案 - 中心点:', centerLat, centerLng, '缩放:', scale);
|
||||
|
||||
// 移动地图到计算出的中心位置
|
||||
this.mapCtx.moveToLocation({
|
||||
latitude: centerLat,
|
||||
longitude: centerLng,
|
||||
scale: scale
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('备用方案失败:', e);
|
||||
}
|
||||
},
|
||||
enterpriseRender() {
|
||||
for (let i = 0; i < this.cusLocationList.length; i++) {
|
||||
const item = this.cusLocationList[i];
|
||||
const lat = Number(item.stationLatitude);
|
||||
const lng = Number(item.stationLongitude);
|
||||
|
||||
// 验证坐标有效性
|
||||
if (isNaN(lat) || isNaN(lng) || lat === 0 || lng === 0) {
|
||||
console.warn('企业点位坐标无效:', item.stationName, lat, lng);
|
||||
continue;
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: item.id || `enterprise_${i}`,
|
||||
iconPath: '/static/qiyeIcon.png',
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
width: 35,
|
||||
height: 52,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false,
|
||||
zIndex: this.markersZIndex,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
},
|
||||
|
||||
stationRender() {
|
||||
if (!this.issscd) {
|
||||
for (let i = 0; i < this.stationList.length; i++) {
|
||||
const item = this.stationList[i];
|
||||
const lat = Number(item.stationLatitude);
|
||||
const lng = Number(item.stationLongitude);
|
||||
|
||||
// 验证坐标有效性
|
||||
if (isNaN(lat) || isNaN(lng) || lat === 0 || lng === 0) {
|
||||
console.warn('站房点位坐标无效:', item.stationName, lat, lng);
|
||||
continue;
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: item.id || `station_${i}`,
|
||||
iconPath: this.baseUrl + '/' + item.stationIcon,
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
width: 239,
|
||||
height: 186,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: item.stationType,
|
||||
stationName: item.stationName,
|
||||
stationCode: item.stationCode,
|
||||
joinCluster: false,
|
||||
zIndex: this.markersZIndex,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
monitorRender() {
|
||||
this.soilStationList.forEach((item, index) => {
|
||||
const lat = Number(item.latitude);
|
||||
const lng = Number(item.longitude);
|
||||
|
||||
// 验证坐标有效性
|
||||
if (isNaN(lat) || isNaN(lng) || lat === 0 || lng === 0) {
|
||||
console.warn('监测点位坐标无效:', item.name, lat, lng);
|
||||
return;
|
||||
}
|
||||
|
||||
let iconPath = '';
|
||||
let width = 35;
|
||||
let height = 35;
|
||||
|
||||
switch (item.type) {
|
||||
case 'soil':
|
||||
iconPath = this.baseUrl + '/icon/device/soil.png';
|
||||
width = 32;
|
||||
height = 47;
|
||||
break;
|
||||
case 'camera':
|
||||
iconPath = this.baseUrl + '/icon/device/cam.png';
|
||||
width = 45;
|
||||
height = 45;
|
||||
break;
|
||||
default:
|
||||
iconPath = this.baseUrl + '/icon/device/default.png';
|
||||
}
|
||||
|
||||
const markerItem = {
|
||||
id: item.id || `device_${index}`,
|
||||
iconPath: iconPath,
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
width: width,
|
||||
height: height,
|
||||
customCallout: {
|
||||
anchorY: 0,
|
||||
anchorX: 0,
|
||||
display: 'ALWAYS'
|
||||
},
|
||||
stationType: 'device',
|
||||
stationName: item.name,
|
||||
stationCode: item.ids,
|
||||
deviceType: item.type,
|
||||
joinCluster: false,
|
||||
zIndex: this.markersZIndex,
|
||||
};
|
||||
this.markers.push(markerItem);
|
||||
});
|
||||
},
|
||||
markertap(e) {
|
||||
const index = e.detail.markerId
|
||||
|
|
@ -241,69 +381,69 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
switch2Change(name) {// 焦点显示图例
|
||||
switch2Change(name) { // 焦点显示图例
|
||||
// 更新对应区域的状态
|
||||
//四种监测站:xuqin nongtian xiaoliuyu turang
|
||||
let that = this;
|
||||
if(name === that.lastTap){
|
||||
that.adjustMapToFitAllMarkers();
|
||||
that.lastTap = '';
|
||||
} else {
|
||||
// 聚焦到特定区域
|
||||
that.adjustMapToRegion(name);
|
||||
that.lastTap = name;
|
||||
// 或者使用更精确的方法:this.preciseMapAdjustment(name);
|
||||
let that = this;
|
||||
if (name === that.lastTap) {
|
||||
that.adjustMapToFitAllMarkers();
|
||||
that.lastTap = '';
|
||||
} else {
|
||||
// 聚焦到特定区域
|
||||
that.adjustMapToRegion(name);
|
||||
that.lastTap = name;
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
// 调整地图视野以包含所有标记点(类似setFitView效果)
|
||||
adjustMapToFitAllMarkers() {
|
||||
if (this.mapCtx && this.markers.length > 0) {
|
||||
this.mapCtx.includePoints({
|
||||
points: this.markers.map(item => ({
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude
|
||||
})),
|
||||
padding: [60, 60, 60, 60] // 上下左右的边距
|
||||
});
|
||||
}
|
||||
},
|
||||
adjustMapToRegion(regionName) {
|
||||
// 调整地图视野到特定区域的标记点
|
||||
//stationType: "orient" 农田
|
||||
//stationType: "livestock" 畜禽
|
||||
//stationType: "watershed" 小流域
|
||||
let that = this;
|
||||
let points = [];
|
||||
let markers = [];
|
||||
if (regionName === 'orient' || regionName === 'livestock' || regionName === 'watershed') {
|
||||
// 获取团柏河区域的所有标记点
|
||||
markers = this.markers.filter(item => item.stationType === regionName);
|
||||
} else if (regionName === 'soil') {
|
||||
// 获取所有土壤设备标记点
|
||||
markers = this.markers.filter(item => item.type === 'soil' || item.deviceType === 'soil');
|
||||
}
|
||||
console.log(this.markers)
|
||||
if (markers.length > 0) {
|
||||
points = markers.map(item => {
|
||||
item.zIndex = (that.markersZIndex++);
|
||||
return {
|
||||
latitude: Number(item.latitude || item.stationLatitude),
|
||||
longitude: Number(item.longitude || item.stationLongitude)
|
||||
}
|
||||
});
|
||||
}
|
||||
if (points.length > 0 && this.mapCtx) {
|
||||
this.mapCtx.includePoints({
|
||||
points: points,
|
||||
padding: [80, 110, 80, 110] // 增加边距以获得更好的显示效果
|
||||
});
|
||||
} else if (points.length === 0) {
|
||||
// 如果没有找到对应的标记点,显示提示
|
||||
// uni.showToast({
|
||||
// title: `未找到${regionName}相关的监测点`,
|
||||
// icon: 'none'
|
||||
// });
|
||||
}
|
||||
},
|
||||
// 调整地图视野以包含所有标记点(类似setFitView效果)
|
||||
adjustMapToFitAllMarkers() {
|
||||
if (this.mapCtx && this.markers.length > 0) {
|
||||
this.mapCtx.includePoints({
|
||||
points: this.markers.map(item => ({latitude: item.latitude, longitude: item.longitude})),
|
||||
padding: [60, 60, 60, 60] // 上下左右的边距
|
||||
});
|
||||
}
|
||||
},
|
||||
adjustMapToRegion(regionName) {
|
||||
// 调整地图视野到特定区域的标记点
|
||||
//stationType: "orient" 农田
|
||||
//stationType: "livestock" 畜禽
|
||||
//stationType: "watershed" 小流域
|
||||
let that = this;
|
||||
let points = [];
|
||||
let markers = [];
|
||||
that.markersZIndex ++;
|
||||
that.markersZIndex ++;
|
||||
if (regionName === 'orient' || regionName === 'livestock' || regionName === 'watershed') {
|
||||
// 获取团柏河区域的所有标记点
|
||||
markers = this.markers.filter(item => item.stationType === regionName);
|
||||
} else if (regionName === 'soil') {
|
||||
// 获取所有土壤设备标记点
|
||||
markers = this.markers.filter(item => item.type === 'soil' || item.deviceType === 'soil');
|
||||
}
|
||||
console.log(this.markers)
|
||||
if(markers.length > 0){
|
||||
points = markers.map(item => {
|
||||
item.zIndex = that.markersZIndex;
|
||||
return {
|
||||
latitude: Number(item.latitude || item.stationLatitude),
|
||||
longitude: Number(item.longitude || item.stationLongitude)
|
||||
}});
|
||||
}
|
||||
if (points.length > 0 && this.mapCtx) {
|
||||
this.mapCtx.includePoints({
|
||||
points: points,
|
||||
padding: [80, 110, 80, 110] // 增加边距以获得更好的显示效果
|
||||
});
|
||||
} else if (points.length === 0) {
|
||||
// 如果没有找到对应的标记点,显示提示
|
||||
// uni.showToast({
|
||||
// title: `未找到${regionName}相关的监测点`,
|
||||
// icon: 'none'
|
||||
// });
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<view class="boxitem_left">
|
||||
<image src="../../static/me_icon_shebei.png" mode=""></image>
|
||||
<view class="zl">
|
||||
站点运维
|
||||
运维记录
|
||||
</view>
|
||||
</view>
|
||||
<image src="../../static/me_icon_in.png" mode=""></image>
|
||||
|
|
|
|||
Loading…
Reference in New Issue