From 22a87039787ea61009457bf80bc47a275ffc18e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Sun, 3 Nov 2024 18:01:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90bbs=E5=95=86=E5=9F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/Shop/ShopGetListOutput.cs | 5 +- .../Services/Shop/BbsShopService.cs | 2 +- Yi.Bbs.Vue3/src/apis/shopApi.js | 33 ++++++++ Yi.Bbs.Vue3/src/views/shop/Index.vue | 83 +++++++++++++++---- .../src/views/shop/components/ShopCard.vue | 65 ++++++++++++--- 5 files changed, 160 insertions(+), 28 deletions(-) create mode 100644 Yi.Bbs.Vue3/src/apis/shopApi.js diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Shop/ShopGetListOutput.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Shop/ShopGetListOutput.cs index 349d7fe6..9401c085 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Shop/ShopGetListOutput.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Shop/ShopGetListOutput.cs @@ -1,8 +1,9 @@ -using Yi.Framework.Bbs.Domain.Shared.Enums; +using Volo.Abp.Application.Dtos; +using Yi.Framework.Bbs.Domain.Shared.Enums; namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Shop; -public class ShopGetListOutput +public class ShopGetListOutput:EntityDto { /// /// 上架时间 diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Shop/BbsShopService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Shop/BbsShopService.cs index 766c17b5..267a58a3 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Shop/BbsShopService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Shop/BbsShopService.cs @@ -92,7 +92,7 @@ public class BbsShopService : ApplicationService var eto = new SetAccountInfoEto(userId); await LocalEventBus.PublishAsync(eto, false); //钱钱累加 - output.Money += eto.Money; + output.Money =money+ eto.Money; output.Points = eto.Points; output.Value = eto.Value; return output; diff --git a/Yi.Bbs.Vue3/src/apis/shopApi.js b/Yi.Bbs.Vue3/src/apis/shopApi.js new file mode 100644 index 00000000..4f59758d --- /dev/null +++ b/Yi.Bbs.Vue3/src/apis/shopApi.js @@ -0,0 +1,33 @@ +import request from "@/config/axios/service"; + +/** + * 获取商城列表 + */ +export function getShopList() { + return request({ + url: `/bbs-shop`, + method: "get", + }); +} + + +/** + * 获取商城的用户信息 + */ +export function getAccountInfo() { + return request({ + url: `/bbs-shop/account`, + method: "get", + }); +} + +/** + * 购买商品 + */ +export function postBuy(data) { + return request({ + url: `/bbs-shop/buy`, + method: "post", + data + }); +} diff --git a/Yi.Bbs.Vue3/src/views/shop/Index.vue b/Yi.Bbs.Vue3/src/views/shop/Index.vue index 8f7d28cc..11fab231 100644 --- a/Yi.Bbs.Vue3/src/views/shop/Index.vue +++ b/Yi.Bbs.Vue3/src/views/shop/Index.vue @@ -1,4 +1,45 @@ -