修改我的预约分页

main
jinna 3 years ago
parent b387c11caf
commit ced3ba90c7
  1. 67
      src/views/myExam.vue

@ -5,7 +5,7 @@
<div class="no_title">查询无结果</div>
<div class="no_txt">暂无您的预约项目请选择医院后进行预约</div>
</div>
<van-list :finished="finished" finished-text="没有更多了" @load="onLoad">
<van-list v-model="loading" :finished="isFinished" finished-text="没有更多了" @load="onLoad">
<van-cell class="exam_box" v-for="item in examArr" :key="item.id">
<div class="time_box">{{ item.createDeptName }}</div>
<div class="pro_box" v-for="item1 in item.details" :key="item1.id">
@ -55,9 +55,10 @@ export default {
return {
current: 1,
size: 10,
finished: false,
isFinished: false,
examArr: [],
userInfo: null,
loading:true,
systemTime: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
setInterval: 0,
interVal: null,
@ -73,7 +74,8 @@ export default {
if (userInfo) {
this.userInfo = userInfo;
this.querySystemTime();
this.queryMyRecord();
// this.queryMyRecord();
this.onLoad()
}
},
computed: {
@ -87,7 +89,7 @@ export default {
},
methods: {
onLoad() {
this.current += 1;
// this.current += 1;
this.queryMyRecord();
},
//
@ -121,7 +123,7 @@ export default {
let retData = JSON.parse(value);
if (retData.code == 200) {
let list = retData.data.records;
this.loading = false
list.map(item1 => {
item1.details.map(item => {
console.log(item)
@ -151,8 +153,9 @@ export default {
// }
this.examArr = [...this.examArr, ...list];
console.log(this.examArr)
if (retData.data.total == this.examArr.length) {
this.finished = true
if(retData.data.records.length == 0 ) {
// console.log('ces')
this.isFinished = true
} else {
this.current++
}
@ -182,11 +185,9 @@ export default {
// item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/')))
item.lastCanTime = Date.parse(new Date(lasCanTime.replace(/-/g, '/')))
item.lastTime = Date.parse(new Date(latime.replace(/-/g, '/')))
console.log('las', item.lastTime)
item.limitTime = this.intervalTime(item.starTime, item.lastTime)
item.lastExamTime = systemTime < item.lastTime ? item.lastTime - systemTime : 0
item.limitCancelTime = systemTime < item.lastCanTime ? item.lastCanTime - systemTime : 0;//
console.log(item.limitCancelTime)
// console.log(latime,item.lastTime,lasCanTime,item.lastCanTime,item.limitCancelTime) //670422000
// this.$set(
// item,"limitTime",item.limitTime
@ -196,12 +197,12 @@ export default {
this.timeList()
this.examArr = [...this.examArr, ...list];
if (res.data.total == res.data.pages) {
this.finished = true
if (res.data.records.length === 0) {
this.isFinished = true;
} else {
this.current++
}
this.loading = false
// this.examArr.map(item => {
// let systemTime = Date.parse(new Date(this.systemTime));
// this.starTime = systemTime
@ -352,19 +353,29 @@ export default {
title: "提示",//
buttonLabels: ['确定', '取消'],
success: (data) => {
console.log(data)
if (JSON.parse(data).buttonIndex == 1) {
// console.log('ces')
this.$toast.loading({
message: '',
duration: 0,
})
if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyjzpzp", "qdsgajjtjczdqxtjyy", JSON.stringify({ id: row.id }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => {
let retData = JSON.parse(value);
if (retData.code == 200) {
this.$toast('操作成功');
setTimeout(() => {
this.current = 1;
this.examArr = []
this.queryMyRecord();
}, 500);
this.examArr.map(item => {
let tmp = item.details.find(item1 => item1.id == row.id)
if(tmp){
tmp.apmStatus = 1;
}
})
this.$toast.clear()
// setTimeout(() => {
// this.current = 1;
// this.examArr = []
// this.queryMyRecord();
// }, 500);
}
}, err => {
})
@ -374,11 +385,21 @@ export default {
console.log(res)
if (res.code == 200) {
this.$toast('操作成功');
setTimeout(() => {
this.current = 1;
this.examArr = []
this.queryMyRecord();
}, 500);
// let tmp = ''
this.examArr.map(item => {
let tmp = item.details.find(item1 => item1.id == row.id)
if(tmp){
tmp.apmStatus = 1
}
})
this.$toast.clear()
// setTimeout(() => {
// this.current = 1;
// this.examArr = [];
// this.loading = false
// this.queryMyRecord();
// }, 500);
}
})
}

Loading…
Cancel
Save