diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index c2f2dc6..5961a6d 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -126,7 +126,9 @@ } } &>.u-swipe-action{ - margin-top:20rpx; + .u-swipe-action-item{ + margin-top:20rpx; + } .u-swipe-action-item__right__button{ display:flex; align-items: center; @@ -189,8 +191,8 @@ {{massif.plotName}} - - + + {{v.goodsType}} {{v.substanceName}} {{v.inputTotal}}{{v.specs[1]}} diff --git a/pages/patrolGarden/detail.vue b/pages/patrolGarden/detail.vue index 1215bd7..ec77d20 100644 --- a/pages/patrolGarden/detail.vue +++ b/pages/patrolGarden/detail.vue @@ -89,7 +89,7 @@ 基地名称 {{detail.baseName}} - + 凭证 @@ -106,6 +106,10 @@ + + 地块名称 + {{record.plotName}} + 位置 {{record.position}} @@ -126,7 +130,6 @@ export default { data(){ return{ map:null, - demo:"", host:host('imgUrl'), detail:{}, record:null, @@ -146,7 +149,10 @@ export default { this.detail=e /* #ifdef APP-PLUS */ - if(this.detail.detailVos){ + + + + if(this.detail?.detailVos?.length>0){ for(var i in this.detail.detailVos){ var marker=new plus.maps.Marker(new plus.maps.Point(this.detail.detailVos[i].lng, this.detail.detailVos[i].lat)) marker.setIcon(`/static/patrolGarden/${({0:'unhandle',1:'handle'})[this.detail.detailVos[i].flagDeal]}.png?i=${i}`) @@ -184,6 +190,7 @@ export default { uni.showToast({title:"修改成功",icon:"success"}) this.detail.detailVos[this.record.index]=this.record this.detail.detailVos[this.record.index].marker.setIcon(`/static/patrolGarden/${({0:'unhandle',1:'handle'})[this.record.flagDeal]}.png?i=${this.record.index}`) + this.eventChannel.emit("update") }else{ uni.showModal({ title:"提示", diff --git a/pages/patrolGarden/record.vue b/pages/patrolGarden/record.vue index b4bef8f..0a7a5c5 100644 --- a/pages/patrolGarden/record.vue +++ b/pages/patrolGarden/record.vue @@ -6,8 +6,18 @@ scroll-view{ flex-grow: 1; height:1rpx; + + .u-swipe-action{ + .u-swipe-action-item{ + margin:0 30rpx 30rpx; + } + .u-swipe-action-item__right__button{ + display:flex; + align-items: center; + } + } .card{ - margin-top:0rpx; + margin:0rpx; &>.title{ display: flex; align-items: center; @@ -97,24 +107,31 @@ - - - - {{v.baseName}} - 无异常 - 异常 - (已处理{{v.deal}}/{{v.detailVos.length}}) - - - - - - {{v.remark}} - - 巡园日期:{{v.operateDate}} - {{v.userName}} - - + + + + + + {{v.baseName}} + 无异常 + 异常 + (已处理{{v.deal}}/{{v.detailVos.length}}) + + + + + + {{v.remark}} + + 巡园日期:{{v.operateDate}} + {{v.userName}} + + + + + + + @@ -140,11 +157,20 @@ export default { this.search() }, methods:{ - async search(type){ + async search(type, i){ if(type=='pageOne'){ this.searchVal.pageNo=1 this.list=[] this.total=0 + }else if(type=='del'){ + if(this.list.length>this.searchVal.pageSize+3){ + this.total-- + this.list.splice(i,1) + }else{ + this.searchVal.pageNo=1 + this.list=[] + this.total=0 + } } if(this.total==0||this.list.length{ + if(e.confirm){ + var res=await request("/api/basetour/deleteById",{ + params:{id:this.list[index].id} + }) + if(res.statu){ + uni.showToast({title:"删除成功!",icon:"success"}) + this.search('del',index) + }else{ + uni.showToast({title:"删除失败!",icon:"error"}) + } + } + } + }) + }, toAddPage(){ uni.navigateTo({ url:"/pages/patrolGarden/info", @@ -175,6 +220,7 @@ export default { toDetail(e){ uni.navigateTo({ url:"/pages/patrolGarden/detail", + events:{update:()=>this.search('pageOne')}, success:res=>{ res.eventChannel.emit('detail',e) } diff --git a/static/patrolGarden/handle.png b/static/patrolGarden/handle.png new file mode 100644 index 0000000..97aef1b Binary files /dev/null and b/static/patrolGarden/handle.png differ diff --git a/static/patrolGarden/unhandle.png b/static/patrolGarden/unhandle.png new file mode 100644 index 0000000..add4b84 Binary files /dev/null and b/static/patrolGarden/unhandle.png differ