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.

134 lines
2.7 KiB

11 months ago
<template>
<!-- 设备 -->
<view class="work-container">
<Search :searchData='searchData' @search='search' @screen='screen' :isShowScreen='false'/>
<view class="list">
<view class="item" v-for="(item,index) in list" :key='index'>
<u-image :src="item.images" width='160'
height="160">
<template v-slot:error>
<view class="image-error">
<u-icon name="photo" color="#c7c7c7" size="38"></u-icon>
<view style="font-size: 24rpx;">暂无图片</view>
</view>
</template>
</u-image>
<view class="text">
<view class="title">
{{item.name}}
</view>
<view class="dec1">
{{item.number}}
</view>
<view class="dec2">
{{item.factoryAreaName}}
</view>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
11 months ago
</template>
<script>
import * as moldApi from "@/api/mold.js"
export default {
data() {
return {
searchData:{
placeholder:'请输入模具名称'
},
params: {
pageNo: 1,
pageSize: 10,
type: '',
name:''
},
status: 'loadmore', //是否显示没有更多了
list: [],
}
},
methods: {
// 搜索
search(keyWord) {
this.params.name = keyWord
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
// 筛选
screen() {
this.$tab.navigateTo(`/pages/device/screen`)
},
// 获取设备保修列表
getList() {
if (this.status == 'nomore') return;
this.status = 'loading';
this.$modal.loading('加载中')
moldApi.moldPage(this.params).then((res) => {
this.$modal.closeLoading()
if (res.data.list.length > 0) {
this.list = this.list.concat(res.data.list);
this.params.pageNo++;
this.status = 'loadmore'
} else {
this.status = 'nomore'
}
})
},
},
onShow() {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
},
onReachBottom() {
this.getList()
}
}
11 months ago
</script>
<style lang="scss" scoped>
.list {
padding-bottom: 20rpx;
.item {
margin-top: 20rpx;
background: white;
padding: 30rpx;
display: flex;
align-items: center;
.text {
margin-left: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
}
.dec1 {
font-size: 28rpx;
margin-top: 16rpx;
color: #acacac;
}
.dec2 {
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
}
}
.image-error {
text-align: center;
}
</style>