145 lines
3.0 KiB
Vue
145 lines
3.0 KiB
Vue
|
<template>
|
|||
|
<view class="container">
|
|||
|
<view class="list">
|
|||
|
|
|||
|
<view class="item u-flex u-row-between u-col-top" v-for="(item,index) in list" :key="index" @click="gotoDetail(item.id)">
|
|||
|
<view class="l">
|
|||
|
<view class="title u-l-1">{{item.goodsName}}</view>
|
|||
|
<view class="name">{{item.typeName}}</view>
|
|||
|
</view>
|
|||
|
<view class="r">
|
|||
|
求购数量:{{item.quantity}}{{item.measureUnit}}
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
</template>
|
|||
|
|
|||
|
<script>
|
|||
|
import { listPurchaseDemandLish } from "@/api/lef/demandPublish.js";
|
|||
|
export default {
|
|||
|
data() {
|
|||
|
return {
|
|||
|
list: [],
|
|||
|
page: 1,
|
|||
|
pageSize: 10,
|
|||
|
total: 0,
|
|||
|
nolist: false,
|
|||
|
type: 0
|
|||
|
}
|
|||
|
},
|
|||
|
onLoad() {
|
|||
|
this.loadData()
|
|||
|
},
|
|||
|
methods: {
|
|||
|
gotoDetail(id){
|
|||
|
uni.navigateTo({
|
|||
|
url:`/pages/index/needList/needDetails?id=${id}&type=${this.type}`
|
|||
|
})
|
|||
|
},
|
|||
|
loadData(callback) {
|
|||
|
listPurchaseDemandLish({
|
|||
|
page: this.page,
|
|||
|
pageSize: this.pageSize
|
|||
|
}).then((res) => {
|
|||
|
if (res.code == 200) {
|
|||
|
if(this.page == 1){
|
|||
|
this.list = [];
|
|||
|
}
|
|||
|
this.list = this.list.concat(res.rows)
|
|||
|
if(res.rows.length < this.pageSize){
|
|||
|
// this.showNoData = true;
|
|||
|
}
|
|||
|
} else {
|
|||
|
uni.showToast({
|
|||
|
title: res.msg,
|
|||
|
icon: "none",
|
|||
|
duration: 1500
|
|||
|
});
|
|||
|
}
|
|||
|
}).finally(() => {
|
|||
|
callback && callback();
|
|||
|
});
|
|||
|
},
|
|||
|
|
|||
|
// listSales() {
|
|||
|
// this.salLoadMorestatus = "loading";
|
|||
|
// listSalesDemandLish(this.SalQueryParams).then((response) => {
|
|||
|
// this.saleList = response.rows;
|
|||
|
// this.salTotal = response.total;
|
|||
|
// if (this.SalQueryParams.pageSize >= this.salTotal) {
|
|||
|
// this.salLoadMorestatus = "noMore";
|
|||
|
// } else {
|
|||
|
// this.salLoadMorestatus = "more";
|
|||
|
// }
|
|||
|
// this.getMaxDemtab();
|
|||
|
// this.loading = false;
|
|||
|
// });
|
|||
|
// },
|
|||
|
},
|
|||
|
|
|||
|
|
|||
|
onPullDownRefresh(){
|
|||
|
this.page=1;
|
|||
|
this.loadData(()=>uni.stopPullDownRefresh());
|
|||
|
},
|
|||
|
onReachBottom(){
|
|||
|
this.page=this.page+1;
|
|||
|
this.loadData();
|
|||
|
},
|
|||
|
|
|||
|
}
|
|||
|
</script>
|
|||
|
|
|||
|
<style lang="scss" scoped>
|
|||
|
$color: #4892FD;
|
|||
|
|
|||
|
.container {
|
|||
|
padding: 10rpx 30rpx 100rpx;
|
|||
|
background: #fff;
|
|||
|
|
|||
|
.list {
|
|||
|
width:100%;
|
|||
|
.item {
|
|||
|
border-bottom: 2rpx solid #eee;
|
|||
|
padding: 25rpx 0;
|
|||
|
|
|||
|
&:last-child {
|
|||
|
border-bottom: 0;
|
|||
|
}
|
|||
|
|
|||
|
.l {
|
|||
|
flex: 1;
|
|||
|
width: 1rpx;
|
|||
|
margin-right: 20rpx;
|
|||
|
|
|||
|
.title {
|
|||
|
font-size: 32rpx;
|
|||
|
font-weight: bold;
|
|||
|
color: #333333;
|
|||
|
line-height: 50rpx;
|
|||
|
height: 50rpx;
|
|||
|
}
|
|||
|
|
|||
|
.name {
|
|||
|
margin-top: 20rpx;
|
|||
|
font-size: 26rpx;
|
|||
|
font-weight: 500;
|
|||
|
color: #777777;
|
|||
|
line-height: 40rpx;
|
|||
|
height: 40rpx;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
.r {
|
|||
|
font-size: 26rpx;
|
|||
|
font-weight: 500;
|
|||
|
color: #0D0D0D;
|
|||
|
line-height: 80rpx;
|
|||
|
height: 80rpx;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
</style>
|