You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.3 KiB

3 years ago
<template>
<view @click="$u.throttle(toAnswer)">
2 years ago
<iframe ref="iframe" src="static/html/explanation.html" frameborder="0"></iframe>
3 years ago
</view>
</template>
<script>
export default {
data() {
return {};
},
methods: {
toAnswer () {
uni.navigateTo({
url: '/pages/answer/answer'
})
2 years ago
},
async getDetail (id) {
const res = await this.$u.api.baseFormShow({
table_name: 'map_points',
'with_relations[0]': 'image',
'with_relations[1]': 'video',
id
})
return res
},
async getVrs (id) {
const res = await this.$u.api.baseFormIndex({
table_name: 'map_point_contents',
'with_relations[0]': 'image',
'with_relations[1]': 'video',
'filter[0][key]': 'map_point_id',
'filter[0][op]': 'eq',
'filter[0][value]': id
})
return res
3 years ago
}
},
2 years ago
onLoad(option) {
3 years ago
window.toAnswer = this.toAnswer
2 years ago
this.$nextTick(() => {
this.$refs['iframe'].onload = async () => {
let detail = await this.getDetail(option.id)
let vrs = await this.getVrs(option.id)
this.$refs['iframe'].contentWindow.setDomData({ detail , vrs })
}
})
},
3 years ago
}
</script>
<style lang="scss">
iframe {
height: 100vh;
width: 100vw;
}
</style>