|
|
|
@ -2,10 +2,10 @@ |
|
|
|
<view class="page__view"> |
|
|
|
|
|
|
|
<!-- 导航栏 --> |
|
|
|
<navbar :title="details.title" leftClick @leftClick="$utils.navigateBack" bgColor="#FFFFFF" /> |
|
|
|
<navbar :title="title" leftClick @leftClick="$utils.navigateBack" bgColor="#FFFFFF" /> |
|
|
|
|
|
|
|
<!-- <image class="img" :src="details.details" mode="widthFix"></image> --> |
|
|
|
<uv-parse :content="details.details"></uv-parse> |
|
|
|
<uv-parse :content="content"></uv-parse> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -14,16 +14,20 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
details: {}, |
|
|
|
title: '', |
|
|
|
content: '', |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad({ api, id, idKey }) { |
|
|
|
this.getData(api, id, idKey) |
|
|
|
onLoad({ api, id, idKey, contentKey }) { |
|
|
|
this.getData(api, id, idKey, contentKey) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async getData(api, id, idKey) { |
|
|
|
async getData(api, id, idKey, contentKey) { |
|
|
|
try { |
|
|
|
this.details = await this.$fetch(api, { [idKey]: id }) |
|
|
|
const result = await this.$fetch(api, { [idKey]: id }) |
|
|
|
|
|
|
|
this.title = result.title |
|
|
|
this.content = result[contentKey] |
|
|
|
} catch (err) { |
|
|
|
console.log('err', err) |
|
|
|
} |
|
|
|
|