学员课程预约操作修改

main
15004070936 4 weeks ago
parent 8a55783041
commit 23dafaf347

@ -11,7 +11,7 @@
<scroll-view scroll-y style="height: 100%;width: 100%;">
<view class="scell" v-if="tabItem.slist.length>0">
<view v-for="(item, index) in tabItem.slist" :key="index" class="oitem">
<view class="otop" @click="gotoInfo(item.bookId)">
<view class="hleft">
<text>{{item.storeName?item.storeName:'门店'}}</text>
@ -26,7 +26,7 @@
<view v-else-if="item.bookStatus==3" class="ctip">已取消</view>
</view>
</view>
<view class="oscon" @click="gotoInfo(item.bookId)">
<view class="osimg imgload">
<image class="osimg" v-if="item.pic" :src="getimgRemoteFile(item.pic)" mode="aspectFill"></image>
@ -37,8 +37,8 @@
<text class="txt"> 上课时间{{ item.claDate+' '+item.startTime+'-'+item.endTime}}</text>
<text class="txt"> 教室{{item.roomName}}</text>
</view>
</view>
</view>
<view class="obtn">
<view class="qr">
<view class="qrimg" v-if="item.qrCode" @click="openQR(item.qrCode)">
@ -48,23 +48,23 @@
<!-- 1待上课2预约中3待评价 4已完成 5已取消-->
<!-- 描述:0->预约中;1->教练确认;2->店长确认/预约成功/待上课 3->已取消;4->已完成/待评价; -->
<button type="primary" class="conbtn" @click="gototeacher(item)"></button>
<button v-if="item.orderstate==2||item.orderstate==1" type="primary" class="cancelbtn" :data-id="item.courseTimeId" @click="cancelkcdo"></button>
<button v-if="item.orderstate==0" type="primary" class="cancelbtn" :data-id="item.courseTimeId" @click="cancelyydo"></button>
<button v-if="item.orderstate==0" type="primary" class="paybtn" :data-id="item.courseTimeId" @click="checkdo($event,item)"></button>
<button v-if="item.orderstate==4" type="primary" class="viewbtn" :data-id="item.courseTimeId" @click="orderdo($event,item)"></button>
<button v-if="item.orderstate==4" type="primary" class="gzbtn" :data-id="item.courseTimeId" @click="gotoevaluate($event,item)"></button>
<!-- <button v-if="item.bookStatus==2||item.bookStatus==1" type="primary" class="cancelbtn" :data-id="item.courseTimeId" @click="cancelkcdo"></button>-->
<button v-if="'0,1,2'.includes(item.bookStatus)" type="primary" class="cancelbtn" :data-id="item.courseTimeId" @click="cancelyydo"></button>
<!-- <button v-if="item.bookStatus==0" type="primary" class="paybtn" :data-id="item.courseTimeId" @click="checkdo($event,item)"></button>-->
<button v-if="item.bookStatus==4" type="primary" class="viewbtn" :data-id="item.courseTimeId" @click="orderdo($event,item)"></button>
<!-- <button v-if="item.bookStatus==4" type="primary" class="gzbtn" :data-id="item.courseTimeId" @click="gotoevaluate($event,item)"></button>-->
</view>
</view>
</view>
<view v-if="tabItem.slist.length==0 && tabItem.loadStatus=='noMore'" class="nodata"></view>
<uni-load-more v-if="tabItem.slist.length>0" iconType="circle" :status="tabItem.loadStatus" />
</scroll-view>
</swiper-item>
</swiper>
<!-- 二维码 -->
<uni-popup ref="pfDialog" :mask-click="false">
<view class="pcon">
@ -77,10 +77,10 @@
</view>
</view>
</uni-popup>
<!-- 是否登录 -->
<openlogin ref="loginId" @getPhoneNumber="getPhoneNumber"></openlogin>
</view>
</template>
@ -96,10 +96,10 @@
openId:"",
phone:"",
userid:"",
tabCurrentIndex: 0,
tabCurrentIndex: 1,
scrollLeft: 0,//tabs
qr:'', //
// 123
// 123
list:[
{
id:0,
@ -427,33 +427,33 @@
});
const {data: res} = await uni.$http.get('/api/course/bookCourseList');
var data = res.data;
if(data){
console.log(res)
if(data){
console.log(res)
//
this.list[0].loadStatus="noMore";
this.list[0].slist=data.all;
this.list[0].slist=data.all;
console.log(this.list[0].slist)
this.$forceUpdate();
//
this.list[4].loadStatus="noMore";
this.list[4].slist=data.canceled;
this.list[4].slist=data.canceled;
this.$forceUpdate();
//
this.list[1].loadStatus="noMore";
this.list[1].slist=data.waitingForClass;
this.list[1].slist=data.waitingForClass;
this.$forceUpdate();
//
this.list[2].loadStatus="noMore";
this.list[2].slist=data.booking;
this.list[2].slist=data.booking;
this.$forceUpdate();
//
this.list[3].loadStatus="noMore";
this.list[3].slist=data.completed;
this.$forceUpdate();
this.list[3].slist=data.completed;
this.$forceUpdate();
}
else{
this.list[this.tabCurrentIndex].loadStatus="noMore";
@ -502,21 +502,21 @@
//
gototeacher(item){
console.log(item);
if(item.teacherId){
if(item.teacherAppId){
uni.showLoading({
title: '会话创建中...'
});
//
var chatid="privatechat-" + this.userid +"-"+ item.teacherId;
var chatid="privatechat-" + this.userid +"-"+ item.teacherAppId;
var timestamp = new Date().getTime();
var info={
chatId: "privatechat-" + this.userid +"-"+ item.teacherId,
chatId: "privatechat-" + this.userid +"-"+ item.teacherAppId,
chatType: "coach",
chatName: item.teacherName,
chatAvatar: item.pic?item.pic:'/static/image/kf.png',
chatTime: timestamp,
userid: this.userid,
friendId: item.teacherId, // userid
userid: this.userid,
friendId: item.teacherAppId, // userid
minId: "", // id
sort:"privatechat", // privatechat groupchat
from:"yh" // yh message
@ -561,23 +561,26 @@
},
//
orderdo(e,item){
console.log(id,item);
console.log(e,item);
var that = this;
uni.navigateTo({
url: `/pages/user/courselist`
});
//
uni.showModal({
title: '提示',
content: '确定再次预约吗?',
cancelText: '取消',
confirmText: '确定',
success: ress => {
if (ress.confirm) {
that.checkdodo(id,item);
}
}
});
// uni.showModal({
// title: '',
// content: '',
// cancelText: '',
// confirmText: '',
// success: ress => {
// if (ress.confirm) {
// that.orderdodo(item);
// }
// }
// });
},
//
async orderdodo(id,item){
async orderdodo(item){
var param={
"courseTimeId": item.courseTimeId
};
@ -630,8 +633,8 @@
//
async checkdodo(id,item){
var param={
"courseTimeId": item.courseTimeId,
"startTime": item.startTime,
"courseTimeId": item.courseTimeId,
"startTime": item.startTime,
"endTime": item.endTime
};
uni.showToast({
@ -686,7 +689,7 @@
duration: 2000
});
const {data: res} = await uni.$http.post('/api/course/cancelCourse', param);
if(res.msg=="successed"){
if(res.success){
uni.showToast({
title: '预约已取消!',
icon: 'success',
@ -697,7 +700,7 @@
}
else{
uni.showToast({
title: res.msg? res.msg:'预约取消失败!',
title: res.message? res.message:'预约取消失败!',
icon: 'error',
duration: 2000
});
@ -732,7 +735,7 @@
duration: 2000
});
const {data: res} = await uni.$http.post('/api/course/cancelCourse', param);
if(res.msg=="successed"){
if(res.msg=="success"){
uni.showToast({
title: '课程已取消!',
icon: 'success',
@ -802,7 +805,7 @@
height: 100%;
}
.scrolllist{
height: 110rpx;
height: 110rpx;
background: #FFF;
white-space: nowrap;
width: 100%;
@ -843,7 +846,7 @@
background-image: url('/static/image/no.png');
background-size: 52% auto;
background-repeat: no-repeat;
background-position: center;
background-position: center;
font-size: 28rpx;
text-align: center;
color: #00a89b;
@ -1144,9 +1147,9 @@
}
}
}
.pcon{
width: 690rpx;
padding-top:30rpx;
@ -1173,10 +1176,10 @@
display: flex;
align-items: center;
justify-content: center;
margin: 30rpx auto;
margin: 30rpx auto;
border-radius: 16rpx 16rpx 16rpx 16rpx;
opacity: 1;
border: 2rpx solid #F7F8FA;
border: 2rpx solid #F7F8FA;
padding: 30rpx;
.qrimg{
width: 400rpx;
@ -1197,5 +1200,5 @@
color: #FCFCFD;
}
}
</style>

Loading…
Cancel
Save