|
|
|
|
@ -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:'', // 预约二维码
|
|
|
|
|
// 1:待上课,2:预约中,3:待评价
|
|
|
|
|
// 1:待上课,2:预约中,3:待评价
|
|
|
|
|
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>
|
|
|
|
|
|