对接公区收益
This commit is contained in:
@@ -269,3 +269,13 @@ export const getInspectionList = (data) =>{
|
||||
export const inspectionDetails = (data) =>{
|
||||
return get(`/api/resident/inspection/${data.id}`,data)
|
||||
}
|
||||
|
||||
// =======公区收益=========
|
||||
// 列表
|
||||
export const getRevenueList = (data) =>{
|
||||
return get('/api/resident/revenueNotice/list',data)
|
||||
}
|
||||
// 详情
|
||||
export const revenueDetails = (data) =>{
|
||||
return get(`/api/resident/revenueNotice/${data.id}`)
|
||||
}
|
||||
@@ -1,24 +1,32 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 内容区域 -->
|
||||
<!-- <scroll-view class="content-scroll" scroll-y> -->
|
||||
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||
<uni-nav-bar title="收益详情" backgroundColor="transparent" :border="false" left-icon="left"
|
||||
@click-left="goBack" />
|
||||
|
||||
<!-- 暂无数据 -->
|
||||
<view v-if="isLoaded && !noticeDetail.noticeTitle" class="empty-state">
|
||||
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
||||
<text class="empty-text">暂无数据</text>
|
||||
</view>
|
||||
|
||||
<!-- 文章标题 -->
|
||||
<view class="article-header">
|
||||
<view class="article-header" v-if="noticeDetail.noticeTitle">
|
||||
<view class="article-title">
|
||||
{{noticeDetail.noticeTitle}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 作者和日期 -->
|
||||
<view class="notice-meta">
|
||||
<view class="notice-meta" v-if="noticeDetail.noticeTitle">
|
||||
<view class="notice-author">
|
||||
<text class="author-name">{{noticeDetail.author}}</text>
|
||||
<text class="separator">·</text>
|
||||
<!-- <text class="author-name">{{noticeDetail.author}}</text> -->
|
||||
<!-- <text class="separator">·</text> -->
|
||||
<text class="publish-time">{{noticeDetail.publishTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 文章内容 -->
|
||||
<view class="article-content">
|
||||
<view class="article-content" v-if="noticeDetail.noticeTitle">
|
||||
<view class="paragraph" v-html="noticeDetail.noticeContent"></view>
|
||||
<view class="articleimg">
|
||||
|
||||
@@ -32,18 +40,22 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import {getNoticeDetails} from '../api/api.js'
|
||||
import {revenueDetails} from '../api/apiSub.js'
|
||||
|
||||
const isLoading = ref(false)
|
||||
const isLoaded = ref(false)
|
||||
const noticeDetail = ref({})
|
||||
const currentNoticeId = ref('') // 接收公告跳转的id
|
||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||
|
||||
// =====方法====
|
||||
onLoad((options) =>{
|
||||
currentNoticeId.value = options?.id
|
||||
// console.log('currentNoticeId',currentNoticeId.value)
|
||||
console.log('收益id---------',currentNoticeId.value)
|
||||
if(currentNoticeId.value){
|
||||
getDetailsData(currentNoticeId.value)
|
||||
} else {
|
||||
isLoaded.value = true
|
||||
}
|
||||
|
||||
// console.log('currentNoticeId',currentNoticeId.value)
|
||||
@@ -52,9 +64,9 @@
|
||||
const getDetailsData = async (noticeId) =>{
|
||||
|
||||
try{
|
||||
const res = await getNoticeDetails(noticeId)
|
||||
const res = await revenueDetails({ id: noticeId })
|
||||
if(res.code === 200){
|
||||
noticeDetail.value = res.data || {}
|
||||
noticeDetail.value = res.data
|
||||
uni.$emit('noticeRead',{
|
||||
noticeId:noticeId,
|
||||
readStatus:noticeDetail.value.readStatus
|
||||
@@ -67,8 +79,14 @@
|
||||
title: err.msg ||"网络异常",
|
||||
icon:"none"
|
||||
})
|
||||
}finally{
|
||||
isLoaded.value = true
|
||||
}
|
||||
}
|
||||
// 返回
|
||||
const goBack = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -79,6 +97,25 @@
|
||||
background-color: #ffffff;
|
||||
padding: 20px;
|
||||
}
|
||||
.status-bar {
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 暂无数据 */
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 200rpx;
|
||||
|
||||
.empty-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/* 内容滚动区域 */
|
||||
.content-scroll {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="status_bar"></view>
|
||||
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||
<!-- 固定导航栏 -->
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
@@ -30,11 +30,11 @@
|
||||
:key="revenue.noticeId"
|
||||
class="item">
|
||||
<view class="title-box">
|
||||
<view class="title">{{ revenue.title }}</view>
|
||||
<view class="title">{{ revenue.noticeTitle }}</view>
|
||||
<view class="dot" v-if="revenue.readStatus === '0'"></view>
|
||||
</view>
|
||||
<view class="info">{{ revenue.author }} · {{ revenue.publishTime }}</view>
|
||||
<view class="content" v-html="revenue.content"></view>
|
||||
<view class="info">{{ revenue.publishTime }}</view>
|
||||
<view class="content" v-html="revenue.noticeContent"></view>
|
||||
<view class="detail" @click="goToDetail(revenue)">
|
||||
<text style="color:#2F77FD;font-size: 24rpx;">详情</text>
|
||||
<uni-icons type="right" size="13" color="#007AFF"/>
|
||||
@@ -56,12 +56,9 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad ,onShow,onUnload} from '@dcloudio/uni-app'
|
||||
// import { getRevenueList } from '../api/api.js'
|
||||
import { getRevenueList } from '../api/apiSub.js'
|
||||
|
||||
const revenueList = ref([
|
||||
{title:'公区收益告知书',author:'张三',publishTime:'2026-7-15',content:'费用明细'},
|
||||
{title:'公区收益告知书',author:'张三',publishTime:'2026-7-15'},
|
||||
])
|
||||
const revenueList = ref([])
|
||||
const refreshing = ref(false)
|
||||
const loadingMore = ref(false)
|
||||
const noMoreData = ref(false)
|
||||
@@ -69,10 +66,11 @@ const loading = ref(false)
|
||||
const pageNum = ref(1)
|
||||
const pageSize = 10
|
||||
const isFirstShow = ref(true) // 详情返回列表刷新状态
|
||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||
|
||||
const goToDetail = (notice) => {
|
||||
uni.navigateTo({
|
||||
url: `/pageSubPack/inspection-revenue/public-revenue-details`
|
||||
url: `/pageSubPack/inspection-revenue/public-revenue-details?id=${notice.noticeId}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -98,8 +96,8 @@ const loadRevenue = async (isRefresh = false) => {
|
||||
}
|
||||
}
|
||||
// 更新单条已读状态
|
||||
const updateReadStatus = ({ revenueId, readStatus }) => {
|
||||
const item = revenueList.value.find(n => String(n.revenueId) === revenueId)
|
||||
const updateReadStatus = ({ noticeId, readStatus }) => {
|
||||
const item = revenueList.value.find(n => String(n.noticeId) === String(noticeId))
|
||||
if (item) {
|
||||
item.readStatus = readStatus
|
||||
}
|
||||
@@ -150,8 +148,8 @@ page {
|
||||
flex-direction: column;
|
||||
}
|
||||
.status_bar {
|
||||
height: 46px;
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.scroll-box {
|
||||
flex: 1;
|
||||
|
||||
@@ -196,14 +196,14 @@ const getVerifyCode = () => {
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '验证码发送失败',
|
||||
icon: 'error'
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: err.msg||'网络异常',
|
||||
icon: 'error'
|
||||
icon: 'none'
|
||||
});
|
||||
})
|
||||
|
||||
@@ -262,18 +262,18 @@ const doLogin = () => {
|
||||
uni.switchTab({ url: '/pages/index/index' });
|
||||
},1500)
|
||||
}else{
|
||||
uni.showToast({ title: '登录失败', icon: 'error' });
|
||||
uni.showToast({ title: '登录失败', icon: 'none' });
|
||||
}
|
||||
|
||||
}else{
|
||||
uni.showToast({ title:'登录失败', icon: 'error' });
|
||||
uni.showToast({ title:'登录失败', icon: 'none' });
|
||||
}
|
||||
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: err.msg || '网络异常,请重试',
|
||||
icon: 'error'
|
||||
icon: 'none'
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
style="height: 100%;width: 100%;"></image>
|
||||
<!-- <uni-icons type="person" size="24" color="#999"></uni-icons> -->
|
||||
</view>
|
||||
<uni-easyinput class="input-content" type="text" v-model="account" placeholder="请输入账号" :inputBorder="false"
|
||||
<uni-easyinput class="input-content" type="text" v-model="account" placeholder="请输入账号(4-20位)" :inputBorder="false"
|
||||
:placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
style="height: 100%;width: 100%;"></image>
|
||||
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
||||
</view>
|
||||
<uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入密码"
|
||||
<uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入密码(6-16位)"
|
||||
:inputBorder="false" :placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
if (!formData.value.carBrand) {
|
||||
/* if (!formData.value.carBrand) {
|
||||
return uni.showToast({
|
||||
title: "请输入车辆品牌",
|
||||
icon: "none"
|
||||
@@ -195,7 +195,7 @@
|
||||
title: "请输入车辆颜色",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
} */
|
||||
|
||||
uni.showLoading({
|
||||
title: '提交中...',
|
||||
|
||||
@@ -485,7 +485,8 @@
|
||||
{
|
||||
"path": "inspection-details",
|
||||
"style": {
|
||||
"navigationBarTitleText": "巡检详情"
|
||||
"navigationBarTitleText": "巡检详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -498,7 +499,8 @@
|
||||
{
|
||||
"path": "public-revenue-details",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收益详情"
|
||||
"navigationBarTitleText": "收益详情",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user