52 lines
1.1 KiB
Vue
52 lines
1.1 KiB
Vue
<template>
|
|
<view>
|
|
<top-bar></top-bar>
|
|
<!-- <common-header></common-header>-->
|
|
<!-- <category-bar></category-bar>-->
|
|
<gap height="50"/>
|
|
<view class="w-1200 m-a bg-white p-40">
|
|
<view class="text-50 font-bold">{{ info.name }}</view>
|
|
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{
|
|
info._update_time ? info._update_time : info._add_time_str
|
|
}}</view>
|
|
<view v-html="info.content" class="mt-20"></view>
|
|
</view>
|
|
<gap height="50"/>
|
|
<common-footer></common-footer>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "detail",
|
|
data() {
|
|
return {
|
|
info: {
|
|
name: '',
|
|
content: ''
|
|
}
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
if (option.id) {
|
|
this.getInfo(option.id);
|
|
this.addViewNum(option.id);
|
|
}
|
|
},
|
|
methods: {
|
|
async getInfo(id) {
|
|
const res = await vk.callFunction({
|
|
url: `client/otherArticle/list/pub/getDetail`,
|
|
data: {id}
|
|
});
|
|
this.info = res
|
|
},
|
|
addViewNum(_id){
|
|
vk.callFunction({
|
|
url: `client/otherArticle/list/pub/addViewNum`,
|
|
data: {_id}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script> |