Browse Source

🔧 fix: 移除订单详情页中重复的查看详情按钮

- 在OrderButtonBar组件中添加hideViewDetail属性
- 在订单详情页中设置hideViewDetail=true隐藏查看详情按钮
- 保持订单列表页中查看详情按钮的正常显示

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 4 weeks ago
parent
commit
9e8aceaf20

+ 10 - 7
mini/src/components/order/OrderButtonBar/index.tsx

@@ -13,6 +13,7 @@ interface OrderButtonBarProps {
   order: Order
   order: Order
   onViewDetail: (order: Order) => void
   onViewDetail: (order: Order) => void
   onCancelOrder?: () => void
   onCancelOrder?: () => void
+  hideViewDetail?: boolean
 }
 }
 
 
 interface ActionButton {
 interface ActionButton {
@@ -21,7 +22,7 @@ interface ActionButton {
   onClick: () => void
   onClick: () => void
 }
 }
 
 
-export default function OrderButtonBar({ order, onViewDetail, onCancelOrder }: OrderButtonBarProps) {
+export default function OrderButtonBar({ order, onViewDetail, onCancelOrder, hideViewDetail = false }: OrderButtonBarProps) {
   const queryClient = useQueryClient()
   const queryClient = useQueryClient()
   const [showCancelDialog, setShowCancelDialog] = useState(false)
   const [showCancelDialog, setShowCancelDialog] = useState(false)
 
 
@@ -202,12 +203,14 @@ export default function OrderButtonBar({ order, onViewDetail, onCancelOrder }: O
   const getActionButtons = (order: Order): ActionButton[] => {
   const getActionButtons = (order: Order): ActionButton[] => {
     const buttons: ActionButton[] = []
     const buttons: ActionButton[] = []
 
 
-    // 查看详情按钮 - 所有状态都显示
-    buttons.push({
-      text: '查看详情',
-      type: 'outline',
-      onClick: () => onViewDetail(order)
-    })
+    // 查看详情按钮 - 所有状态都显示,除非明确隐藏
+    if (!hideViewDetail) {
+      buttons.push({
+        text: '查看详情',
+        type: 'outline',
+        onClick: () => onViewDetail(order)
+      })
+    }
 
 
     // 根据支付状态和订单状态显示不同的操作按钮
     // 根据支付状态和订单状态显示不同的操作按钮
     if (order.payState === 0) {
     if (order.payState === 0) {

+ 1 - 0
mini/src/pages/order-detail/index.tsx

@@ -338,6 +338,7 @@ export default function OrderDetailPage() {
           order={order}
           order={order}
           onViewDetail={() => {}}
           onViewDetail={() => {}}
           onCancelOrder={handleCancelOrder}
           onCancelOrder={handleCancelOrder}
+          hideViewDetail={true}
         />
         />
       </View>
       </View>