提交 4a153b9a authored 作者: lihuihui's avatar lihuihui

update

上级 416b167e
......@@ -39,6 +39,7 @@
</template>
<script>
import { getDocDetails } from '../api'
export default {
props: {
data: { type: Array }
......@@ -48,11 +49,18 @@ export default {
this.$router.push({ path: '/list', query: { id: row.id } })
},
goDetail(row) {
if (row.url === '') {
this.$router.push({ path: '/details', query: { id: row.id } })
} else {
window.location.href = row.url
}
getDocDetails({ id: row.id }).then(res => {
if (res.data.content === '') {
window.location.href = row.url
} else {
this.$router.push({ path: '/details', query: { id: row.id } })
}
})
// if (row.url === '') {
// this.$router.push({ path: '/details', query: { id: row.id } })
// } else {
// window.location.href = row.url
// }
}
}
}
......
......@@ -6,6 +6,9 @@
<div class="show_content_img" v-html="data.content"></div>
</div>
</div>
<div class="main_content_footer" v-if="data.url != ''">
<div class="show_content_btn" @click="goPage">立即报名</div>
</div>
</div>
</template>
......@@ -22,6 +25,9 @@ export default {
}
},
methods: {
goPage() {
window.location.href = this.data.url
},
getDocDetails() {
getDocDetails({ id: this.$route.query.id }).then(res => {
this.data = res.data
......@@ -37,7 +43,7 @@ export default {
<style lang="scss" scoped>
.main {
.main_content {
padding: 1.2rem 0.32rem;
padding: 1.2rem 0.32rem 1.6rem;
.show_content {
.show_content_img {
// width: 6.9rem;
......@@ -59,4 +65,27 @@ export default {
// border-radius: 0.1rem;
}
}
.main_content_footer {
width: 100%;
height: 1.6rem;
background: rgba(255, 255, 255, 0.5);
position: fixed;
bottom: 0;
left: 0;
.show_content_btn {
width: 6.54rem;
background: #2c4694;
border-radius: 0.44rem;
font-weight: 500;
color: #fff;
font-size: 0.3rem;
text-align: center;
line-height: 0.68rem;
position: fixed;
bottom: 0.4rem;
left: 50%;
transform: translate(-50%);
cursor: pointer;
}
}
</style>
......@@ -6,6 +6,9 @@
<div class="show_content_img" v-html="data.content"></div>
</div>
</div>
<div class="main_content_footer" v-if="data.url != ''">
<div class="show_content_btn" @click="goPage">立即报名</div>
</div>
</div>
</template>
......@@ -22,9 +25,13 @@ export default {
}
},
methods: {
goPage() {
window.location.href = this.data.url
},
getDocDetails() {
getDocDetails({ id: this.$route.query.id }).then(res => {
this.data = res.data
console.log(this.data, 'data')
})
}
},
......@@ -37,7 +44,7 @@ export default {
<style lang="scss" scoped>
.main {
.main_content {
padding: 1.2rem 0.32rem;
padding: 1.2rem 0.32rem 1.6rem;
.show_content {
.show_content_img {
// width: 6.9rem;
......@@ -59,4 +66,27 @@ export default {
// border-radius: 0.1rem;
}
}
.main_content_footer {
width: 100%;
height: 1.6rem;
background: rgba(255, 255, 255, 0.5);
position: fixed;
bottom: 0;
left: 0;
.show_content_btn {
width: 6.54rem;
background: #2c4694;
border-radius: 0.44rem;
font-weight: 500;
color: #fff;
font-size: 0.3rem;
text-align: center;
line-height: 0.68rem;
position: fixed;
bottom: 0.4rem;
left: 50%;
transform: translate(-50%);
cursor: pointer;
}
}
</style>
......@@ -21,7 +21,7 @@
</template>
<script>
import { getList } from '../api'
import { getList, getDocDetails } from '../api'
import Foot from '@/components/Foot.vue'
export default {
components: {
......@@ -34,15 +34,25 @@ export default {
},
methods: {
goPage(item) {
if (item.url !== '') {
window.location.href = item.url
} else {
console.log(111)
this.$router.push({
path: '/message/details',
query: { id: item.id }
})
}
getDocDetails({ id: item.id }).then(res => {
if (res.data.content === '') {
window.location.href = item.url
} else {
this.$router.push({
path: '/message/details',
query: { id: item.id }
})
}
})
// if (item.url !== '') {
// window.location.href = item.url
// } else {
// console.log(111)
// this.$router.push({
// path: '/message/details',
// query: { id: item.id }
// })
// }
}
},
mounted() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论