Merge branch 'wp' of http://61.174.243.28:15863/chuangte/SmartBeehive into tx
This commit is contained in:
commit
099e437e42
|
@ -84,7 +84,7 @@
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn_box">
|
<view class="btn_box">
|
||||||
<view class="btns">
|
<view class="btns" @click="btncz">
|
||||||
重置
|
重置
|
||||||
</view>
|
</view>
|
||||||
<view class="btn1" @click="btnbc">
|
<view class="btn1" @click="btnbc">
|
||||||
|
@ -159,6 +159,25 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
btncz(){
|
||||||
|
this.miteInterval = ''
|
||||||
|
this.minPower = ''
|
||||||
|
this.minHeat = ''
|
||||||
|
this.maxHeat = ''
|
||||||
|
this.maxFan = ''
|
||||||
|
this.minCo2 = ''
|
||||||
|
this.maxCo2 = ''
|
||||||
|
this.list.forEach(item => {
|
||||||
|
if (item.checked) {
|
||||||
|
item.checked = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.lists.forEach(item => {
|
||||||
|
if (item.checked) {
|
||||||
|
item.checked = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
checkboxChange(e) {
|
checkboxChange(e) {
|
||||||
let index = this.value.indexOf(e)
|
let index = this.value.indexOf(e)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
|
|
|
@ -151,10 +151,10 @@
|
||||||
电子围栏(Km)
|
电子围栏(Km)
|
||||||
</view>
|
</view>
|
||||||
<view class="cont">
|
<view class="cont">
|
||||||
最大距离 <view class="ipt"><input type="text" class="ips" v-model="code" placeholder=" "
|
最大距离 <view class="ipt"><input type="text" class="ips" v-model="dzcode" placeholder=" "
|
||||||
placeholder-class="my-placeholder" /></view>
|
placeholder-class="my-placeholder" /></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">
|
<view class="btn" @click="btnqued">
|
||||||
确定
|
确定
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -181,18 +181,8 @@
|
||||||
latitude: '',
|
latitude: '',
|
||||||
longitude: '',
|
longitude: '',
|
||||||
isMap: false,
|
isMap: false,
|
||||||
zoomSize: 15,
|
zoomSize: 13,
|
||||||
markers: [{
|
markers: [],
|
||||||
id: 1,
|
|
||||||
latitude: 39.90469,
|
|
||||||
longitude: 116.40717,
|
|
||||||
title: 'Marker1'
|
|
||||||
}, {
|
|
||||||
id: 2,
|
|
||||||
latitude: 39.90969,
|
|
||||||
longitude: 116.41217,
|
|
||||||
title: 'Marker2'
|
|
||||||
}],
|
|
||||||
showtq: false,
|
showtq: false,
|
||||||
showwl: false,
|
showwl: false,
|
||||||
apiaryId: '',
|
apiaryId: '',
|
||||||
|
@ -204,6 +194,7 @@
|
||||||
chartData8: [],
|
chartData8: [],
|
||||||
daytime: '',
|
daytime: '',
|
||||||
covers: [],
|
covers: [],
|
||||||
|
dzcode:'',
|
||||||
polygons: [{
|
polygons: [{
|
||||||
//多边形的坐标数组
|
//多边形的坐标数组
|
||||||
points: [],
|
points: [],
|
||||||
|
@ -242,8 +233,8 @@
|
||||||
id: Number(item.storeId),
|
id: Number(item.storeId),
|
||||||
latitude: item.lat,
|
latitude: item.lat,
|
||||||
longitude: item.lng,
|
longitude: item.lng,
|
||||||
width: 25,
|
width: 20,
|
||||||
height: 30,
|
height: 20,
|
||||||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/ukbyhyrDcp3VzgyeJo2G',
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/ukbyhyrDcp3VzgyeJo2G',
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -255,7 +246,31 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 点击确定电子围栏
|
||||||
|
btnqued(){
|
||||||
|
let data = {
|
||||||
|
apiaryId:this.apiaryId,
|
||||||
|
radius:this.dzcode
|
||||||
|
}
|
||||||
|
this.$u.put(`farm/apiary`,data).then(res =>{
|
||||||
|
if(res.code == 200){
|
||||||
|
uni.showToast({
|
||||||
|
title: '修改成功',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
this.showwl = false
|
||||||
|
this.getfcxq()
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
btnedfc() {
|
btnedfc() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -273,7 +288,6 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gettq() {
|
gettq() {
|
||||||
console.log(this.latitude, this.longitude);
|
|
||||||
this.$u.get(`weather/7d?location=${this.longitude},${this.latitude}`).then(res => {
|
this.$u.get(`weather/7d?location=${this.longitude},${this.latitude}`).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.daily = res.data.daily
|
this.daily = res.data.daily
|
||||||
|
@ -314,8 +328,6 @@
|
||||||
let circlePoints = this.calculateCirclePoints(centerLat, centerLon, radius)
|
let circlePoints = this.calculateCirclePoints(centerLat, centerLon, radius)
|
||||||
this.polygons[0].points = circlePoints
|
this.polygons[0].points = circlePoints
|
||||||
|
|
||||||
console.log(this.polygons[0].points, '圆形电子围栏点')
|
|
||||||
|
|
||||||
this.gettq()
|
this.gettq()
|
||||||
this.getmy()
|
this.getmy()
|
||||||
this.getfz()
|
this.getfz()
|
||||||
|
@ -330,28 +342,28 @@
|
||||||
},
|
},
|
||||||
// 计算电子围栏
|
// 计算电子围栏
|
||||||
calculateCirclePoints(lat, lon, radiusInKm, numPoints = 36) {
|
calculateCirclePoints(lat, lon, radiusInKm, numPoints = 36) {
|
||||||
let earthRadiusKm = 6371; // 地球平均半径,单位:千米
|
let earthRadiusKm = 6371
|
||||||
let radius = radiusInKm / earthRadiusKm; // 半径转换为弧度
|
let radius = radiusInKm / earthRadiusKm
|
||||||
let points = [];
|
let points = [];
|
||||||
for (let i = 0; i < numPoints; i++) {
|
for (let i = 0; i < numPoints; i++) {
|
||||||
let angle = (i / (numPoints - 1)) * 2 * Math.PI; // 角度从0到2π
|
let angle = (i / (numPoints - 1)) * 2 * Math.PI
|
||||||
let latRad = lat * Math.PI / 180; // 中心纬度转换为弧度
|
let latRad = lat * Math.PI / 180
|
||||||
let lonRad = lon * Math.PI / 180; // 中心经度转换为弧度
|
let lonRad = lon * Math.PI / 180
|
||||||
let newLatRad = Math.asin(Math.sin(latRad) * Math.cos(radius) +
|
let newLatRad = Math.asin(Math.sin(latRad) * Math.cos(radius) +
|
||||||
Math.cos(latRad) * Math.sin(radius) * Math.cos(angle));
|
Math.cos(latRad) * Math.sin(radius) * Math.cos(angle))
|
||||||
let newLonRad = lonRad + Math.atan2(
|
let newLonRad = lonRad + Math.atan2(
|
||||||
Math.sin(angle) * Math.sin(radius) * Math.cos(latRad),
|
Math.sin(angle) * Math.sin(radius) * Math.cos(latRad),
|
||||||
Math.cos(radius) - Math.sin(latRad) * Math.sin(newLatRad)
|
Math.cos(radius) - Math.sin(latRad) * Math.sin(newLatRad)
|
||||||
);
|
);
|
||||||
let newLat = newLatRad * 180 / Math.PI;
|
let newLat = newLatRad * 180 / Math.PI;
|
||||||
let newLon = (newLonRad + 3 * Math.PI) % (2 * Math.PI) - Math.PI; // 转换到-180到180的范围
|
let newLon = (newLonRad + 3 * Math.PI) % (2 * Math.PI) - Math.PI
|
||||||
newLon = newLon * 180 / Math.PI;
|
newLon = newLon * 180 / Math.PI;
|
||||||
points.push({
|
points.push({
|
||||||
latitude: newLat,
|
latitude: newLat,
|
||||||
longitude: newLon
|
longitude: newLon
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return points;
|
return points
|
||||||
},
|
},
|
||||||
getmy() {
|
getmy() {
|
||||||
this.$u.get(`/common/getDictByType?dictType=apiary_honey_type`).then(res => {
|
this.$u.get(`/common/getDictByType?dictType=apiary_honey_type`).then(res => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
title-size='36' :title-bold='true' height='45' id="navbar">
|
title-size='36' :title-bold='true' height='45' id="navbar">
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
|
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
|
||||||
:show-location='true' :markers="covers"></map>
|
:show-location='true' :markers="covers" @markertap="handleMarkerClick"></map>
|
||||||
|
|
||||||
<view class="fxtongji">
|
<view class="fxtongji">
|
||||||
<view class="one">
|
<view class="one">
|
||||||
|
@ -36,42 +36,7 @@
|
||||||
longitude: '',
|
longitude: '',
|
||||||
isMap: false,
|
isMap: false,
|
||||||
zoomSize: 15,
|
zoomSize: 15,
|
||||||
markers: [{
|
markers: [],
|
||||||
id: 1,
|
|
||||||
latitude: 39.90469,
|
|
||||||
longitude: 116.40717,
|
|
||||||
|
|
||||||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uYrX2QTRLdVVDTB3E5cp',
|
|
||||||
width: 39,
|
|
||||||
height: 46,
|
|
||||||
callout: {
|
|
||||||
content: '福鼎蜂场福建省宁德市福鼎市太姥山镇秦屿大道二号\n', // 修改为你想要显示的文字内容
|
|
||||||
color: '#000', // 修改为文字颜色
|
|
||||||
fontSize: 14, // 修改为文字大小
|
|
||||||
borderRadius: 10, // 修改为气泡圆角大小
|
|
||||||
bgColor: '#FFFFFF', // 修改为气泡背景颜色
|
|
||||||
padding: 10, // 修改为气泡内边距
|
|
||||||
display: 'ALWAYS', // 修改为气泡的显示策略
|
|
||||||
textAlign: 'center', // 设置文字对齐方式
|
|
||||||
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
id: 2,
|
|
||||||
latitude: 39.90969,
|
|
||||||
longitude: 116.41217,
|
|
||||||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uYrX2QTRLdVVDTB3E5cp',
|
|
||||||
width: 39,
|
|
||||||
height: 46,
|
|
||||||
callout: {
|
|
||||||
content: '未上架', // 修改为你想要显示的文字内容
|
|
||||||
color: '#ffffff', // 修改为文字颜色
|
|
||||||
fontSize: 14, // 修改为文字大小
|
|
||||||
borderRadius: 10, // 修改为气泡圆角大小
|
|
||||||
bgColor: '#000000', // 修改为气泡背景颜色
|
|
||||||
padding: 6, // 修改为气泡内边距
|
|
||||||
display: 'ALWAYS', // 修改为气泡的显示策略
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
jinweidu:'',
|
jinweidu:'',
|
||||||
covers: [],
|
covers: [],
|
||||||
mapContext: null,
|
mapContext: null,
|
||||||
|
@ -98,6 +63,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 点击地图图标
|
||||||
|
handleMarkerClick(e) {
|
||||||
|
console.log(e.markerId);
|
||||||
|
},
|
||||||
|
|
||||||
getMyLocations() {
|
getMyLocations() {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
|
@ -106,14 +76,13 @@
|
||||||
this.latitude = Number(res.latitude.toFixed(5)) - 0.004
|
this.latitude = Number(res.latitude.toFixed(5)) - 0.004
|
||||||
this.longitude = Number(res.longitude.toFixed(5)) + 0.004
|
this.longitude = Number(res.longitude.toFixed(5)) + 0.004
|
||||||
// this.setMapScale()
|
// this.setMapScale()
|
||||||
// 请求附近的店铺
|
|
||||||
this.$u.get("/farm/beehive/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(
|
this.$u.get("/farm/beehive/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(
|
||||||
res => {
|
res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.listmaps = res.data
|
this.listmaps = res.data
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
this.covers.push({
|
this.covers.push({
|
||||||
id: parseFloat(item.storeId),
|
id: parseFloat(item.beehiveId),
|
||||||
latitude: item.lat,
|
latitude: item.lat,
|
||||||
longitude: item.lng,
|
longitude: item.lng,
|
||||||
width: 25,
|
width: 25,
|
||||||
|
@ -146,7 +115,6 @@
|
||||||
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||||
borderColor:'#fff',
|
borderColor:'#fff',
|
||||||
borderRadius:5,
|
borderRadius:5,
|
||||||
// bgColor: 'rgba(255, 255, 255, 0.7)'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// this.covers.push(shopCover)
|
// this.covers.push(shopCover)
|
||||||
|
@ -173,7 +141,7 @@
|
||||||
this.listmap = res.data
|
this.listmap = res.data
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
this.covers.push({
|
this.covers.push({
|
||||||
id: parseFloat(item.storeId),
|
id: parseFloat(item.apiaryId),
|
||||||
latitude: item.lat,
|
latitude: item.lat,
|
||||||
longitude: item.lng,
|
longitude: item.lng,
|
||||||
width: 25,
|
width: 25,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user