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

245 lines
5.1 KiB

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