|
@@ -2,7 +2,14 @@
|
|
<view class="content">
|
|
<view class="content">
|
|
<view class="head">
|
|
<view class="head">
|
|
<span class="title">项目列表</span>
|
|
<span class="title">项目列表</span>
|
|
- <span class="self">只看自己</span>
|
|
|
|
|
|
+ <span class="self">
|
|
|
|
+ <uni-data-checkbox
|
|
|
|
+ multiple
|
|
|
|
+ v-model="checkself"
|
|
|
|
+ :localdata="self"
|
|
|
|
+ @change="checkSelf()"
|
|
|
|
+ ></uni-data-checkbox>
|
|
|
|
+ </span>
|
|
</view>
|
|
</view>
|
|
<view class="list">
|
|
<view class="list">
|
|
<view
|
|
<view
|
|
@@ -20,26 +27,37 @@
|
|
<script>
|
|
<script>
|
|
import { queryProject } from "@/services/project";
|
|
import { queryProject } from "@/services/project";
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
|
|
+import uniDataCheckbox from "../../uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue";
|
|
export default {
|
|
export default {
|
|
|
|
+ components: { uniDataCheckbox },
|
|
computed: {
|
|
computed: {
|
|
...mapState(["currentProject"]),
|
|
...mapState(["currentProject"]),
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
- return { projectList: [] };
|
|
|
|
|
|
+ return {
|
|
|
|
+ checkself: [],
|
|
|
|
+ projectList: [],
|
|
|
|
+ self: [{ text: "只看自己", value: 0 }],
|
|
|
|
+ };
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- this.getProject();
|
|
|
|
|
|
+ this.getProject({});
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- async getProject() {
|
|
|
|
|
|
+ async getProject(params) {
|
|
let res = {};
|
|
let res = {};
|
|
- res = await queryProject();
|
|
|
|
|
|
+ res = await queryProject(params);
|
|
this.projectList = res.data.list;
|
|
this.projectList = res.data.list;
|
|
},
|
|
},
|
|
async onClickProject(project) {
|
|
async onClickProject(project) {
|
|
await this.$store.commit("setCurrentProject", project);
|
|
await this.$store.commit("setCurrentProject", project);
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: `./detail?id=${project.id}&auth=${false}`,
|
|
|
|
|
|
+ url: `./detail?id=${project.id}`,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ checkSelf() {
|
|
|
|
+ this.getProject({
|
|
|
|
+ filter_type: this.checkself.length,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -70,9 +88,10 @@ export default {
|
|
.list {
|
|
.list {
|
|
width: 90%;
|
|
width: 90%;
|
|
margin-top: 60px;
|
|
margin-top: 60px;
|
|
|
|
+ border-top: 2px solid gray;
|
|
}
|
|
}
|
|
.project {
|
|
.project {
|
|
- border-top: 2px solid gray;
|
|
|
|
|
|
+ border-bottom: 2px solid gray;
|
|
padding: 20px 0px;
|
|
padding: 20px 0px;
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
}
|
|
}
|