吉光研途前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.5 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="card">
  3. <serveModuleView v-model="isFold" :data="data" @change="onChange"></serveModuleView>
  4. <view v-if="!isFold" class="content">
  5. <view class="list">
  6. <view class="list-item" v-for="item in list" :key="item.id">
  7. <serveSecondModuleCard :data="item"></serveSecondModuleCard>
  8. </view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import serveModuleView from './serveModuleView.vue';
  15. import serveSecondModuleCard from './serveSecondModuleCard.vue';
  16. export default {
  17. components: {
  18. serveModuleView,
  19. serveSecondModuleCard,
  20. },
  21. props: {
  22. data: {
  23. type: Object,
  24. default() {
  25. return {}
  26. }
  27. }
  28. },
  29. data() {
  30. return {
  31. isFold: true,
  32. list: [],
  33. }
  34. },
  35. methods: {
  36. async getData() {
  37. try {
  38. this.list = (await this.$fetch('queryCategoryServiceModuleList', { pid: this.data.id, pageNo: 1, pageSize: 1000 }))?.records
  39. } catch (err) {
  40. }
  41. },
  42. onChange(isFold) {
  43. console.log('onChange', isFold)
  44. if (isFold) {
  45. return
  46. }
  47. if (this.list.length) {
  48. return
  49. }
  50. this.getData()
  51. },
  52. },
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. .card,
  57. .content {
  58. width: 100%;
  59. position: relative;
  60. }
  61. .absolute {
  62. position: absolute;
  63. top: 0;
  64. left: 0;
  65. }
  66. .list {
  67. padding: 0 12rpx;
  68. box-sizing: border-box;
  69. &-item {
  70. margin-top: 26rpx;
  71. }
  72. }
  73. </style>