|
@@ -75,10 +75,12 @@
|
|
|
</form>
|
|
|
</view>
|
|
|
</tui-bottom-popup>
|
|
|
- <!--加载loadding-->
|
|
|
- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
|
|
|
- <!-- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore> -->
|
|
|
- <!--加载loadding-->
|
|
|
+ <view :style="{marginTop: procurementList.length > 0 ? '0' : '88rpx'}">
|
|
|
+ <!--加载loadding-->
|
|
|
+ <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
|
|
|
+ <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
|
|
|
+ <!--加载loadding-->
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -128,37 +130,37 @@ export default {
|
|
|
// 组件传递集采需求
|
|
|
proDataInfo: {},
|
|
|
popupShow: false, // 底部上移栏
|
|
|
- loadding: false, // 下拉刷新
|
|
|
- pullUpOn: false, // 下拉刷新
|
|
|
+ loadding: true, // 下拉刷新
|
|
|
+ pullUpOn: true, // 下拉刷新
|
|
|
// 分页参数
|
|
|
pageInfo: {
|
|
|
pageNo: 1,
|
|
|
pageSize: 10
|
|
|
},
|
|
|
+ // 我参与的数据请求
|
|
|
+ participate: {
|
|
|
+ userId: '',
|
|
|
+ procurementType: 0,
|
|
|
+ },
|
|
|
// 所有数据
|
|
|
- procurementList: [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- userId: 2,
|
|
|
- productImage: '',
|
|
|
- productName: '测试',
|
|
|
- price: 1000,
|
|
|
- number: 1000,
|
|
|
- saveTime: '2023-1-2',
|
|
|
- createUserId: 33,
|
|
|
- isAchieve: 0,
|
|
|
- delFlag: 0,
|
|
|
- clubName: '测试机构',
|
|
|
- isInvolved: 0
|
|
|
- }
|
|
|
- ],
|
|
|
+ procurementList: [],
|
|
|
// 下拉刷新
|
|
|
- nomoreText: '已经被掏空了~'
|
|
|
+ nomoreText: '已经被掏空了~',
|
|
|
+ userInfo: {},
|
|
|
+ isLastPage: false, // 是否是最后一页
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
currentTab(val) {
|
|
|
- if (val) {
|
|
|
+ this.loadding = true
|
|
|
+ this.pullUpOn = true
|
|
|
+ if (val>0) {
|
|
|
+ this.participate.procurementType = --val
|
|
|
+ this.procurementTabChange()
|
|
|
+ } else {
|
|
|
+ this.isLastPage = false
|
|
|
+ this.pageInfo.pageNo = 1
|
|
|
+ this.procurementAllList()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -167,13 +169,18 @@ export default {
|
|
|
...mapState(['hasLogin'])
|
|
|
},
|
|
|
onShow() {
|
|
|
+ // if (this.hasLogin) {
|
|
|
+ this.userInfo = uni.getStorageSync('userInfo')
|
|
|
+ this.pageInfo.userId = this.userInfo.userId
|
|
|
+ this.participate.userId = this.userInfo.userId
|
|
|
+ this.procurementAllList()
|
|
|
+ // } else {
|
|
|
+ // this.$api.redirectTo('/pages/login/login')
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ this.pageInfo.pageNo+=1
|
|
|
this.procurementAllList()
|
|
|
- if (this.hasLogin) {
|
|
|
- this.skeletonShow = false
|
|
|
- } else {
|
|
|
- // this.$api.redirectTo('/pages/login/login')
|
|
|
- this.skeletonShow = false
|
|
|
- }
|
|
|
},
|
|
|
methods: {
|
|
|
// tab 切换
|
|
@@ -218,13 +225,31 @@ export default {
|
|
|
*/
|
|
|
// 全部集采
|
|
|
async procurementAllList() {
|
|
|
- try {
|
|
|
- const data = await this.ProcurementService.procurementAllList(this.pageInfo)
|
|
|
- this.procurementList = data.list
|
|
|
- } catch (error) {
|
|
|
+ if (!this.isLastPage) {
|
|
|
+ try {
|
|
|
+ const {data} = await this.ProcurementService.procurementAllList(this.pageInfo)
|
|
|
+ this.procurementList = [...this.procurementList, ...data.list]
|
|
|
+ this.isLastPage = data.isLastPage
|
|
|
+ this.loadding = !data.isLastPage
|
|
|
+ this.pullUpOn = !data.isLastPage
|
|
|
+ this.skeletonShow = false
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 我参与的 | 我发起的
|
|
|
+ async procurementTabChange() {
|
|
|
+ try{
|
|
|
+ const {data} = await this.ProcurementService.procurementTabChange(this.participate)
|
|
|
+ this.procurementList = data
|
|
|
+ this.loadding = false
|
|
|
+ this.pullUpOn = false
|
|
|
+ this.skeletonShow = false
|
|
|
+ }catch(error){
|
|
|
console.log(error)
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|