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.
96 lines
1.9 KiB
96 lines
1.9 KiB
<style lang="scss">
|
|
.container{
|
|
min-height:100%;
|
|
background:#f6f6f6;
|
|
padding:30rpx 0;
|
|
|
|
.card{
|
|
.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">
|
|
<cu-navbar text="农资列表" isBack style="--bg:#10C176;--c:#fff;">
|
|
<text slot="right" class="plant-xinjian" @click="$u.route({url:'pages/purchase/newAgr'})"/>
|
|
</cu-navbar>
|
|
|
|
<d-search v-model="searchVal.goodsName" @search="search"/>
|
|
|
|
<view class="card" v-if="(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>
|
|
</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(){
|
|
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>
|