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

296 lines
7.4 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
10 months ago
12 months ago
1 year ago
12 months ago
12 months ago
10 months ago
10 months ago
12 months ago
1 year ago
12 months 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
12 months ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
12 months ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg pad">
  3. <view class="searchBox">
  4. <searchRow placeholder="搜索学员姓名、学员手机号"></searchRow>
  5. </view>
  6. <view class="card">
  7. <view class="myClass">
  8. <view class="leftTxt">我的排课</view>
  9. <view class="leftBtn" @click="$goPage('/pages/recordEntry/operate/mySchedule/mySchedule')">去管理</view>
  10. </view>
  11. </view>
  12. <view class="tabs">
  13. <view class="tab" v-for="(item,index) in tabArr" :key="index" :class="{active: params.status==item.id}"
  14. @click="changeTab(item)">{{ item.text }}</view>
  15. </view>
  16. <view class="screen_row">
  17. <view class="selectItem" @click="showSubject=true">
  18. <view class="text oneRowText">{{screen.subject}}</view>
  19. <view class="downIcon">
  20. <u-icon name="arrow-down"></u-icon>
  21. </view>
  22. </view>
  23. <view class="selectItem" @click="showCar=true">
  24. <view class="text oneRowText">{{screen.car}}</view>
  25. <view class="downIcon">
  26. <u-icon name="arrow-down"></u-icon>
  27. </view>
  28. </view>
  29. <view class="selectItem" @click="showDatePicker=true">
  30. <view class="text">{{screen.timer}}</view>
  31. <view class="downIcon">
  32. <u-icon name="arrow-down"></u-icon>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="list" v-if="list.length">
  37. <view class="card" v-for="(item,index) in list" :key="index">
  38. <appointItem-operate @click.native="$goPage('/pages/recordEntry/operate/detail/detail?id='+item.id)" :item="item"/>
  39. </view>
  40. </view>
  41. <!-- <nodata v-if="!list.length"></nodata> -->
  42. <view style="padding-bottom: 100rpx;" v-if="list.length">
  43. <u-loadmore :status="status" />
  44. </view>
  45. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  46. <UserTab name ='实操训练'></UserTab>
  47. <!-- <u-datetime-picker
  48. :show="showDatePicker"
  49. mode="date"
  50. :closeOnClickOverlay="true"
  51. :visibleItemCount="4"
  52. :minDate="1587524800000"
  53. @confirm="confirmDatePicker"
  54. @cancel="cancelDate"
  55. cancelText="不限日期"
  56. @close="showDatePicker=false"
  57. ></u-datetime-picker> -->
  58. <u-calendar :show="showDatePicker" ref="calendar" @confirm="confirmDatePicker" @close="cancelDate" :minDate="minDate" :maxDate="maxDate"></u-calendar>
  59. <u-picker :show="showCar" :columns="carColumns" keyName="licnum" @confirm="confirmCar" @cancel="showCar=false" :closeOnClickOverlay="true" @close="showCar=false"></u-picker>
  60. <u-picker :show="showSubject" :columns="subjectTxt" keyName="lab" @confirm="confirmSubject" @cancel="showSubject=false" :closeOnClickOverlay="true" @close="showSubject=false"></u-picker>
  61. </view>
  62. </template>
  63. <script>
  64. import { bookingMasterPage, carPage} from '@/config/api.js'
  65. export default {
  66. data() {
  67. return {
  68. tabArr: [{
  69. text: '待上课',
  70. id: 0
  71. },
  72. {
  73. text: '已完成',
  74. id: 2
  75. },
  76. {
  77. text: '已取消',
  78. id: 9
  79. },
  80. ],//状态:0:未签到,1:已签到,2:已签退,3:已过期,9:已取消,示例值(2)
  81. currentTab: 1,
  82. screen: {
  83. subject: '训练科目',
  84. car: '预约车辆',
  85. timer: '预约时间'
  86. },
  87. status: 'loading',
  88. subjectTxt: [
  89. [
  90. {lab: '不限', id: 0},
  91. {lab: '科目二', id: 2},
  92. {lab: '科目三', id: 3},
  93. ]
  94. ],
  95. // :0:不限;2:科目二;3:科目三
  96. showDatePicker: false,
  97. showCar: false,
  98. showSubject: false,
  99. carColumns: [],
  100. params: {
  101. pageNo: 1,
  102. pageSize: 20,
  103. status: 0,
  104. carNumber: '',
  105. bookingTime: []
  106. },
  107. list: [],
  108. minDate: 0,
  109. maxDate: 0,
  110. }
  111. },
  112. onLoad() {
  113. console.log('我的页面')
  114. this.params.coachId = this.vuex_coachId
  115. this.carPageFn()
  116. // this.bookingMasterPageFn()
  117. let nowTime = new Date()*1
  118. // 一个月的时间戳
  119. const oneMonthMilliseconds = 30 * 24 * 60 * 60 * 1000;
  120. this.minDate = parseInt( nowTime - oneMonthMilliseconds )
  121. this.maxDate = parseInt( nowTime + oneMonthMilliseconds )
  122. },
  123. onShow() {
  124. uni.hideTabBar();
  125. this.initList()
  126. },
  127. onPullDownRefresh() {
  128. this.initList()
  129. },
  130. onReachBottom() {
  131. if(this.list<this.total) {
  132. this.initList()
  133. }
  134. },
  135. methods: {
  136. cancelDate() {
  137. this.showDatePicker=false
  138. this.params.bookingStartTime = ''
  139. this.params.bookingEndTime = ''
  140. this.screen.timer = '预约时间'
  141. this.initList()
  142. },
  143. async initList() {
  144. this.status = 'loading'
  145. this.list = []
  146. this.params.pageNo = 1
  147. this.bookingMasterPageFn()
  148. },
  149. async bookingMasterPageFn() {
  150. console.log(this.params)
  151. let obj = Object.assign({},this.params)
  152. console.log(obj.carNumber)
  153. if(obj.carNumber=='不限') delete obj.carNumber
  154. const {data: res } = await bookingMasterPage(obj)
  155. // uni.$u.http.get('/api/admin-api/business/booking/master/page', this.params ).then(res => {
  156. // console.log(res)
  157. // }).catch(err => {
  158. // })
  159. this.params.pageNo ++
  160. this.list.push(...res.list)
  161. this.total = res.total
  162. if(this.list.length>=this.total) this.status = 'nomore'
  163. console.log(res)
  164. },
  165. changeTab(item) {
  166. if(item.id==this.params.status) return
  167. this.params.status = item.id
  168. this.initList()
  169. },
  170. confirmDatePicker(val) {
  171. this.showDatePicker = false
  172. this.screen.timer = val[0]
  173. this.params.bookingStartTime = this.screen.timer+ ' 00:00:00'
  174. this.params.bookingEndTime = this.screen.timer+ ' 23:59:59'
  175. // this.params.bookingTime = [startTimer, bookingEndTimer]
  176. this.initList()
  177. },
  178. confirmCar(val) {
  179. let item = val.value[0]
  180. this.screen.car = item.licnum
  181. this.params.carNumber = item.licnum
  182. this.showCar = false
  183. this.initList()
  184. },
  185. confirmSubject(val) {
  186. let item = val.value[0]
  187. this.screen.subject = item.lab
  188. this.params.subject = item.id
  189. this.initList()
  190. this.showSubject = false
  191. },
  192. async carPageFn() {
  193. let obj = {
  194. pageNo: 1,
  195. pageSize: 40,
  196. schoolId: this.vuex_schoolId,
  197. coachId: this.vuex_coachId
  198. }
  199. const {data: res} = await carPage(obj)
  200. res.list.unshift({licnum: '不限', id: 0})
  201. this.carColumns = [res.list]
  202. },
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .pageBgImg {
  208. .searchBox {
  209. padding: 24rpx 0;
  210. }
  211. .card {
  212. padding: 0 28rpx;
  213. margin-bottom: 20rpx;
  214. .myClass {
  215. height: 108rpx;
  216. display: flex;
  217. justify-content: space-between;
  218. padding: 0 10rpx;
  219. align-items: center;
  220. .leftTxt {
  221. font-size: 32rpx;
  222. font-weight: 500;
  223. }
  224. .leftBtn {
  225. width: 192rpx;
  226. height: 60rpx;
  227. background: $themC; border-radius: 8rpx;
  228. line-height: 60rpx;
  229. text-align: center;
  230. font-weight: 500;
  231. color: #FFFFFF;
  232. }
  233. }
  234. }
  235. .tabs {
  236. height: 72rpx;
  237. background: #FFFFFF;
  238. border-radius: 16rpx;
  239. display: flex;
  240. line-height: 72rpx;
  241. text-align: center;
  242. color: #ADADAD;
  243. margin: 24rpx 0;
  244. .tab {
  245. flex: 1;
  246. text-align: center;
  247. &.active {
  248. background: rgba(25, 137, 250, 0.1);
  249. border: 2rpx solid #1989FA;
  250. color: $themC;
  251. border-radius: 16rpx;
  252. }
  253. }
  254. }
  255. .screen_row {
  256. display: flex;
  257. margin-bottom: 24rpx;
  258. width: 100%;
  259. justify-content: space-between;
  260. .selectItem {
  261. display: flex;
  262. padding: 0 18rpx;
  263. border: 2rpx solid rgba(25,137,250,0.3);
  264. height: 60rpx;
  265. border-radius: 16rpx;
  266. background-color: #FFFFFF;
  267. line-height: 60rpx;
  268. align-items: center;
  269. width: 29%;
  270. .text {
  271. color: $themC;
  272. flex: 1;
  273. white-space: nowrap;
  274. text-align: center;
  275. }
  276. .downIcon {
  277. width: 24rpx;
  278. }
  279. }
  280. }
  281. .list {
  282. .card {
  283. appointitem-operate {}
  284. }
  285. }
  286. }
  287. </style>