|
@@ -20,6 +20,7 @@
|
|
|
>
|
|
|
{{ `${project.project_name}(${project.project_full_code})` }}
|
|
|
</view>
|
|
|
+ <view class="loadmore">{{ loadMoreText }}</view>
|
|
|
</view>
|
|
|
|
|
|
<uni-fab
|
|
@@ -33,7 +34,9 @@
|
|
|
<script>
|
|
|
import { queryProject } from "@/services/project";
|
|
|
import { mapState } from "vuex";
|
|
|
+import mixin from "@/utils/listMixin";
|
|
|
export default {
|
|
|
+ mixins: [mixin],
|
|
|
computed: {
|
|
|
...mapState(["currentProject"]),
|
|
|
},
|
|
@@ -41,18 +44,20 @@ export default {
|
|
|
return {
|
|
|
checkself: [],
|
|
|
projectList: [],
|
|
|
- projectFilter: { pageSize: 99999 },
|
|
|
self: [{ text: "只看自己", value: 0 }],
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.getProject();
|
|
|
+ this.initData();
|
|
|
},
|
|
|
methods: {
|
|
|
- async getProject() {
|
|
|
+ async getProject(params) {
|
|
|
let res = {};
|
|
|
- res = await queryProject(this.projectFilter);
|
|
|
- this.projectList = res.data.list;
|
|
|
+ res = await queryProject(params);
|
|
|
+ this.pagination.currentPage == 1
|
|
|
+ ? (this.projectList = res.data.list)
|
|
|
+ : (this.projectList = this.projectList.concat(res.data.list));
|
|
|
+ return res.data;
|
|
|
},
|
|
|
async onClickProject(project) {
|
|
|
await this.$store.commit("setCurrentProject", project);
|
|
@@ -65,7 +70,7 @@ export default {
|
|
|
...this.projectFilter,
|
|
|
filter_type: this.checkself.length,
|
|
|
};
|
|
|
- this.getProject();
|
|
|
+ this.initData();
|
|
|
},
|
|
|
onClickAdd() {
|
|
|
uni.navigateTo({
|
|
@@ -107,4 +112,10 @@ export default {
|
|
|
padding: 20px 0px;
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
+.loadmore {
|
|
|
+ padding: 20px 0px;
|
|
|
+ font-size: 18px;
|
|
|
+ color: gray;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|