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.
 
 
 
 
 
 

200 lines
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.StuNumOfApplyPre }}
  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. var _this = this;
  83. this.user = this.GET_GLOBAL('loginUser');
  84. this.fetchList();
  85. this.ready = true;
  86. },
  87. // 拉取列表
  88. async fetchList() {
  89. if (this.page > this.total) {
  90. return;
  91. }
  92. let _this = this;
  93. let _postParam = {
  94. pagination: {
  95. rows: _this.rows,
  96. page: _this.page,
  97. sidx: 'LessonNo',
  98. sord: 'asc'
  99. },
  100. queryJson: '{}'
  101. };
  102. if (true) {
  103. _postParam.queryJson = JSON.stringify({
  104. StuNo: _this.user.account
  105. });
  106. }
  107. _this.LOADING('加载数据中…')
  108. _this.HTTP_GET('learun/EducationalAdministration/OpenLessonPlanOfElectiveStudent/studentpagelist', _postParam, '加载数据时出错').then(res => {
  109. _this.HIDE_LOADING();
  110. // console.log(res);
  111. this.data = this.data.concat(res.rows);
  112. _this.total = res.total;
  113. _this.records = res.records;
  114. this.page = res.page + 1;
  115. this.loadState = res.page >= res.total ? '已加载所有项目' : '向下翻以加载更多';
  116. // console.log(_this.data);
  117. });
  118. },
  119. // 列表下拉
  120. pullDown() {
  121. this.refreshList().then(() => {
  122. this.$refs.data.stopPullDown();
  123. });
  124. },
  125. async refreshList() {
  126. this.page = 1;
  127. this.total = 1;
  128. this.data = [];
  129. this.fetchList();
  130. },
  131. tapClick(data) {
  132. this.NAV_TO('./from', data.OLPEId, true);
  133. }
  134. },
  135. computed: {
  136. jieci() {
  137. return str => {
  138. let ls = '';
  139. if (str.indexOf(',') == -1) ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1) + '节';
  140. else ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1, 2) + '、' + str.slice(4) + '节';
  141. return ls;
  142. };
  143. },
  144. typePd() {
  145. return num => {
  146. let txt = '';
  147. if (num == 1) {
  148. txt = '审核中';
  149. } else if (num == 2) {
  150. txt = '报名成功';
  151. } else if (num == 3) {
  152. txt = '报名失败';
  153. } else {
  154. txt = '未报名';
  155. }
  156. return txt;
  157. };
  158. }
  159. },
  160. created() {
  161. this.init();
  162. }
  163. };
  164. </script>
  165. <style lang="less" scoped>
  166. @import '~@/common/css/sidepage.less';
  167. @import '~@/common/css/customlist.less';
  168. .page {
  169. background-color: #fff;
  170. }
  171. .page-content {
  172. margin-top: 39px;
  173. }
  174. .records {
  175. color: #8f8f94;
  176. background: #ffffff;
  177. padding: 10px 12px;
  178. width: 100%;
  179. vertical-align: middle;
  180. border-bottom: 0.5px solid #ddd;
  181. position: fixed;
  182. top: var(--window-top);
  183. z-index: 1024;
  184. border-bottom: 0.5px solid #ddd;
  185. height: 40px;
  186. width: 100%;
  187. box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1);
  188. }
  189. .pageBox {
  190. padding: 5px 15px;
  191. line-height: 24px;
  192. border-bottom: 5px solid #f5f5f5;
  193. background-color: #fff;
  194. }
  195. </style>