You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.2 KiB

2 years ago
<style lang="scss">
2 years ago
.container{
2 years ago
height: 100%;
2 years ago
background:#F6F6F6;
&>map{
2 years ago
flex-shrink: 0;
2 years ago
height:348rpx;
width:100%;
2 years ago
margin-bottom:-9rpx;
2 years ago
}
&>.u-tabs{
2 years ago
flex-shrink: 0;
2 years ago
background:#fff;
box-shadow: 0 6rpx 12rpx 2rpx rgba(0,0,0,0.1);
}
2 years ago
swiper{
flex-grow: 1;
height:1rpx;
}
2 years ago
}
</style>
<template>
2 years ago
<view class="container flex">
2 years ago
<map id="amap"/>
2 years ago
2 years ago
<u-tabs :list="tabs" :current="tabIndex" activeStyle="color:#10C176;" lineColor="#10C176" lineWidth="50" :scrollable="false" @change="plantId='';tabIndex=$event.index"/>
2 years ago
2 years ago
<swiper :current="tabIndex" @change="tabIndex=$event.detail.current">
<swiper-item>
2 years ago
<plant-plan :plotId="plotId" @trigger="$refs.recovery.reSearch($event.plantId);tabIndex=$event.tabIndex"/>
2 years ago
</swiper-item>
<swiper-item>
<farmRecord :plotId="plotId"/>
</swiper-item>
<swiper-item>
2 years ago
<recovery :plotId="plotId" ref="recovery"/>
2 years ago
</swiper-item>
</swiper>
2 years ago
</view>
</template>
<script>
import plantPlan from './plantPlan.vue'
import farmRecord from './farmRecord.vue'
import recovery from './recovery.vue'
export default {
components:{plantPlan,farmRecord,recovery},
data(){
return{
tabIndex:0,
tabs:[
{name:"种植计划",},
{name:"农事记录",},
{name:"采收记录",},
],
2 years ago
plotId:"",
2 years ago
}
},
onLoad(options){
2 years ago
this.plotId=options.id
},
2 years ago
onReady(){
/* #ifdef APP-PLUS */
var a=uni.createMapContext("amap",this)
var maps=a.$getAppMap()
maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE)
maps.onclick=(e)=>{
console.log(e,'-------maps--click---------')
}
var polygon=new plus.maps.Polygon([
new plus.maps.Point(116.39524,39.925301),
new plus.maps.Point(116.400444,39.925285),
new plus.maps.Point(116.400558,39.923282),
new plus.maps.Point(116.395502,39.923082),
])
polygon.setLineWidth(2)
polygon.setStrokeColor("#10C176")
polygon.setFillColor("#10C176")
2 years ago
polygon.setFillOpacity(0.3)
maps.addOverlay(polygon)
2 years ago
var marker=new plus.maps.Marker(new plus.maps.Point(116.396137,39.924055));
marker.setIcon("/static/tab_home.png");
marker.bringToTop()
marker.setDraggable(true)
maps.addOverlay(marker);
2 years ago
/* #endif */
},
methods:{
}
2 years ago
}
</script>