From a0d8823b02bbef0f5627c6e4449c9a6b31ede19d Mon Sep 17 00:00:00 2001 From: dzl <786316265@qq.com> Date: Sun, 28 Sep 2025 11:53:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Pay.vue | 7 +++- src/views/ProductSummary.vue | 17 ++++----- src/views/Shop.vue | 68 ++++++++++++++++++++++++++++-------- 3 files changed, 66 insertions(+), 26 deletions(-) diff --git a/src/views/Pay.vue b/src/views/Pay.vue index 8544ea7..526ca68 100644 --- a/src/views/Pay.vue +++ b/src/views/Pay.vue @@ -455,7 +455,12 @@ const selectPaymentMethod = async (method) => { paymentData.value.totalAmount = totalPointsPrice paymentData.value.pointsAmount = availablePoints paymentData.value.beansAmount = requiredBeans - } + }// else if (method === 'alipay_wap') { + // const requiredBeans = Math.ceil(totalPointsPrice / EXCHANGE_RATE) + // paymentData.value.totalAmount = totalPointsPrice + // paymentData.value.pointsAmount = 0 + // paymentData.value.beansAmount = requiredBeans + // } } // 获取用户地址列表 diff --git a/src/views/ProductSummary.vue b/src/views/ProductSummary.vue index d56d476..c4339c6 100644 --- a/src/views/ProductSummary.vue +++ b/src/views/ProductSummary.vue @@ -2,7 +2,7 @@
<返回 - +
@@ -260,14 +260,7 @@ onMounted(async () => { .header { /* 基础布局 */ padding: 16px 20px; - background-color: #ffffff; - border-bottom: 1px solid #f0f0f0; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); - - /* 固定在顶部 */ - position: sticky; - top: 0; - z-index: 100; + background: #72c9ffae; /* 内容居中 */ display: flex; @@ -304,7 +297,7 @@ onMounted(async () => { .header span { /* 返回按钮样式 */ - color: #333333; + color: #ffffff; font-size: 16px; font-weight: 500; cursor: pointer; @@ -312,6 +305,8 @@ onMounted(async () => { border-radius: 6px; transition: all 0.2s ease; + margin-left: -15px; + /* 添加返回图标占位 */ display: inline-flex; align-items: center; @@ -334,7 +329,7 @@ onMounted(async () => { box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all 0.3s ease; overflow: hidden; - width: 374px; + width: 100%; min-height: 526px; display: flex; flex-direction: column; /* 改为垂直布局 */ diff --git a/src/views/Shop.vue b/src/views/Shop.vue index d39f0bf..fb33b0b 100644 --- a/src/views/Shop.vue +++ b/src/views/Shop.vue @@ -4,17 +4,21 @@ @@ -92,11 +96,11 @@
融豆 - {{ product.rongdou_price }} + {{ product.flash_price }}
- {{ product.points_price }} + {{ product.flash_price*10000 }}
@@ -203,6 +207,10 @@ const hasMore = ref(true) // 用户积分 const userPoints = ref(0) +// 用户融豆 +const userBeans = ref(0) + + // 分类数据 const categories = ref([ { id: 'all', name: '全部', icon: '🛍️' }, @@ -352,6 +360,20 @@ const getUserPoints = async () => { } } +// 获取用户融豆 +const getUserBeans = async () => { + try { + const {data} = await api.get('/user/profile') + console.log(data.user.balance,'beans'); + + userBeans.value = data.user.balance + } catch (error) { + console.error('获取用户融豆失败:', error) + } +} + + + const truncateText = (text, maxLength) => { if (text.length <= maxLength) return text return text.substring(0, maxLength) + '...' @@ -403,6 +425,7 @@ onMounted(() => { getProducts() getUserPoints() + getUserBeans() getHotProducts() getCheapProducts() }) @@ -418,11 +441,9 @@ onMounted(() => { .navbar { display: flex; align-items: center; - justify-content: space-between; padding: 0 16px; + justify-content: space-between; height: 56px; - background: white; - border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 100; @@ -440,12 +461,31 @@ onMounted(() => { margin: 0 auto; font-size: 18px; font-weight: 500; - color: #333; + color: #ffffff; display: inline-block; /* 使文本能够真正居中 */ } .nav-right { - margin-left: auto; /* 将积分按钮推到最右侧 */ + margin-left: auto; +} + +.points-btn { + display: flex; + align-items: center; + gap: 4px; + color: #409eff; + font-size: 14px; + white-space: nowrap; /* 防止换行 */ +} + +.beans-container { + display: flex; + align-items: center; + gap: 4px; +} + +.beans-container img { + margin-right: -2px; } .back-btn,