Compare commits

..

No commits in common. "jixian" and "main" have entirely different histories.
jixian ... main

36 changed files with 2370 additions and 1247 deletions

12
App.vue
View File

@ -190,12 +190,20 @@
}, },
onLoad() { onLoad() {
console.log('App onLoad!') if(!uni.getStorageSync('third_session')){
uni.reLaunch({
url:'/packDetail/pages/login/login'
})
}else{
uni.reLaunch({
url:'/pages/index/index'
})
}
}, },
onShow: function() { onShow: function() {
}, },
onHide: function() { onHide: function() {
console.log('App Hide1') console.log('App Hide')
} }
} }

View File

@ -1,6 +1,5 @@
import { http } from '@/common/service/service.js' import { http } from '@/common/service/service.js'
import configService from '@/common/service/config.service.js'; import configService from '@/common/service/config.service.js';
import indexData from "@/pages/index/indexData";
const apiService = { const apiService = {
/** /**
@ -38,55 +37,7 @@ const apiService = {
}else{ }else{
return configService.staticDomainURL + "/" + avatar; return configService.staticDomainURL + "/" + avatar;
} }
},
// 检查登录并执行api.checkLogin(()=>{}, () => {});
checkLogin(successCallback,failCallback){
let that = this;
if (uni.getStorageSync('userInfo') && uni.getStorageSync('third_session')) {
if(successCallback){
successCallback();
} }
} else {
uni.login({
success: function(res) {
let params = {}
params.jsCode = res.code
that.wxlogin(params).then(res => {
that.loginCallback(res, successCallback, failCallback);
})
}
});
}
},
loginCallback(res, successCallback, failCallback){
let that = this;
if (res.data.code == 0) {
let userInfo = res.data.data;
if (!userInfo.id) {
console.error('登录失败',userInfo)
that.loginFail();
if(failCallback){
failCallback();
}
} else {
console.warn('登录成功',userInfo)
uni.setStorageSync('userInfo', userInfo);
uni.setStorageSync('third_session', userInfo.thirdSession);
if(successCallback){
successCallback();
}
}
} else {
that.loginFail();
if(failCallback){
failCallback();
}
}
},
loginFail () {
uni.removeStorageSync('third_session')
uni.removeStorageSync('userInfo');
},
}; };
export default apiService; export default apiService;

View File

@ -22,12 +22,10 @@ let apiUrl = configService.apiUrl;
const http = new Request() const http = new Request()
http.setConfig((config) => { /* 设置全局配置 */ http.setConfig((config) => { /* 设置全局配置 */
config.baseUrl = apiUrl; /* 根域名不同 */ config.baseUrl = apiUrl /* 根域名不同 */
config.header = { config.header = {
...config.header ...config.header
}; }
console.log(config)
// config.headers['X-Access-Token'] = localStorage.getItem("token")
return config return config
}) })
@ -45,10 +43,9 @@ http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
config.header = { config.header = {
...config.header, ...config.header,
// 'X-Access-Token':getTokenStorage() // 'X-Access-Token':getTokenStorage()
'app-id' : uni.getAccountInfoSync().miniProgram.appId, 'app-id':uni.getAccountInfoSync().miniProgram.appId,
"client-type" : "MA", "client-type":"MA",
'third-session' : uni.getStorageSync('third_session')||'123', 'third-session':uni.getStorageSync('third_session')
'X-Tenant-Id' : '1002'
} }
/* /*
if (!token) { // 如果token不存在调用cancel 会取消本次请求但是该函数的catch() 仍会执行 if (!token) { // 如果token不存在调用cancel 会取消本次请求但是该函数的catch() 仍会执行

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name" : "吉县面源污染监测平台", "name" : "汾西小流域面源污染监测",
"appid" : "__UNI__A58A5D7", "appid" : "__UNI__44A8AB0",
"description" : "", "description" : "",
"versionName" : "2.2.22", "versionName" : "2.2.22",
"versionCode" : 233, "versionCode" : 233,
@ -84,7 +84,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxc078890f8668ed2e", "appid" : "wx54f76f700fe3a498",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"es6" : true, "es6" : true,

View File

@ -102,7 +102,7 @@
</view> </view>
<view class="jczb_bot"> <view class="jczb_bot">
<view> <view>
<view class="jccontent" v-if="orientlist && orientlist.length != 0"> <view class="jccontent" v-if="orientlist.length != 0">
<view class="titles"> <view class="titles">
重要污染物监测 重要污染物监测
</view> </view>
@ -120,7 +120,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="jccontent" v-if="livelist && livelist.length != 0"> <view class="jccontent" v-if="livelist.length != 0">
<view class="titles"> <view class="titles">
重要污染物监测 重要污染物监测
</view> </view>
@ -260,12 +260,14 @@
}, },
onLoad(options) { onLoad(options) {
this.item = JSON.parse(decodeURIComponent(options.item)); this.item = JSON.parse(decodeURIComponent(options.item));
console.log("...........",this.item)
uni.getSystemInfo({ uni.getSystemInfo({
success: res => { success: res => {
var pxToRpxScale = 750 / res.windowWidth var pxToRpxScale = 750 / res.windowWidth
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height this.scorllheight = this.height
} }
}); });
@ -304,7 +306,6 @@
let items = item.deployCode.split('-') let items = item.deployCode.split('-')
var obj = { var obj = {
url: "https://m.ilhzn.cn/#/pages/cameraView/ysyCamera", url: "https://m.ilhzn.cn/#/pages/cameraView/ysyCamera",
// url: "https://m.ilhzn.cn/#/pages/cameraView/cameraView",
deployDes: item.deployDes + '-' + '', deployDes: item.deployDes + '-' + '',
ysToken: this.token, ysToken: this.token,
deviceIotUrl: item.deviceUrl deviceIotUrl: item.deviceUrl
@ -326,6 +327,7 @@
}) })
}, },
tosjdetail(item,index){ tosjdetail(item,index){
console.log(item,'gegwg')
uni.navigateTo({ uni.navigateTo({
url:'/packDetail/pages/Site/sjdetail?item=' + encodeURIComponent(JSON.stringify(item)) + '&stationCode='+this.details.stationCode + '&stationName=' + this.details.stationName url:'/packDetail/pages/Site/sjdetail?item=' + encodeURIComponent(JSON.stringify(item)) + '&stationCode='+this.details.stationCode + '&stationName=' + this.details.stationName
}) })

View File

@ -8,8 +8,7 @@
<view class="list_item" v-for="(item,index) in List" :key="index" @click="todetail(item,index)"> <view class="list_item" v-for="(item,index) in List" :key="index" @click="todetail(item,index)">
<view class="list_item_top"> <view class="list_item_top">
<view class="list_item_left"> <view class="list_item_left">
<image v-if="item.stationType == 'livestock1'" src="../../static/zhandian_icon_xuqin.png" mode=""></image> <image v-if="item.stationType == 'livestock'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
<image v-else-if="item.stationType == 'watershed1'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
<image v-else src="../../static/zd.png" mode=""></image> <image v-else src="../../static/zd.png" mode=""></image>
<view class="item_right" v-if="item.stationName"> <view class="item_right" v-if="item.stationName">
<view class="right_top"> <view class="right_top">
@ -96,6 +95,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height this.scorllheight = this.height
} }
}); });
@ -143,20 +143,27 @@
this.List[i].survDataCount = (this.List[i].survDataCount /100000000).toFixed(1) + '亿' this.List[i].survDataCount = (this.List[i].survDataCount /100000000).toFixed(1) + '亿'
} }
} }
console.log(this.List,'35415')
if(res.data.data.total != 0){ if(res.data.data.total != 0){
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+''; this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
console.log(this.allNum,'总页数')
if(this.allNum.indexOf('.') == -1) { if(this.allNum.indexOf('.') == -1) {
this.allNum = this.allNum; this.allNum = this.allNum;
console.log(this.allNum,'if')
} else { } else {
this.allNum = parseInt(Number(this.allNum)+1); this.allNum = parseInt(Number(this.allNum)+1);
console.log(this.allNum,'else')
} }
console.log(this.pageNo,this.allNum,'156156')
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true','nomore')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;
@ -168,6 +175,7 @@
}) })
}, },
lower() { lower() {
console.log("最后一页了,取消下拉功能");
// //
if (this.isLastpage) { if (this.isLastpage) {
return return
@ -177,6 +185,7 @@
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
num = num+1; num = num+1;
},1000) },1000)
console.log(this.intervalId,num)
this.pageNo = this.pageNo + 1; this.pageNo = this.pageNo + 1;
let params = {} let params = {}
params.pageNo = this.pageNo params.pageNo = this.pageNo
@ -189,10 +198,12 @@
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;

View File

@ -1,12 +1,12 @@
<template> <template>
<view class="container"> <view class="container">
<uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar <uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar
:title="details.name"/> :title="details.name" />
<view class="contant" v-if="details.icon || details.name"> <view class="contant">
<view class="list_item"> <view class="list_item">
<view class="list_item_top"> <view class="list_item_top">
<view class="list_item_left"> <view class="list_item_left">
<image :src="baseUrl + '/' + details.icon" mode=""></image> <image :src="details.icon" mode=""></image>
<view class="item_right"> <view class="item_right">
<view class="right_top" v-if="details.name"> <view class="right_top" v-if="details.name">
监测指标-{{details.name}} 监测指标-{{details.name}}
@ -64,14 +64,12 @@
<script> <script>
import uniEcCanvas from '../../components/uni-ec-canvas/uni-ec-canvas.vue' import uniEcCanvas from '../../components/uni-ec-canvas/uni-ec-canvas.vue'
import * as echarts from '../../components/uni-ec-canvas/echarts.js' import * as echarts from '../../components/uni-ec-canvas/echarts.js'
import configService from "@/common/service/config.service";
export default { export default {
components: { components: {
uniEcCanvas, uniEcCanvas,
}, },
data() { data() {
return { return {
baseUrl:configService.staticDomainURL,
items: {}, items: {},
details: {}, details: {},
list: [], list: [],
@ -132,6 +130,8 @@
value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2), value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2),
dataDateTime:data[i].dataDateTime dataDateTime:data[i].dataDateTime
}) })
console.log(data[i].codelist, '数据')
console.log(data, '数据全部')
} }
} }
} }
@ -139,19 +139,26 @@
} }
// this.list = data // this.list = data
this.list = this.list.concat(data) this.list = this.list.concat(data)
// console.log(this.list, 'all')
if(res.data.data.total != 0){ if(res.data.data.total != 0){
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+''; this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
console.log(this.allNum,'总页数')
if(this.allNum.indexOf('.') == -1) { if(this.allNum.indexOf('.') == -1) {
this.allNum = this.allNum; this.allNum = this.allNum;
console.log(this.allNum,'if')
} else { } else {
this.allNum = parseInt(Number(this.allNum)+1); this.allNum = parseInt(Number(this.allNum)+1);
console.log(this.allNum,'else')
} }
console.log(this.pageNo,this.allNum,'156156')
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true','nomore')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;
@ -160,6 +167,7 @@
}) })
}, },
lower() { lower() {
console.log("最后一页了,取消下拉功能");
// //
if (this.isLastpage) { if (this.isLastpage) {
return return
@ -169,6 +177,7 @@
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
num = num+1; num = num+1;
},1000) },1000)
console.log(this.intervalId,num)
this.pageNo = this.pageNo + 1; this.pageNo = this.pageNo + 1;
let params = {} let params = {}
params.pollutionCode = this.details.code params.pollutionCode = this.details.code
@ -190,6 +199,8 @@
value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2), value: (Math.floor(Object.values(data[i])[k] * 100) / 100).toFixed(2),
dataDateTime:data[i].dataDateTime dataDateTime:data[i].dataDateTime
}) })
console.log(data[i].codelist, '数据')
console.log(data, '数据全部')
} }
} }
} }
@ -201,10 +212,12 @@
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;

View File

@ -40,11 +40,11 @@
</picker> </picker>
</view> </view>
</view> </view>
<!-- 年月日选择器 --> <!-- 在template部分找到年月日选择器部分修改为以下代码 -->
<view class="uni-form-item uni-column"> <view class="uni-form-item uni-column">
<radio-group class="radio-group" @change="radioChange"> <radio-group class="radio-group" @change="radioChange">
<label class="radio-label" v-for="(item, index) in timList" :key="item.value" :class="{ 'checked': current === index }"> <label class="radio-label" v-for="(item, index) in timList" :key="item.value">
<radio :value="item.value" :checked="index === current" class="radio-item" color="#0f6efe" /> <radio :value="item.value" :checked="index === current" class="radio-item" />
<view class="radio-text">{{item.name}}</view> <view class="radio-text">{{item.name}}</view>
</label> </label>
</radio-group> </radio-group>
@ -126,19 +126,16 @@
height: 0, height: 0,
scorllheight: 0, scorllheight: 0,
zt: '', zt: '',
date: new Date().getFullYear().toString(), date: new Date().getFullYear(),
array: [], array: [],
index: 0, index: '',
index1: 0, index1: '',
array1: [], array1: [],
arrays: [], arrays: [],
list: [], list: [],
tabList: ['站点名称', '告警指标', '指标值', '告警时间'], tabList: ['站点名称', '告警指标', '指标值', '告警时间'],
pjlist: [], pjlist: [],
chartData: { chartData: {},
categories: [],
series: []
},
opts: { opts: {
color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"], color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
padding: [15,10,0,15], padding: [15,10,0,15],
@ -147,8 +144,9 @@
enableScroll: false, enableScroll: false,
legend: {}, legend: {},
xAxis: { xAxis: {
disabled: false, disabled: false, // X
gridType: 'dash', // itemCount
gridType: 'dash', //
dashLength: 2, dashLength: 2,
}, },
yAxis: { yAxis: {
@ -178,8 +176,8 @@
allNum: '', allNum: '',
isLastpage: '', isLastpage: '',
intervalId: null, intervalId: null,
loadStatus: 'more', loadStatus: 'more', //more-loading-nomore-
isLoadMore: false, isLoadMore: false, //
show: false, show: false,
show1: false, show1: false,
top: 0, top: 0,
@ -192,7 +190,8 @@
zxtdata: [], zxtdata: [],
timList: [{ timList: [{
value: 'yearMonth', value: 'yearMonth',
name: '年' name: '年',
checked: 'true'
}, },
{ {
value: 'monthDays', value: 'monthDays',
@ -204,11 +203,9 @@
}, },
], ],
current: 0, current: 0,
dateqs: new Date().getFullYear().toString(), dateqs:new Date().getFullYear(),
datetwo: currentDate, datetwo:currentDate,
riqinumber: 'yearMonth', riqinumber:'yearMonth',
startDate: '2000-01-01',
endDate: '2030-12-31'
} }
}, },
onLoad() { onLoad() {
@ -217,7 +214,7 @@
var pxToRpxScale = 750 / res.windowWidth var pxToRpxScale = 750 / res.windowWidth
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale this.height = res.windowHeight * pxToRpxScale //px rpx
this.scorllheight = this.height this.scorllheight = this.height
} }
}); });
@ -227,14 +224,10 @@
this.importWyw() this.importWyw()
this.getazsurvMulchRecord() this.getazsurvMulchRecord()
this.getyjList() this.getyjList()
// this.gettj()
this.qushicov()
}, },
methods: { methods: {
//
cutMoneyFiter(val) {
if (!val && val !== 0) return 0
return val
},
//
importWyw() { importWyw() {
this.array = [] this.array = []
this.arrays = [] this.arrays = []
@ -254,22 +247,12 @@
}) })
this.array.push(res.data.data[i].stationName) this.array.push(res.data.data[i].stationName)
} }
//
if (this.array.length > 0) {
this.stationCode = this.arrays[0]?.value || ''
//
setTimeout(() => {
this.qushicov()
}, 300)
}
}).catch(err => {
console.log('获取站点列表失败', err)
}) })
}, },
// //
getazsurvMulchRecord() { getazsurvMulchRecord() {
this.arrays = [] this.arrays = []
this.array1 = ['全部监测设备'] this.array1 = ['全部监测设备', ]
this.arrays1 = [{ this.arrays1 = [{
label: '全部监测设备', label: '全部监测设备',
value: '' value: ''
@ -286,8 +269,6 @@
}) })
this.array1.push(res.data.data[i].fullDeviceName) this.array1.push(res.data.data[i].fullDeviceName)
} }
}).catch(err => {
console.log('获取设备列表失败', err)
}) })
}, },
// //
@ -314,18 +295,11 @@
data[i].shi = data[i].times[3]; data[i].shi = data[i].times[3];
data[i].fen = data[i].times[4]; data[i].fen = data[i].times[4];
data[i].miao = data[i].times[5]; data[i].miao = data[i].times[5];
data[i].datetime = data[i].yue + '-' + data[i].ri + ' ' + data[i].shi + ':' + data[i].fen data[i].datetime = data[i].yue + '-' + data[i].ri + ' ' + data[i].shi + ':' + data[i]
if (data[i].alertContent && data[i].alertContent.indexOf('监测数据名称:') != -1) { .fen
if (data[i].alertContent.indexOf('监测数据名称:') != -1) {
data[i].alertContent = data[i].alertContent.replace('监测数据名称:', '') data[i].alertContent = data[i].alertContent.replace('监测数据名称:', '')
} }
// alertContent
if (typeof data[i].alertContent === 'string') {
data[i].alertContent = [{
name: '告警',
val: data[i].alertContent,
unit: ''
}]
}
} }
this.list = this.list.concat(data) this.list = this.list.concat(data)
this.total = res.data.data.total this.total = res.data.data.total
@ -341,6 +315,7 @@
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
} }
} else { } else {
@ -350,13 +325,11 @@
} }
uni.hideLoading(); uni.hideLoading();
this.isRefresher = false this.isRefresher = false
}).catch(err => {
uni.hideLoading();
console.log('获取预警列表失败', err)
}) })
}, },
// //
lower() { lower() {
//
if (this.isLastpage) { if (this.isLastpage) {
return return
} }
@ -384,17 +357,11 @@
data[i].shi = data[i].times[3]; data[i].shi = data[i].times[3];
data[i].fen = data[i].times[4]; data[i].fen = data[i].times[4];
data[i].miao = data[i].times[5]; data[i].miao = data[i].times[5];
data[i].datetime = data[i].yue + '-' + data[i].ri + ' ' + data[i].shi + ':' + data[i].fen data[i].datetime = data[i].yue + '-' + data[i].ri + ' ' + data[i].shi + ':' + data[i]
if (data[i].alertContent && data[i].alertContent.indexOf('监测数据名称:') != -1) { .fen
if (data[i].alertContent.indexOf('监测数据名称:') != -1) {
data[i].alertContent = data[i].alertContent.replace('监测数据名称:', '') data[i].alertContent = data[i].alertContent.replace('监测数据名称:', '')
} }
if (typeof data[i].alertContent === 'string') {
data[i].alertContent = [{
name: '告警',
val: data[i].alertContent,
unit: ''
}]
}
} }
this.list = this.list.concat(data) this.list = this.list.concat(data)
if (res.data.data.total != 0) { if (res.data.data.total != 0) {
@ -403,6 +370,7 @@
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
} }
} else { } else {
@ -410,8 +378,6 @@
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
} }
} }
}).catch(err => {
console.log('加载更多预警失败', err)
}) })
}, },
// //
@ -424,129 +390,94 @@
this.pjnr = data[i].detailValue this.pjnr = data[i].detailValue
} }
} }
}).catch(err => {
console.log('获取评价失败', err)
}) })
}, },
// //
radioChange(e) { radioChange(e){
this.riqinumber = e.detail.value this.riqinumber = e.detail.value
// this.bindDateqsChange(this.datetwo,'twotime')
this.timList.forEach((item, index) => {
if (item.value === e.detail.value) {
this.current = index
}
})
//
let currentDate = new Date()
let year = currentDate.getFullYear()
let month = String(currentDate.getMonth() + 1).padStart(2, '0')
let day = String(currentDate.getDate()).padStart(2, '0')
if (this.riqinumber === 'yearMonth') {
this.dateqs = String(year)
} else if (this.riqinumber === 'monthDays') {
this.dateqs = year + '-' + month
} else {
this.dateqs = year + '-' + month + '-' + day
}
this.qushicov()
}, },
// //
bindDateqsChange(e) { bindDateqsChange(e,tiem) {
let selectedDate = e.detail.value if (tiem=='twotime') {
if (this.riqinumber === 'yearMonth') { let selectedDate = e
this.dateqs = selectedDate.slice(0, 4) if (this.riqinumber === 'monthDays') {
} else if (this.riqinumber === 'monthDays') { this.dateqs = selectedDate.slice(0, 7); // YYYY-MM
this.dateqs = selectedDate.slice(0, 7) } else if (this.riqinumber === 'yearMonth') {
this.dateqs = selectedDate.slice(0, 4); // YYYY
} else { } else {
this.dateqs = selectedDate this.dateqs = selectedDate; // YYYY-MM-DD
} }
this.qushicov() } else {
let selectedDate = e.detail.value;
if (this.riqinumber === 'monthDays') {
this.dateqs = selectedDate.slice(0, 7); // YYYY-MM
} else if (this.riqinumber === 'yearMonth') {
this.dateqs = selectedDate.slice(0, 4); // YYYY
} else {
this.dateqs = selectedDate; // YYYY-MM-DD
}
}
this.qushicov();
}, },
// //
qushicov() { qushicov() {
// 使
if (!this.stationCode) {
console.log('站点编码为空,使用默认站点')
if (this.arrays.length > 0) {
this.stationCode = this.arrays[0].value
} else {
//
setTimeout(() => {
if (this.arrays.length > 0) {
this.stationCode = this.arrays[0].value
this.qushicov()
}
}, 500)
return
}
}
let data = { let data = {
summrayMode: this.riqinumber, summrayMode: this.riqinumber,
startTime: this.dateqs, startTime: this.dateqs,
stationCode: this.stationCode, stationCode:this.stationCode,
} }
console.log('请求趋势数据参数:', data)
this.$http.post('/applet/survDeviceDeploy/waterIntegrateStatistic', data).then(iem => { this.$http.post('/applet/survDeviceDeploy/waterIntegrateStatistic', data).then(iem => {
let lynum = iem.data.data let lynum = iem.data.data
console.log('趋势数据返回:', lynum)
//
if (!lynum || !lynum.tableHead || !lynum.tableData2 || lynum.tableHead.length === 0) {
console.log('趋势数据为空')
this.chartData = {
categories: [],
series: []
}
return
}
setTimeout(() => { setTimeout(() => {
let categories = [] let categories = [];
let displayCategories = [] let displayCategories = []; // X
let series = [] let series = [];
let allValues = [] let allValues = []; //
// X if (lynum.tableHead && lynum.tableHead.length > 0) {
categories = lynum.tableIndex || [] categories = lynum.tableIndex;
// X
if (categories.length > 0) { if (categories.length > 0) {
const first = categories[0] const first = categories[0];
const middle = categories[Math.floor(categories.length / 2)] const middle = categories[Math.floor(categories.length / 2)];
const last = categories[categories.length - 1] const last = categories[categories.length - 3];
// categories
displayCategories = categories.map((item, index) => { displayCategories = categories.map((item, index) => {
if (index === 0 || index === Math.floor(categories.length / 2) || index === categories.length - 1) { if (index === 0 || index === Math.floor(categories.length / 2) || index === categories.length - 2) {
return item return item;
} }
return '' return '';
}) });
} }
// series
lynum.tableHead.forEach((header, index) => { lynum.tableHead.forEach((header, index) => {
const seriesData = (lynum.tableData2 || []).map(row => { const seriesData = lynum.tableData2.map(row => {
const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0 const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0;
allValues.push(value) allValues.push(value); //
return value return value;
}) });
series.push({ series.push({
name: header.eleDesc || header.name || '指标', name: header.eleDesc,
data: seriesData data: seriesData
}) });
}) });
// Y // Y
if (allValues.length > 0) { const maxValue = Math.max(...allValues);
const maxValue = Math.max(...allValues) const minValue = Math.min(...allValues);
const minValue = Math.min(...allValues)
const padding = maxValue * 0.1 || 10
const yAxisMax = maxValue + padding
const yAxisMin = Math.max(0, minValue - padding)
//
const padding = maxValue * 0.1; // 10%
const yAxisMax = maxValue + padding;
const yAxisMin = Math.max(0, minValue - padding); // 0
// optsyAxis
this.opts = { this.opts = {
...this.opts, ...this.opts,
yAxis: { yAxis: {
@ -555,47 +486,239 @@
data: [ data: [
{ {
min: yAxisMin, min: yAxisMin,
max: yAxisMax || 100 max: yAxisMax
} }
] ]
} }
} };
} }
this.chartData = { let res = {
categories: displayCategories, categories: displayCategories, // 使
series: series series: series
};
this.chartData = JSON.parse(JSON.stringify(res));
}, 500);
})
},
// 线
gettj() {
if (!this.stationCode) {
this.stationCode = 'S_1'
} }
console.log('图表数据:', this.chartData) this.$http.post('/applet/wxclient/getPplutionSummry?stationCode=' + this.stationCode).then(res => {
}, 300) this.zxtdata = res.data.data[0]
}).catch(err => { this.ec.option.legend.data = ['总磷', '总氮', '硝态氮']
console.log('趋势数据请求失败', err) this.ec.option.color = ['#19D58A', '#FFC53B', '#3BA0FF']
this.chartData = { this.ec.option.series = [{
categories: [], name: '总磷',
series: [] type: 'line',
stack: 'Total1',
areaStyle: { //
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(25, 213, 138, 1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 255, 255, 1)' // 100%
}],
global: false // false
}
},
emphasis: {
focus: 'series'
},
data: this.zxtdata.TPSummry
},
{
name: '总氮',
type: 'line',
stack: 'Total2',
areaStyle: { //
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(255, 197, 59, 1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 255, 255, 1)' // 100%
}],
global: false // false
}
},
emphasis: {
focus: 'series'
},
data: this.zxtdata.TNSummry
},
{
name: '硝态氮',
type: 'line',
stack: 'Total3',
areaStyle: { //
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(59, 160, 255, 1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 255, 255, 1)' // 100%
}],
global: false // false
}
},
emphasis: {
focus: 'series'
},
data: this.zxtdata.NOSummry
},
]
if (this.array[this.index].indexOf('畜禽') != -1) {
this.ec.option.legend.data = ['总磷', '总氮', 'COD', '氨氮']
this.ec.option.color = ['#19D58A', '#FFC53B', '#3BA0FF', '#FF3B3B']
this.ec.option.series = [{
name: '总磷',
type: 'line',
stack: 'Total1',
areaStyle: { //
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(25, 213, 138, 1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 255, 255, 1)' // 100%
}],
global: false // false
}
},
emphasis: {
focus: 'series'
},
data: this.zxtdata.TPSummry
},
{
name: '总氮',
type: 'line',
stack: 'Total2',
areaStyle: { //
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(255, 197, 59, 1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 255, 255, 1)' // 100%
}],
global: false // false
}
},
emphasis: {
focus: 'series'
},
data: this.zxtdata.TNSummry
},
{
name: 'COD',
type: 'line',
stack: 'Total3',
areaStyle: { //
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(59, 160, 255, 1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 255, 255, 1)' // 100%
}],
global: false // false
}
},
emphasis: {
focus: 'series'
},
data: this.zxtdata.CODSummry
},
{
name: '氨氮',
type: 'line',
stack: 'Total4',
areaStyle: { //
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(255, 59, 59, 1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 255, 255, 1)' // 100%
}],
global: false // false
}
},
emphasis: {
focus: 'series'
},
data: this.zxtdata.NHSummry
},
]
} }
}) })
}, },
// 线 // 线
bindPickerChange: function(e) { bindPickerChange: function(e) {
this.index = e.detail.value this.index = e.detail.value
let stationName = this.array[this.index] this.stationName = this.array[this.index]
for (var i = 0; i < this.arrays.length; i++) { for (var i = 0; i < this.arrays.length; i++) {
if (stationName == this.arrays[i].label) { if (this.stationName == this.arrays[i].label) {
this.stationCode = this.arrays[i].value this.stationCode = this.arrays[i].value
break
} }
} }
// this.gettj()
this.qushicov() this.qushicov()
}, },
// //
bindPickerChange1: function(e) { bindPickerChange1: function(e) {
this.index1 = e.detail.value this.index1 = e.detail.value
this.stationName1 = this.array1[this.index1] this.stationName1 = this.array1[this.index1]
for (var i = 0; i < this.arrays1.length; i++) { for (var i = 0; i < this.arrays.length; i++) {
if (this.stationName1 == this.arrays1[i].label) { if (this.stationName1 == this.arrays1[i].label) {
this.stationCode1 = this.arrays1[i].value this.stationCode1 = this.arrays1[i].value
break
} }
} }
if (this.stationName1 == '全部监测设备') { if (this.stationName1 == '全部监测设备') {
@ -616,6 +739,7 @@
let year = date.getFullYear(); let year = date.getFullYear();
let month = date.getMonth() + 1; let month = date.getMonth() + 1;
let day = date.getDate(); let day = date.getDate();
if (type === 'start') { if (type === 'start') {
year = year - 10; year = year - 10;
} else if (type === 'end') { } else if (type === 'end') {
@ -631,10 +755,12 @@
<style lang="scss"> <style lang="scss">
page { page {
// height: 100%;
background-color: #0f6efe; background-color: #0f6efe;
} }
.container { .container {
// height: 100%;
padding: 0 32rpx; padding: 0 32rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: scroll; overflow-y: scroll;
@ -670,6 +796,7 @@
} }
.ybecharts image { .ybecharts image {
// position: absolute;
width: 90%; width: 90%;
height: 100%; height: 100%;
} }
@ -882,18 +1009,21 @@
.tabitem:first-child { .tabitem:first-child {
width: 31%; width: 31%;
// text-align: center
} }
.tabitem:nth-child(2) { .tabitem:nth-child(2) {
width: 27%; width: 27%;
// text-align: center
} }
.tabitem:nth-child(3) { .tabitem:nth-child(3) {
width: 19%; width: 19%;
// text-align: center
} }
.tabitem:nth-child(4) { .tabitem:nth-child(4) {
flex: 1 flex: 1 // text-align: center
} }
.scroll-Y { .scroll-Y {
@ -953,6 +1083,10 @@
} }
} }
// .lists_item:first-child {
// padding-top: 0;
// }
.jczbs { .jczbs {
width: 32%; width: 32%;
font-size: 24rpx; font-size: 24rpx;
@ -962,6 +1096,7 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
// text-align: center
} }
.zbz { .zbz {
@ -973,6 +1108,7 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
// text-align: center
} }
.sbsj { .sbsj {
@ -981,6 +1117,8 @@
font-weight: 400; font-weight: 400;
color: #667482; color: #667482;
flex: 1; flex: 1;
// text-align: center
// text-align: right;
} }
.szqss { .szqss {
@ -996,9 +1134,12 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
// text-align: center
} }
.load { .load {
// height: 50rpx;
// line-height: 50rpx;
text-align: center; text-align: center;
color: #c6c6c6; color: #c6c6c6;
} }
@ -1006,13 +1147,14 @@
.pagebot { .pagebot {
height: 100rpx; height: 100rpx;
} }
// //
.radio-group { .radio-group {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
// margin: 20rpx 32rpx 0;
border-radius: 20rpx; border-radius: 20rpx;
padding: 8rpx; padding: 8rpx;
// width: 60%;
.radio-label { .radio-label {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1027,6 +1169,7 @@
background: rgba(15, 110, 254, 0.1); background: rgba(15, 110, 254, 0.1);
} }
//
&.checked { &.checked {
background: #0f6efe; background: #0f6efe;
@ -1040,6 +1183,7 @@
transform: scale(0.8); transform: scale(0.8);
margin-right: 8rpx; margin-right: 8rpx;
//
&[checked] { &[checked] {
color: #ffffff; color: #ffffff;
} }

View File

@ -178,6 +178,7 @@
text:res.data.data[i].itemText, text:res.data.data[i].itemText,
value:res.data.data[i].itemValue value:res.data.data[i].itemValue
}) })
console.log(this.hobby)
} }
}) })
}, },
@ -206,6 +207,7 @@
text:res.data.data[i].itemText, text:res.data.data[i].itemText,
value:res.data.data[i].itemValue value:res.data.data[i].itemValue
}) })
console.log(this.hobby3)
} }
}) })
}, },
@ -215,14 +217,17 @@
}, },
// //
change1(e){ change1(e){
console.log(e)
this.details.breedVariety = e.detail.value this.details.breedVariety = e.detail.value
}, },
// //
change2(e){ change2(e){
console.log(e)
this.details.controlMode = e.detail.value this.details.controlMode = e.detail.value
}, },
// //
change3(e){ change3(e){
console.log(e)
this.details.useMode = e.detail.value this.details.useMode = e.detail.value
}, },
// //

View File

@ -119,6 +119,7 @@
text:res.data.data[i].itemText, text:res.data.data[i].itemText,
value:res.data.data[i].itemValue value:res.data.data[i].itemValue
}) })
console.log(this.hobby)
} }
}) })
}, },
@ -154,6 +155,7 @@
text:res.data.data[i].itemText, text:res.data.data[i].itemText,
value:res.data.data[i].itemValue value:res.data.data[i].itemValue
}) })
console.log(this.hobby3)
} }
for(var i=0;i<this.hobby3.length;i++){ for(var i=0;i<this.hobby3.length;i++){
if(this.details.useMode){ if(this.details.useMode){

View File

@ -179,6 +179,7 @@
text:res.data.data[i].itemText, text:res.data.data[i].itemText,
value:res.data.data[i].itemValue value:res.data.data[i].itemValue
}) })
console.log(this.hobby)
} }
}) })
}, },
@ -207,6 +208,7 @@
text:res.data.data[i].itemText, text:res.data.data[i].itemText,
value:res.data.data[i].itemValue value:res.data.data[i].itemValue
}) })
console.log(this.hobby3)
} }
}) })
}, },
@ -216,14 +218,17 @@
}, },
// //
change1(e){ change1(e){
console.log(e)
this.details.breedVariety = e.detail.value this.details.breedVariety = e.detail.value
}, },
// //
change2(e){ change2(e){
console.log(e)
this.details.controlMode = e.detail.value this.details.controlMode = e.detail.value
}, },
// //
change3(e){ change3(e){
console.log(e)
this.details.useMode = e.detail.value this.details.useMode = e.detail.value
}, },
// //

View File

@ -129,6 +129,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height - 182 this.scorllheight = this.height - 182
} }
}); });
@ -141,12 +142,14 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height - 182 this.scorllheight = this.height - 182
} }
}); });
let pages = getCurrentPages(); let pages = getCurrentPages();
let currPage = pages[pages.length - 1]; // let currPage = pages[pages.length - 1]; //
this.reload = currPage.data.reload this.reload = currPage.data.reload
console.log(this.reload,'Ge')
if(this.reload){ if(this.reload){
this.farmName = '' this.farmName = ''
this.breedVariety = '' this.breedVariety = ''
@ -172,6 +175,7 @@
value:res.data.data[i].itemValue value:res.data.data[i].itemValue
}) })
this.array.push(res.data.data[i].itemText) this.array.push(res.data.data[i].itemText)
console.log(this.array)
} }
}) })
}, },
@ -206,18 +210,24 @@
this.List = this.List.concat(data) this.List = this.List.concat(data)
if(res.data.data.total != 0){ if(res.data.data.total != 0){
this.allNum = Number(res.data.data.total)/Number(this.pageSize)+''; this.allNum = Number(res.data.data.total)/Number(this.pageSize)+'';
console.log(this.allNum,'总页数')
if(this.allNum.indexOf('.') == -1) { if(this.allNum.indexOf('.') == -1) {
this.allNum = this.allNum; this.allNum = this.allNum;
console.log(this.allNum,'if')
} else { } else {
this.allNum = parseInt(Number(this.allNum)+1); this.allNum = parseInt(Number(this.allNum)+1);
console.log(this.allNum,'else')
} }
console.log(this.pageNo,this.allNum,'156156')
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true','nomore')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;
@ -230,6 +240,7 @@
}, },
// //
lower() { lower() {
console.log("最后一页了,取消下拉功能");
// //
if (this.isLastpage) { if (this.isLastpage) {
return return
@ -239,6 +250,7 @@
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
num = num+1; num = num+1;
},1000) },1000)
console.log(this.intervalId,num)
this.pageNo = this.pageNo + 1; this.pageNo = this.pageNo + 1;
let params = {} let params = {}
params.pageNo = this.pageNo params.pageNo = this.pageNo
@ -254,10 +266,12 @@
if(this.pageNo == this.allNum) { if(this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus='nomore' this.loadStatus='nomore'
console.log(this.isLastpage,'true')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage,'false')
} }
}else{ }else{
this.isLastpage = true; this.isLastpage = true;
@ -267,6 +281,7 @@
}) })
}, },
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.index = e.detail.value this.index = e.detail.value
this.breedVariety = this.arrays[this.index].value this.breedVariety = this.arrays[this.index].value
this.breedVariety1 = this.arrays[this.index].text this.breedVariety1 = this.arrays[this.index].text
@ -297,10 +312,12 @@
}, },
// //
caozuo(item){ caozuo(item){
console.log(item)
var that = this var that = this
uni.showActionSheet({ uni.showActionSheet({
itemList: ['编辑', '删除'], itemList: ['编辑', '删除'],
success: function (res) { success: function (res) {
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
if((res.tapIndex + 1) == 1){ if((res.tapIndex + 1) == 1){
uni.navigateTo({ uni.navigateTo({
url:'/packDetail/pages/fwtz/edit?item='+ encodeURIComponent(JSON.stringify(item)) url:'/packDetail/pages/fwtz/edit?item='+ encodeURIComponent(JSON.stringify(item))
@ -311,6 +328,8 @@
content: '是否删除数据?', content: '是否删除数据?',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定');
console.log(item.id,1)
that.$http.delete(that.deleteUrl+'?id='+item.id).then(res =>{ that.$http.delete(that.deleteUrl+'?id='+item.id).then(res =>{
if(res.data.code == 0){ if(res.data.code == 0){
uni.showToast({ uni.showToast({

View File

@ -35,7 +35,7 @@
</view> </view>
</view> </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"> <!-- <view class="loginpage">
<image class="bigimg" src="../../static/dls.jpg" mode=""></image> <image class="bigimg" src="../../static/dls.jpg" mode=""></image>
<view class="padding text-center margin-top"> <view class="padding text-center margin-top">
@ -80,7 +80,7 @@ export default {
thirdLoginInfo: "", thirdLoginInfo: "",
thirdLoginState: false, thirdLoginState: false,
bindingPhoneModal: false, bindingPhoneModal: false,
login: true, login: false,
thirdUserUuid: '', thirdUserUuid: '',
url: { url: {
bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone' bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone'
@ -100,20 +100,26 @@ export default {
var that = this var that = this
uni.login({ uni.login({
success: function (res) { success: function (res) {
console.log(res.code)
that.code = res.code that.code = res.code
let params = {} let params = {}
params.jsCode = that.code params.jsCode = that.code
console.log(params, 152)
api.wxlogin(params).then(res => { api.wxlogin(params).then(res => {
console.log(res, 165)
if (res.data.code == 0) {
let userInfo = res.data.data; let userInfo = res.data.data;
uni.setStorageSync('third_session', userInfo.thirdSession); uni.setStorageSync('third_session', userInfo.thirdSession);
// api.loginCallback(res, ()=>{ console.log(that.login, '状态')
// that.login = false if (userInfo.id) {
// uni.reLaunch({ that.login = false
// url: '/pages/index/index' uni.reLaunch({
// }) url: '/pages/index/index'
// }, ()=>{ })
// that.login = true } else if (!userInfo.id) {
// }); that.login = true
}
}
}) })
} }
}); });
@ -144,6 +150,7 @@ export default {
}) })
}, },
TypeInput(e) { TypeInput(e) {
console.log(e, 415)
// ; // ;
const inputType = /[\W]/g // const inputType = /[\W]/g //
this.$nextTick(function () { this.$nextTick(function () {
@ -151,6 +158,7 @@ export default {
}) })
}, },
tologins() { tologins() {
console.log(this.userInfoLoginDTO.password, this.userInfoLoginDTO.userName, '密码用户')
if (!this.userInfoLoginDTO.userName) { if (!this.userInfoLoginDTO.userName) {
uni.showToast({ uni.showToast({
title: '请输入账号', title: '请输入账号',
@ -168,21 +176,23 @@ export default {
return return
} }
this.$http.post('/applet/userInfo/logins', this.userInfoLoginDTO).then(res => { this.$http.post('/applet/userInfo/logins', this.userInfoLoginDTO).then(res => {
api.loginCallback(res, ()=>{ if (res.data.code == 0) {
uni.setStorageSync('constant', res.data.data) uni.setStorageSync('constant', res.data.data)
uni.setStorageSync('password', this.userInfoLoginDTO.password) uni.setStorageSync('password', this.userInfoLoginDTO.password)
uni.setStorageSync('userName', this.userInfoLoginDTO.userName) uni.setStorageSync('userName', this.userInfoLoginDTO.userName)
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}) })
}, ()=>{ } else {
uni.removeStorageSync('constant') uni.removeStorageSync('constant')
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
}); // this.userInfoLoginDTO.password = ''
// this.userInfoLoginDTO.userName = ''
}
}) })
} }
} }

View File

@ -167,6 +167,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height - 120 this.scorllheight = this.height - 120
} }
}); });
@ -198,17 +199,21 @@
this.$set(item, 'checked', true) this.$set(item, 'checked', true)
}) })
this.checkList = this.alllist this.checkList = this.alllist
console.log(this.checkList,156)
} }
}, },
checkSelectItem(e, item) { checkSelectItem(e, item) {
console.log(item,156)
// checkedfalse,checked=true // checkedfalse,checked=true
if (item.checked == true) { if (item.checked == true) {
this.$set(item, 'checked', false) this.$set(item, 'checked', false)
this.checkList = this.checkList.filter(items => (items.value !== item.value)) this.checkList = this.checkList.filter(items => (items.value !== item.value))
console.log(this.checkList,'true')
} else { } else {
this.$set(item, 'checked', true) this.$set(item, 'checked', true)
this.checkList.push(item) this.checkList.push(item)
console.log(this.checkList,'false')
} }
// checkedtruealllist // checkedtruealllist
let newArr = this.alllist.filter(item => (item.checked == true)) let newArr = this.alllist.filter(item => (item.checked == true))
@ -217,6 +222,7 @@
} else { } else {
this.checkTrue = false; this.checkTrue = false;
} }
console.log(this.checkList,41561456)
}, },
submit(){ submit(){
uni.navigateBack({ uni.navigateBack({

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<!-- 顶部选项卡 --> <!-- 顶部选项卡 -->
<!-- <view class="topScroll"> <view class="topScroll">
<scroll-view scroll-x="true" class="scroll"> <scroll-view scroll-x="true" class="scroll">
<view class="scroll-item" v-for="(item,index) in topItems" :key="index" @click="chooseClick(item,index)" <view class="scroll-item" v-for="(item,index) in topItems" :key="index" @click="chooseClick(item,index)"
:class="{'scroll-item2':isActive == index}"> :class="{'scroll-item2':isActive == index}">
@ -10,7 +10,7 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> --> </view>
<!-- 监测站告警 --> <!-- 监测站告警 -->
<block v-if="isActive == 0"> <block v-if="isActive == 0">
@ -135,13 +135,12 @@
arrays: [], arrays: [],
isRefresher: false, // isRefresher: false, //
reload: '', reload: '',
topItems: [ topItems: [{
// { dictLabel: '监测站告警'
// dictLabel: '' },
// }, {
// { dictLabel: '异常趋势图'
// dictLabel: '' }
// }
], ],
value: 0, value: 0,
rangeList: [], rangeList: [],
@ -939,8 +938,8 @@
.zwsj { .zwsj {
height: calc(100vh - 100rpx); height: calc(100vh - 100rpx);
display: flex; display: flex;
// align-items: center; align-items: center;
// justify-content: center; justify-content: center;
} }
.inzwsj { .inzwsj {
@ -948,8 +947,8 @@
} }
.zwsjimg { .zwsjimg {
width: 100%; width: 200rpx;
height: 240rpx; height: 200rpx;
} }
.zwsjtext { .zwsjtext {

View File

@ -66,6 +66,7 @@
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
this.contentheight = this.height - ktxStatusHeight - navigationHeight - 150 this.contentheight = this.height - ktxStatusHeight - navigationHeight - 150
console.log(this.contentheight,123132)
} }
}); });
}, },
@ -104,6 +105,7 @@
}); });
}, },
radioChange(value){ radioChange(value){
console.log(value)
this.constant.sex = value.detail.value this.constant.sex = value.detail.value
}, },
submit() { submit() {

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="container"> <view class="container">
<uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar :title="item.deployDes"/> <uni-nav-bar :fixed="true" left-icon="left" background-color="#0F6EFF" @clickLeft="back()" status-bar :title="item.stationName"/>
<view class="liebiaos"> <view class="liebiaos">
<view class="list_item"> <view class="list_item">
<view class="list_item_top"> <view class="list_item_top">
@ -128,6 +128,7 @@
} }
}, },
onLoad(options) { onLoad(options) {
console.log(JSON.parse(decodeURIComponent(options.item)))
this.item = JSON.parse(decodeURIComponent(options.item)); this.item = JSON.parse(decodeURIComponent(options.item));
}, },
onShow() { onShow() {

View File

@ -85,6 +85,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height this.scorllheight = this.height
} }
}); });
@ -101,22 +102,8 @@
this.$http.get('/applet/survStationInfo/deviceList'), this.$http.get('/applet/survStationInfo/deviceList'),
this.$http.get('/applet/survStationInfo/fdeviceList') this.$http.get('/applet/survStationInfo/fdeviceList')
]).then(([res1, res2]) => { ]).then(([res1, res2]) => {
const data1 = res1?.data?.data || []; //
this.list = res1.data.data.concat(res2.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(); uni.hideLoading();
}).catch(error => { }).catch(error => {
console.error('请求失败:', error); console.error('请求失败:', error);

View File

@ -9,7 +9,7 @@
<image v-if="it[0].stationType == 'livestock'" src="../../static/zhandian_icon_xuqin.png" mode=""></image> <image v-if="it[0].stationType == 'livestock'" src="../../static/zhandian_icon_xuqin.png" mode=""></image>
<view class="item_right"> <view class="item_right">
<view class="right_top"> <view class="right_top">
{{it[0].stationName?it[0].stationName:'无设备信息'}} {{it[0].stationName}}
</view> </view>
<view class="right_bot"> <view class="right_bot">
<image src="../../static/shebei_icon_shebei.png" mode=""></image> <image src="../../static/shebei_icon_shebei.png" mode=""></image>
@ -84,6 +84,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height this.scorllheight = this.height
} }
}); });
@ -100,6 +101,7 @@
}) })
}, },
todetail(item,index){ todetail(item,index){
console.log(item,12)
uni.navigateTo({ uni.navigateTo({
url:'/packDetail/pages/vidio/detail?item=' + encodeURIComponent(JSON.stringify(item)) url:'/packDetail/pages/vidio/detail?item=' + encodeURIComponent(JSON.stringify(item))
}) })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View File

@ -23,7 +23,7 @@
</view> </view>
</view> --> </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>
</view> </view>
</template> </template>
@ -112,6 +112,6 @@
left: 50%; left: 50%;
transform: translate(-50%); transform: translate(-50%);
color: #999; color: #999;
width: 60%; width: 52%;
} }
</style> </style>

View File

@ -11,7 +11,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="bot_box" :class="{'single-item': item.depUrlArr && item.depUrlArr.length === 1}"> <view class="bot_box">
<view class="bot_left" v-for="(it,i) in item.depUrlArr" :key="i" @click="todetail(it,i,item)"> <view class="bot_left" v-for="(it,i) in item.depUrlArr" :key="i" @click="todetail(it,i,item)">
<view class="botleft_bot"> <view class="botleft_bot">
<view class=""> <view class="">
@ -71,6 +71,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale //px rpx this.height = res.windowHeight * pxToRpxScale //px rpx
console.log(this.height, ktxStatusHeight, navigationHeight)
this.scorllheight = this.height this.scorllheight = this.height
} }
}); });
@ -84,6 +85,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale //px rpx this.height = res.windowHeight * pxToRpxScale //px rpx
console.log(this.height, ktxStatusHeight, navigationHeight)
this.scorllheight = this.height this.scorllheight = this.height
} }
}); });
@ -110,18 +112,24 @@
this.List = this.List.concat(data) this.List = this.List.concat(data)
if (data.length != 0) { if (data.length != 0) {
this.allNum = Number(data.length) / Number(this.pageSize) + ''; this.allNum = Number(data.length) / Number(this.pageSize) + '';
console.log(this.allNum, '总页数')
if (this.allNum.indexOf('.') == -1) { if (this.allNum.indexOf('.') == -1) {
this.allNum = this.allNum; this.allNum = this.allNum;
console.log(this.allNum, 'if')
} else { } else {
this.allNum = parseInt(Number(this.allNum) + 1); this.allNum = parseInt(Number(this.allNum) + 1);
console.log(this.allNum, 'else')
} }
console.log(this.pageNo, this.allNum, '156156')
if (this.pageNo == this.allNum) { if (this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
console.log(this.isLastpage, 'true', 'nomore')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage, 'false')
} }
} else { } else {
this.isLastpage = true; this.isLastpage = true;
@ -133,6 +141,7 @@
}) })
}, },
lower() { lower() {
console.log("最后一页了,取消下拉功能");
// //
if (this.isLastpage) { if (this.isLastpage) {
return return
@ -142,6 +151,7 @@
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
num = num + 1; num = num + 1;
}, 1000) }, 1000)
console.log(this.intervalId, num)
this.pageNo = this.pageNo + 1; this.pageNo = this.pageNo + 1;
let params = {} let params = {}
params.pageNo = this.pageNo params.pageNo = this.pageNo
@ -156,10 +166,12 @@
if (this.pageNo == this.allNum) { if (this.pageNo == this.allNum) {
this.isLastpage = true; this.isLastpage = true;
this.loadStatus = 'nomore' this.loadStatus = 'nomore'
console.log(this.isLastpage, 'true')
} else { } else {
this.isLastpage = false; this.isLastpage = false;
// this.isLoadMore=true // this.isLoadMore=true
this.loadStatus = 'more' this.loadStatus = 'more'
console.log(this.isLastpage, 'false')
} }
} else { } else {
this.isLastpage = true; this.isLastpage = true;
@ -222,7 +234,6 @@
font-size: 28rpx; font-size: 28rpx;
padding: 20rpx 0; padding: 20rpx 0;
color: #8b95ea; color: #8b95ea;
margin-top: 20rpx;
} }
.top_box { .top_box {
@ -242,21 +253,6 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
/* 当只有一个子元素时的样式优化 */
.bot_box.single-item {
justify-content: center;
}
.bot_box.single-item .bot_left {
width: 100%;
height: 370rpx;
}
.bot_box.single-item .bot_left .botleft_top {
width: 100%;
height: 300rpx;
}
.bot_left { .bot_left {
width: 48%; width: 48%;
border: 4rpx solid #f0f0f0; border: 4rpx solid #f0f0f0;

View File

@ -2326,6 +2326,7 @@
uni.sendSocketMessage({ uni.sendSocketMessage({
data: JSON.stringify(param) data: JSON.stringify(param)
}); });
console.log('websocket发送给服务端的消息:', param);
socketTask.close({ socketTask.close({
code: 1000, code: 1000,
success: (res) => { success: (res) => {
@ -2336,6 +2337,7 @@
// push // push
pusherStateChange: function (e) { pusherStateChange: function (e) {
console.log('>>> live-pusher onPushStateChange:', e.detail.code);
const code = e.detail.code; const code = e.detail.code;
let content = ''; let content = '';
switch (code) { switch (code) {
@ -2438,11 +2440,13 @@
}, },
stopPush() { stopPush() {
console.log('停止推流');
this.pushVideoContext.stop(); this.pushVideoContext.stop();
this.pushVideo=false this.pushVideo=false
}, },
startPush() { startPush() {
console.log('开始推流,推流地址为:', this.pushUrl);
uni.showToast({ uni.showToast({
title: '开始推流,推流地址为:' title: '开始推流,推流地址为:'
}); });
@ -2454,6 +2458,7 @@
}, },
error(e) { error(e) {
console.log('live-player', e);
console.error('live-player error:', e.detail.errMsg); console.error('live-player error:', e.detail.errMsg);
if (e.detail.errCode == 10001) { if (e.detail.errCode == 10001) {
uni.showToast({ uni.showToast({

View File

@ -34,13 +34,19 @@
var player = null; var player = null;
export default { export default {
created() { created() {
console.log(1111111111111111111111)
// this.initPlayer() // this.initPlayer()
}, },
mounted() { mounted() {
console.log('mounted...');
if (typeof window.EZUIKit !== 'undefined') { if (typeof window.EZUIKit !== 'undefined') {
console.log('defined EZUIKit...');
this.initPlayer(); this.initPlayer();
} else { } else {
console.log('undefined EZUIKit...');
// //
const script = document.createElement('script') const script = document.createElement('script')
// view www www // view www www
@ -56,6 +62,7 @@
windowWidth, windowWidth,
windowHeight windowHeight
} = uni.getSystemInfoSync(); } = uni.getSystemInfoSync();
console.log('initPlayer...');
return return
fetch('https://zy.sxzooh.com/zh-api/applet/ysyun/getYsToken') fetch('https://zy.sxzooh.com/zh-api/applet/ysyun/getYsToken')
// .then(response => response.json()) // .then(response => response.json())

View File

@ -226,8 +226,10 @@ export default {
}, },
onLoad: function (options) { onLoad: function (options) {
livePlayerContext = uni.createLivePlayerContext('livePlayer'); livePlayerContext = uni.createLivePlayerContext('livePlayer');
console.log('获取参数', options);
// //
const currentPage = getCurrentPages(); const currentPage = getCurrentPages();
console.log(currentPage.nv_length);
// url // url
const { accessToken, deviceSerial, channelNo, date, switch1Checked } = options; const { accessToken, deviceSerial, channelNo, date, switch1Checked } = options;
@ -236,6 +238,7 @@ export default {
this.deviceSerial=deviceSerial, this.deviceSerial=deviceSerial,
this.channelNo=channelNo, this.channelNo=channelNo,
this.page=currentPage.nv_length this.page=currentPage.nv_length
console.log(date);
// //
if (date) { if (date) {
this.date=date, this.date=date,
@ -258,8 +261,10 @@ export default {
*/ */
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
const { accessToken, deviceSerial, channelNo, date, switch1Checked } = this; const { accessToken, deviceSerial, channelNo, date, switch1Checked } = this;
console.log(switch1Checked);
if (res.from === 'button') { if (res.from === 'button') {
// //
console.log(res.target);
this.panelStatus=0 this.panelStatus=0
} }
return { return {
@ -293,6 +298,7 @@ export default {
// //
switch1Change: function (e) { switch1Change: function (e) {
console.log('当前存储类型', e.detail);
if (e.detail.value == false) { if (e.detail.value == false) {
this.switchText='云存储', this.switchText='云存储',
this.switch1Checked=false, this.switch1Checked=false,
@ -321,8 +327,10 @@ export default {
// //
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
console.log('当前操作系统:', res.system);
const sys = res.system; const sys = res.system;
type = sys.split(' '); type = sys.split(' ');
console.log(type);
if (type[0] == 'iOS') { if (type[0] == 'iOS') {
that.toDay=date.replace(/\-/g, '/') that.toDay=date.replace(/\-/g, '/')
} else { } else {
@ -343,6 +351,7 @@ export default {
// //
getTimeLine: function () { getTimeLine: function () {
const { recType, date, accessToken, deviceSerial, channelNo, timelineTimer, currentTimer } = this; const { recType, date, accessToken, deviceSerial, channelNo, timelineTimer, currentTimer } = this;
console.log('获取到的accessToken, accessToken', accessToken);
var that = this; var that = this;
let currentDate = null; let currentDate = null;
let timestampCurrent = null; let timestampCurrent = null;
@ -372,6 +381,7 @@ export default {
}, },
success: (res) => { success: (res) => {
console.log('获取播放时间片段', res.data);
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data != null) { if (res.data.data != null) {
var result = res.data.data; var result = res.data.data;
@ -398,6 +408,7 @@ export default {
et: et et: et
}); });
} }
console.log('availArr:', availArr);
this.dateLine=availArr this.dateLine=availArr
} else { } else {
this.dialogNodataTitle='暂无数据', this.dialogNodataTitle='暂无数据',
@ -436,6 +447,7 @@ export default {
let stTime = e.detail.stTime; let stTime = e.detail.stTime;
let etTime = e.detail.etTime; let etTime = e.detail.etTime;
const { type, date, accessToken, deviceSerial, channelNo, videoSrc } = this; const { type, date, accessToken, deviceSerial, channelNo, videoSrc } = this;
console.log('当前播放时间', stTime, etTime);
let startTime = null; let startTime = null;
let stopTime = null; let stopTime = null;
startTime = date + ' ' + stTime; startTime = date + ' ' + stTime;
@ -469,6 +481,7 @@ export default {
}, },
success: (res) => { success: (res) => {
console.log('获取到的播放地址:', res.data);
if (res.data.code == '200' && res.data.data && res.data.data.url) { if (res.data.code == '200' && res.data.data && res.data.data.url) {
const playUrl = res.data.data.url; const playUrl = res.data.data.url;
this.videoSrc=playUrl this.videoSrc=playUrl
@ -476,6 +489,7 @@ export default {
this.handleStop(); this.handleStop();
// //
this.handlePlay(); this.handlePlay();
console.log('当前播放地址:', this.videoSrc);
} else if (res.data.code == '20007') { } else if (res.data.code == '20007') {
debugger; debugger;
this.dialogTitle='获取播放地址失败', this.dialogTitle='获取播放地址失败',
@ -505,6 +519,7 @@ export default {
this.dialogTitle='获取播放地址失败', this.dialogTitle='获取播放地址失败',
this.dialogContent=res.data.msg, this.dialogContent=res.data.msg,
this.dialogShow=true this.dialogShow=true
console.log('获取rtmp播放地址失败');
} }
} }
}); });
@ -534,6 +549,7 @@ export default {
_this.fullScreen=true _this.fullScreen=true
} }
}); });
console.log('开启全屏');
}, },
unfullScreen() { unfullScreen() {
@ -543,6 +559,7 @@ export default {
_this.fullScreen=false _this.fullScreen=false
} }
}); });
console.log('开启全屏');
}, },
ToggleObjectFit() { ToggleObjectFit() {
@ -559,6 +576,7 @@ export default {
}, },
handlePlay(callback) { handlePlay(callback) {
console.log('handelPlay', this.playVideo, this.isHD);
this.checkNetWork(); this.checkNetWork();
livePlayerContext.play({ livePlayerContext.play({
success: () => { success: () => {
@ -576,6 +594,7 @@ export default {
title: '网络异常', title: '网络异常',
icon: 'none' icon: 'none'
}); });
console.log('开始播放失败');
this.videoNetWorkError=true this.videoNetWorkError=true
this.showVideoControls=false this.showVideoControls=false
this.videoLoadingStatus=100 this.videoLoadingStatus=100
@ -584,6 +603,7 @@ export default {
}, },
handleStop(callback) { handleStop(callback) {
console.log('stop');
const { list } = this; const { list } = this;
livePlayerContext.stop({ livePlayerContext.stop({
success: () => { success: () => {
@ -602,6 +622,7 @@ export default {
}, },
autoHideControl() { autoHideControl() {
console.log('showHdSelect', this.showHDSelect);
const _this = this; const _this = this;
clearTimeout(this.autoHideTimer); clearTimeout(this.autoHideTimer);
this.autoHideTimer = setTimeout(() => { this.autoHideTimer = setTimeout(() => {
@ -619,6 +640,7 @@ export default {
handleHD(e) { handleHD(e) {
var showHDSelect = this.showHDSelect; var showHDSelect = this.showHDSelect;
console.log('handleHD', showHDSelect);
this.showHDSelect=!showHDSelect this.showHDSelect=!showHDSelect
}, },
@ -636,6 +658,7 @@ export default {
}, },
statechange(e) { statechange(e) {
console.log('live-player code:', e.detail.code, e.detail);
const { code } = e.detail; const { code } = e.detail;
let { videoLoadingStatus, list, panelStatus } = this; let { videoLoadingStatus, list, panelStatus } = this;
switch (code) { switch (code) {
@ -703,6 +726,7 @@ export default {
}, },
error(e) { error(e) {
console.log('live-player', e);
console.error('live-player error:', e.detail.errMsg); console.error('live-player error:', e.detail.errMsg);
if (e.detail.errCode == 10001) { if (e.detail.errCode == 10001) {
uni.showToast({ uni.showToast({
@ -714,6 +738,7 @@ export default {
}, },
onVideoTap(e) { onVideoTap(e) {
console.log('点击视频');
const { deviceOffline, showVideoControls, panelStatus, videoNetWorkError } = this; const { deviceOffline, showVideoControls, panelStatus, videoNetWorkError } = this;
if (deviceOffline || panelStatus === 4 || videoNetWorkError) { if (deviceOffline || panelStatus === 4 || videoNetWorkError) {
return false; return false;
@ -730,8 +755,10 @@ export default {
screenShoot(e) { screenShoot(e) {
const { playVideo, videoLoadingStatus } = this; const { playVideo, videoLoadingStatus } = this;
if (!playVideo || videoLoadingStatus != 100) { if (!playVideo || videoLoadingStatus != 100) {
console.log('非播放状态下点击截图');
return false; return false;
} }
console.log('开始截图');
// livePlayerContext.snapshot('raw'); // livePlayerContext.snapshot('raw');
let that = this; let that = this;
uni.getSetting({ uni.getSetting({
@ -759,10 +786,13 @@ export default {
livePlayerContext livePlayerContext
.snapshot('raw') .snapshot('raw')
.then((data) => { .then((data) => {
console.log('data', data);
if (data) { if (data) {
console.log(data);
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
filePath: data.tempImagePath, filePath: data.tempImagePath,
success(res) { success(res) {
console.log('保存成功', res);
uni.showToast({ uni.showToast({
title: '截图已保存至手机相册', title: '截图已保存至手机相册',
icon: 'none' icon: 'none'
@ -820,6 +850,7 @@ export default {
// //
bindDateChange: function (e) { bindDateChange: function (e) {
console.log('picker发送选择改变携带值为', e.detail.value);
this.date=e.detail.value this.date=e.detail.value
this.getTimeLine(); this.getTimeLine();
}, },

View File

@ -167,6 +167,7 @@
var ktxStatusHeight = res.statusBarHeight * pxToRpxScale var ktxStatusHeight = res.statusBarHeight * pxToRpxScale
var navigationHeight = 44 * pxToRpxScale var navigationHeight = 44 * pxToRpxScale
this.height = res.windowHeight * pxToRpxScale//px rpx this.height = res.windowHeight * pxToRpxScale//px rpx
console.log(this.height,ktxStatusHeight,navigationHeight)
this.scorllheight = this.height - 120 this.scorllheight = this.height - 120
} }
}); });
@ -198,17 +199,21 @@
this.$set(item, 'checked', true) this.$set(item, 'checked', true)
}) })
this.checkList = this.alllist this.checkList = this.alllist
console.log(this.checkList,156)
} }
}, },
checkSelectItem(e, item) { checkSelectItem(e, item) {
console.log(item,156)
// checkedfalse,checked=true // checkedfalse,checked=true
if (item.checked == true) { if (item.checked == true) {
this.$set(item, 'checked', false) this.$set(item, 'checked', false)
this.checkList = this.checkList.filter(items => (items.value !== item.value)) this.checkList = this.checkList.filter(items => (items.value !== item.value))
console.log(this.checkList,'true')
} else { } else {
this.$set(item, 'checked', true) this.$set(item, 'checked', true)
this.checkList.push(item) this.checkList.push(item)
console.log(this.checkList,'false')
} }
// checkedtruealllist // checkedtruealllist
let newArr = this.alllist.filter(item => (item.checked == true)) let newArr = this.alllist.filter(item => (item.checked == true))
@ -217,6 +222,7 @@
} else { } else {
this.checkTrue = false; this.checkTrue = false;
} }
console.log(this.checkList,41561456)
}, },
submit(){ submit(){
uni.navigateBack({ uni.navigateBack({

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{ {
"name": "FenXiNspUniapp", "name": "HJApplet",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {

View File

@ -4,7 +4,7 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "吉县小流域面源污染监测", "navigationBarTitleText": "汾西小流域面源污染监测",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
@ -156,7 +156,7 @@
{ {
"path": "pages/operations/index", "path": "pages/operations/index",
"style": { "style": {
"navigationBarTitleText": "运维记录", "navigationBarTitleText": "站点运维",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor":"#0F6EFF" "navigationBarBackgroundColor":"#0F6EFF"
} }
@ -164,7 +164,7 @@
{ {
"path": "pages/operations/detail", "path": "pages/operations/detail",
"style": { "style": {
"navigationBarTitleText": "运维记录详情", "navigationBarTitleText": "站点运维详情",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor":"#0F6EFF" "navigationBarBackgroundColor":"#0F6EFF"
} }
@ -172,7 +172,7 @@
{ {
"path": "pages/operations/add", "path": "pages/operations/add",
"style": { "style": {
"navigationBarTitleText": "新增运维记录", "navigationBarTitleText": "新增站点运维",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor":"#0F6EFF" "navigationBarBackgroundColor":"#0F6EFF"
} }
@ -180,7 +180,7 @@
{ {
"path": "pages/operations/edit", "path": "pages/operations/edit",
"style": { "style": {
"navigationBarTitleText": "编辑运维记录", "navigationBarTitleText": "编辑站点运维",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor":"#0F6EFF" "navigationBarBackgroundColor":"#0F6EFF"
} }
@ -196,7 +196,7 @@
{ {
"path": "pages/analysis/index", "path": "pages/analysis/index",
"style": { "style": {
"navigationBarTitleText": "监测数据统计分析", "navigationBarTitleText": "统计分析",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor":"#0F6EFF" "navigationBarBackgroundColor":"#0F6EFF"
} }
@ -212,7 +212,7 @@
{ {
"path": "pages/sjdyj/index", "path": "pages/sjdyj/index",
"style": { "style": {
"navigationBarTitleText": "智能预警", "navigationBarTitleText": "预警信息",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor":"#0F6EFF" "navigationBarBackgroundColor":"#0F6EFF"
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,449 +0,0 @@
const indexData = {
bigswiperList : [{
"id": "1692474977070829569",
"infoId": "1692474921957675010",
"detailCode": "图1",
"detailValue": "图",
"detailValue2": "1",
"propsValue1": null,
"propsValue2": null,
"detailPics": "temp/20230818174636_1692352452041.jpg",
"detailExtPics": null,
"detailNote": null,
"isShow": "1",
"sortNo": 1,
"tenantId": null,
"reVision": 0,
"createdBy": "hjadmin",
"createTime": "2023-08-18 17:54:14",
"updatedBy": null,
"isDel": 0,
"updatedTime": null
}, {
"id": "1692475023417888770",
"infoId": "1692474921957675010",
"detailCode": "图2",
"detailValue": "图",
"detailValue2": "2",
"propsValue1": null,
"propsValue2": null,
"detailPics": "temp/20230818174638_1692352462933.png",
"detailExtPics": null,
"detailNote": null,
"isShow": "1",
"sortNo": 1,
"tenantId": null,
"reVision": 0,
"createdBy": "hjadmin",
"createTime": "2023-08-18 17:54:25",
"updatedBy": null,
"isDel": 0,
"updatedTime": null
}],
wrwlist : [{
"unit": "℃",
"code": "dataAirTemp",
"color": "#22BB8A",
"icon": "sys/icon/shebei_icon_qixiang.png",
"description": "大气温度"
}, {
"unit": "%RH",
"code": "dataAirWet",
"color": "#EE701C",
"icon": "sys/icon/zhandian_icon_kongqishidu.png",
"description": "大气湿度"
}, {
"unit": "hPa",
"code": "dataAirPress",
"color": "#52AC2A",
"icon": "sys/icon/zhandian_icon_daqiyali.png",
"description": "大气压力"
}, {
"unit": "mm",
"code": "dataRainFall",
"color": "#2BADB9",
"icon": "sys/icon/zhandian_icon_jiangyuliang.png",
"description": "雨量"
}, {
"unit": "mm",
"code": "dataRainTotal",
"color": "#102B6A",
"icon": "sys/icon/zhandian_icon_jiangyuliang.png",
"description": "雨量累计"
}, {
"unit": "m/s",
"code": "dataWindSpeed",
"color": "#7CD6CF",
"icon": "sys/icon/zhandian_icon_fengsu.png",
"description": "风速"
}, {
"unit": "°",
"code": "dataWindDirection",
"color": "#26A3CC",
"icon": "sys/icon/zhandian_icon_fengxiang.png",
"description": "风向"
}, {
"unit": "MJ/m2",
"code": "dataSunTotal",
"color": "#6C48C7",
"icon": "sys/icon/zhandian_icon_taiyangquanfushe.png",
"description": "辐射累计"
}, {
"unit": "W/m2",
"code": "dataSunFallout",
"color": "#22BB8A",
"icon": "sys/icon/zhandian_icon_taiyangquanfushe.png",
"description": "太阳全辐射"
}, {
"unit": "%",
"code": "dataSoilWet",
"color": "#6495ED",
"icon": "sys/icon/zhandian_icon_turangshidu.png",
"description": "20CM土壤湿度"
}, {
"unit": "%",
"code": "dataSoilWet2",
"color": "#4169E1",
"icon": "sys/icon/zhandian_icon_turangshidu.png",
"description": "40CM土壤湿度"
}, {
"unit": "%",
"code": "dataSoilWet3",
"color": "#0000CD",
"icon": "sys/icon/zhandian_icon_turangshidu.png",
"description": "60CM土壤湿度"
}, {
"unit": "℃",
"code": "dataSoilTemp",
"color": "#C71585",
"icon": "sys/icon/zhandian_icon_turangwendu.png",
"description": "20CM土壤温度"
}, {
"unit": "℃",
"code": "dataSoilTemp2",
"color": "#FF1493",
"icon": "sys/icon/zhandian_icon_turangwendu.png",
"description": "40CM土壤温度"
}, {
"unit": "℃",
"code": "dataSoilTemp3",
"color": "#FF69B4",
"icon": "sys/icon/zhandian_icon_turangwendu.png",
"description": "60CM土壤温度"
}, {
"unit": "uS/cm",
"code": "dataSoilDdl",
"color": "#92D0D0",
"icon": "sys/icon/zhandian_icon_ec.png",
"description": "20CM电导率"
}, {
"unit": "uS/cm",
"code": "dataSoilDdl2",
"color": "#73A2A2",
"icon": "sys/icon/zhandian_icon_ec.png",
"description": "40CM电导率"
}, {
"unit": "uS/cm",
"code": "dataSoilDdl3",
"color": "#567777",
"icon": "sys/icon/zhandian_icon_ec.png",
"description": "60CM电导率"
}, {
"unit": "",
"code": "dataSoilSalt",
"color": "#4F5555",
"icon": "sys/icon/zhandian_icon_ec.png",
"description": "土壤盐分"
}, {
"unit": "%",
"code": "dataSoilWetMark",
"color": "#6495ED",
"icon": "sys/icon/zhandian_icon_turangshidu.png",
"description": "土壤湿度"
}, {
"unit": "℃",
"code": "dataSoilMark",
"color": "#C71585",
"icon": "sys/icon/zhandian_icon_turangwendu.png",
"description": "土壤温度"
}, {
"unit": "uS/cm",
"code": "dataSoilDdlMark",
"color": "#92D0D0",
"icon": "sys/icon/zhandian_icon_ec.png",
"description": "电导率"
}, {
"unit": "mg/L",
"code": "dataWaterTp",
"color": "#C8CC00",
"icon": "sys/icon/shebei_icon_tp.png",
"description": "总磷"
}, {
"unit": "mg/L",
"code": "dataWaterTn",
"color": "#009DB2",
"icon": "sys/icon/shebei_icon_tn.png",
"description": "总氮"
}, {
"unit": "mg/L",
"code": "dataWaterNo",
"color": "#72BAA7",
"icon": "sys/icon/shebei_icon_no3n.png",
"description": "硝态氮"
}, {
"unit": "mg/L",
"code": "dataWaterNh",
"color": "#225A1F",
"icon": "sys/icon/shebei_icon_nh3n.png",
"description": "氨氮"
}, {
"unit": "mg/L",
"code": "dataWaterCod",
"color": "#FDB933",
"icon": "sys/icon/shebei_icon_cod.png",
"description": "化学需氧量"
}, {
"unit": "mg/m³",
"code": "dataOu",
"color": "#f47a75",
"icon": "sys/icon/zhandian_icon_ou.png",
"description": "臭气浓度"
}, {
"unit": "mg/m³",
"code": "dataNh3",
"color": "#d05c7c",
"icon": "sys/icon/zhandian_icon_nh3.png",
"description": "氨气"
}, {
"unit": "mg/m³",
"code": "dataH2s",
"color": "#d05c9f",
"icon": "sys/icon/zhandian_icon_h2s.png",
"description": "硫化氢"
}, {
"unit": "mg/m³",
"code": "dataTvoc",
"color": "#f06464",
"icon": "sys/icon/zhandian_icon_tvoc.png",
"description": "总挥发性有机物"
}, {
"unit": "台",
"code": "default",
"color": "#DEAB8A",
"icon": "",
"description": "默认"
}],
list : [{
"name": "总氮",
"unit": "mg/L",
"value": "2.0000",
"color": "#009DB2",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:23",
"stationName": "小流域监测站1#站",
"stationCode": "S_1",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "总磷",
"unit": "mg/L",
"value": "1.0061",
"color": "#C8CC00",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:23",
"stationName": "小流域监测站1#站",
"stationCode": "S_1",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "硝态氮",
"unit": "mg/L",
"value": "5.2110",
"color": "#72BAA7",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:23",
"stationName": "小流域监测站1#站",
"stationCode": "S_1",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "总氮",
"unit": "mg/L",
"value": "2.1114",
"color": "#009DB2",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:50",
"stationName": "小流域监测站1#站",
"stationCode": "S_2",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "总磷",
"unit": "mg/L",
"value": "0.9864",
"color": "#C8CC00",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:50",
"stationName": "小流域监测站1#站",
"stationCode": "S_2",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "硝态氮",
"unit": "mg/L",
"value": "1.2373",
"color": "#72BAA7",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:50",
"stationName": "小流域监测站1#站",
"stationCode": "S_2",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "总氮",
"unit": "mg/L",
"value": "49.6451",
"color": "#009DB2",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:36",
"stationName": "畜禽1号站",
"stationCode": "S_3",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "总磷",
"unit": "mg/L",
"value": "10.1785",
"color": "#C8CC00",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:36",
"stationName": "畜禽1号站",
"stationCode": "S_3",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "氨氮",
"unit": "mg/L",
"value": "49.9502",
"color": "#225A1F",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:36",
"stationName": "畜禽1号站",
"stationCode": "S_3",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "化学需氧量",
"unit": "mg/L",
"value": "501.5000",
"color": "#FDB933",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:33:36",
"stationName": "畜禽1号站",
"stationCode": "S_3",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "总氮",
"unit": "mg/L",
"value": "50.6921",
"color": "#009DB2",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:00:00",
"stationName": "畜禽2号站",
"stationCode": "S_4",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "总磷",
"unit": "mg/L",
"value": "0.2719",
"color": "#C8CC00",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:00:00",
"stationName": "畜禽2号站",
"stationCode": "S_4",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "氨氮",
"unit": "mg/L",
"value": "48.9038",
"color": "#225A1F",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:00:00",
"stationName": "畜禽2号站",
"stationCode": "S_4",
"stationType": null,
"dataCounts": 1045510
}, {
"name": "化学需氧量",
"unit": "mg/L",
"value": "498.3486",
"color": "#FDB933",
"trend": null,
"survItem": null,
"dataDateTime": "2025-05-23 19:00:00",
"stationName": "畜禽2号站",
"stationCode": "S_4",
"stationType": null,
"dataCounts": 1045510
}],
menu: [
{
name: '监测站点',
img: require('../../static/home_icon_jiance.png'),
path: '/packDetail/pages/Site/index'
}, {
name: '智能预警',
img: require('../../static/scd.png'),
path: '/packDetail/pages/sjdyj/index'
},
{
name: '视频监控',
img: require('../../static/home_icon_shipin.png'),
path: '/packDetail1/pages/device/index'
},
{
name: '运维记录',
img: require('../../static/home_icon_yunwei.png'),
path: '/packDetail/pages/operations/index'
},
{
name: '农业废弃物',
img: require('../../static/home_icon_feiqiwu.png'),
path: '/packDetail/pages/waste/index'
},
{
name: '粪污台账',
img: require('../../static/home_icon_fenwu.png'),
path: '/packDetail/pages/fwtz/index'
},
{
name: '设备管理',
img: require('../../static/home_icon_shebei.png'),
path: '/packDetail/pages/vidio/index'
},
{
name: '统计分析',
img: require('../../static/home_icon_shuju.png'),
path: '/packDetail/pages/analysis/index'
},
]
};
export default indexData;

View File

@ -0,0 +1,457 @@
<template>
<view class="container">
<map id="map" ref="map" style="width: 100%; height:2000rpx;" scale="13" :markers="markers" longitude="111.436625"
latitude="36.771975" show-location @markertap="markertap" @callouttap="callouttap">
</map>
<view class="zdxq">
<view class="zdxqitem" @click="switch2Change('团柏河')">
<image src="../../static/zhandian_nongtian_dingwei.png" mode=""></image>
<view class="textss">
团柏河典型小流域监测站
</view>
<!-- <view class="crildon" :style="!issscd?'background:#00ff37':'background: #ccc;'"></view> -->
</view>
<view class="zdxqitem" @click="switch2Change('对竹河')">
<image src="../../static/zhandian_xuqin_dingwei.png" mode=""></image>
<view class="textss">
对竹河典型小流域监测站
</view>
<!-- <view class="crildon" :style="!isssscd?'background:#00ff37':'background: #ccc;'"></view> -->
</view>
<view class="zdxqitem" @click="switch2Change('土壤')">
<image src="../../static/iconsheturangzs.png" mode=""></image>
<view class="textss">
土壤监测
</view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api'
import configService from '@/common/service/config.service.js';
export default {
data() {
return {
baseUrl:configService.staticDomainURL,
markers: [],
list: [],
issscd: false, // (false)
isssscd: false, // (false)
stationInfo: [],
cusLocation: [],
stationlist: [],
stationTwolist:[],
mapCtx: null //
};
},
onLoad() {
this.$nextTick(() => {
this.getList()
})
},
onReady() {
// onReady
this.mapCtx = uni.createMapContext('map', this);
},
onShow() {
if (!uni.getStorageSync('third_session')) {
uni.reLaunch({
url: '/packDetail/pages/login/login'
})
}
},
methods: {
getList() {
this.markers = []
this.list = []
this.stationInfo = []
this.cusLocation = []
this.stationlist = []
this.stationTwolist = []
uni.showLoading({
title: '加载中'
});
this.$http.get('/applet/survStationInfo/stationMap').then(res => {
// stationInfo deviceList
const combinedList = [...res.data.data.stationInfo, ...res.data.data.deviceList];
this.stationlist = combinedList;
this.stationTwolist = [...res.data.data.stationInfo];
console.log("合并后的stationlist+++++", this.stationlist);
//
this.stationlist.forEach((item, index) => {
item.id = index;
// deviceList stationInfo
const markerItem = {
id: item.id,
latitude: Number(item.latitude || item.stationLatitude),
longitude: Number(item.longitude || item.stationLongitude),
stationType: item.stationType || 'device', // deviceList stationType 'device'
sortNo: item.sortNo || index,
stationName: item.name || item.stationName,
stationCode: item.ids || item.stationCode || item.id,
//
groupName: item.groupName || '',
//
deviceType: item.type || null
};
this.list.push(markerItem);
//
if (item.stationType === 'cusLocaltion') {
this.cusLocation.push(item);
}
if (item.stationType === 'orient' || item.stationType === 'livestock') {
this.stationInfo.push(item);
}
});
this.issscd = false
this.isssscd = false
this.qiyeChange()
this.list1query()
this.addDeviceMarkers() //
//
setTimeout(() => {
this.adjustMapToFitAllMarkers();
}, 500);
uni.hideLoading();
})
},
//
addDeviceMarkers() {
this.stationlist.forEach((item, index) => {
// deviceList type stationType
if (item.type && !item.stationType) {
let iconPath = '';
let width = 35;
let height = 35;
//
switch(item.type) {
case 'soil':
iconPath = this.baseUrl + '/icon/device/soil.png';
width = 40;
height = 40;
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: true
};
this.markers.push(markerItem);
}
});
},
//
adjustMapToFitAllMarkers() {
if (this.mapCtx && this.list.length > 0) {
this.mapCtx.includePoints({
points: this.list.map(item => ({
latitude: item.latitude,
longitude: item.longitude
})),
padding: [40, 40, 40, 40] //
});
}
},
//
adjustMapToRegion(regionName) {
let points = [];
if (regionName === '团柏河') {
//
points = this.stationTwolist
.filter(item => item.groupName === '团柏河')
.map(item => ({
latitude: Number(item.stationLatitude),
longitude: Number(item.stationLongitude)
}));
} else if (regionName === '对竹河') {
//
points = this.stationTwolist
.filter(item => item.groupName === '对竹河')
.map(item => ({
latitude: Number(item.stationLatitude),
longitude: Number(item.stationLongitude)
}));
}
if (points.length > 0 && this.mapCtx) {
this.mapCtx.includePoints({
points: points,
padding: [60, 60, 60, 60] //
});
}
},
markertap(e) {
const index = e.detail.markerId
const marker = this.markers.find(m => m.id === index);
if (marker) {
if (['orient', 'livestock'].includes(marker.stationType)) {
uni.navigateTo({
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
})
} else if (marker.stationType === 'device') {
//
uni.showToast({
title: `设备: ${marker.stationName}`,
icon: 'none'
});
//
}
}
},
callouttap(e) {
const index = e.detail.markerId
const marker = this.markers.find(m => m.id === index);
if (marker) {
if (['orient', 'livestock'].includes(marker.stationType)) {
uni.navigateTo({
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
})
} else if (marker.stationType === 'device') {
//
uni.showToast({
title: `设备: ${marker.stationName}`,
icon: 'none'
});
}
}
},
qiyeChange() {
for (let i = 0; i < this.cusLocation.length; i++) {
const item = this.cusLocation[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: true
};
this.markers.push(markerItem);
}
},
switch2Change(name) {
if (name === "团柏河") {
this.issscd = !this.issscd;
} else {
this.isssscd = !this.isssscd;
}
//
if ((name === "团柏河" && !this.issscd) || (name === "对竹河" && !this.isssscd)) {
// 绿
setTimeout(() => {
this.adjustMapToRegion(name);
}, 300);
} else {
//
setTimeout(() => {
this.adjustMapToFitAllMarkers();
}, 300);
}
},
list1query() {
// orient
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];
if (item.stationType === 'orient') {
item.iconPath = this.baseUrl +'/'+ item.stationIcon;
item.latitude = Number(item.stationLatitude);
item.longitude = Number(item.stationLongitude);
item.width = 172;
item.height = 148;
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: true
};
this.markers.push(markerItem);
}
}
}
},
}
}
</script>
<style lang="scss">
/* 样式保持不变 */
.bgimg {
position: fixed;
// z-index: -99;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.customCallout {
width: 349rpx;
height: 49rpx;
color: #fff;
font-size: 24rpx;
text-shadow: 1rpx 2rpx 0rpx #0D1934;
font-weight: bold;
// background-image: url('@/static/zhandian_icon_nongtian_title.png');
background-repeat: no-repeat;
background-size: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.customCallout1 {
width: 349rpx;
height: 49rpx;
color: #fff;
font-size: 24rpx;
text-shadow: 1rpx 2rpx 0rpx #0D1934;
font-weight: bold;
// background-image: url('@/static/zhandian_icon_xuqin_title.png');
background-repeat: no-repeat;
background-size: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.zdxq {
position: fixed;
left: 33rpx;
bottom: 36rpx;
}
.zdxqitem {
padding: 8rpx 0 7rpx 17rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 22rpx;
font-family: Source Han Sans SC;
font-weight: 500;
color: #FFFFFF;
text-shadow: 0rpx 1rpx 0rpx rgba(4, 49, 52, 0.55);
width: 359rpx;
background: rgba(0, 0, 0, 0.52);
border: 1px solid #4B677C;
border-radius: 6rpx;
margin-bottom: 10rpx;
position: relative;
}
.crildon {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
margin-right: 15rpx;
}
.zdxqitem:last-child {
margin-bottom: 0;
}
.zdxqitem image {
width: 33rpx;
height: 50rpx;
margin-right: 15rpx;
}
.zdxqitem:first-child image {
width: 30rpx;
height: 40rpx;
margin-right: 15rpx;
}
.textss {
flex: 1;
text-align: left;
}
.imgs {
position: absolute;
width: 100%;
height: 100%;
z-index: -9;
}
.switchs {
position: fixed;
top: 36rpx;
right: 40rpx;
display: flex;
align-items: center;
}
</style>

View File

@ -1,34 +1,27 @@
<template> <template>
<view class="container"> <view class="container">
<map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" :scale="mapScale" :markers="markers" <map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" scale="13" :markers="markers" longitude="111.436625"
longitude="112.83100231396601" latitude="36.872032399813556" show-location show-compass show-scale latitude="36.771975" show-location @markertap="markertap" @callouttap="callouttap">
@markertap="markertap">
</map> </map>
<view class="zdxq"> <view class="zdxq">
<view class="zdxqitem" @click="switch2Change('livestock')"> <view class="zdxqitem" @click="switch2Change('团柏河')">
<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> <image src="../../static/zhandian_nongtian_dingwei.png" mode=""></image>
<view class="textss"> <view class="textss">
农田污染监测站 团柏河监测站
</view> </view>
</view> </view>
<!-- <view class="zdxqitem" @click="switch2Change('watershed')"> <view class="zdxqitem" @click="switch2Change('对竹河')">
<image src="../../static/zhandian_xiaoliuyu_dingwei.png" mode=""></image> <image src="../../static/zhandian_xuqin_dingwei.png" mode=""></image>
<view class="textss"> <view class="textss">
小流域监测站 对竹河监测站
</view> </view>
</view> </view>
<view class="zdxqitem" @click="switch2Change('soil')"> <view class="zdxqitem" @click="switch2Change('土壤')">
<image src="../../static/iconsheturangzs.png" mode=""></image> <image src="../../static/iconsheturangzs.png" mode=""></image>
<view class="textss"> <view class="textss">
长期定位监测点 长期定位监测点
</view> </view>
</view> --> </view>
</view> </view>
</view> </view>
</template> </template>
@ -45,291 +38,132 @@
latitude: 36.5, latitude: 36.5,
longitude: 111.7 longitude: 111.7
}, },
mapScale: 13, scale: 14,
markers: [], markers: [],
markersZIndex: 1, list: [],
lastTap: '', issscd: false, // (false)
stationList: [], isssscd: false, // (false)
cusLocationList: [], isSoilShow: false, // (false)
soilStationList: [], stationInfo: [],
allStationList: [], cusLocation: [],
stationTwoList: [], stationlist: [],
stationTwolist: [],
mapCtx: null // mapCtx: null //
}; };
}, },
onLoad() {}, onLoad() {
this.$nextTick(() => {
this.getList()
})
},
onReady() { onReady() {
// onReady // onReady
this.mapCtx = uni.createMapContext('map', this); this.mapCtx = uni.createMapContext('map', this);
}, },
onShow() { onShow() {
api.checkLogin(() => { if(uni.getStorageSync('third_session')){
this.$nextTick(() => { uni.login({
this.getList() success: function (res) {
}) this.code = res.code
}, () => { let params = {}
params.jsCode = this.code
api.wxlogin(params).then(res=>{
if(res.data.code == 0){
let userInfo = res.data.data;
// uni.setStorageSync('third_session', userInfo.thirdSession);
if(!userInfo.id){
uni.reLaunch({ uni.reLaunch({
url: '/packDetail/pages/login/login' url:'/packDetail/pages/login/login'
}) })
}
}
}) })
}
});
}else if(!uni.getStorageSync('third_session')){
uni.reLaunch({
url:'/packDetail/pages/login/login'
})
}
}, },
methods: { methods: {
// kaihs
getList() { getList() {
this.markers = [] this.markers = []
this.stationList = [] this.list = []
this.cusLocationList = [] this.stationInfo = []
this.soilStationList = [] this.cusLocation = []
this.allStationList = [] this.stationlist = []
this.stationTwoList = [] this.stationTwolist = []
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
this.$http.get('/applet/survStationInfo/stationMap').then(res => { this.$http.get('/applet/survStationInfo/stationMap').then(res => {
// // stationInfo deviceList
this.stationList = [...res.data.data.stationInfo]; const combinedList = [...res.data.data.stationInfo, ...res.data.data.deviceList];
this.cusLocationList = [...res.data.data.cusLocation]; this.stationlist = combinedList;
this.soilStationList = [...res.data.data.deviceList]; this.stationTwolist = [...res.data.data.stationInfo];
this.allStationList.push(...this.stationList);
this.allStationList.push(...this.cusLocationList); console.log("合并后的stationlist+++++", this.stationlist);
this.allStationList.push(...this.soilStationList);
this.allStationList.forEach((item, index) => { //
this.stationlist.forEach((item, index) => {
item.id = index; item.id = index;
// deviceList stationInfo
const markerItem = {
id: item.id,
latitude: Number(item.latitude || item.stationLatitude),
longitude: Number(item.longitude || item.stationLongitude),
stationType: item.stationType || 'device', // deviceList stationType 'device'
sortNo: item.sortNo || index,
stationName: item.name || item.stationName,
stationCode: item.ids || item.stationCode || item.id,
//
groupName: item.groupName || '',
//
deviceType: item.type || null
};
this.list.push(markerItem);
//
if (item.stationType === 'cusLocaltion') {
this.cusLocation.push(item);
}
if (item.stationType === 'orient' || item.stationType === 'livestock') {
this.stationInfo.push(item);
}
}); });
this.issscd = false this.issscd = false
this.isssscd = false this.isssscd = false
this.isSoilShow = false this.isSoilShow = false
this.qiyeChange()
this.list1query()
this.addDeviceMarkers() //
// //
this.enterpriseRender();
this.stationRender();
this.monitorRender()
// 使
this.ensureAllMarkersVisible();
uni.hideLoading();
}).catch(err => {
uni.hideLoading();
uni.showToast({
title: '数据加载失败',
icon: 'none'
});
console.error('加载地图数据失败:', err);
})
},
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(() => { setTimeout(() => {
if (this.mapCtx) { this.adjustMapToFitAllMarkers();
try {
this.mapCtx.includePoints({
points: validPoints,
padding: [80, 80, 80, 80]
});
} catch (e) {
console.error('第二次调整失败:', e);
}
}
}, 500); }, 500);
// 3 uni.hideLoading();
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) { addDeviceMarkers() {
for (let i = 0; i < this.stationList.length; i++) { this.stationlist.forEach((item, index) => {
const item = this.stationList[i]; // deviceList type stationType
const lat = Number(item.stationLatitude); if (item.type && !item.stationType) {
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 iconPath = '';
let width = 35; let width = 35;
let height = 35; let height = 35;
switch (item.type) { //
switch(item.type) {
case 'soil': case 'soil':
iconPath = this.baseUrl + '/icon/device/soil.png'; iconPath = this.baseUrl + '/icon/device/soil.png';
width = 32; width = 32;
@ -345,10 +179,10 @@
} }
const markerItem = { const markerItem = {
id: item.id || `device_${index}`, id: item.id,
iconPath: iconPath, iconPath: iconPath,
latitude: lat, latitude: Number(item.latitude),
longitude: lng, longitude: Number(item.longitude),
width: width, width: width,
height: height, height: height,
customCallout: { customCallout: {
@ -360,12 +194,103 @@
stationName: item.name, stationName: item.name,
stationCode: item.ids, stationCode: item.ids,
deviceType: item.type, deviceType: item.type,
joinCluster: false, joinCluster: false //
zIndex: this.markersZIndex,
}; };
this.markers.push(markerItem); this.markers.push(markerItem);
}
}); });
}, },
// setFitView
adjustMapToFitAllMarkers() {
if (this.mapCtx && this.list.length > 0) {
this.mapCtx.includePoints({
points: this.list.map(item => ({
latitude: item.latitude,
longitude: item.longitude
})),
padding: [60, 60, 60, 60] //
});
}
},
//
adjustMapToRegion(regionName) {
let points = [];
if (regionName === '团柏河') {
//
points = this.stationTwolist
.filter(item => item.groupName === '团柏河')
.map(item => ({
latitude: Number(item.stationLatitude),
longitude: Number(item.stationLongitude)
}));
} else if (regionName === '对竹河') {
//
points = this.stationTwolist
.filter(item => item.groupName === '对竹河')
.map(item => ({
latitude: Number(item.stationLatitude),
longitude: Number(item.stationLongitude)
}));
} else if (regionName === '土壤') {
//
points = this.stationlist
.filter(item => item.type === 'soil' || item.deviceType === 'soil')
.map(item => ({
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
preciseMapAdjustment(regionName) {
if (!this.mapCtx) return;
//
const regionConfigs = {
'团柏河': {
latitude: 36.5, //
longitude: 111.7, //
scale: 14
},
'对竹河': {
latitude: 36.4, //
longitude: 111.6, //
scale: 14
},
'土壤': {
latitude: 36.45, //
longitude: 111.65, //
scale: 13
}
};
const config = regionConfigs[regionName];
if (config) {
this.mapCtx.moveToLocation({
latitude: config.latitude,
longitude: config.longitude,
scale: config.scale
});
}
},
markertap(e) { markertap(e) {
const index = e.detail.markerId const index = e.detail.markerId
const marker = this.markers.find(m => m.id === index); const marker = this.markers.find(m => m.id === index);
@ -381,69 +306,122 @@
} }
} }
}, },
switch2Change(name) { //
//
let that = this;
if (name === that.lastTap) {
that.adjustMapToFitAllMarkers();
that.lastTap = '';
} else {
//
that.adjustMapToRegion(name);
that.lastTap = name;
callouttap(e) {
const index = e.detail.markerId
const marker = this.markers.find(m => m.id === index);
if (marker) {
if (['orient', 'livestock'].includes(marker.stationType)) {
uni.navigateTo({
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
})
} else if (marker.stationType === 'device') {
uni.showToast({
title: `设备: ${marker.stationName}`,
icon: 'none'
});
}
} }
}, },
// setFitView
adjustMapToFitAllMarkers() { qiyeChange() {
if (this.mapCtx && this.markers.length > 0) { for (let i = 0; i < this.cusLocation.length; i++) {
this.mapCtx.includePoints({ const item = this.cusLocation[i];
points: this.markers.map(item => ({ 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, latitude: item.latitude,
longitude: item.longitude longitude: item.longitude,
})), width: item.width,
padding: [60, 60, 60, 60] // height: item.height,
}); customCallout: {
anchorY: 0,
anchorX: 0,
display: 'ALWAYS'
},
stationType: item.stationType,
stationName: item.stationName,
stationCode: item.stationCode,
joinCluster: false //
};
this.markers.push(markerItem);
} }
}, },
adjustMapToRegion(regionName) {
// switch2Change(name) {
//stationType: "orient" //
//stationType: "livestock" const stateMap = {
//stationType: "watershed" '团柏河': 'issscd',
let that = this; '对竹河': 'isssscd',
let points = []; '土壤': 'isSoilShow'
let markers = []; };
if (regionName === 'orient' || regionName === 'livestock' || regionName === 'watershed') {
// if (stateMap[name]) {
markers = this.markers.filter(item => item.stationType === regionName); this[stateMap[name]] = !this[stateMap[name]];
} 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 => { const shouldFocus = {
item.zIndex = (that.markersZIndex++); '团柏河': !this.issscd,
return { '对竹河': !this.isssscd,
latitude: Number(item.latitude || item.stationLatitude), '土壤': !this.isSoilShow
longitude: Number(item.longitude || item.stationLongitude) };
}
}); if (shouldFocus[name]) {
} //
if (points.length > 0 && this.mapCtx) { setTimeout(() => {
this.mapCtx.includePoints({ this.adjustMapToRegion(name);
points: points, // 使this.preciseMapAdjustment(name);
padding: [80, 110, 80, 110] // }, 300);
}); } else {
} else if (points.length === 0) { //
// setTimeout(() => {
// uni.showToast({ this.adjustMapToFitAllMarkers();
// title: `${regionName}`, }, 300);
// icon: 'none'
// });
} }
}, },
list1query() {
// orient
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];
if (item.stationType === 'orient') {
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 //
};
this.markers.push(markerItem);
}
}
}
}
} }
} }
</script> </script>

View File

@ -31,7 +31,7 @@
<view class="boxitem_left"> <view class="boxitem_left">
<image src="../../static/me_icon_shebei.png" mode=""></image> <image src="../../static/me_icon_shebei.png" mode=""></image>
<view class="zl"> <view class="zl">
运维记录 站点运维
</view> </view>
</view> </view>
<image src="../../static/me_icon_in.png" mode=""></image> <image src="../../static/me_icon_in.png" mode=""></image>
@ -78,14 +78,31 @@
}); });
}, },
onShow() { onShow() {
api.checkLogin(()=>{ if(uni.getStorageSync('third_session')){
this.getuserInfo(); uni.login({
}, () => { success: function (res) {
this.code = res.code
let params = {}
params.jsCode = this.code
api.wxlogin(params).then(res=>{
if(res.data.code == 0){
let userInfo = res.data.data;
// uni.setStorageSync('third_session', userInfo.thirdSession);
if(!userInfo.id){
uni.reLaunch({ uni.reLaunch({
url:'/packDetail/pages/login/login' url:'/packDetail/pages/login/login'
}) })
}
}
})
}
}); });
}else if(!uni.getStorageSync('third_session')){
uni.reLaunch({
url:'/packDetail/pages/login/login'
})
}
this.getuserInfo()
}, },
methods: { methods: {
getuserInfo(){ getuserInfo(){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB