zouyanyan 3 weeks ago
commit 598ea2c158

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

Loading…
Cancel
Save