index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div id="my_other_bank">
  3. <h2 class="title">我的题库</h2>
  4. <ul>
  5. <li v-for="(item, index) in list" :key="index" class="li_style">
  6. <div class="left">
  7. <h3>{{ item.goodsName }}</h3>
  8. <p>所属类型:{{ item.businessName }}</p>
  9. <p>总题数:{{ item.questionNum || 300 }}题</p>
  10. <p>
  11. 有效期:{{
  12. $tools.timestampToTime(item.serviceStartTime) +
  13. " - " +
  14. $tools.timestampToTime(item.serviceEndTime)
  15. }}
  16. </p>
  17. </div>
  18. <div class="right">
  19. <el-button type="primary" size="small">开始做题</el-button>
  20. </div>
  21. </li>
  22. </ul>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. formData: {
  30. pageNum: 1,
  31. pageSize: 5
  32. },
  33. list: [],
  34. total: 0
  35. };
  36. },
  37. created() {
  38. this.getInit();
  39. },
  40. methods: {
  41. getInit() {
  42. this.$request.coursespecialquestionlist(this.formData).then(res => {
  43. this.list = res.rows;
  44. });
  45. }
  46. }
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. #my_other_bank {
  51. padding: 14px 0px;
  52. .title {
  53. font-size: 20px;
  54. margin-bottom: 10px;
  55. }
  56. .li_style {
  57. padding: 14px 0px;
  58. display: flex;
  59. border-top: 1px solid #eee;
  60. &:last-child {
  61. border-bottom: 1px solid #eee;
  62. }
  63. & > .left {
  64. flex: 1;
  65. h3 {
  66. font-size: 16px;
  67. }
  68. p {
  69. margin-top: 10px;
  70. color: #6f6e6e;
  71. }
  72. }
  73. & > .right {
  74. width: 150px;
  75. display: flex;
  76. flex-direction: column;
  77. align-items: center;
  78. justify-content: center;
  79. }
  80. }
  81. }
  82. </style>