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.

248 lines
5.3 KiB

8 months ago
8 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="我的排课"></topNavbar>
  4. <view class="pad">
  5. <pickDateTimer @confirmPopup="confirmPopup" :step="step" @cancelChoose="step=1" ref="pickDateRef"/>
  6. <view class="btn_row" v-if="step==1">
  7. <view class="btnBorder btn" @click="changeStep(1)">管理排课计划</view>
  8. <view class="btnBg btn" @click="changeStep(2)">编辑排课信息</view>
  9. </view>
  10. <!-- <view class="step2" v-if="step==2">
  11. <view class="">
  12. <myCheckbox :checkData="checkData" @changeCheck="changeCheck"></myCheckbox>
  13. </view>
  14. <view class="btnBg" @click="showPopupFn">确认发布</view>
  15. </view> -->
  16. </view>
  17. <u-popup :show="show" @close="show=false" mode="center" :round="16">
  18. <view>
  19. <mySchedulePopup @confirmClass="confirmClass"/>
  20. </view>
  21. </u-popup>
  22. </view>
  23. </template>
  24. <script>
  25. import mySchedulePopup from './comp/mySchedulePopup'
  26. import pickDateTimer from './comp/pickDateTimer/pickDateTimer'
  27. import { scheduleClassGetById, scheduleClassGet, scheduleClassCreateByTime } from '@/config/api.js'
  28. export default {
  29. components: { mySchedulePopup,pickDateTimer },
  30. data() {
  31. return {
  32. show: false,
  33. dateArr: [
  34. {week: '一', num: '08'},
  35. {week: '二', num: '09'},
  36. {week: '三', num: '10'},
  37. {week: '四', num: '11'},
  38. {week: '五', num: '12'},
  39. ],
  40. checkData: [
  41. {name: '全选', id: 0},
  42. {name: '取消选择', id: 1},
  43. ],
  44. step: 1,
  45. course: [
  46. {status: 0, time: '06:00-07:00'},
  47. {status: 1, time: '08:00-09:00'},
  48. {status: 2, time: '09:00-10:00'},
  49. {status: 3, time: '11:00-12:00'},
  50. {status: 0, time: '14:00-15:00'},
  51. ],
  52. courseIds: []
  53. }
  54. },
  55. onLoad() {
  56. },
  57. methods: {
  58. changeStep(val) {
  59. if(val==1) {
  60. this.$goPage('/pages/recordEntry/operate/mySchedule/plan/plan')
  61. }else {
  62. let pickDateRef = this.$refs.pickDateRef
  63. if(!pickDateRef.timerArr.length||!pickDateRef.timerArr2.length) return this.$u.toast('没有排课计划,请添加排课计划')
  64. pickDateRef.radioVal = ''
  65. this.step = val
  66. }
  67. // this.$emit('changeStep', val)
  68. },
  69. // 根据时间段排课
  70. async confirmClass(val, obj) {
  71. this.show = false
  72. if(val==0) return
  73. obj.deptId = this.vuex_deptId
  74. obj.coachId = this.vuex_coachId
  75. const res = await scheduleClassCreateByTime(Object.assign(this.pickDate, obj))
  76. if(res.code==0) this.$u.toast('发布排课成功')
  77. this.$refs.pickDateRef.courseIds = []
  78. // uni.$emit('refreshMySchedule')
  79. this.step = 1
  80. this.$refs.pickDateRef.scheduleClassGetFn()
  81. },
  82. // 显示弹出框
  83. confirmPopup(pickDate) {
  84. if(!pickDate.timeList.length) return this.$u.toast('请选择排课时间')
  85. this.pickDate = pickDate
  86. this.show = true
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .step2 {
  93. display: flex;
  94. justify-content: space-between;
  95. align-items: center;
  96. .btnBg {
  97. width: 310rpx;
  98. }
  99. }
  100. .card {
  101. width: 100%;
  102. margin-bottom: 24rpx;
  103. overflow: hidden;
  104. .dateBox {
  105. padding: 36rpx 0 40rpx 0;
  106. .month-row {
  107. display: flex;
  108. justify-content: center;
  109. align-items: center;
  110. margin-bottom: 36rpx;
  111. .month {
  112. font-size: 32rpx;
  113. color: $themC;
  114. }
  115. .arrow {
  116. margin-left: 6rpx;
  117. }
  118. }
  119. .date_row {
  120. width: 100%;
  121. height: 100rpx;
  122. position: relative;
  123. .icon {
  124. width: 40rpx;
  125. height: 40rpx;
  126. background: rgba(51,51,51,0.18);
  127. backdrop-filter: blur(4rpx);
  128. position: absolute;
  129. top: 50%;
  130. transform: translateY(-50%);
  131. display: flex;
  132. align-items: center;
  133. justify-content: center;
  134. border-radius: 50%;
  135. &.left {
  136. left: 16rpx;
  137. }
  138. &.right {
  139. right: 16rpx;
  140. }
  141. }
  142. .dateArr {
  143. display: flex;
  144. padding: 0 70rpx;
  145. justify-content: space-between;
  146. .date {
  147. width: 74rpx;
  148. height: 100rpx;
  149. border-radius: 16rpx;
  150. display: flex;
  151. flex-direction: column;
  152. align-items: center;
  153. justify-content: center;
  154. font-size: 28rpx;
  155. color: #333;
  156. &.active {
  157. background: rgba(25,137,250,0.1);
  158. border: 2rpx solid #1989FA;
  159. color: $themC;
  160. }
  161. .week {
  162. }
  163. .num {
  164. margin-top: 4rpx;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. }
  171. .card {
  172. .timeCon {
  173. padding: 0 24rpx 40rpx 24rpx;
  174. }
  175. .h2 {
  176. line-height: 90rpx;
  177. font-weight: 500;
  178. color: #333;
  179. }
  180. .time_box {
  181. display: flex;
  182. flex-wrap: wrap;
  183. justify-content: space-between;
  184. &::after {
  185. content: "";
  186. width: 30%;
  187. }
  188. .time_item {
  189. width: 30%;
  190. height: 120rpx;
  191. background: #F8F8F8;
  192. border-radius: 12rpx;
  193. display: flex;
  194. flex-direction: column;
  195. justify-content: center;
  196. align-items: center;
  197. border-radius: 12rpx;
  198. color: #333;
  199. margin-bottom: 20rpx;
  200. &.active {
  201. background: rgba(25,137,250,0.1);
  202. border: 2rpx solid #1989FA;
  203. color: $themC;
  204. }
  205. &.disable {
  206. opacity: 0.5;
  207. }
  208. .lab {
  209. font-size: 28rpx;
  210. font-weight: 500;
  211. display: flex;
  212. align-items: center;
  213. margin-bottom: 6rpx;
  214. .icon {
  215. margin-left: 10rpx;
  216. background: rgba(51,51,51,0.18);
  217. border-radius: 50%;
  218. padding: 6rpx;
  219. }
  220. }
  221. .time {
  222. font-size: 24rpx;
  223. margin-top: 4rpx;
  224. }
  225. }
  226. }
  227. }
  228. .btn_row {
  229. display: flex;
  230. justify-content: space-between;
  231. padding-bottom: 40rpx;
  232. .btn {
  233. width: 47%;
  234. }
  235. }
  236. </style>