<template>
|
|
<view class="page__view">
|
|
|
|
<!-- 导航栏 -->
|
|
<navbar :title="title" leftClick @leftClick="$utils.navigateBack" bgColor="#FFFFFF" />
|
|
|
|
<!-- <image class="img" :src="details.details" mode="widthFix"></image> -->
|
|
<uv-parse :content="content"></uv-parse>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
title: '',
|
|
content: '',
|
|
}
|
|
},
|
|
onLoad({ api, id, idKey, contentKey }) {
|
|
this.getData(api, id, idKey, contentKey)
|
|
},
|
|
methods: {
|
|
async getData(api, id, idKey, contentKey) {
|
|
try {
|
|
const result = await this.$fetch(api, { [idKey]: id })
|
|
|
|
this.title = result.title
|
|
this.content = result[contentKey]
|
|
} catch (err) {
|
|
console.log('err', err)
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.page__view {
|
|
background: $uni-bg-color;
|
|
}
|
|
|
|
.img {
|
|
width: 100vw;
|
|
height: auto;
|
|
}
|
|
|
|
</style>
|