Commit afdd37f1 authored by xinzhedeai's avatar xinzhedeai

add:隐患列表 全部已读UI

parent 7164cd96
......@@ -95,3 +95,27 @@ body {
position: absolute;
right: 0;
}
/* 在现有样式中添加以下CSS */
.float-read-btn {
position: fixed; /* 固定定位 */
right: 0.3rem; /* 右侧距离 */
bottom: 0.3rem; /* 底部距离 */
width: 1.07rem; /* 宽度 */
height: 1.07rem; /* 高度 */
background: #40A6FF; /* 背景色 */
border-radius: 50%; /* 圆角 */
display: flex; /* 弹性布局 */
flex-direction: column; /* 垂直排列 */
justify-content: center; /* 垂直居中 */
align-items: center; /* 水平居中 */
z-index: 999; /* 层级保证不被遮挡 */
cursor: pointer; /* 手型光标 */
}
.float-read-btn .btn-text {
font-size: 0.28rem; /* 文字大小 */
color: #FFFFFF; /* 文字颜色 */
line-height: 1.2; /* 行高 */
}
\ No newline at end of file
......@@ -74,6 +74,12 @@
</div>
</van-cell>
</van-list>
<!-- 新增悬浮按钮 -->
<div class="float-read-btn" @click="markAllAsRead">
<span class="btn-text">全部</span>
<span class="btn-text">已读</span>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -11,104 +11,129 @@ window.addEventListener('load', function () {
// 更多示例数据...
],
activeTab: '',
status: '',
status: '',
merId: '',
showSearch: false, // 控制搜索框的显示和隐藏
// 整改状态 0:待整改 1:已整改 2:待审核 3:整改逾期
tabList: [
{ name: '', title: '全部', msgNum:0, },
{ name: '2', title: '待审核', msgNum:0, },
{ name: '0', title: '待整改', msgNum:5, },
{ name: '1', title: '已整改' , msgNum:6,},
{ name: '3', title: '整改逾期' , msgNum:7,},
// 整改状态 0:待整改 1:已整改 2:待审核 3:整改逾期
tabList: [
{ name: '', title: '全部', msgNum: 0, },
{ name: '2', title: '待审核', msgNum: 0, },
{ name: '0', title: '待整改', msgNum: 0, },
{ name: '1', title: '已整改', msgNum: 0, },
{ name: '3', title: '整改逾期', msgNum: 0, },
],
loading: false,
finished: false,
page: 0,
size: 6,
total: 0,
remindStatistic:[]
loading: false,
finished: false,
page: 0,
size: 6,
total: 0,
remindStatistic: []
}
},
computed: {
},
created() {
let merId = gemhoUtil.getParameter('merId')
let merId = gemhoUtil.getParameter('merId')
if (merId !== undefined && merId !== null) {
this.merId = merId
} else {
this.merId = ''
}
// 2025年6月7日 新增首页(信息统计跳转)类别区分逻辑。
let type = gemhoUtil.getParameter('type')
if(type === 'nopass'){
this.activeTab = 2
}else if(type === 'willExpire'){ // 即将超期待整改
this.activeTab = 2
}else if(type === 'expired'){ // 超期 整改逾期
this.activeTab = 4
}
// 2025年6月7日 新增首页(信息统计跳转)类别区分逻辑。
let type = gemhoUtil.getParameter('type')
if (type === 'nopass') {
this.activeTab = 2
} else if (type === 'willExpire') { // 即将超期待整改
this.activeTab = 2
} else if (type === 'expired') { // 超期 整改逾期
this.activeTab = 4
}
if (gemhoUtil.getCookie('userType') !== 'shop') {
this.showSearch = true
}
this.init()
this.getRemindStatistic()
this.getRemindStatistic()
},
methods: {
getRemindStatistic(){
http2.post(
{
serviceId: API_KEY_MAP['no-page']['id'],
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: {
sign: 24, // 隐患tab
},
},
(res) => {
if (!res) {
// 中台返回为undefined 重新请求
setTimeout(() => {
this.getRemindStatistic()
}, 0)
return
}
if (res) {
var result = JSON.parse(res)
this.remindStatistic = result.data
}
}
)
},
reset(){
this.page = 0
this.size = 6
this.hazardList = []
},
yhstatus(){ // tab值对应的隐患状态码装欢
if(this.activeTab === 0){
return ''
}else if(this.activeTab === 1){
return ~~'2'
}else if(this.activeTab === 2){
return ~~'0'
}else if(this.activeTab === 3){
return ~~'1'
}else if(this.activeTab === 4){
return ~~'3'
}
},
tabChange(title){
console.log('tab 切换', title)
this.reset()
this.getList()
},
markAllAsRead() { // 全部标记为已读
http2.post(
{
serviceId: API_KEY_MAP['no-page']['id'],
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: {
sign: 24, // 隐患tab
},
},
(res) => {
if (!res) {
// 中台返回为undefined 重新请求
setTimeout(() => {
this.markAllAsRead()
}, 0)
return
}
if (res) {
var result = JSON.parse(res)
this.remindStatistic = result.data
}
}
)
},
getRemindStatistic() {
http2.post(
{
serviceId: API_KEY_MAP['no-page']['id'],
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: {
sign: 24, // 隐患tab
},
},
(res) => {
if (!res) {
// 中台返回为undefined 重新请求
setTimeout(() => {
this.getRemindStatistic()
}, 0)
return
}
if (res) {
var result = JSON.parse(res)
this.remindStatistic = result.data
}
}
)
},
reset() {
this.page = 0
this.size = 6
this.hazardList = []
},
yhstatus() { // tab值对应的隐患状态码装欢
if (this.activeTab === 0) {
return ''
} else if (this.activeTab === 1) {
return ~~'2'
} else if (this.activeTab === 2) {
return ~~'0'
} else if (this.activeTab === 3) {
return ~~'1'
} else if (this.activeTab === 4) {
return ~~'3'
}
},
tabChange(title) {
console.log('tab 切换', title)
this.reset()
this.getList()
},
init() {
this.getList()
},
onSearch() {
this.reset()
this.getList()
this.reset()
this.getList()
},
// 新增选择确认方法
onConfirmType(value) {
......@@ -151,13 +176,13 @@ window.addEventListener('load', function () {
interfacePublicKey: API_KEY_MAP['page']['publicKey'],
interfacePrivateKey: API_KEY_MAP['page']['privateKey'],
reqParams: {
sign: 3,
// merId: this.merId ? this.merId : '',
merName: this.shanghuName,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
sort: 'lawId,desc',
status: this.yhstatus()
sign: 3,
// merId: this.merId ? this.merId : '',
merName: this.shanghuName,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
sort: 'lawId,desc',
status: this.yhstatus()
},
},
(res) => {
......@@ -171,23 +196,23 @@ window.addEventListener('load', function () {
return
}
if (res) {
var result = JSON.parse(res)
console.log(result, 'result')
this.loading = false; // 加载状态结束
this.hazardList.push(...result.rows);
this.total = result.total
if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据
}
var result = JSON.parse(res)
console.log(result, 'result')
this.loading = false; // 加载状态结束
this.hazardList.push(...result.rows);
this.total = result.total
if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据
}
}
this.loading = false
setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear()
})
}, 0);
this.loading = false
setTimeout(() => {
this.$nextTick(() => {
vant.Toast.clear()
})
}, 0);
}
)
}, 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment