browse.fxml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?import javafx.geometry.*?>
  3. <?import javafx.scene.control.*?>
  4. <?import javafx.scene.layout.*?>
  5. <VBox fx:id="browsePane" xmlns="http://javafx.com/javafx/23" xmlns:fx="http://javafx.com/fxml/1">
  6. <HBox spacing="10" styleClass="well" style="-fx-background-radius: 0; -fx-border: none; -fx-effect: none;">
  7. <padding><Insets top="12" right="16" bottom="12" left="16"/></padding>
  8. <TextField fx:id="searchField" promptText="搜索书名、作者..." styleClass="form-control" HBox.hgrow="ALWAYS"/>
  9. <ComboBox fx:id="categoryCombo" prefWidth="140" styleClass="form-control"/>
  10. <Button text="搜索" onAction="#handleSearch" styleClass="btn,btn-primary" prefWidth="90"/>
  11. </HBox>
  12. <SplitPane dividerPositions="0.68" VBox.vgrow="ALWAYS">
  13. <ScrollPane fitToWidth="true" hbarPolicy="NEVER" VBox.vgrow="ALWAYS">
  14. <TilePane fx:id="bookCardGrid" prefTileWidth="210" prefTileHeight="240" hgap="16" vgap="16" styleClass="well" style="-fx-background-radius: 0; -fx-border: none; -fx-effect: none;">
  15. <padding><Insets top="16" right="16" bottom="16" left="16"/></padding>
  16. </TilePane>
  17. </ScrollPane>
  18. <VBox fx:id="detailPanel" spacing="16" styleClass="detail-panel" visible="false" managed="false">
  19. <padding><Insets top="20" right="16" bottom="20" left="16"/></padding>
  20. <HBox alignment="CENTER_LEFT" spacing="8">
  21. <Label fx:id="detailTitle" text="选择一本书" styleClass="detail-title" HBox.hgrow="ALWAYS"/>
  22. <Button text="✕" onAction="#handleCloseDetail" styleClass="btn,btn-secondary" style="-fx-padding: 4px 10px; -fx-font-size: 14px;"/>
  23. </HBox>
  24. <HBox spacing="8">
  25. <Label fx:id="detailCategory" styleClass="label,label-primary" text="-"/>
  26. <Label fx:id="detailStock" styleClass="label" text="-"/>
  27. </HBox>
  28. <Label text="作者" styleClass="detail-label"/>
  29. <Label fx:id="detailAuthor" text="-"/>
  30. <Separator/>
  31. <HBox spacing="12" alignment="CENTER_LEFT">
  32. <VBox>
  33. <Label text="原价" styleClass="detail-label"/>
  34. <Label fx:id="detailOriginalPrice" styleClass="book-original-price" text="-"/>
  35. </VBox>
  36. <VBox>
  37. <Label text="售价" styleClass="detail-label"/>
  38. <Label fx:id="detailPrice" styleClass="detail-price" text="-"/>
  39. </VBox>
  40. </HBox>
  41. <Separator/>
  42. <HBox spacing="8" alignment="CENTER_LEFT">
  43. <Label text="数量" styleClass="detail-label"/>
  44. <TextField fx:id="quantityField" text="1" styleClass="form-control" maxWidth="80"/>
  45. </HBox>
  46. <Button text="立即购买" onAction="#handlePurchase" maxWidth="Infinity" styleClass="btn,btn-success" prefHeight="42"/>
  47. </VBox>
  48. </SplitPane>
  49. <HBox spacing="10" alignment="CENTER" styleClass="well" style="-fx-background-radius: 0; -fx-border: none; -fx-effect: none;">
  50. <padding><Insets top="8" right="16" bottom="8" left="16"/></padding>
  51. <Button fx:id="prevPageBtn" text="‹ 上一页" onAction="#handlePrevPage" styleClass="btn,btn-secondary" disable="true"/>
  52. <Label fx:id="pageInfoLabel" text="第 1 页 / 共 1 页" style="-fx-font-size: 13px; -fx-padding: 0 16px;"/>
  53. <Button fx:id="nextPageBtn" text="下一页 ›" onAction="#handleNextPage" styleClass="btn,btn-secondary" disable="true"/>
  54. <Region HBox.hgrow="ALWAYS"/>
  55. <Label text="每页:" style="-fx-font-size: 13px;"/>
  56. <ComboBox fx:id="pageSizeCombo" prefWidth="70"/>
  57. </HBox>
  58. </VBox>