107 lines
2.5 KiB
Vue
107 lines
2.5 KiB
Vue
<template>
|
|
<tpx-page>
|
|
<tpx-layout>
|
|
<template v-slot:body>
|
|
<view class="pos-abt-all">
|
|
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
|
|
ref="listRef"
|
|
>
|
|
<view class="pgb-cont">
|
|
<view>
|
|
<view v-for="(item) in resData.list" class="blcok-white radius-20 mb-20" style="margin-top: 0;"
|
|
>
|
|
<view @click="goto(`service/articledetail?artId=${item.id}`)">
|
|
<u-text :text="item.title" size="30" :bold="true" lines="1"></u-text>
|
|
|
|
<u-row class="mt-20" justify="between">
|
|
<view class="pr-10">
|
|
<u-text :text="item.description || '-'" size="28" color="#999" lines="2"></u-text>
|
|
</view>
|
|
<u-image :src="item.fileUrl" height="100" width="150"></u-image>
|
|
</u-row>
|
|
</view>
|
|
|
|
<view class="mt-20">
|
|
<u-row justify="between">
|
|
<u-row @click="handleLike(item)">
|
|
<u-icon name="thumb-up" size="38"
|
|
:color="`${item.isGiveLike==1?'#B12D29':'#999'}`"
|
|
/>
|
|
<u-text margin="0 0 0 10rpx" size="26" :text="item.clickCount || 0" color="#999"></u-text>
|
|
</u-row>
|
|
<view>
|
|
<u-text :text="item.createTime" size="26" color="#999"></u-text>
|
|
</view>
|
|
</u-row>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</tpx-scroll-view>
|
|
</view>
|
|
</template>
|
|
</tpx-layout>
|
|
</tpx-page>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import * as apiService from "@/common/api"
|
|
|
|
export default {
|
|
props: {
|
|
// hasLeftWin: {
|
|
// type: Boolean
|
|
// }
|
|
},
|
|
computed: {
|
|
|
|
},
|
|
data() {
|
|
return {
|
|
searchParam: {
|
|
},
|
|
resData: { list: [] },
|
|
queryOption: {},
|
|
}
|
|
},
|
|
onShow(){
|
|
this.triggerListReload()
|
|
this.initData()
|
|
},
|
|
onLoad(queryOption) {
|
|
this.queryOption = queryOption
|
|
this.initData();
|
|
},
|
|
onUnload() {
|
|
},
|
|
methods: {
|
|
getListFun: apiService.queryArticleList,
|
|
initData(){
|
|
|
|
},
|
|
async handleLike(item){
|
|
let res = await apiService.articleGiveLike({ articleId: item.id, _loading: true })
|
|
this.triggerListReload()
|
|
},
|
|
triggerListReload(){
|
|
this?.$refs?.listRef?.getDataList?.(true) // 重置到第一页数据
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import '@/common/uni-nvue.scss';
|
|
page {
|
|
background-color: #F6F6F6;
|
|
height: 100% !important;
|
|
}
|
|
|
|
</style>
|
|
<style scoped lang="scss">
|
|
.pgb-cont{
|
|
padding: 30rpx;
|
|
}
|
|
</style> |