Browse Source

预约

master
unknown 11 months ago
parent
commit
74aae0e4be
  1. 33
      components/appointItem-operate/appointItem-operate.vue
  2. 31
      components/nodata/nodata.vue
  3. 13
      components/pickDateTimer/pickDateTimer.vue
  4. 2
      components/user-info/user-info.vue
  5. 6
      config/api.js
  6. 6
      config/request.js
  7. 2
      pages.json
  8. 2
      pages/login/login.vue
  9. 14
      pages/recordEntry/operate/mySchedule/detail/detail.vue
  10. 11
      pages/tabbar/examSimulation/comp/simulation.vue
  11. 90
      pages/tabbar/operateTrain/index.vue
  12. BIN
      static/images/index/carIcon.png
  13. BIN
      static/images/index/listIcon.png
  14. BIN
      static/images/index/site.png
  15. BIN
      static/images/index/timerIcon.png

33
components/appointItem-operate/appointItem-operate.vue

@ -3,10 +3,10 @@
<view class="consultItem">
<view class="top_row">
<view class="flex">
<view class="schoolName">张三三 18265468753</view>
<view class="schoolName">{{item.studentName}} <text style="margin-left: 6px;">{{ item.studentPhone}}</text></view>
</view>
<view class="status">
<view class="text">待上课</view>
<view class="text">{{loginStatusTxt[item.loginStatus]}}</view>
<view class="icon">
<u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon>
</view>
@ -15,27 +15,27 @@
<view class="target">
<view class="row">
<view class="iconImg">
<image src="@/static/images/index/radio_nor.png" mode=""></image>
<image src="@/static/images/index/listIcon.png" mode=""></image>
</view>
<view class="name">训练科目科目二</view>
<view class="name">训练科目{{ subjectTxt[item.subject] }}</view>
</view>
<view class="row">
<view class="iconImg">
<image src="@/static/images/index/radio_nor.png" mode=""></image>
<image src="@/static/images/index/site.png" mode=""></image>
</view>
<view class="name">预约场地xxx场地</view>
<view class="name">预约场地{{item.siteName}}</view>
</view>
<view class="row">
<view class="iconImg">
<image src="@/static/images/index/radio_nor.png" mode=""></image>
<image src="@/static/images/index/carIcon.png" mode=""></image>
</view>
<view class="name">预约车辆2号车浙A99999</view>
<view class="name">预约车辆{{item.carNumber}}</view>
</view>
<view class="row">
<view class="iconImg">
<image src="@/static/images/index/radio_nor.png" mode=""></image>
<image src="@/static/images/index/timerIcon.png" mode=""></image>
</view>
<view class="name">预约时间2023/08/08 9:0010:00</view>
<view class="name">预约时间{{$u.timeFormat(item.startTime, 'yyyy/mm/dd MM:ss')}}</view>
</view>
</view>
@ -43,6 +43,15 @@
</template>
<script>
export default {
props: ['item'],
data() {
return {
subjectTxt: ['不限', '科目二', '科目三'],//:023
loginStatusTxt: ['未签到', '已签到', '已签退', '已过期', '已取消'],//012退39
}
}
}
</script>
<style lang="scss" scoped>
@ -89,8 +98,8 @@
display: flex;
align-items: center;
.iconImg {
width: 25rpx;
height: 25rpx;
width: 32rpx;
height: 28rpx;
}
.name {
font-size: 28rpx;

31
components/nodata/nodata.vue

@ -0,0 +1,31 @@
<template>
<view class="noDate">
<view class="img">
<image src="https://jiangxijiakao-1.oss-cn-hangzhou.aliyuncs.com/complain/2023-10-09/1696832739095-nodata.png" mode=""></image>
</view>
<view class="text">
<text solt>暂无数据</text>
</view>
</view>
</template>
<script>
</script>
<style lang="scss" scoped>
.noDate {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.img {
width: 438rpx;height: 286rpx;
}
.text {
font-size: 26rpx;
color: #999;
margin-top: 60rpx;
}
</style>

13
components/pickDateTimer/pickDateTimer.vue

@ -198,7 +198,14 @@
async initDate() {
await this.getClassDateLimitFn()
this.dateArr = getDates(this.startDate, this.endDate);
// let obj = {
// date: "2023-10-24",
// num: "24",
// week: ""
// }
// this.dateArr[0][0] = obj
this.chooseDay = this.dateArr[0][0].date
console.log(this.dateArr)
this.scheduleClassGetFn()
},
//
@ -219,8 +226,8 @@
chooseDate(item) {
this.chooseDay = item.date
this.scheduleClassGetFn()
console.log('*****')
console.log(this.chooseDay)
// console.log('*****')
// console.log(this.chooseDay)
},
changeDateIndex(num) {
if(this.currentDay==0&&num==-1) return this.$u.toast('已是可选最小日期')
@ -229,6 +236,8 @@
this.chooseDay = this.dateArr[this.currentDay][0].date
},
chooseCourse(item) {
// this.$goPage('/pages/recordEntry/operate/mySchedule/detail/detail?id='+ item.id)
// return
if(this.step!=2) {
//
console.log(item)

2
components/user-info/user-info.vue

@ -5,7 +5,7 @@
</view>
<view class="info" @click="$goPage('/pages/userCenter/personaInfo/personaInfo')">
<view class="name_row">
<view class="name">大乔{{identity=='校长'?'校长': '教练'}}</view>
<view class="name">{{ vuex_userInfo.user.nickname}}</view>
<view class="icon">
<image src="@/static/images/coach/ic_gengduo.png" mode=""></image>
</view>

6
config/api.js

@ -15,7 +15,7 @@ export const schoolPage = (params) => http.get('business/school/page', {params:
// 获得租户分页
export const tenantPage = (params) => http.get('system/tenant/pages', {params: params, custom: { noToken: true }})
// 实操预约记录分页
export const bookingMasterPage = (params) => http.get('business/booking/master/page', {params: params, })
export const bookingMasterPage = (params) => http.get('business/booking/master/page', {params: params, header: {'contentType': 3} })
// 获得我的排课详情
export const scheduleClassGetById = (params) => http.get('business/booking/schedule-class/getById', {params: params, })
// 获得我的排课详情预约记录
@ -40,6 +40,10 @@ export const scheduleTemplateUpdate = (data) => http.put('business/booking/sched
export const scheduleTemplateGet = (params) => http.get('business/booking/schedule-template/get', {params} ,)
// 训练场地
export const trainingSiteList = (params) => http.get('business/training-site/list', {params} ,)
// 获得考场模拟预约记录分页
export const examSimulationPages = (params) => http.get('business/exam-simulation-record/page', {params} ,)

6
config/request.js

@ -14,9 +14,9 @@ module.exports = (vm) => {
let prefix = config.custom.prefix?config.custom.prefix: httpPrefix
/* config 为默认全局配置*/
config.baseURL = H5_API+ WX_API + prefix; /* 根域名 */
console.log(config)
// console.log(config)
config.header['tenant-id'] = vm.$store.state.user.vuex_TenantId
// config.dataType= 'xml'
return config
})
@ -25,8 +25,10 @@ module.exports = (vm) => {
console.log(config)
let contentTypeIndex = config.header.contentType
if(contentTypeIndex) {
// alert(contentTypeIndex)
config.header['content-type'] = ContentType[contentTypeIndex]
}
// config.header['content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
// 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
config.data = config.data || {}
// 根据custom参数中配置的是否需要token,添加对应的请求头

2
pages.json

@ -161,7 +161,7 @@
"style": {
"navigationBarTitleText": "我的排课详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}
},

2
pages/login/login.vue

@ -81,6 +81,7 @@
selectClick(item) {
this.showRole = false
this.chooseIdentity(item.name)
// alert(item.name)
},
chooseIdentity(name) {
// let val = ''
@ -177,6 +178,7 @@
await this.$store.dispatch('getUserInfo')
console.log(this.role)
this.list = []
this.role.forEach((item)=>{
let obj = {
name: this.roleObj[item]

14
pages/recordEntry/operate/mySchedule/detail/detail.vue

@ -20,9 +20,9 @@
</view>
<view class="h1">预约学员</view>
<view class="ul">
<view class="li" v-for="(item,index) in 4" :key="index">
<view class="name">张三三 <text> 17628378888</text></view>
<view class="time">提交预约时间2023/08/06 09:12:33</view>
<view class="li" v-for="(item,index) in list" :key="index">
<view class="name">{{ item.studentName}} <text> {{ item.studentPhone }}</text></view>
<view class="time">提交预约时间{{item.classDate}} <text style="margin-left: 6px;">{{item.classTime}}</text></view>
</view>
</view>
</view>
@ -37,12 +37,18 @@
info: {},
id: '',
subjectText: ['不限', '科目二', '科目三'],//023
list: []
}
},
onLoad(options) {
this.id = options.id
this.scheduleClassGetByIdFn()
},
onPullDownRefresh() {
this.scheduleClassGetByIdFn().then(()=>{
uni.stopPullDownRefresh()
})
},
methods: {
async scheduleClassGetByIdFn() {
const {data: res} = await scheduleClassGetById({id: this.id})
@ -52,6 +58,8 @@
},
async getBookingDetailByClassIdFn(id) {
const {data: res} = await getBookingDetailByClassId({classId: id})
if(!res.length) return
this.list = res
console.log(res)
}
}

11
pages/tabbar/examSimulation/comp/simulation.vue

@ -50,6 +50,7 @@
</template>
<script>
import { examSimulationPages } from '@/config/api.js'
export default {
data() {
return {
@ -63,10 +64,20 @@
showDate: false,
params: {
car: 1,
pageNo: 1,
pageSize: 20,
// status: 0,
}
}
},
created() {
this.examSimulationPagesFn()
},
methods: {
async examSimulationPagesFn() {
const {data: res} = await examSimulationPages(this.params)
console.log(res)
},
changeTab(num) {
console.log(num)
this.currentTab = num

90
pages/tabbar/operateTrain/index.vue

@ -10,7 +10,7 @@
</view>
</view>
<view class="tabs">
<view class="tab" v-for="(item,index) in tabArr" :key="index" :class="{active: currentTab==item.id}"
<view class="tab" v-for="(item,index) in tabArr" :key="index" :class="{active: params.status==item.id}"
@click="changeTab(item)">{{ item.text }}</view>
</view>
<view class="screen_row">
@ -34,34 +34,43 @@
</view>
</view>
<view class="list">
<view class="card">
<appointItem-operate @click.native="$goPage('/pages/recordEntry/operate/detail/detail')"/>
<view class="list" v-if="list.length">
<view class="card" v-for="(item,index) in list" :key="index">
<appointItem-operate @click.native="$goPage('/pages/recordEntry/operate/detail/detail')" :item="item"/>
</view>
</view>
<!-- <nodata v-if="!list.length"></nodata> -->
<view style="padding-bottom: 20rpx;" v-if="list.length">
<u-loadmore :status="status" />
</view>
<nodata v-if="!list.length&&status=='nomore'"></nodata>
<UserTab name ='实操训练'></UserTab>
<u-datetime-picker
:show="showDatePicker"
mode="date"
:visibleItemCount="4"
:minDate="1587524800000"
:closeOnClickOverlay="false"
@confirm="confirmDatePicker"
@cancel="showDatePicker=false"
></u-datetime-picker>
<!-- <u-picker :show="showC" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker> -->
<u-picker :show="showCar" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker>
<u-picker :show="showSubject" :columns="subjectArr" keyName="lab" @confirm="confirmSubject" @cancel="showSubject=false"></u-picker>
<u-picker :show="showSubject" :columns="subjectTxt" keyName="lab" @confirm="confirmSubject" @cancel="showSubject=false"></u-picker>
</view>
</template>
<script>
import { bookingMasterPage } from '@/config/api.js'
import { bookingMasterPage, } from '@/config/api.js'
export default {
data() {
return {
tabArr: [{
text: '待上课',
id: 1
id: 0
},
{
text: '已完成',
@ -69,15 +78,24 @@
},
{
text: '已取消',
id: 3
id: 9
},
],
],//012退39,(2)
currentTab: 1,
screen: {
subject: '训练科目',
car: '预约车辆',
timer: '预约时间'
},
status: 'loading',
subjectTxt: [
[
{lab: '不限', id: 0},
{lab: '科目二', id: 2},
{lab: '科目三', id: 3},
]
],
// :023
showDatePicker: false,
showCar: false,
showSubject: false,
@ -87,48 +105,84 @@
{lab: 'C2',id: 2},
]
],
subjectArr: [
carArr: [
[
{lab: '浙00006',id: 1},
{lab: '浙A66666学',id: 1},
{lab: '浙00007',id: 2},
]
],
params: {
pageNo: 1,
pageSize: 20
}
pageSize: 20,
status: 0,
carNumber: '',
bookingTime: []
},
list: []
}
},
onLoad() {
console.log('我的页面')
this.bookingMasterPageFn()
this.params.coachId = this.vuex_coachId
// this.bookingMasterPageFn()
},
onShow() {
uni.hideTabBar();
this.initList()
},
onPullDownRefresh() {
this.initList()
},
onReachBottom() {
if(this.list<this.total) {
this.initList()
}
},
methods: {
async initList() {
this.status = 'loading'
this.list = []
this.params.pageNo = 1
this.bookingMasterPageFn()
},
async bookingMasterPageFn() {
console.log(this.params)
const {data: res } = await bookingMasterPage(this.params)
// uni.$u.http.get('/api/admin-api/business/booking/master/page', this.params ).then(res => {
// console.log(res)
// }).catch(err => {
// })
this.params.pageNo ++
this.list.push(...res.list)
this.total = res.total
if(this.list.length>=this.total) this.status = 'nomore'
console.log(res)
},
changeTab(item) {
this.currentTab = item.id
this.params.status = item.id
this.initList()
},
confirmDatePicker(val) {
this.showDatePicker = false
console.log(val)
console.log(uni.$u.date(val.value, 'yyyy-mm-dd'))
this.screen.timer = uni.$u.date(val.value, 'yyyy-mm-dd')
console.log(this.screen.timer)
this.params.beginTime = this.screen.timer+ ' 00:00:00'
this.params.endTime = this.screen.timer+ ' 23:59:59'
// this.params.bookingTime = [startTimer, endTimer]
this.initList()
},
confirmCar(val) {
let item = val.value[0]
this.screen.car = item.lab
this.params.carNumber = item.lab
this.showCar = false
this.initList()
},
confirmSubject(val) {
let item = val.value[0]
this.screen.subject = item.lab
this.params.subject = item.id
this.initList()
this.showSubject = false
}
}

BIN
static/images/index/carIcon.png

After

Width: 32  |  Height: 28  |  Size: 1.2 KiB

BIN
static/images/index/listIcon.png

After

Width: 34  |  Height: 30  |  Size: 403 B

BIN
static/images/index/site.png

After

Width: 32  |  Height: 28  |  Size: 1.3 KiB

BIN
static/images/index/timerIcon.png

After

Width: 32  |  Height: 28  |  Size: 839 B

Loading…
Cancel
Save