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.
 
 
 
 
 

107 lines
2.2 KiB

<style lang="scss">
.container{
min-height:100%;
background:#f6f6f6;
scroll-view{
flex-grow: 1;
height:1rpx;
border-bottom:1rpx solid transparent;
.card{
margin-top:0;
.name{
display: flex;
align-items: center;
margin-bottom:20rpx;
text{
&:first-child{
font-size:20rpx;
color:#fff;
background:#10C176;
width:80rpx;
height:40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 0 20rpx 0 20rpx;
margin-right:10rpx;
}
&.plant-youbian{
margin-left: auto;
}
}
}
.company{
text{
&:first-child{
color:#FBA83C;
margin-right:14rpx;
}
&:nth-child(2){
color:#999;
}
}
}
}
}
}
</style>
<template>
<view class="container flex">
<d-navbar text="农资列表" isBack style="--bg:#10C176;--c:#fff;">
<text slot="right" class="plant-xinjian" @click="$u.route({url:'pages/purchase/newAgr'})"/>
</d-navbar>
<d-search v-model="searchVal.goodsName" @search="search"/>
<scroll-view scroll-y @scrolltolower="search">
<view class="card" v-for="(v,k) in list" :key="k" @click="$u.route({url:'pages/purchase/specs'})">
<view class="name">
<text>化肥</text> 中量元素水溶肥 <text class="plant-youbian"/>
</view>
<view class="company">
<text>微量元素肥</text> <text>云南云天化股份有限公司</text>
</view>
</view>
<u-empty v-if="list.length==0" icon="http://cdn.uviewui.com/uview/empty/data.png"/>
</scroll-view>
</view>
</template>
<script>
import request from '@/common/request'
export default {
data(){
return{
searchVal:{
goodsName:"",
pageNo:1,
pageSize:5,
},
list:[],
total:0,
}
},
onLoad(){
this.search()
},
methods:{
async search(){
if(this.total==0||this.list.length<this.total){
var res=await request("/api/goods/goodsList",{
params: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.records)
this.total=res.data.total
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取农资列表失败",
showCancel:false,
})
}
}
}
}
}
</script>