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.

125 lines
2.7 KiB

7 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="模板"></topNavbar>
  4. <view class="pad">
  5. <view class="card" v-for="(item,index) in list" :key="index" @click="chooseMould(item)">
  6. <view class="tit_row">
  7. <view class="tit">{{item.templateName}}</view>
  8. <view class="manage" @click.stop="$goPage('/pages/recordEntry/operate/mySchedule/mouldEdit/mouldEdit?id='+item.id)">管理</view>
  9. </view>
  10. <view class="ul">
  11. <view class="li lab">
  12. <view class="text">时间段</view>
  13. <view class="text">最多人数</view>
  14. </view>
  15. <view class="li" v-for="(item2,index2) in item.detailVO" :key="index2">
  16. <view class="text">{{ item2.startTime}} <text>-</text> {{item2.endTime}}</view>
  17. <view class="text">{{ item2.personCount }}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view style="padding-bottom: 20rpx;" v-if="list.length>10">
  23. <u-loadmore :status="status" />
  24. </view>
  25. <view class="btn_footer">
  26. <view class="btnBorder" @click="$goPage('/pages/recordEntry/operate/mySchedule/mouldEdit/mouldAdd' )">新增模版</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { scheduleTemplatePage } from '@/config/api.js'
  32. export default {
  33. data() {
  34. return {
  35. list: [],
  36. total: 20,
  37. params: {
  38. pageNo: 1,
  39. pageSize: 20
  40. },
  41. status: 'loading'
  42. }
  43. },
  44. onLoad() {
  45. this.params.coachId = this.vuex_coachId
  46. this.scheduleTemplatePageFn()
  47. uni.$on('refreshMould', ()=>{
  48. this.initList()
  49. })
  50. },
  51. onPullDownRefresh() {
  52. this.initList()
  53. },
  54. onReachBottom() {
  55. if(this.total>this.list.length) {
  56. this.scheduleTemplatePageFn()
  57. }
  58. },
  59. methods: {
  60. chooseMould(item) {
  61. uni.$emit('chooseMould', item)
  62. uni.navigateBack()
  63. },
  64. initList() {
  65. this.status = 'loading'
  66. this.params.pageNo =1
  67. this.list = []
  68. this.scheduleTemplatePageFn()
  69. },
  70. async scheduleTemplatePageFn() {
  71. const {data: res} = await scheduleTemplatePage(this.params)
  72. this.params.pageNo ++
  73. this.list.push(...res.list)
  74. this.total = res.total
  75. if(this.list.length>=this.total) {
  76. this.status = 'nomore'
  77. }
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .card {
  84. padding: 0 28rpx;
  85. margin-bottom: 24rpx;
  86. .tit_row {
  87. display: flex;
  88. align-items: center;
  89. justify-content: space-between;
  90. border-bottom: 2rpx solid #E8E9EC;
  91. height: 96rpx;
  92. font-weight: 500;
  93. .manage {
  94. color: $themC;
  95. }
  96. }
  97. .ul {
  98. padding-bottom: 20rpx;
  99. .li {
  100. padding: 12rpx;
  101. display: flex;
  102. color: #333;
  103. &.lab {
  104. color: #ADADAD;
  105. }
  106. .text {
  107. flex: 1;
  108. text-align: center;
  109. }
  110. }
  111. }
  112. }
  113. .btn_footer {
  114. display: flex;
  115. justify-content: center;
  116. padding: 30rpx 0;
  117. .btnBorder {
  118. width: 396rpx;
  119. }
  120. }
  121. </style>