This commit is contained in:
2026-10-08 18:36:23 +08:00
commit 8a1da677e4
904 changed files with 111327 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="文章详情"></uititle>
</u-sticky>
<view class="m-a bg-white p-30">
<view class="text-50 font-bold">{{ info.name }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
<view v-html="info.content" class="mt-20"></view>
</view>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
export default {
name: "detail",
components: {uititle},
data() {
return {
info: {
name: '',
content: ''
}
}
},
onLoad(option) {
if (option.id) this.getInfo(option.id);
},
methods: {
async getInfo(id) {
const res = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
this.info = res
const regex = new RegExp('img','gi')
this.info.content = this.info.content.replace(regex,`img style="max-width:100%;"`)
}
}
}
</script>
<style>
img {
width: 100% !important;
}
</style>
+65
View File
@@ -0,0 +1,65 @@
<template>
<view>
<u-sticky offset-top="0" customNavHeight="0">
<!-- 顶部 -->
<uititle title="文章列表"></uititle>
</u-sticky>
<view class="p-40">
<view v-for="(item, index) in list" :key="index"
@click="navTo(item._id)"
class="p-30 border-bottom flex justify-start flex-col items-start bg-white">
<text class="font-bold">{{ item.name }}</text>
<text class="text-gray">{{ item._add_time_str }}</text>
</view>
<!-- <view class="text-center">-->
<!-- <el-pagination-->
<!-- :page-size="pageSize"-->
<!-- @current-change="getList"-->
<!-- background-->
<!-- layout="prev, pager, next"-->
<!-- :total="total">-->
<!-- </el-pagination>-->
<!-- </view>-->
</view>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
export default {
name: "list",
components: {uititle},
data() {
return {
list: [],
parentId: null,
pageSize: 500,
total: 0,
}
},
methods: {
getList(pageIndex) {
vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
pageSize: this.pageSize,
pageIndex,
data: {
parentId: this.parentId
},
success: res => {
this.list = res.rows;
this.total = res.total;
}
})
},
navTo(id) {
vk.navigateTo(`/pages/article/info?id=${id}`)
}
},
onLoad(options) {
if (options) this.parentId = options.id;
this.getList();
}
}
</script>