|
|
@@ -14,26 +14,26 @@
|
|
|
<ul class="list">
|
|
|
<li v-for="l in list">
|
|
|
<div class="lt">
|
|
|
- <h5>{{l.expTime}}</h5>
|
|
|
- <span>{{l.timeLong}}</span>
|
|
|
+ <h5>{{l.CurrentDate}}</h5>
|
|
|
+ <span>{{l.BeginStr}}-{{l.EndStr}}</span>
|
|
|
</div>
|
|
|
<div class="md">
|
|
|
<em>
|
|
|
- {{l.name}}
|
|
|
+ {{l.ClassName}}
|
|
|
</em>
|
|
|
<span class="green" v-if="l.Status == 0">
|
|
|
- 预约成功
|
|
|
+ 预约上课
|
|
|
</span>
|
|
|
<span class="red" v-if="l.Status == 1">
|
|
|
- 预约失败
|
|
|
+ 预约未到
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="rt">
|
|
|
<div class="cancleBtn" v-if="l.Status == 0" @click="cancleAppoint(l)">取消</div>
|
|
|
<span v-if="l.Status == 1" class="isFinish">
|
|
|
- 已完成
|
|
|
+ 已完成
|
|
|
</span>
|
|
|
- <span class="red" v-if="l.Status == 2" >
|
|
|
+ <span class="red" v-if="l.Status == 2">
|
|
|
已取消
|
|
|
</span>
|
|
|
<em v-if="l.Status == 3">
|
|
|
@@ -51,6 +51,8 @@
|
|
|
import axios from 'axios';
|
|
|
import bottomTab from '../components/bottomTab'
|
|
|
import {
|
|
|
+ OrderListQuery,
|
|
|
+ VipUserConsumeListQuery,
|
|
|
testSelect,
|
|
|
testTable,
|
|
|
} from '../api/getApiRes.js'
|
|
|
@@ -78,38 +80,62 @@
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- cancleAppoint(row){
|
|
|
+ cancleAppoint(row) {
|
|
|
let that = this;
|
|
|
this.$confirm('是否取消前课程预约?', '提示', {
|
|
|
type: 'warning'
|
|
|
}).then(({result}) => {
|
|
|
- if (result) {
|
|
|
- let param = {
|
|
|
- token: localStorage.token,
|
|
|
- };
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- testTable(postdata).then(res => {
|
|
|
- let json = res;
|
|
|
- if (json.Code == 0) {
|
|
|
- that.Toast('当前课程已取消预约','success');
|
|
|
- that.getList();
|
|
|
- } else {
|
|
|
- that.Toast(json.Memo + ',错误码:' + json.Code);
|
|
|
- }
|
|
|
- })
|
|
|
+ if (result) {
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ testTable(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.Toast('当前课程已取消预约', 'success');
|
|
|
+ that.getList();
|
|
|
+ } else {
|
|
|
+ that.Toast(json.Memo + ',错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$toast.message('点击了取消');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getOrderListQuery(statusList){
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ statusList: statusList,
|
|
|
+ start:1,
|
|
|
+ tableMax :10,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ if(parseInt(this.active) == 0 || parseInt(this.active) == 1){
|
|
|
+ OrderListQuery(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.list = json.Rs;
|
|
|
+ if (that.list) {
|
|
|
+ that.num = json.Rs.length;
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.$toast.message('点击了取消');
|
|
|
+ that.$message.error(json.Memo);
|
|
|
}
|
|
|
- });
|
|
|
+ }) ;
|
|
|
+ }
|
|
|
},
|
|
|
- getList() {
|
|
|
+ getVipUserConsumeListQuery(){
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
- active: this.active
|
|
|
+ start:1,
|
|
|
+ tableMax :10,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- testTable(postdata).then(res => {
|
|
|
+ VipUserConsumeListQuery(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
that.list = json.Rs;
|
|
|
@@ -121,8 +147,43 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getList() {
|
|
|
+ let statusList = '';
|
|
|
+ switch (parseInt(this.active)) {
|
|
|
+ // 已预约
|
|
|
+ case 0:
|
|
|
+ statusList = 1;
|
|
|
+ this.getOrderListQuery(statusList);
|
|
|
+ break;
|
|
|
+ // 预约记录
|
|
|
+ case 1:
|
|
|
+ statusList = '1,2,3,4';
|
|
|
+ this.getOrderListQuery(statusList);
|
|
|
+ break;
|
|
|
+ // 消费记录
|
|
|
+ case 2:
|
|
|
+ statusList = 1;
|
|
|
+ this.getVipUserConsumeListQuery(statusList);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ beforeRouteEnter(to, from, next) {
|
|
|
+ next(vm => {
|
|
|
+ //因为当钩子执行前,组件实例还没被创建
|
|
|
+ // vm 就是当前组件的实例相当于上面的 this,所以在 next 方法里你就可以把 vm 当 this 来用了。
|
|
|
+ if (to.name == 'record') {
|
|
|
+ console.log(123);
|
|
|
+ vm.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
watch: {
|
|
|
+ '$route'(to) {
|
|
|
+ if (to.name == 'record') {
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
'active'() {
|
|
|
this.getList();
|
|
|
}
|
|
|
@@ -214,10 +275,12 @@
|
|
|
background: #fff;
|
|
|
border-bottom: 1px solid #ccc;
|
|
|
}
|
|
|
+
|
|
|
.list .lt {
|
|
|
width: 120px;
|
|
|
float: left;
|
|
|
}
|
|
|
+
|
|
|
.list .lt h5 {
|
|
|
font-family: "PingFang SC";
|
|
|
font-weight: normal;
|
|
|
@@ -226,6 +289,7 @@
|
|
|
color: #4e4e4e;
|
|
|
margin: 0;
|
|
|
}
|
|
|
+
|
|
|
.list .lt span {
|
|
|
font-family: "PingFang SC";
|
|
|
font-weight: normal;
|
|
|
@@ -233,12 +297,14 @@
|
|
|
text-align: left;
|
|
|
color: #909090;
|
|
|
}
|
|
|
+
|
|
|
.list .md {
|
|
|
max-width: 200px;
|
|
|
/*width: 220px;*/
|
|
|
float: left;
|
|
|
padding-top: 5px;
|
|
|
}
|
|
|
+
|
|
|
.list .rt {
|
|
|
width: 55px;
|
|
|
float: right;
|
|
|
@@ -248,6 +314,7 @@
|
|
|
margin: 0 auto;
|
|
|
padding-top: 4px;
|
|
|
}
|
|
|
+
|
|
|
.md em {
|
|
|
float: left;
|
|
|
font-family: "PingFang SC";
|
|
|
@@ -257,6 +324,7 @@
|
|
|
color: #3b3b3b;
|
|
|
margin-right: 20px;
|
|
|
}
|
|
|
+
|
|
|
.md span {
|
|
|
font-family: "PingFang SC";
|
|
|
font-weight: normal;
|
|
|
@@ -265,12 +333,15 @@
|
|
|
color: #37cb00;
|
|
|
line-height: 30px;
|
|
|
}
|
|
|
+
|
|
|
span.green {
|
|
|
color: #37cb00;
|
|
|
}
|
|
|
+
|
|
|
span.red {
|
|
|
- color:#FF453C;
|
|
|
+ color: #FF453C;
|
|
|
}
|
|
|
+
|
|
|
.rt span {
|
|
|
float: right;
|
|
|
line-height: 35px;
|
|
|
@@ -281,6 +352,7 @@
|
|
|
color: #909090;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
.rt .red {
|
|
|
font-family: "PingFang SC";
|
|
|
font-weight: normal;
|
|
|
@@ -288,6 +360,7 @@
|
|
|
text-align: left;
|
|
|
color: #f8847f;
|
|
|
}
|
|
|
+
|
|
|
.rt .cancleBtn {
|
|
|
width: 55px;
|
|
|
height: 24px;
|
|
|
@@ -300,6 +373,7 @@
|
|
|
line-height: 24px;
|
|
|
margin-top: 6px;
|
|
|
}
|
|
|
+
|
|
|
.rt em {
|
|
|
font-family: "PingFang SC";
|
|
|
font-weight: normal;
|