|
@@ -18,17 +18,14 @@ const pdfState = reactive({
|
|
|
})
|
|
|
let showHint = ref(true)
|
|
|
let hasRight = ref(true)
|
|
|
-let isLoading = ref(false)
|
|
|
let hintText = ref('')
|
|
|
const loadingFailed = ()=>{
|
|
|
LOADING.close()
|
|
|
- isLoading.value = false
|
|
|
ElMessage.error('加载PDF失败!')
|
|
|
showHint.value = true
|
|
|
}
|
|
|
const loadedPDF=()=>{
|
|
|
LOADING.close()
|
|
|
- isLoading.value = false
|
|
|
showHint.value = false
|
|
|
hintText.value = ''
|
|
|
}
|
|
@@ -37,7 +34,6 @@ const getPDFDetail = (pdf_id)=>{
|
|
|
ElMessage.error('未找到PDF')
|
|
|
hintText.value="获取PDF失败"
|
|
|
LOADING&&LOADING.close()
|
|
|
- isLoading.value = false
|
|
|
return
|
|
|
}
|
|
|
apiGetPDFDetail({pdf_id}).then(res=>{
|
|
@@ -68,7 +64,6 @@ const checkRight = async()=>{
|
|
|
hasRight.value = true
|
|
|
}else{
|
|
|
LOADING&&LOADING.close()
|
|
|
- isLoading.isLoading = false
|
|
|
hasRight.value = false
|
|
|
}
|
|
|
}
|
|
@@ -105,7 +100,6 @@ onMounted(async ()=>{
|
|
|
target:'.preview-pdf-wrap',
|
|
|
text:'正在加载PDF'
|
|
|
})
|
|
|
- isLoading.value = true
|
|
|
await checkRight()
|
|
|
getPDFDetail(Number(route.query.pdf_id))
|
|
|
//handleDataToXcx()
|
|
@@ -123,7 +117,7 @@ onMounted(async ()=>{
|
|
|
<span class="global-main-btn btn" @click="handleApply">立即申请</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template v-else-if="pdfState.pdf_url.length&&!isLoading">
|
|
|
+ <template v-else-if="pdfState.pdf_url.length">
|
|
|
<vue-pdf-embed :source="pdfState.pdf_url" @loading-failed="loadingFailed" @loaded="loadedPDF"/>
|
|
|
<p v-if="showHint" class="hint">加载PDF失败!</p>
|
|
|
</template>
|