From ecaba39523b8ff19f2bfeb49322972d62fe007a7 Mon Sep 17 00:00:00 2001 From: LyMysterious Date: Fri, 11 Apr 2025 21:56:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=81=93=E5=85=B7=E5=95=86=E5=9F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/shop.js | 15 +++++ src/pages/fishbaskets/Fishbaskets.vue | 6 +- src/pages/main/Home.vue | 2 +- src/pages/shop/Shop.vue | 91 ++++++++++++++++++++++----- 4 files changed, 94 insertions(+), 20 deletions(-) create mode 100644 src/api/shop/shop.js diff --git a/src/api/shop/shop.js b/src/api/shop/shop.js new file mode 100644 index 0000000..51786e8 --- /dev/null +++ b/src/api/shop/shop.js @@ -0,0 +1,15 @@ +import request from '@/utils/request' + +/** + * 我能买的道具 + */ +export function whatCanIBuy () { + return request.get('/Trade/what-can-i-buy') +} + +/** + * 购买道具 + */ +export function buy (data) { + return request.post('/Trade/buy',data) +} \ No newline at end of file diff --git a/src/pages/fishbaskets/Fishbaskets.vue b/src/pages/fishbaskets/Fishbaskets.vue index 2bd1191..2203f42 100644 --- a/src/pages/fishbaskets/Fishbaskets.vue +++ b/src/pages/fishbaskets/Fishbaskets.vue @@ -6,7 +6,6 @@
刷新 一键处理鱼 -
@@ -15,7 +14,7 @@ - + @@ -34,7 +33,6 @@ - @@ -90,7 +88,7 @@ const handleProcessFish = async () => { // 处理出售操作 const handleSell = async (fish) => { - const { value: price } = await ElMessageBox.prompt('请输入出售价格', `出售鱼 (${fish.name})` , { + const { value: price } = await ElMessageBox.prompt('请输入出售价格', `出售鱼 (${fish.name})`, { confirmButtonText: '确认', cancelButtonText: '取消', inputPattern: /^\d+(\.\d{1,2})?$/, diff --git a/src/pages/main/Home.vue b/src/pages/main/Home.vue index f5103de..b4114be 100644 --- a/src/pages/main/Home.vue +++ b/src/pages/main/Home.vue @@ -29,7 +29,7 @@ const menuItems = [ { label: '🎒 查看装备', route: 'equipments' }, { label: '🎣 拉竿钓鱼', route: 'fishing' }, { label: '🐟 查看鱼篓', route: 'fishbaskets' }, - { label: '🛒 商店售卖', route: 'shop' }, + { label: '🛒 道具商店', route: 'shop' }, { label: '💰 市场信息', route: 'market' }, { label: '🏆 游戏排名', route: 'ranking' } ] diff --git a/src/pages/shop/Shop.vue b/src/pages/shop/Shop.vue index fcfa6da..58e8ded 100644 --- a/src/pages/shop/Shop.vue +++ b/src/pages/shop/Shop.vue @@ -1,24 +1,85 @@ -