江西小程序管理端
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.

243 lines
5.0 KiB

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