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) => {
return request({
url: '/api/blade-business/apm-record/cancel',
method: 'get',
method: 'post',
params: {
id,
}

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

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

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

Loading…
Cancel
Save