|
@ -76,6 +76,17 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.addPest{ |
|
|
|
|
|
position:absolute; |
|
|
|
|
|
bottom:0; |
|
|
|
|
|
left:0; |
|
|
|
|
|
width:100%; |
|
|
|
|
|
background:#fff; |
|
|
|
|
|
color:#333; |
|
|
|
|
|
height:60rpx; |
|
|
|
|
|
padding:0 20rpx; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
<template> |
|
|
<template> |
|
@ -98,13 +109,17 @@ |
|
|
<view class="tabs"> |
|
|
<view class="tabs"> |
|
|
<text v-for="(v,k) in agrProd" :class="{active:searchVal.value==v.value}" :key="k" @click="agrSearch(v.value)">{{v.label}}</text> |
|
|
<text v-for="(v,k) in agrProd" :class="{active:searchVal.value==v.value}" :key="k" @click="agrSearch(v.value)">{{v.label}}</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="title">害虫种类 <button class="cu-btn round sm" v-if="searchVal.value">自定义+</button></view> |
|
|
<view class="title">害虫种类 <button class="cu-btn round sm" v-if="searchVal.value" @click="show=true">自定义+</button></view> |
|
|
<scroll-view scroll-y> |
|
|
<scroll-view scroll-y> |
|
|
<view class="items"> |
|
|
<view class="items"> |
|
|
<text :class="{active:select==v}" v-for="(v,k) in list" :key="k" @click="select=v">{{v}}</text> |
|
|
<text :class="{active:select==v}" v-for="(v,k) in list" :key="k" @click="select=v">{{v}}</text> |
|
|
</view> |
|
|
</view> |
|
|
<u-empty :show="list.length<=0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/> |
|
|
<u-empty :show="list.length<=0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
|
|
|
|
|
|
|
|
|
<u-overlay :show="show" @click="show=false"> |
|
|
|
|
|
<input class="addPest" placeholder="请输入" @click.stop="" :focus="show" @blur="show=false" @confirm="addPest($event.detail.value)"/> |
|
|
|
|
|
</u-overlay> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
@ -121,6 +136,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
select:"", |
|
|
select:"", |
|
|
eventChannel:null, |
|
|
eventChannel:null, |
|
|
|
|
|
show:false, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed:{ |
|
|
computed:{ |
|
@ -210,6 +226,24 @@ export default { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
async addPest(e){ |
|
|
|
|
|
var res=await request("/common/api/dict/AddCategory",{ |
|
|
|
|
|
method:"post", |
|
|
|
|
|
body:{ |
|
|
|
|
|
pid: typeof this.searchVal.value=='string'?this.searchVal.value:this.cropList.find(v=>v.pest==this.searchVal.value).value, |
|
|
|
|
|
name:e |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(res.statu){ |
|
|
|
|
|
this.list.push(e) |
|
|
|
|
|
}else{ |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title:"提示", |
|
|
|
|
|
content:"添加害虫失败!", |
|
|
|
|
|
showCancel:false, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |