|
@@ -4,12 +4,12 @@
|
|
|
<img class="project-cover" src="@/assets/img/home_ban1.jpg">
|
|
|
</span>
|
|
|
<span class="project-title col-md-2 col-sm-10">{{project.name}}</span>
|
|
|
- <span class="project-title col-md-2 col-sm-10">{{project.code}}</span>
|
|
|
- <span class="col-md-1 col-sm-5">
|
|
|
+ <span class="project-title col-md-2 col-sm-10">{{project.id}}</span>
|
|
|
+ <span class="col-md-2 col-sm-10">
|
|
|
<span
|
|
|
- v-bind:class="['badge',{ 'ios-platform': item.toLowerCase()=='ios','android-platform': item.toLowerCase()=='android','web-platform': item.toLowerCase()=='web'}]"
|
|
|
- v-for="item in platformType"
|
|
|
- >{{item}}</span>
|
|
|
+ v-bind:class="['badge',{ 'ios-platform': item=='0','android-platform': item=='1','web-platform': item=='2'}]"
|
|
|
+ v-for="item in project.platform"
|
|
|
+ >{{platformType[item]}}</span>
|
|
|
</span>
|
|
|
<span class="col-md-1 col-sm-5">¥{{project.price}}</span>
|
|
|
<span class="project-td">
|
|
@@ -19,57 +19,54 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import PlatformType from "@/constants/enum/platform-type";
|
|
|
+import PlatformType from '@/constants/enum/platform-type'
|
|
|
+
|
|
|
export default {
|
|
|
- name: "Project-Item",
|
|
|
+ name: 'Project-Item',
|
|
|
props: {
|
|
|
- projectId: Number
|
|
|
+ projectItem: {}
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
- project: {
|
|
|
- id: 1,
|
|
|
- code: "27382hdsjkfdskfK",
|
|
|
- name: "多人聊天发送文件测试",
|
|
|
- platform: [0],
|
|
|
- description: "任务描述文字xxxx",
|
|
|
- price: "10"
|
|
|
- },
|
|
|
- platformType: []
|
|
|
- };
|
|
|
+ project: this.projectItem,
|
|
|
+ platformType: PlatformType
|
|
|
+ }
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.project.platform.map(item => {
|
|
|
- this.platformType.push(PlatformType[item]);
|
|
|
- });
|
|
|
+ mounted () {
|
|
|
+ // this.project.platform.map(item => {
|
|
|
+ // this.platformType.push(PlatformType[item]);
|
|
|
+ // });
|
|
|
},
|
|
|
methods: {
|
|
|
- goToProjectDetail(id) {
|
|
|
- console.log(id);
|
|
|
- this.$router.push({ name: "Project", params: { projectId: id } });
|
|
|
+ goToProjectDetail (id) {
|
|
|
+ console.log(id)
|
|
|
+ this.$router.push({name: 'Project', params: {projectId: id}})
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.project-item-container {
|
|
|
- padding: 20px;
|
|
|
- border: 1px solid #eee;
|
|
|
- margin: 15px 5px;
|
|
|
- span {
|
|
|
- display: inline-block;
|
|
|
+ .project-item-container {
|
|
|
+ padding: 20px;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ margin: 15px 5px;
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .project-cover {
|
|
|
+ width: 200px;
|
|
|
+ height: 130px;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+
|
|
|
+ .project-title {
|
|
|
+ font-weight: 700;
|
|
|
+ }
|
|
|
+
|
|
|
+ .project-td {
|
|
|
+ padding: 15px;
|
|
|
}
|
|
|
-}
|
|
|
-.project-cover {
|
|
|
- width: 200px;
|
|
|
- height: 130px;
|
|
|
- vertical-align: middle;
|
|
|
-}
|
|
|
-.project-title {
|
|
|
- font-weight: 700;
|
|
|
-}
|
|
|
-.project-td {
|
|
|
- padding: 15px;
|
|
|
-}
|
|
|
</style>
|