更新
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<view class="view-page" :style="{backgroundImage : `url('${ThemeData?.app_bg ?? $config.PRIMARY_BGURL}')`}">
|
||||
<headerHeight />
|
||||
<navBar :navTitle="'青少年模式'" :emitBack="true" @backEvent="back">
|
||||
<navBar :style="{marginTop: `${statusBarHeight}${uni.getSystemInfoSync().platform === 'ios' ? 'px': 'dp'}`}" :navTitle="'青少年模式'" :emitBack="true" @backEvent="back">
|
||||
</navBar>
|
||||
<view class="content-view">
|
||||
<view class="flex-line">
|
||||
@@ -9,7 +8,7 @@
|
||||
</NavigationTabs>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="flex-line flex-spaceB w-fill new-box" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="flex-line flex-spaceB w-fill new-box" v-for="(item, index) in dataList" :key="index" @click="openDetail(item)">
|
||||
<view class="">
|
||||
<view class="color-3 font-32 font-w500">
|
||||
{{ item.title }}
|
||||
@@ -31,12 +30,10 @@
|
||||
|
||||
<script>
|
||||
import http from '@/until/http.js';
|
||||
import headerHeight from '@/component/headerHeight.vue';
|
||||
import navBar from '@/component/nav.vue';
|
||||
import NavigationTabs from '@/component/tab.vue';
|
||||
export default {
|
||||
components: {
|
||||
headerHeight,
|
||||
navBar,
|
||||
NavigationTabs
|
||||
},
|
||||
@@ -44,6 +41,7 @@ export default {
|
||||
return {
|
||||
errorPage: true,
|
||||
currentIndex: 0,
|
||||
statusBarHeight:0,
|
||||
pageConfig: {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
@@ -65,9 +63,12 @@ export default {
|
||||
this.errorPage = true
|
||||
this.dataList = []
|
||||
const {
|
||||
id
|
||||
id,
|
||||
h
|
||||
} = options
|
||||
uni.setStorageSync('token', id)
|
||||
this.statusBarHeight = h
|
||||
uni.setStorageSync('BarHeight', h)
|
||||
if (uni.getStorageSync('token')) this.getUnderageTypeList()
|
||||
if (uni.getStorageSync('Theme_Data')) {
|
||||
this.ThemeData = JSON.parse(uni.getStorageSync('Theme_Data'))
|
||||
@@ -147,6 +148,11 @@ export default {
|
||||
this.pageConfig.currentPage = 1
|
||||
this.pageConfig.pageSize = 10
|
||||
this.getUnderageModeList(data.tab.type)
|
||||
},
|
||||
openDetail(data){
|
||||
uni.navigateTo({
|
||||
url: `/pages/feedback/teenageDetail?dataId=${data.id}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
111
pages/feedback/teenageDetail.vue
Normal file
111
pages/feedback/teenageDetail.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view class="view-page" :style="{backgroundImage : `url('${ThemeData?.app_bg ?? $config.PRIMARY_BGURL}')`}">
|
||||
<headerHeight />
|
||||
<navBar :navTitle="'内容详情'">
|
||||
</navBar>
|
||||
<template v-if="detailData">
|
||||
<view class="" v-if="detailData.from === 2">
|
||||
<iframe id="myIframe" :src="detailData.url" style="width: 100%;border: none;height: 100dvh;"></iframe>
|
||||
<!-- <web-view :src="detailData.url"></web-view> -->
|
||||
</view>
|
||||
<view class="detailContent" v-else>
|
||||
<!-- from 1站内 2 外链 -->
|
||||
|
||||
<view class="">
|
||||
<view class="detailTitle">
|
||||
{{detailData.title}}
|
||||
</view>
|
||||
<!-- 内容 -->
|
||||
<view class="detailData" v-html="detailData.content || ''">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headerHeight from '@/component/headerHeight.vue';
|
||||
import navBar from '@/component/nav.vue';
|
||||
import http from '@/until/http.js';
|
||||
export default {
|
||||
components: {
|
||||
headerHeight,
|
||||
navBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detailData: null,
|
||||
ThemeData: null,
|
||||
BarHeight:0
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
const {
|
||||
dataId
|
||||
} = options
|
||||
if (dataId) {
|
||||
this.getDetail(dataId)
|
||||
}
|
||||
if (uni.getStorageSync('Theme_Data')) {
|
||||
this.ThemeData = JSON.parse(uni.getStorageSync('Theme_Data'))
|
||||
}
|
||||
this.BarHeight = uni.getStorageSync('BarHeight')
|
||||
},
|
||||
methods: {
|
||||
// 获取公会信息
|
||||
async getDetail(Id) {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中'
|
||||
})
|
||||
http.get('/api/Usermode/getUnderageModeContent', {
|
||||
id: Id,
|
||||
token: uni.getStorageSync('token') ?? ''
|
||||
}).then(response => {
|
||||
uni.hideLoading()
|
||||
const {
|
||||
data,
|
||||
code
|
||||
} = response
|
||||
this.detailData = code ? data : null
|
||||
console.log(this.detailData)
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.view-page {
|
||||
// padding: 32rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-image: url('@/static/image/help/bg.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
min-height: 100vh;
|
||||
|
||||
.detailContent {
|
||||
padding: 0 32rpx;
|
||||
flex: 1;
|
||||
/* 关键:撑满剩余空间 */
|
||||
overflow: auto;
|
||||
|
||||
/* 允许内容滚动 */
|
||||
.detailTitle {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
padding-bottom: 48rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.detailData{
|
||||
padding: 0 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user