From 53b3556ee9659435d2ff5f5425f7b058a5203dcc Mon Sep 17 00:00:00 2001 From: Rogee Date: Wed, 30 Apr 2025 21:44:18 +0800 Subject: [PATCH] feat: fix user boughts --- backend/app/http/users.go | 2 ++ frontend/wechat/index.html | 2 +- frontend/wechat/src/components/ArticleListItem.vue | 4 ++-- frontend/wechat/src/layouts/MainLayout.vue | 4 ++-- frontend/wechat/src/views/ArticleDetail.vue | 2 +- frontend/wechat/src/views/UserProfile.vue | 5 +++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/backend/app/http/users.go b/backend/app/http/users.go index b801e0a..7c22ec3 100644 --- a/backend/app/http/users.go +++ b/backend/app/http/users.go @@ -17,6 +17,7 @@ type UserInfo struct { ID int64 `json:"id,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` Username string `json:"username,omitempty"` + Avatar string `json:"avatar,omitempty"` } // @Router /users/profile [get] @@ -26,6 +27,7 @@ func (ctl *users) Profile(ctx fiber.Ctx, user *model.Users) (*UserInfo, error) { ID: user.ID, CreatedAt: user.CreatedAt, Username: user.Username, + Avatar: *user.Avatar, }, nil } diff --git a/frontend/wechat/index.html b/frontend/wechat/index.html index da7b223..8cb8fd4 100644 --- a/frontend/wechat/index.html +++ b/frontend/wechat/index.html @@ -3,7 +3,7 @@ - + 动态曲谱 diff --git a/frontend/wechat/src/components/ArticleListItem.vue b/frontend/wechat/src/components/ArticleListItem.vue index 6f4de39..f938c3e 100644 --- a/frontend/wechat/src/components/ArticleListItem.vue +++ b/frontend/wechat/src/components/ArticleListItem.vue @@ -17,7 +17,7 @@ const formattedDate = computed(() => { }) const discountPrice = computed(() => { - return (props.article.price * props.article.discount / 100).toFixed(2) + return (props.article.price * props.article.discount / (100 * 100)).toFixed(2) }) const showArticle = (article) => { @@ -68,7 +68,7 @@ const showArticle = (article) => { diff --git a/frontend/wechat/src/layouts/MainLayout.vue b/frontend/wechat/src/layouts/MainLayout.vue index e91f376..bc9322a 100644 --- a/frontend/wechat/src/layouts/MainLayout.vue +++ b/frontend/wechat/src/layouts/MainLayout.vue @@ -30,7 +30,7 @@ const switchTab = (index, route) => { diff --git a/frontend/wechat/src/views/ArticleDetail.vue b/frontend/wechat/src/views/ArticleDetail.vue index 5b70c23..691cdd3 100644 --- a/frontend/wechat/src/views/ArticleDetail.vue +++ b/frontend/wechat/src/views/ArticleDetail.vue @@ -185,7 +185,7 @@ onUnmounted(() => {
¥ - {{ (article.price / 100).toFixed(2) }} + {{ (article.price * article.discount / (100 * 100)).toFixed(2) }}