|
|
|
|
@ -48,11 +48,11 @@
|
|
|
|
|
<!-- 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>
|
|
|
|
|
@ -96,7 +96,7 @@
|
|
|
|
|
openId:"",
|
|
|
|
|
phone:"",
|
|
|
|
|
userid:"",
|
|
|
|
|
tabCurrentIndex: 0,
|
|
|
|
|
tabCurrentIndex: 1,
|
|
|
|
|
scrollLeft: 0,//tabs
|
|
|
|
|
qr:'', // 预约二维码
|
|
|
|
|
// 1:待上课,2:预约中,3:待评价
|
|
|
|
|
@ -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
|
|
|
|
|
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
|
|
|
|
|
};
|
|
|
|
|
@ -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',
|
|
|
|
|
|