Files
jjx-web-sign-only/pages/otherArticle/list.vue
T
2026-10-08 18:20:51 +08:00

66 lines
1.8 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 v-for="(item, index) in list" :key="index"
@click="navTo(item._id)"
class="py-30 border-bottom flex justify-between items-center pointer">
<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>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "list",
data() {
return {
list: [],
parentId: null,
pageSize: 20,
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({
url: `/pages/otherArticle/detail?id=${id}`
})
}
},
onLoad(options) {
if (options) this.parentId = options.id;
this.getList();
}
}
</script>