wechat_yxcl/pages/ProductReview/ProductReview.vue
ylj20011123 d23f7a9109 update
2025-07-28 18:54:09 +08:00

167 lines
3.7 KiB
Vue

<template>
<view class="content">
<!-- <view style="flex: 1;overflow: hidden;" >
<scroll-view scroll-y="true" style="height: 100%;width: 100%;" @scrolltolower="loadMore"> -->
<view v-if="pageList.length > 0">
<list-unit v-for="(item, index) in pageList" :key="index" :item="item" :i="index"
@goDetail="goDetail"></list-unit>
</view>
<view v-else-if="!pageData.isLoading" style="height: 100%;">
<noFound :nodata="pageList.length > 0 ? false : true" />
</view>
<view class="load-more" v-if="pageList.length > 0">
<text>{{ !pageData.isEnd ? '正在加载,请稍后...' : '——— 我是有底线的 ———' }}</text>
</view>
<!-- </scroll-view>
</view> -->
</view>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
import ListUnit from './components/businessUnit.vue'
export default {
data() {
return {
pageData: {
pageIndex: 1,
pageSize: 10,
isEnd: false,
isLoading: true
},
pageList: []
}
},
components: {
ListUnit
},
computed: {
...mapGetters({
reloading: 'shouldReLoadingList',
users: 'getUser'
})
},
methods: {
...mapMutations(['shouldReLoadingList']),
getList() {
let _this = this
let req = {
SearchParameter: {
Accept_Code: "",
BusinessProcess_StateSearch: "",
Operation_Type: 6,
UserId: this.users.UserId
},
PageIndex: _this.pageData.pageIndex,
PageSize: _this.pageData.pageSize,
}
console.log('reqreqreqreq', req);
this.$request.$webPost('EShangApiMain/BusinessProcess/GetBusinessProcessList', req).then(res => {
console.log('resada', res);
if (res.Result_Code === 100) {
let list = res.Result_Data.List
if (list.length > 0) {
_this.pageList = this.pageData.pageIndex == 1 ? list : [..._this.pageList, ...list]
}
if (list.length < _this.pageData.pageSize) { // 返回条数小于每页条数
_this.pageData.isEnd = true
}
_this.$forceUpdate()
} else {
_this.pageList = []
}
uni.hideLoading()
setTimeout(function () {
_this.pageData.isLoading = false
}, 500)
})
// _this.$request.$get("GetCommdityFlowList",{
// pageIndex: _this.pageData.pageIndex,
// pageSize: _this.pageData.pageSize
// }).then(res => {
// if(!res.ResultCode ||res.ResultCode!='100'){
// _this.pageList = []
// }else{
// let list = res.Data.List
// if (list.length > 0) {
// _this.pageList = this.pageData.pageIndex==1 ? list : [..._this.pageList,...list]
// }
// if (list.length < _this.pageData.pageSize) { // 返回条数小于每页条数
// _this.pageData.isEnd = true
// }
// _this.$forceUpdate()
// }
// })
},
loadMore() {
if (!this.pageData.isEnd) {
this.pageData.pageIndex += 1
this.getList()
}
},
goDetail(item) {
let pageName = ''
this.$util.toNextRoute('navigateTo', "/pages/businessApproval/productDetail?id=" + item.HIGHWAYPROINST_ID)
},
},
onPullDownRefresh() {
this.pageData.pageIndex = 1
this.pageData.isEnd = false
uni.showLoading({
title: '正在加载'
})
this.getList()
setTimeout(function () {
uni.stopPullDownRefresh()
}, 1000)
},
onReachBottom() {
this.loadMore()
},
onShow() {
let _this = this
if (this.reloading) {
uni.showLoading({
title: '正在加载'
})
_this.pageData.pageIndex = 1
_this.pageData.isEnd = false
_this.getList()
this.shouldReLoadingList(false)
}
},
onLoad() {
this.pageData.isLoading = true
uni.showLoading({
title: '正在加载'
})
this.getList()
},
onUnload() {
this.$util.addUserBehaviorNew()
},
onHide() {
}
}
</script>
<style scoped>
.content {
display: flex;
flex-direction: column;
justify-content: center;
/* height: 100%; */
}
</style>