This commit is contained in:
Paidax
2025-06-04 15:27:27 +08:00
parent d046c3be5d
commit 2409b3ddfe
116 changed files with 12202 additions and 1804 deletions
@@ -29,23 +29,28 @@ layout("/mobile/platform.html"){
.pre_text {
white-space: break-spaces;
padding-left: 7px;
max-height: calc(80vh - 290px);
overflow-y: auto;
}
.pdfjs {
height: 90%;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="职工疗休养"></van-nav-bar>
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder title="职工疗休养"></van-nav-bar>
</van-sticky>
<!--顶部轮播图-->
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe class="my-swipe" style="height: 20vh" :autoplay="3000" indicator-color="white">
<van-swipe-item>
<van-image width="100%" height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpg"></van-image>
<van-image width="100%" height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpeg"></van-image>
</van-swipe-item>
<van-swipe-item>
<van-image height="180" src="/assets/mobile/img/therapyRecuperation/index2.jpg"></van-image>
<van-image height="180" src="/assets/mobile/img/therapyRecuperation/index1.jpeg"></van-image>
</van-swipe-item>
</van-swipe>
@@ -60,35 +65,36 @@ layout("/mobile/platform.html"){
</div>
<!--疗休养描述-->
<div class="van-doc-card" style="margin-top: 20px;margin-bottom: 60px">
<div class="van-doc-card" style="margin-top: 10px; height: calc(80vh - 245px)">
<van-image width="190" height="43" src="/assets/mobile/img/therapyRecuperation/title.png"></van-image>
<div class="pre_text" v-html="configData.notice"></div>
<div v-if="isPdf" class="pre_text" v-html="configData.notice"></div>
<div v-else id="demo" class="pdf_div"></div>
</div>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养报名
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的疗休养
</van-tabbar-item>
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养首页</van-tabbar-item>
<van-tabbar-item icon="search" replace url="/platform/mobile/theRapyRecuperation/mobileLineListPage">线路选择</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的报名</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
let pdfh5 = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
tarBarActive: 0,
chooseButton: [],
configData: {},
tarBarActive: 0,
isPdf: false,
}
},
methods: {
async toLineList(index) {
const isExist = await getScopeUser(this.configData.activityGroupId)
/*const isExist = await getScopeUser(this.configData.activityGroupId)
if (!isExist) {
vant.Dialog.alert({
title: '温馨提示',
@@ -96,7 +102,7 @@ layout("/mobile/platform.html"){
confirmButtonColor: '#1867b0'
})
return
}
}*/
localStorage.setItem("clickIndex", JSON.stringify({clickIndex: index}))
location.href = '/platform/mobile/theRapyRecuperation/mobileLineListPage'
},
@@ -107,8 +113,58 @@ layout("/mobile/platform.html"){
},
async created() {
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
this.chooseButton = this.chooseButton.filter(o => o.value !== 2)
await this.getConfigData()
try {
const parser = new DOMParser();
const doc = parser.parseFromString(this.configData.notice, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
this.$nextTick(() => {
pdfh5 = new Pdfh5('#demo', {
pdfurl: href,
});
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && !['van-image__img', 'top_icon'].includes(event.target.className)) {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
}
this.$nextTick(() => {
pdfh5.on("complete", function () {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(!['van-image__img', 'top_icon'].includes(o.getAttribute('class'))) {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && !['van-image__img', 'top_icon'].includes(event.target.className)) {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
})
})
}
})
</script>