|
|
@@ -3,8 +3,8 @@
|
|
|
|
|
|
<div class="as">
|
|
|
<img src="../static/images/main/banner.png" height="121" width="414"/>
|
|
|
- <mu-tabs :value.sync="active" color="#F2F2F2" indicator-color="#ffffff">
|
|
|
- <mu-tab v-for="(day,i) in weeks">{{ day.data }} <br> <em>{{ day.name }}</em></mu-tab>
|
|
|
+ <mu-tabs :value.sync="active" color="#F2F2F2" indicator-color="#ffffff" @change="getIndex" v-if="reFresh">
|
|
|
+ <mu-tab v-for="day in weeks">{{ day.data }} <br> <em>{{ day.name }}</em></mu-tab>
|
|
|
</mu-tabs>
|
|
|
<span class="sum">
|
|
|
{{ today }} 预约名额剩余
|
|
|
@@ -100,6 +100,7 @@
|
|
|
sum: 0,
|
|
|
HaveDays: 0,
|
|
|
openAlert: false,
|
|
|
+ reFresh: true,
|
|
|
list: [],
|
|
|
weeks: [],
|
|
|
today: '',
|
|
|
@@ -116,17 +117,23 @@
|
|
|
// this.alertInfo( window.screen.height);
|
|
|
},
|
|
|
watch: {
|
|
|
- '$route': function (val) {
|
|
|
- if (val.path == '/appoint') {
|
|
|
- this.active = 0;
|
|
|
- this.getQueryNextWeek();
|
|
|
- }
|
|
|
- },
|
|
|
- 'active'() {
|
|
|
+ 'active'(to) {
|
|
|
this.getList();
|
|
|
}
|
|
|
},
|
|
|
+ activated() {
|
|
|
+ this.active = 0;
|
|
|
+ this.reFresh = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.reFresh = true;
|
|
|
+ this.getQueryNextWeek();
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getIndex(val) {
|
|
|
+ console.log(val);
|
|
|
+ },
|
|
|
getQueryNextWeek() {
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
@@ -134,12 +141,14 @@
|
|
|
shopId: this.$route.query.shopId,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
+ this.weeks = [];
|
|
|
QueryNextWeek(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
this.HaveDays = json.Rs;
|
|
|
this.getFurtherDays(this.HaveDays);
|
|
|
} else {
|
|
|
+ that.list = [];
|
|
|
that.$message.error(json.Memo);
|
|
|
}
|
|
|
})
|
|
|
@@ -154,14 +163,6 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 计算距离11/8号还有集体那
|
|
|
- calcHaveDays(sDate1) {
|
|
|
- var date2 = new Date();
|
|
|
- var date1 = new Date(Date.parse(sDate1.replace(/-/g, "/")));
|
|
|
- var iDays = parseInt(Math.abs(date2.getTime() - date1.getTime()) / 1000 / 60 / 60 / 24) + 2;
|
|
|
- return iDays;
|
|
|
-
|
|
|
- },
|
|
|
// 获取未来7天的
|
|
|
getFurtherDays(HaveDays) {
|
|
|
let now = new Date();
|
|
|
@@ -276,9 +277,8 @@
|
|
|
},
|
|
|
getList() {
|
|
|
let that = this;
|
|
|
- this.today = this.weeks[this.active].name;
|
|
|
- let curDay = this.weeks[this.active].orderDate;
|
|
|
- console.log(curDay);
|
|
|
+ this.today = this.weeks[this.active].name;
|
|
|
+ let curDay = this.weeks[this.active].orderDate;
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
orderDate: curDay,
|