Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

198 linhas
4.6 KiB

  1. <template>
  2. <view class="page">
  3. <view class="mainpage" :class="sideOpen ? 'show' : ''" style="padding-top: 40px;">
  4. <!-- <l-customlist-banner></l-customlist-banner> -->
  5. <view class="records">共 {{ records }} 条数据</view>
  6. <l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="data">
  7. <l-customlist :tips="loadState" showTips>
  8. <view></view>
  9. <view class="pageBox customlist-item" v-for="(item, ind) in data" :key="item.MakeDate" @click="tapClick(item)">
  10. <view class="">
  11. <text>学年:</text>
  12. {{ item.AcademicYearNo }}
  13. </view>
  14. <view class="">
  15. <text>学期:</text>
  16. {{ item.Semester }}
  17. </view>
  18. <view class="">
  19. <text>课程名称:</text>
  20. {{ item.LessonName }}
  21. </view>
  22. <view class="">
  23. <text>上课节次:</text>
  24. {{ jieci(item.LessonSection) }}
  25. </view>
  26. <view class="">
  27. <text>上课时间:</text>
  28. {{ item.LessonTime }}
  29. </view>
  30. <view class="">
  31. <text>学分:</text>
  32. {{ item.StudyScore }}
  33. </view>
  34. <view class="">
  35. <text>教师姓名:</text>
  36. {{ item.EmpName }}
  37. </view>
  38. <view class="">
  39. <text>教室名称:</text>
  40. {{ item.ClassRoomNo }}
  41. </view>
  42. <view class="">
  43. <text>人数上限:</text>
  44. {{ item.StuNumMax }}
  45. </view>
  46. <view class="">
  47. <text>已报名人数:</text>
  48. {{ item.StuNumOfApply}}
  49. </view>
  50. <view class="pageType">{{ typePd(item.Status) }}</view>
  51. </view>
  52. </l-customlist>
  53. </l-scroll-list>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. weekChina: ['一', '二', '三', '四', '五', '六', '日'],
  62. user: null,
  63. data: [],
  64. total: 1,
  65. records: 0,
  66. ready: false,
  67. page: 1,
  68. rows: 10,
  69. multipleData: null,
  70. sideOpen: false,
  71. loadState: '向下翻以加载更多'
  72. };
  73. },
  74. onUnload() {
  75. this.OFF('EducationalAdministrationBookBorrow-list-change');
  76. },
  77. methods: {
  78. init() {
  79. this.ON('EducationalAdministrationBookBorrow-list-change', this.refreshList);
  80. // 拉取加载列表和数据源
  81. Promise.all([() => {}]);
  82. this.user = this.GET_GLOBAL('loginUser');
  83. this.fetchList();
  84. this.ready = true;
  85. },
  86. // 拉取列表
  87. async fetchList() {
  88. if (this.page > this.total) {
  89. return;
  90. }
  91. let _postParam = {
  92. pagination: {
  93. rows: this.rows,
  94. page: this.page,
  95. sidx: 'LessonNo',
  96. sord: 'asc'
  97. },
  98. queryJson: '{}'
  99. };
  100. if (true) {
  101. _postParam.queryJson = JSON.stringify({
  102. StuNo: this.user.account
  103. });
  104. }
  105. this.LOADING('加载数据中…')
  106. this.HTTP_GET('learun/OpenLessonPlanOfElectiveStudent/studentpagelist', _postParam, '加载数据时出错').then(res => {
  107. this.HIDE_LOADING();
  108. // console.log(res);
  109. this.data = this.data.concat(res.rows);
  110. this.total = res.total;
  111. this.records = res.records;
  112. this.page = res.page + 1;
  113. this.loadState = res.page >= res.total ? '已加载所有项目' : '向下翻以加载更多';
  114. // console.log(_this.data);
  115. });
  116. },
  117. // 列表下拉
  118. pullDown() {
  119. this.refreshList().then(() => {
  120. this.$refs.data.stopPullDown();
  121. });
  122. },
  123. async refreshList() {
  124. this.page = 1;
  125. this.total = 1;
  126. this.data = [];
  127. this.fetchList();
  128. },
  129. tapClick(data) {
  130. this.NAV_TO('./from', data.OLPEId, true);
  131. }
  132. },
  133. computed: {
  134. jieci() {
  135. return str => {
  136. let ls = '';
  137. if (str.indexOf(',') == -1) ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1) + '节';
  138. else ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1, 2) + '、' + str.slice(4) + '节';
  139. return ls;
  140. };
  141. },
  142. typePd() {
  143. return num => {
  144. let txt = '';
  145. if (num == 1) {
  146. txt = '审核中';
  147. } else if (num == 2) {
  148. txt = '报名成功';
  149. } else if (num == 3) {
  150. txt = '报名失败';
  151. } else {
  152. txt = '未报名';
  153. }
  154. return txt;
  155. };
  156. }
  157. },
  158. created() {
  159. this.init();
  160. }
  161. };
  162. </script>
  163. <style lang="less" scoped>
  164. @import '~@/common/css/sidepage.less';
  165. @import '~@/common/css/customlist.less';
  166. .page {
  167. background-color: #fff;
  168. }
  169. .page-content {
  170. margin-top: 39px;
  171. }
  172. .records {
  173. color: #8f8f94;
  174. background: #ffffff;
  175. padding: 10px 12px;
  176. width: 100%;
  177. vertical-align: middle;
  178. border-bottom: 0.5px solid #ddd;
  179. position: fixed;
  180. top: var(--window-top);
  181. z-index: 1024;
  182. border-bottom: 0.5px solid #ddd;
  183. height: 40px;
  184. width: 100%;
  185. box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1);
  186. }
  187. .pageBox {
  188. padding: 5px 15px;
  189. line-height: 24px;
  190. border-bottom: 5px solid #f5f5f5;
  191. background-color: #fff;
  192. }
  193. </style>