courseForm.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="course-form">
  3. <view class="course-form-item">
  4. <view class="course-form-item-left">
  5. 申请课时
  6. </view>
  7. <view class="course-form-item-right">
  8. 第十周周一第一节课
  9. </view>
  10. </view>
  11. <!-- <view @click="openPopTea" class="course-form-item">
  12. <view class="course-form-item-left">
  13. 调换老师
  14. </view>
  15. <view class="course-form-item-right">
  16. {{teacher == ''?'请选择':teacher}}
  17. </view>
  18. </view> -->
  19. <view @click="openPopDate" class="course-form-item">
  20. <view class="course-form-item-left">
  21. 调换时间
  22. </view>
  23. <view class="course-form-item-right">
  24. {{date == ''?'请选择':date}}
  25. </view>
  26. </view>
  27. <view class="course-form-btn">
  28. <view @click="clearBtn" style="margin-right: 16rpx;" class="course-form-btn-content">
  29. 关闭
  30. </view>
  31. <view @click="submit" style="margin-left: 16rpx;background-color: #05CCA1;color: #fff;"
  32. class="course-form-btn-content">
  33. 提交
  34. </view>
  35. </view>
  36. <uni-popup ref="tea" background-color="transparent">
  37. <view class="popup-content" style="border-radius: 0rpx;width: 770rpx;"
  38. :class="{ 'popup-height': type === 'left' ||type === 'right' }">
  39. <SelectClass :active="selectActive" @itemClick='selectItemClick' :list='selectList' />
  40. </view>
  41. </uni-popup>
  42. <uni-popup ref="course" background-color="transparent">
  43. <view class="popup-content" style="border-radius: 0rpx;width: 770rpx;"
  44. :class="{ 'popup-height': type === 'left' ||type === 'right' }">
  45. <view class="select-course">
  46. <view style="font-size: 32rpx;" class="select-course-title">
  47. <view class="">
  48. 本周 <uni-icons type="right" size="14"></uni-icons>
  49. </view>
  50. <view style="font-size: 28rpx;" class="">
  51. 可申请时间
  52. </view>
  53. </view>
  54. <view class="">
  55. <CourseList @itemClick="itemClick" :list='CourseInfo' />
  56. </view>
  57. </view>
  58. </view>
  59. </uni-popup>
  60. </view>
  61. </template>
  62. <script>
  63. import SelectClass from '@/components/selectClass.vue'
  64. import CourseList from '@/components/CourseList.vue'
  65. export default {
  66. components: {
  67. SelectClass,
  68. CourseList
  69. },
  70. props: {
  71. },
  72. data() {
  73. return {
  74. teacher: '',
  75. date: '',
  76. type: '',
  77. selectActive: 0,
  78. selectList: [{
  79. class_name: '无尘',
  80. id: 0
  81. }, {
  82. class_name: '沈秒',
  83. id: 1
  84. }],
  85. CourseInfo: [{
  86. arr: [{
  87. class: '第一节课',
  88. type: 0,
  89. }, {
  90. class: '第一节课',
  91. type: 0,
  92. }, {
  93. class: '第一节课',
  94. type: 0,
  95. }, {
  96. class: '第一节课',
  97. type: 0,
  98. }, {
  99. class: '第一节课',
  100. type: 0,
  101. }, ]
  102. }, {
  103. arr: [{
  104. class: '第一节课',
  105. type: 0,
  106. }, {
  107. class: '第一节课',
  108. type: 0,
  109. }, {
  110. class: '第一节课',
  111. type: 0,
  112. }, {
  113. class: '第一节课',
  114. type: 0,
  115. }, {
  116. class: '第一节课',
  117. type: 0,
  118. }, ]
  119. }, {
  120. arr: [{
  121. class: '第一节课',
  122. type: 0,
  123. }, {
  124. class: '第一节课',
  125. type: 0,
  126. }, {
  127. class: '第一节课',
  128. type: 0,
  129. }, {
  130. class: '第一节课',
  131. type: 0,
  132. }, {
  133. class: '第一节课',
  134. type: 0,
  135. }, ]
  136. }, {
  137. arr: [{
  138. class: '第一节课',
  139. type: 1,
  140. }, {
  141. class: '第一节课',
  142. type: 2,
  143. }, {
  144. class: '第一节课',
  145. type: 0,
  146. }, {
  147. class: '第一节课',
  148. type: 0,
  149. }, {
  150. class: '第一节课',
  151. type: 0,
  152. }, ]
  153. }]
  154. };
  155. },
  156. methods: {
  157. clearBtn() {
  158. this.$emit('clear')
  159. },
  160. openPopTea() {
  161. this.type = 'bottom'
  162. this.$refs.tea.open('bottom')
  163. },
  164. selectItemClick(item) {
  165. this.selectActive = item.id
  166. this.teacher = item.class_name
  167. this.$refs.tea.close()
  168. },
  169. openPopDate() {
  170. this.type = 'bottom'
  171. this.$refs.course.open('bottom')
  172. },
  173. itemClick(item) {
  174. this.date = item.class
  175. this.$refs.course.close()
  176. },
  177. submit() {
  178. if (this.teacher == '') {
  179. uni.showToast({
  180. title: '请选择教师',
  181. 'icon': 'none',
  182. duration: 2000
  183. });
  184. return
  185. }
  186. if (this.date == '') {
  187. uni.showToast({
  188. title: '请选择调换时间',
  189. 'icon': 'none',
  190. duration: 2000
  191. });
  192. return
  193. }
  194. }
  195. },
  196. computed: {
  197. },
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .select-course-title {
  202. display: flex;
  203. justify-content: space-between;
  204. padding-bottom: 10rpx;
  205. border-bottom: 1px solid #f2f2f2;
  206. margin-bottom: 32rpx;
  207. }
  208. .select-course {
  209. padding: 32rpx;
  210. width: 100%;
  211. box-sizing: border-box;
  212. }
  213. .course-form {
  214. width: 100%;
  215. box-sizing: border-box;
  216. padding: 32rpx;
  217. .course-form-item {
  218. display: flex;
  219. justify-content: space-between;
  220. align-items: center;
  221. height: 80rpx;
  222. border-bottom: 1px solid #f2f2f2;
  223. .course-form-item-right {
  224. color: #999;
  225. }
  226. }
  227. }
  228. .course-form-btn {
  229. display: flex;
  230. margin-top: 32rpx;
  231. .course-form-btn-content {
  232. flex: 1;
  233. text-align: center;
  234. height: 72rpx;
  235. border-radius: 36rpx;
  236. line-height: 72rpx;
  237. border: 1px solid #f2f2f2;
  238. font-size: 32rpx;
  239. color: #999;
  240. }
  241. }
  242. </style>