businessList.vue
2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<template>
<!-- 商务合作 -->
<view class="page">
<!-- 搜索 -->
<view class="head-search">
<u-search bg-color="#fff" placeholder="请输入关键词" v-model="query.keyword" :show-action="false" @search="search"></u-search>
<u-button type="success" @click="search">搜索</u-button>
</view>
<view class="goods-data">
<view class="goods-list">
<view class="good-item" v-for="(v, i) in datalist" :key="i" @click="toDetail">
<view class="body">
<view class="info">
<view class="title">商务合作标题商务合作标题商务合作标题商务合作标题</view>
<view class="info-item">2023-02-02 14:54</view>
</view>
<image :src="$imgUrl('/img/2.jpg')" ></image>
</view>
</view>
<u-loadmore :status="statuslist" @loadmore='loading' style="width: 100%; text-align: center;"/>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tabList:[
{ name: '全部' },
{ name: '待提交' },
{ name: '待审核' },
{ name: '通过' },
{ name: '驳回' },
{ name: '进行中' },
{ name: '已结束' },
],
current: 0,
datalist: [{}, {}, {}],
total: 2,
statuslist: 'loadmore',
query: {
keyword: '',
pageSize: 10,
pageNum: 0,
},
listIn:0,
num:0,
};
},
onLoad(option) {
console.log(option.id);
this.num = option.id;
this.statuslist = 'nomore';
},
onPullDownRefresh(e) {
let that = this
that.statuslist = 'loading';
this.page = 0;
setTimeout(() => {
that.datalist = [{}];
that.statuslist = that.datalist.length >= that.total ? 'nomore' : 'loadmore';
uni.stopPullDownRefresh();
}, 1000);
},
onReachBottom(e) {
// this.loading();
},
methods: {
tabsChange(val) {
this.current = val;
},
search() {},
loading() {
let that = this
if(that.statuslist == 'nomore') return;
that.statuslist = 'loading';
that.query.pageNum = ++that.query.pageNum;
setTimeout(() => {
let data = [{}, {}];
that.datalist = [...that.datalist, ...data];
console.log(that.datalist);
that.statuslist = that.datalist.length >= that.total ? 'nomore' : 'loadmore';
}, 300)
},
sel(val){
this.listIn = val
},
toDetail() {
uni.navigateTo({
url: '/pages/business/businessDetail/businessDetail'
})
},
reconciliationdetail() {
},
toAdd() {
uni.navigateTo({
url: '/pages/activityAdd/activityAdd'
})
}
}
}
</script>
<style scoped lang="scss">
@import 'businessList.scss';
</style>