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.

315 lines
8.2 KiB

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