sample-charg.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div class="container">
  3. <div class="list">
  4. <ul>
  5. <li v-for="(v, i) in tableData" :key="i">
  6. <h4>
  7. <div class="title">{{ v.name }}</div>
  8. </h4>
  9. <div class="price-item">
  10. <span class="price">{{ v.price }}</span>
  11. <span>元/样</span>
  12. </div>
  13. </li>
  14. </ul>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import to from "await-to-js";
  20. import { getSampleOption } from "@/api/instr/index";
  21. export default {
  22. name: "equipment",
  23. components: {},
  24. data() {
  25. return {
  26. tableData: [],
  27. searchForm: {
  28. id: 0,
  29. },
  30. total: 0,
  31. };
  32. },
  33. created() {},
  34. mounted() {
  35. this.searchForm.id = this.$route.query.id * 1;
  36. this.getNoticeListData();
  37. },
  38. methods: {
  39. async getNoticeListData() {
  40. const [err, res] = await to(getSampleOption(this.searchForm));
  41. if (err) return;
  42. if (res.code == 200) {
  43. this.tableData = res.data;
  44. }
  45. },
  46. },
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .container {
  51. padding: 10px 0;
  52. .list {
  53. li {
  54. background: #f3f6fb;
  55. border-radius: 6px;
  56. margin-bottom: 20px;
  57. padding: 24px 36px 24px 18px;
  58. display: flex;
  59. line-height: 42px;
  60. font-size: 14px;
  61. align-content: center;
  62. color: #666;
  63. .title {
  64. font-weight: 700;
  65. width: 285px;
  66. overflow: hidden;
  67. text-overflow: ellipsis;
  68. white-space: nowrap;
  69. padding: 0 10px 0 18px;
  70. position: relative;
  71. color: #333;
  72. }
  73. .price {
  74. color: #1677ff;
  75. }
  76. }
  77. }
  78. }
  79. .pagination {
  80. width: 100%;
  81. height: 50px;
  82. display: flex;
  83. align-items: center;
  84. justify-content: flex-end;
  85. }
  86. </style>