From d57efcb8d4c5a5bb7bf384481b5cb6b48be0e90f Mon Sep 17 00:00:00 2001 From: DU Date: Sat, 24 Jan 2026 13:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=80=80=E6=AC=BE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pagesUser/goodsOrderDetail/index.scss | 99 +++++++++++++++++++++++ src/pagesUser/goodsOrderDetail/index.tsx | 93 ++++++++++++++++++++- 2 files changed, 188 insertions(+), 4 deletions(-) diff --git a/src/pagesUser/goodsOrderDetail/index.scss b/src/pagesUser/goodsOrderDetail/index.scss index c59862c..c8b127d 100644 --- a/src/pagesUser/goodsOrderDetail/index.scss +++ b/src/pagesUser/goodsOrderDetail/index.scss @@ -136,3 +136,102 @@ } } } + +// 退款申请弹窗 +.refund_popup { + background-color: #FFFFFF; + border-radius: 24px 24px 0 0; + padding: 0 30px 30px; + max-height: 80vh; + overflow-y: auto; + + // 标题栏 + .popup_header { + display: flex; + align-items: center; + justify-content: space-between; + height: 100px; + border-bottom: 1PX solid #EBEDF0; + margin-bottom: 30px; + + .cancel_btn { + font-size: 30px; + color: #646566; + } + + .popup_title { + font-size: 33px; + color: #323233; + font-weight: 500; + } + + .submit_btn { + font-size: 30px; + color: #03C175; + font-weight: 500; + } + } + + // 商品信息 + .popup_goods_info { + display: flex; + align-items: center; + padding: 30px; + background-color: #F7F8FA; + border-radius: 12px; + margin-bottom: 30px; + + .popup_goods_image { + width: 160px; + height: 160px; + border-radius: 8px; + flex-shrink: 0; + } + + .popup_goods_detail { + flex: 1; + margin-left: 30px; + display: flex; + flex-direction: column; + gap: 20px; + + .popup_goods_name { + font-size: 28px; + color: #323233; + line-height: 1.4; + } + + .popup_goods_price { + font-size: 28px; + color: #323233; + font-weight: 500; + } + } + } + + // 退款原因 + .refund_reason_section { + .reason_label { + display: block; + font-size: 28px; + color: #323233; + margin-bottom: 20px; + } + + .reason_input { + width: 100%; + min-height: 200px; + padding: 20px; + background-color: #F7F8FA; + border-radius: 8px; + font-size: 28px; + color: #323233; + line-height: 1.5; + box-sizing: border-box; + } + + .reason_placeholder { + color: #C8C9CC; + } + } +} diff --git a/src/pagesUser/goodsOrderDetail/index.tsx b/src/pagesUser/goodsOrderDetail/index.tsx index 55c35a3..7de6b97 100644 --- a/src/pagesUser/goodsOrderDetail/index.tsx +++ b/src/pagesUser/goodsOrderDetail/index.tsx @@ -1,10 +1,10 @@ /** * 订单详情页(商品消费详情) */ -import { View, Text, Button } from '@tarojs/components' +import { View, Text, Button, Textarea } from '@tarojs/components' import { useState } from 'react' import Taro, { useLoad } from '@tarojs/taro' -import { Image } from '@taroify/core' +import { Image, Popup } from '@taroify/core' import './index.scss' // 商品信息接口 @@ -35,6 +35,9 @@ interface OrderDetail { const OrderDetail = () => { const [pageType, setPageType] = useState<'unpaid' | 'paid'>('unpaid') + const [refundPopupOpen, setRefundPopupOpen] = useState(false) + const [currentRefundGoods, setCurrentRefundGoods] = useState(null) + const [refundReason, setRefundReason] = useState('') // 模拟订单详情数据 const [orderDetail] = useState({ @@ -81,10 +84,44 @@ const OrderDetail = () => { // 申请退款 const handleRefund = (goodsId: string) => { console.log('申请退款', goodsId) + // 查找商品 + const goods = orderDetail.goods.find(item => item.id === goodsId) + if (goods) { + setCurrentRefundGoods(goods) + setRefundReason('') + setRefundPopupOpen(true) + } + } + + // 提交退款申请 + const handleSubmitRefund = () => { + if (!refundReason.trim()) { + Taro.showToast({ + title: '请输入退款原因', + icon: 'none' + }) + return + } + + console.log('提交退款申请', { + goodsId: currentRefundGoods?.id, + reason: refundReason + }) + Taro.showToast({ - title: '申请退款', - icon: 'none' + title: '退款申请已提交', + icon: 'success' }) + + // 关闭弹窗 + setRefundPopupOpen(false) + setRefundReason('') + } + + // 取消退款 + const handleCancelRefund = () => { + setRefundPopupOpen(false) + setRefundReason('') } // 立即支付 @@ -192,6 +229,54 @@ const OrderDetail = () => { )} + + {/* 退款申请弹窗 */} + + + {/* 标题栏 */} + + 取消 + 申请退款 + 提交 + + + {/* 商品信息 */} + {currentRefundGoods && ( + + + + {currentRefundGoods.name} + ¥ {currentRefundGoods.price.toFixed(2)} + + + )} + + {/* 退款原因 */} + + 退款原因: +