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.

184 lines
3.7 KiB

2 years ago
<template>
2 years ago
<view class="content">
2 years ago
<view class="navBarBox" :style="{height:navBarBoxHeight+'px'}">
2 years ago
<!-- 状态栏占位 -->
2 years ago
<view class="statusBar" :style="{paddingTop: navBarTop+'px'}"></view>
2 years ago
<!-- 真正的导航栏内容 -->
2 years ago
<view class="navBar" :style="{'height':navBarHeight+'px','line-height':navBarHeight+'px'}">
2 years ago
<view class="back" @click="goback">
<u-icon name="arrow-left"></u-icon>
</view>
<view>{{menutitle}}</view>
</view>
</view>
2 years ago
<view class='contop' :style="{'margin-top':(navBarBoxHeight)+'px'}">
<view class='title'>{{info.title?info.title:''}}</view>
<view v-if="info.source" class='time'><span>来源{{info.source?info.source:''}}</span></view>
2 years ago
</view>
2 years ago
2 years ago
<view class='detail'>
2 years ago
<u-parse v-if='showContent' :content="info.text?info.text:' '"/>
2 years ago
</view>
2 years ago
</view>
</template>
2 years ago
<script>
2 years ago
import uParse from '@/components/gaoyia-parse/parse.vue'
import {
shareInfo
} from "@/common/util.js"
2 years ago
export default {
components: {
uParse,
},
2 years ago
data() {
2 years ago
return {
navBarBoxHeight: 0,
2 years ago
navBarHeight:0,
navBarTop:0,
menutitle: '',
2 years ago
info: {},
id: '',
2 years ago
showContent:false
2 years ago
}
2 years ago
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
2 years ago
},
2 years ago
onLoad(options) {
2 years ago
const MenuButton = uni.getMenuButtonBoundingClientRect()
this.navBarTop = MenuButton.top //左侧文字与右侧胶囊对齐
this.navBarHeight = MenuButton.height
this.navBarBoxHeight = this.navBarTop + this.navBarHeight + 10
console.log(options)
this.id = options.id ? options.id : ''
this.menutitle = options.menuTitle?options.menuTitle:'冬训云课堂'
this.loadDetail(this.id)
this.enterAudios(this.id)
2 years ago
},
methods: {
2 years ago
goback(){
uni.navigateBack({
delta: 1 // 返回的页面数这里设置为1表示返回上一页
});
},
async enterAudios(id){
await this.$u.api.enterAudios(id,{})
2 years ago
},
2 years ago
async loadDetail(id) {
const res = await this.$u.api.showAudios(id,{})
this.info = res
this.showContent = true
2 years ago
}
2 years ago
}
2 years ago
}
</script>
2 years ago
<style lang='scss'>
.navBarBox {
position: fixed;
top: 0;
left: 0;
z-index: 999;
width: 100%;
padding: 0 20rpx;
background: linear-gradient(to right, #da212d, #f96666);
margin-bottom:24rpx;
.navBar {
color: #fff;
font-size: 32rpx;
text-align: center;
.back {
position: absolute;
left: 20rpx;
}
}
}
</style>
<style>
@import url("/components/gaoyia-parse/parse.css");
.content {
/* background-color: #fbf3ea; */
/* padding-bottom:180rpx */
}
.contop{
padding:0 30rpx;
padding-bottom: 30rpx;
border-radius: 0 0 30rpx 30rpx;
background: #fff;
}
.title {
text-align: center;
padding: 30rpx 0rpx;
font-size: 36rpx;
font-weight:bold;
}
2 years ago
2 years ago
.time {
text-align: center;
color: #6e6e6e;
font-size: 28rpx;
padding-bottom: 30rpx;
border-bottom: 1px solid #fafaf9;
}
2 years ago
2 years ago
.time span {
margin: 0 10rpx;
}
2 years ago
2 years ago
.head {
margin:30rpx 0;
margin-bottom:0;
}
2 years ago
2 years ago
.head img {
width: 100%
}
.head_unit{
background-color: #fcf8f3;
border:8rpx solid #f8ebdb;
border-radius: 20rpx;
padding:35rpx;
margin:30rpx 0;
margin-bottom:0;
font-size: 28rpx;
}
.head_unit>view{
display: flex;
}
.head_unit>view>view:first-child{
width:28%;
}
.head_unit>view>view:last-child{
width:72%;
}
.head_unit>view>view:last-child view{
margin-bottom: 20rpx;
}
.bg40{
width:100%;
height:40rpx;
background-color: #fbf3ea;
}
.detail {
padding:0 60rpx;
background: #fff;
2 years ago
/* padding-top: 30rpx; */
2 years ago
border-radius: 30rpx 30rpx 0 0;
padding-bottom:180rpx;
font-size: 28rpx;
}
.detail img {
width: 100%;
margin:10rpx 0;
}
.wxParse{
line-height: 2.3;
2 years ago
}
</style>