laoding效果补充

main
xuechunyuan 3 years ago
parent 4d0955aaff
commit ed4a0c7a9a
  1. 2
      src/api/hospital.js
  2. 46
      src/views/Guidance.vue
  3. 30
      src/views/HomeView.vue
  4. 45
      src/views/myExam.vue

@ -44,7 +44,7 @@ export const myRecord = (createDept, cupCardNo, current,size) => {
export const recordCancel = (id) => { export const recordCancel = (id) => {
return request({ return request({
url: '/api/blade-business/apm-record/cancel', url: '/api/blade-business/apm-record/cancel',
method: 'get', method: 'post',
params: { params: {
id, id,
} }

@ -1,7 +1,7 @@
<template> <template>
<div class="guidance"> <div class="guidance">
<div class="guide_title">{{ article.title }}</div> <div class="guide_title">{{ article.title }}</div>
<div v-html="article.content" class="guide_contant" ref="scrollView" id="scroll-view" ></div> <div v-html="article.content" class="guide_contant" ref="scrollView" id="scroll-view"></div>
<div class="guide_btn"> <div class="guide_btn">
<div class="guide_actBtn" @click="doCancel">取消</div> <div class="guide_actBtn" @click="doCancel">取消</div>
<div class="guide_actBtn blue" @click="doRead">已阅读</div> <div class="guide_actBtn blue" @click="doRead">已阅读</div>
@ -10,31 +10,42 @@
</template> </template>
<script> <script>
import {queryArticleDetail} from "@/api/hospital"; import { queryArticleDetail } from "@/api/hospital";
export default { export default {
data() { data() {
return { return {
isFlag: false,// isFlag: false,//
article:{ article: {
title:'', title: '',
content:'' content: ''
},// },//
} }
}, },
mounted() { mounted() {
if(this.$route.query.deptId){ if (this.$route.query.deptId) {
this.queryAticle(this.$route.query.deptId); this.queryAticle(this.$route.query.deptId);
} }
}, },
methods: { methods: {
// //
queryAticle(id) { queryAticle(id) {
queryArticleDetail(id).then(res => { this.$toast.loading({
if(JSON.stringify(res.data) != '{}'){ message: '加载中',
res.data.content = decodeURIComponent(res.data.content); duration: 0,
this.article = res.data;
}
}) })
try {
queryArticleDetail(id).then(res => {
this.$toast.clear();
if (JSON.stringify(res.data) != '{}') {
res.data.content = decodeURIComponent(res.data.content);
this.article = res.data;
}
}, err => {
this.$toast.clear();
})
} catch (error) {
this.$toast.clear();
}
}, },
// //
doCancel() { doCancel() {
@ -43,11 +54,11 @@ export default {
// //
doRead() { doRead() {
let readBox = this.$refs.scrollView; let readBox = this.$refs.scrollView;
console.log(readBox.scrollHeight,readBox.scrollTop,readBox.clientHeight) console.log(readBox.scrollHeight, readBox.scrollTop, readBox.clientHeight)
if(readBox.scrollHeight - readBox.scrollTop !== readBox.clientHeight){ if (readBox.scrollHeight - readBox.scrollTop !== readBox.clientHeight) {
console.log('未阅读完成'); console.log('未阅读完成');
this.isFlag = false; this.isFlag = false;
}else{ } else {
this.isFlag = true; this.isFlag = true;
} }
if (!this.isFlag) { if (!this.isFlag) {
@ -66,7 +77,7 @@ export default {
} }
else { else {
// //
this.$router.replace({ name: 'examination', query:{id: this.$route.query.deptId} }) this.$router.replace({ name: 'examination', query: { id: this.$route.query.deptId } })
} }
}, },
// //
@ -75,7 +86,7 @@ export default {
return; return;
} }
const { scrollTop, clientHeight, scrollHeight } = e.target; const { scrollTop, clientHeight, scrollHeight } = e.target;
console.log(scrollTop,clientHeight,scrollHeight) console.log(scrollTop, clientHeight, scrollHeight)
if ((scrollTop + clientHeight) >= (scrollHeight - 5) || scrollTop == 0) { if ((scrollTop + clientHeight) >= (scrollHeight - 5) || scrollTop == 0) {
this.isFlag = true; this.isFlag = true;
console.log('阅读完成') console.log('阅读完成')
@ -110,7 +121,8 @@ export default {
overflow-y: auto; overflow-y: auto;
margin: 0.93rem 0.4rem 0 0; margin: 0.93rem 0.4rem 0 0;
padding: 0 0.4rem; padding: 0 0.4rem;
img{
img {
max-width: 100% !important; max-width: 100% !important;
} }
} }

@ -72,9 +72,20 @@ export default {
methods: { methods: {
// //
queryHosiptal() { queryHosiptal() {
queryHosiptal().then(res => { this.$toast.loading({
this.hospitalList = res.data; message:'加载中',
duration: 0,
}) })
try {
queryHosiptal().then(res => {
this.$toast.clear();
this.hospitalList = res.data;
},err => {
this.$toast.clear();
})
} catch (error) {
this.$toast.clear();
}
}, },
// //
goMyBook() { goMyBook() {
@ -85,19 +96,6 @@ export default {
this.getUserInfo(); this.getUserInfo();
} }
}, },
testAlert() {
lightAppJssdk.notification.alert({
message: "这是一个弹窗",
title: "提示",//
buttonName: "收到",
success: function (data) {
//onSuccessbutton
/*回调*/
},
fail: function (data) { //
}
});
},
// //
doCancelGuide() { doCancelGuide() {
this.guideShow = false; this.guideShow = false;
@ -105,7 +103,7 @@ export default {
// //
doGuidance(id) { doGuidance(id) {
// this.guideShow = true; // this.guideShow = true;
console.log(this.userInfo) // console.log(this.userInfo.papersnumber)
if(this.userInfo){ if(this.userInfo){
checkBacklist(this.userInfo.papersnumber).then(res => { checkBacklist(this.userInfo.papersnumber).then(res => {
if(res.data){ if(res.data){

@ -1,7 +1,7 @@
<template> <template>
<div class="my_exam" :style="{backgroundColor:examArr.length > 0?'#f9f9f9':'#fff'}"> <div class="my_exam" :style="{ backgroundColor: examArr.length > 0 ? '#f9f9f9' : '#fff' }">
<div class="exam_noresult" v-if="examArr.length < 1"> <div class="exam_noresult" v-if="examArr.length < 1">
<img src="~@/assets/image/no_result.jpg"/> <img src="~@/assets/image/no_result.jpg" />
<div class="no_title">查询无结果</div> <div class="no_title">查询无结果</div>
<div class="no_txt">暂无您的预约项目请选择医院后进行预约</div> <div class="no_txt">暂无您的预约项目请选择医院后进行预约</div>
</div> </div>
@ -63,9 +63,20 @@ export default {
methods: { methods: {
// //
queryMyRecord() { queryMyRecord() {
myRecord("", this.userInfo.papersnumber, this.current, this.size).then(res => { this.$toast.loading({
this.examArr = res.data.records; message: '加载中',
duration: 0,
}) })
try {
myRecord("", this.userInfo.papersnumber, this.current, this.size).then(res => {
this.$toast.clear();
this.examArr = res.data.records;
}, err => {
this.$toast.clear();
})
} catch (error) {
this.$toast.clear();
}
}, },
// //
doDateFormatter(date) { doDateFormatter(date) {
@ -73,13 +84,13 @@ export default {
}, },
// //
cancelRegisiter(row) { cancelRegisiter(row) {
if(row.apmStatus !== 0) { if (row.apmStatus !== 0) {
return; return;
} }
lightAppJssdk.notification.alert({ lightAppJssdk.notification.confirm({
message: "是否取消该体检项目", message: "是否取消该体检项目",
title: "提示",// title: "提示",//
buttonName: "确认", buttonLabels: ['确定', '取消'],
success: function (data) { success: function (data) {
//onSuccessbutton //onSuccessbutton
/*回调*/ /*回调*/
@ -106,25 +117,29 @@ export default {
height: 100%; height: 100%;
background: #f9f9f9; background: #f9f9f9;
position: absolute; position: absolute;
.exam_noresult{
.exam_noresult {
text-align: center; text-align: center;
padding-top: 2rem; padding-top: 2rem;
img{
width:2.56rem; img {
height:2.56rem; width: 2.56rem;
height: 2.56rem;
} }
.no_title{
.no_title {
color: #666; color: #666;
font-size: 0.44rem; font-size: 0.44rem;
font-weight: bold; font-weight: bold;
margin-bottom: 0.1rem; margin-bottom: 0.1rem;
} }
.no_txt{
.no_txt {
color: #999; color: #999;
font-size: 0.24rem; font-size: 0.24rem;
width:3rem; width: 3rem;
line-height: 0.33rem; line-height: 0.33rem;
margin:0 auto; margin: 0 auto;
} }
} }

Loading…
Cancel
Save