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

284 lines
6.8 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 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 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. :visibleItemCount="4"
  51. :minDate="1587524800000"
  52. :closeOnClickOverlay="false"
  53. @confirm="confirmDatePicker"
  54. @cancel="cancelDate"
  55. ></u-datetime-picker>
  56. <!-- <u-picker :show="showC" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker> -->
  57. <u-picker :show="showCar" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker>
  58. <u-picker :show="showSubject" :columns="subjectTxt" keyName="lab" @confirm="confirmSubject" @cancel="showSubject=false"></u-picker>
  59. </view>
  60. </template>
  61. <script>
  62. import { bookingMasterPage, } from '@/config/api.js'
  63. export default {
  64. data() {
  65. return {
  66. tabArr: [{
  67. text: '待上课',
  68. id: 0
  69. },
  70. {
  71. text: '已完成',
  72. id: 2
  73. },
  74. {
  75. text: '已取消',
  76. id: 9
  77. },
  78. ],//状态:0:未签到,1:已签到,2:已签退,3:已过期,9:已取消,示例值(2)
  79. currentTab: 1,
  80. screen: {
  81. subject: '训练科目',
  82. car: '预约车辆',
  83. timer: '预约时间'
  84. },
  85. status: 'loading',
  86. subjectTxt: [
  87. [
  88. {lab: '不限', id: 0},
  89. {lab: '科目二', id: 2},
  90. {lab: '科目三', id: 3},
  91. ]
  92. ],
  93. // :0:不限;2:科目二;3:科目三
  94. showDatePicker: false,
  95. showCar: false,
  96. showSubject: false,
  97. carArr: [
  98. [
  99. {lab: 'C1',id: 1},
  100. {lab: 'C2',id: 2},
  101. ]
  102. ],
  103. carArr: [
  104. [
  105. {lab: '不限',id: 0},
  106. {lab: '浙A66666学',id: 1},
  107. {lab: '浙00007',id: 2},
  108. ]
  109. ],
  110. params: {
  111. pageNo: 1,
  112. pageSize: 20,
  113. status: 0,
  114. carNumber: '',
  115. bookingTime: []
  116. },
  117. list: []
  118. }
  119. },
  120. onLoad() {
  121. console.log('我的页面')
  122. this.params.coachId = this.vuex_coachId
  123. // this.bookingMasterPageFn()
  124. },
  125. onShow() {
  126. uni.hideTabBar();
  127. this.initList()
  128. },
  129. onPullDownRefresh() {
  130. this.initList()
  131. },
  132. onReachBottom() {
  133. if(this.list<this.total) {
  134. this.initList()
  135. }
  136. },
  137. methods: {
  138. cancelDate() {
  139. this.showDatePicker=false
  140. this.params.beginTime = ''
  141. this.params.endTime = ''
  142. this.initList()
  143. },
  144. async initList() {
  145. this.status = 'loading'
  146. this.list = []
  147. this.params.pageNo = 1
  148. this.bookingMasterPageFn()
  149. },
  150. async bookingMasterPageFn() {
  151. console.log(this.params)
  152. let obj = Object.assign({},this.params)
  153. console.log(obj.carNumber)
  154. if(obj.carNumber=='不限') delete obj.carNumber
  155. const {data: res } = await bookingMasterPage(obj)
  156. // uni.$u.http.get('/api/admin-api/business/booking/master/page', this.params ).then(res => {
  157. // console.log(res)
  158. // }).catch(err => {
  159. // })
  160. this.params.pageNo ++
  161. this.list.push(...res.list)
  162. this.total = res.total
  163. if(this.list.length>=this.total) this.status = 'nomore'
  164. console.log(res)
  165. },
  166. changeTab(item) {
  167. this.params.status = item.id
  168. this.initList()
  169. },
  170. confirmDatePicker(val) {
  171. this.showDatePicker = false
  172. this.screen.timer = uni.$u.date(val.value, 'yyyy-mm-dd')
  173. this.params.beginTime = this.screen.timer+ ' 00:00:00'
  174. this.params.endTime = this.screen.timer+ ' 23:59:59'
  175. // this.params.bookingTime = [startTimer, endTimer]
  176. this.initList()
  177. },
  178. confirmCar(val) {
  179. let item = val.value[0]
  180. this.screen.car = item.lab
  181. this.params.carNumber = item.lab
  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. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. .pageBgImg {
  197. .searchBox {
  198. padding: 140rpx 0 24rpx 0;
  199. }
  200. .card {
  201. padding: 0 28rpx;
  202. margin-bottom: 20rpx;
  203. .myClass {
  204. height: 108rpx;
  205. display: flex;
  206. justify-content: space-between;
  207. padding: 0 10rpx;
  208. align-items: center;
  209. .leftTxt {
  210. font-size: 32rpx;
  211. font-weight: 500;
  212. }
  213. .leftBtn {
  214. width: 192rpx;
  215. height: 60rpx;
  216. background: $themC; border-radius: 8rpx;
  217. line-height: 60rpx;
  218. text-align: center;
  219. font-weight: 500;
  220. color: #FFFFFF;
  221. }
  222. }
  223. }
  224. .tabs {
  225. height: 72rpx;
  226. background: #FFFFFF;
  227. border-radius: 16rpx;
  228. display: flex;
  229. line-height: 72rpx;
  230. text-align: center;
  231. color: #ADADAD;
  232. margin: 24rpx 0;
  233. .tab {
  234. flex: 1;
  235. text-align: center;
  236. &.active {
  237. background: rgba(25, 137, 250, 0.1);
  238. border: 2rpx solid #1989FA;
  239. color: $themC;
  240. border-radius: 16rpx;
  241. }
  242. }
  243. }
  244. .screen_row {
  245. display: flex;
  246. margin-bottom: 24rpx;
  247. width: 100%;
  248. justify-content: space-between;
  249. .selectItem {
  250. display: flex;
  251. padding: 0 18rpx;
  252. border: 2rpx solid rgba(25,137,250,0.3);
  253. height: 60rpx;
  254. border-radius: 16rpx;
  255. background-color: #FFFFFF;
  256. line-height: 60rpx;
  257. align-items: center;
  258. width: 29%;
  259. .text {
  260. color: $themC;
  261. flex: 1;
  262. white-space: nowrap;
  263. text-align: center;
  264. }
  265. .downIcon {
  266. width: 24rpx;
  267. }
  268. }
  269. }
  270. .list {
  271. .card {
  272. appointitem-operate {}
  273. }
  274. }
  275. }
  276. </style>