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.

125 lines
2.4 KiB

2 years ago
<style lang="scss">
.container{
height:100%;
2 years ago
background:#f6f6f6;
scroll-view{
flex-grow: 1;
height:1rpx;
.card{
margin-top:0;
.name{
display:flex;
align-items: center;
margin-bottom:20rpx;
text{
&:first-child{
flex-shrink: 0;
color:#fff;
font-size:20rpx;
border-radius: 0px 20rpx 0px 20rpx;
background:#10C176;
width:80rpx;
height:40rpx;
text-align: center;
line-height: 40rpx;
margin-right:10rpx;
}
&:nth-child(2){
flex-grow: 1;
display:flex;
align-items: center;
2 years ago
font-weight: bold;
margin-right:20rpx;
2 years ago
}
}
}
.company{
text{
font-size:24rpx;
&:first-child{
color:#FBA83C;
margin-right:16rpx;
}
&:nth-child(2){
color:#999;
}
2 years ago
}
}
}
}
}
</style>
<template>
<view class="container flex">
<d-search v-model="searchVal.search" @click="clean();search(0)"/>
2 years ago
<scroll-view scroll-y>
<view class="card" v-for="(v,k) in list" :key="k" @click="toSpecs(v)">
<view class="name">
<text>{{v.parentName}}</text> <text>{{v.name}}</text> <text class="plant-youbian"/>
</view>
<view class="company">
<text>{{v.typeOne}}</text> <text>{{v.supplier}}</text>
</view>
2 years ago
</view>
</scroll-view>
2 years ago
</view>
</template>
<script>
import request from '@/common/request'
2 years ago
export default {
data(){
return{
searchVal:{
pageNo:1,
pageSize:6,
search:"",
},
list:[],
total:0,
eventChannel:null,
2 years ago
}
},
onLoad(){
this.eventChannel=this.getOpenerEventChannel()
this.search()
},
methods:{
clean(){
this.list=[]
this.total=0
this.searchVal.pageNo=1
},
async search(){
var res=await request("/api/plantFarming/listAgrMaterials",{
params: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.list)
this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取领用农资失败!",
showCancel:false,
})
}
},
toSpecs(e){
uni.navigateTo({
url:`/pages/massif/agrSpecs?id=${e.id}`,
events:{update: e=>{
this.eventChannel.emit("addSpecs", e)
uni.navigateBack()
}},
success(res){
res.eventChannel.emit('detail',e)
}
})
},
2 years ago
}
}
</script>