Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Sep 22, 2024
1 parent b64b5fe commit d88dcce
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 280 deletions.
4 changes: 2 additions & 2 deletions src/pages/projects/[id]/fork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</template>

<template v-slot:subtitle>
作者{{ project.author_display_name }},发布于:{{ project.time }},{{ project.view_count }}次浏览
作者{{ project.author.display_name }},发布于:{{ project.time }},{{ project.view_count }}次浏览
</template>

<template v-slot:text>
Expand Down Expand Up @@ -104,7 +104,7 @@ export default {
methods: {
async getproject() {
this.project = await request({
url: '/api/projectinfo?id=' + this.$route.params.id,
url: "/project/" + this.$route.params.id,
method: 'get',
})
console.log(this.project)
Expand Down
70 changes: 23 additions & 47 deletions src/pages/projects/[id]/index.vue
Original file line number Diff line number Diff line change
@@ -1,43 +1,27 @@
<template>
<v-container>
<v-row
><v-col cols="8" md="8" lg="8" xl="8" sm="8" xs="8">
<v-row><v-col cols="8" md="8" lg="8" xl="8" sm="8" xs="8">
<ProjectRunner :type="project.type" :id="project.id" />
</v-col>

<v-col cols="4">
<v-card hover
><v-card-item>
<v-card hover><v-card-item>
<v-card-title>{{ project.title }}</v-card-title>
<v-card-subtitle>{{ project.description }}</v-card-subtitle>
</v-card-item>
<div class="px-4 d-flex ga-2 mb-2">
<v-chip pill>
<v-avatar start>
<v-img
:src="
'https://s4-1.wuyuan.1r.ink/user/' + project.author_images
"
></v-img> </v-avatar
>{{ project.author_display_name }}</v-chip
>
<v-img :src="'https://s4-1.wuyuan.1r.ink/user/' + project.author.images
"></v-img> </v-avatar>{{ project.author.display_name }}</v-chip>
</div>
<div class="px-4 d-flex ga-2 mb-2">
<v-chip pill prepend-icon="mdi-eye"
>{{ project.view_count }}浏览</v-chip
>
<v-chip pill prepend-icon="mdi-eye">{{ project.view_count }}浏览</v-chip>
<v-chip pill prepend-icon="mdi-clock">{{ project.time }}</v-chip>
</div>
<div class="px-4 d-flex ga-2 mb-2">
<v-chip pill prepend-icon="mdi-xml" v-if="project.state == 'public'"
>开源作品</v-chip
>
<v-chip
pill
prepend-icon="mdi-xml"
v-if="project.state == 'private'"
>私密作品</v-chip
>
<v-chip pill prepend-icon="mdi-xml" v-if="project.state == 'public'">开源作品</v-chip>
<v-chip pill prepend-icon="mdi-xml" v-if="project.state == 'private'">私密作品</v-chip>

<v-chip pill prepend-icon="mdi-application">{{
project.type
Expand All @@ -49,39 +33,28 @@
</div>
</div>
<div class="px-4 d-flex ga-2 mb-2">
<v-btn @click="openEditor(project.id, project.type)" variant="text"
>打开创造页</v-btn
>
<v-btn
v-if="project.authorid != localuser.user.id"
:to="'/projects/' + project.id + '/fork'"
variant="text"
>改编</v-btn
>
<v-btn @click="openEditor(project.id, project.type)" variant="text">打开创造页</v-btn>
<v-btn v-if="project.authorid != localuser.user.id" :to="'/projects/' + project.id + '/fork'"
variant="text">改编</v-btn>
</div>

<div class="px-4">
<v-card hover variant="tonal" :to="'/user/' + project.authorid">
<v-card-item>
<template v-slot:prepend>
<v-avatar>
<v-img
:alt="project.author_display_name"
:src="
'https://s4-1.wuyuan.1r.ink/user/' +
project.author_images
"
></v-img>
<v-img :alt="project.author.display_name" :src="'https://s4-1.wuyuan.1r.ink/user/' +
project.author.images
"></v-img>
</v-avatar>
</template>
<v-card-title class="text-white">
{{ project.author_display_name }}
{{ project.author.display_name }}
</v-card-title>
<v-card-subtitle class="text-white">
{{ project.author_motto }}
{{ project.author.motto }}
</v-card-subtitle>
</v-card-item></v-card
>
</v-card-item></v-card>
</div>

<br />
Expand Down Expand Up @@ -120,9 +93,12 @@ export default {
tags: "",
likeid: "",
favoid: "",
author_display_name: "加载中",
author_images: "10d366468781c064f087c75708bf24b9",
author_motto: "加载中",
author: {
id: 1,
display_name: "加载中",
images: "加载中",
}
},
openEditor: openEditor,
localuser: localuser,
Expand Down Expand Up @@ -153,7 +129,7 @@ export default {
methods: {
async getproject() {
this.project = await request({
url: "/api/projectinfo?id=" + this.$route.params.id,
url: "/project/" + this.$route.params.id,
method: "get",
});
console.log(this.project);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects/[id]/push.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default {
methods: {
async getproject() {
this.project = await request({
url: '/api/projectinfo?id=' + this.$route.params.id,
url: "/project/" + this.$route.params.id,
method: 'get',
})
console.log(this.project)
Expand Down
Loading

0 comments on commit d88dcce

Please sign in to comment.