commit
This commit is contained in:
@@ -3,12 +3,6 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
.container {
|
||||
height: calc(100vh - 46px - 50px - 60px);
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container img {
|
||||
background-size: contain;
|
||||
width: 100%;
|
||||
@@ -26,10 +20,6 @@ layout("/mobile/platform.html"){
|
||||
padding: 0px 10px 56px 10px;
|
||||
}
|
||||
|
||||
.backTop {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 19px;
|
||||
@@ -55,6 +45,10 @@ layout("/mobile/platform.html"){
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.backTop {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.footer {
|
||||
background-color: white;
|
||||
position: fixed;
|
||||
@@ -157,7 +151,7 @@ layout("/mobile/platform.html"){
|
||||
|
||||
.top_icon {
|
||||
position: fixed;
|
||||
bottom: 130px;
|
||||
bottom: 80px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
@@ -253,7 +247,7 @@ layout("/mobile/platform.html"){
|
||||
|
||||
.pdf_div {
|
||||
padding-bottom: 12px;
|
||||
height: calc(100vh - 46px - 178px - 24px - 60px - 70px);
|
||||
height: 800px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -261,7 +255,7 @@ layout("/mobile/platform.html"){
|
||||
<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="pageBack" fixed left-arrow placeholder title="职工疗休养-酒店介绍"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<!--线路详情-->
|
||||
@@ -610,6 +604,13 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pageBack() {
|
||||
if(this.fromUrlByMy !== 'find') {
|
||||
pjaxReplace('/platform/mobile/theRapyRecuperation/mobileLineListPage')
|
||||
} else {
|
||||
pjaxReplace('/platform/mobile/theRapyRecuperation/myRecuperation')
|
||||
}
|
||||
},
|
||||
calConfirm(date) {
|
||||
const start = moment(date[0]).format('MM月DD日')
|
||||
const end = moment(date[1]).format('MM月DD日')
|
||||
@@ -983,6 +984,42 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
this.show = false
|
||||
},
|
||||
handleClick(event, classArray = [], imagesArray = []) {
|
||||
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
|
||||
if(imagesArray.length > 0) {
|
||||
const index = classArray.indexOf(event.target.className)
|
||||
if(index !== -1) {
|
||||
vant.ImagePreview({
|
||||
images: imagesArray,
|
||||
startPosition: index,
|
||||
closeable: true,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
vant.ImagePreview({
|
||||
images: [event.target.src],
|
||||
closeable: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
readPDFPicture(pdf) {
|
||||
const that = this
|
||||
if(pdf != null) {
|
||||
pdf.on("complete", function () {
|
||||
const imgDoc = document.querySelectorAll('img')
|
||||
let array = []
|
||||
let classArray = []
|
||||
imgDoc.forEach(o => {
|
||||
if(o.getAttribute('class') !== 'top_icon') {
|
||||
classArray.push(o.getAttribute('class'))
|
||||
array.push(o.getAttribute('src'))
|
||||
}
|
||||
})
|
||||
document.addEventListener('click', (event) => that.handleClick(event, classArray, array))
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.id = getQueryString('id') ? getQueryString('id') : ''
|
||||
@@ -1007,42 +1044,11 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
}catch (e) {
|
||||
this.isPdf = true
|
||||
document.addEventListener('click', function (event) {
|
||||
// 打印被点击的元素标签名和 class
|
||||
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
|
||||
vant.ImagePreview({
|
||||
images: [event.target.src],
|
||||
closeable: true,
|
||||
})
|
||||
}
|
||||
})
|
||||
document.addEventListener('click', (event) => this.handleClick(event))
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
pdfh5.on("complete", function () {
|
||||
const imgDoc = document.querySelectorAll('img')
|
||||
let array = []
|
||||
let classArray = []
|
||||
imgDoc.forEach(o => {
|
||||
if(o.getAttribute('class') !== 'top_icon') {
|
||||
classArray.push(o.getAttribute('class'))
|
||||
array.push(o.getAttribute('src'))
|
||||
}
|
||||
})
|
||||
document.addEventListener('click', function (event) {
|
||||
// 打印被点击的元素标签名和 class
|
||||
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
|
||||
const index = classArray.indexOf(event.target.className)
|
||||
if(index !== -1) {
|
||||
vant.ImagePreview({
|
||||
images: array,
|
||||
startPosition: index,
|
||||
closeable: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
this.readPDFPicture(pdfh5)
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
@@ -1050,6 +1056,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('scroll', this.scrollToTop)
|
||||
document.removeEventListener('click', (event) => this.handleClick(event))
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user