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.
 
 
 
 
 
zhishifufei_uniapp/pages/special/single_text_detail.vue

84 lines
1.7 KiB

<template>
<BaseContainer class="single-text-detail">
<NavBar :title="title" />
<mp-html
class="main"
container-style="padding: 30rpx;background: #ffffff;"
:content="isTry == '1' ? profile.try_content : content"
></mp-html>
<view v-if="isTry == '1'" style="height: 128rpx"></view>
<view v-if="isTry == '1'" class="try-btn">
<navigator :url="`/pages/special/single_details?id=${id}`"
>已试看,去购买</navigator
>
</view>
</BaseContainer>
</template>
<script>
import { getSingleImgContent } from "@/api/special";
import mpHtml from "mp-html/dist/uni-app/components/mp-html/mp-html.vue";
export default {
components: {
mpHtml,
},
data() {
return {
title: "",
profile: {},
id: 0,
isTry: "",
content: "",
};
},
onLoad({ try: x_try, id }) {
this.isTry = x_try;
this.id = id;
this.getDetail();
},
mounted: function () {
// this.$nextTick(function () {
// document.body.style.paddingTop = this.$refs.header.clientHeight + "px";
// });
},
methods: {
getDetail() {
getSingleImgContent(this.id).then(({ data }) => {
this.title = data.title;
this.profile = data.profile;
this.content = data.content;
});
},
goBack: function () {
window.location.href = "{:url('special/single_details')}?id=" + this.id;
},
},
};
</script>
<style scoped lang="scss">
.try-btn {
position: fixed;
bottom: 0;
left: 0;
z-index: 10;
width: 100%;
padding: 20rpx 30rpx;
}
.try-btn navigator {
display: block;
width: 100%;
height: 88rpx;
border-radius: 44rpx;
background-color: #2c8eff;
font-size: 28rpx;
line-height: 88rpx;
text-align: center;
color: #ffffff;
}
</style>