Commit 504bc6ea authored by xinzhedeai's avatar xinzhedeai

fix:清理无用代码-home

parent 6fdf9f04
...@@ -374,3 +374,82 @@ border-right: 1px solid #eee; */ ...@@ -374,3 +374,82 @@ border-right: 1px solid #eee; */
color: #666; color: #666;
margin-top: 0.1rem; margin-top: 0.1rem;
} }
/* 新增提醒模块样式 */
.info-reminder {
width: 6.9rem;
height: 2.54rem;
background: #FFFFFF;
border-radius: 0.2rem;
margin: 0.3rem auto;
padding: 0.24rem 0.3rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.reminder-item {
position: relative;
width: 2.2rem;
height: 100%;
text-align: center;
}
.new-badge {
position: absolute;
top: 0.15rem;
right: 0.1rem;
min-width: .8rem;
text-align: left;
text-indent: .16rem;
height: 0.36rem;
line-height: 0.36rem;
font-size: 0.2rem;
color: #FFFFFF;
background-image: url(image/code/home/tip.png);
background-size: contain;
background-repeat: no-repeat;
}
.reminder-badge {
position: absolute;
top: -0.15rem;
right: 0.2rem;
min-width: 0.4rem;
height: 0.4rem;
line-height: 0.4rem;
padding: 0 0.12rem;
border-radius: 0.2rem;
font-size: 0.24rem;
color: #FFFFFF;
background: #00AEF1;
}
.reminder-badge1 {
background: #00AEF1;
/* 默认 蓝色 */
}
.reminder-badge2 {
background: #FF9C01;
/* 橙黄色 */
}
.reminder-badge2 {
background: #FF4D4F;
/* 红色 */
}
.reminder-img {
width: 1.2rem;
height: 1.2rem;
margin-bottom: 0.16rem;
}
.reminder-text {
font-size: 0.28rem;
color: #333333;
line-height: 1.2;
}
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" /> <head>
<meta <meta charset="UTF-8" />
name="viewport" <meta name="viewport" content="width=device-width, initial-scale=1.0" />
content="width=device-width, initial-scale=1.0" <title>商户检查页面</title>
/> <meta charset="UTF-8" />
<title>商户检查页面</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8" /> <meta name="viewport"
<meta content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover" />
http-equiv="X-UA-Compatible" <title>高区安全“码”上查监管平台-首页</title>
content="IE=edge" <link rel="stylesheet" href="home.css" />
/> <style>
<meta [v-cloak] {
name="viewport" display: none;
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover" }
/> </style>
<title>高区安全“码”上查监管平台-首页</title> <!-- 在 includeHead.js 之后添加环境判断 -->
<link <script src="./sdk/includeHead.js"></script>
rel="stylesheet" </head>
href="home.css"
/> <body>
<style> <!-- 获取授权用户信息 本地token等操作 -->
[v-cloak] { <script>
display: none; if (window.env === 'pro') {
} document.write('<script type="text/javascript" src="sdk/jssdk2/index.js"><\/script>')
</style> }
<style> </script>
/* 新增提醒模块样式 */ <script type="text/javascript" src="./home.js"></script>
.info-reminder { <div id="app" class="page_wrapper" v-cloak>
width: 6.9rem; <!-- 第二层:商户图标、名称、等级、场所类型和地址 -->
height: 2.54rem; <div class="second-layer second-layer-zf" v-if="showOrg" v-cloak>
background: #FFFFFF; <!-- v-show="" -->
border-radius: 0.2rem; <img class="merchant-icon" src="image/code/zhengfu_logo.png" alt="" />
margin: 0.3rem auto; <div class="merchant-info welcome" v-cloak>
padding: 0.24rem 0.3rem; <p>欢迎您,{{userInfo.deptName}}<br />进入安全“码”上查</p>
display: flex; <div class="user_tag">
justify-content: space-between; <img src="image/code/user.png" alt="" />
align-items: center; <span>{{userInfo.roleName}}</span>
}
.reminder-item {
position: relative;
width: 2.2rem;
height: 100%;
text-align: center;
}
.new-badge{
position: absolute;
top: 0.15rem;
right: 0.1rem;
min-width: .8rem;
text-align: left;
text-indent: .16rem;
height: 0.36rem;
line-height: 0.36rem;
font-size: 0.2rem;
color: #FFFFFF;
background-image: url(image/code/home/tip.png);
background-size: contain;
background-repeat: no-repeat;
}
.reminder-badge {
position: absolute;
top: -0.15rem;
right: 0.2rem;
min-width: 0.4rem;
height: 0.4rem;
line-height: 0.4rem;
padding: 0 0.12rem;
border-radius: 0.2rem;
font-size: 0.24rem;
color: #FFFFFF;
background: #00AEF1;
}
.reminder-badge1{
background: #00AEF1; /* 默认 蓝色 */
}
.reminder-badge2 {
background: #FF9C01; /* 橙黄色 */
}
.reminder-badge2 {
background: #FF4D4F; /* 红色 */
}
.reminder-img {
width: 1.2rem;
height: 1.2rem;
margin-bottom: 0.16rem;
}
.reminder-text {
font-size: 0.28rem;
color: #333333;
line-height: 1.2;
}
</style>
<!-- 在 includeHead.js 之后添加环境判断 -->
<script src="./sdk/includeHead.js"></script>
</head>
<body>
<!-- 获取授权用户信息 本地token等操作 -->
<script>
if (window.env === 'pro') {
document.write('<script type="text/javascript" src="sdk/jssdk2/index.js"><\/script>')
}
</script>
<script
type="text/javascript"
src="./home.js"
></script>
<div
id="app"
class="page_wrapper"
v-cloak
>
<!-- 第二层:商户图标、名称、等级、场所类型和地址 -->
<div
class="second-layer second-layer-zf"
v-if="showOrg"
v-cloak
>
<!-- v-show="" -->
<img
class="merchant-icon"
src="image/code/zhengfu_logo.png"
alt=""
/>
<div
class="merchant-info welcome"
v-cloak
>
<p>欢迎您,{{userInfo.deptName}}<br />进入安全“码”上查</p>
<div class="user_tag">
<img
src="image/code/user.png"
alt=""
/>
<span>{{userInfo.roleName}}</span>
</div>
</div> </div>
</div> </div>
</div>
<!-- 第二层:商户图标、名称、等级、场所类型和地址 --> <!-- 第二层:商户图标、名称、等级、场所类型和地址 -->
<div <div class="second-layer-sj" v-if="showShop" v-cloak>
class="second-layer-sj" <div class="header">
v-if="showShop" <span>商家信息</span>
v-cloak <div class="user_tag">
> <img src="image/code/user.png" alt="" />
<div class="header"> <span>商家</span>
<span>商家信息</span>
<div class="user_tag">
<img
src="image/code/user.png"
alt=""
/>
<span>商家</span>
</div>
</div> </div>
<div class="bottom"> </div>
<div class="left"> <div class="bottom">
<img <div class="left">
class="merchant-icon" <img class="merchant-icon" src="image/code/sj.png" alt="商户图标" />
src="image/code/sj.png" </div>
alt="商户图标" <div class="right" v-cloak>
/> <div class="merchant-info">
</div> <div class="name-rank">
<div <span class="merchant-name">{{userInfo.unitName}}</span>
class="right" <span class="user-rank green" v-if="userInfo.safeLevel==0" @click="gotoPage('anquan_level')">安全等级:绿</span>
v-cloak <span class="user-rank yellow" v-if="userInfo.safeLevel==1"
> @click="gotoPage('anquan_level')">安全等级:黄</span>
<div class="merchant-info"> <span class="user-rank red" v-if="userInfo.safeLevel==2" @click="gotoPage('anquan_level')">安全等级:红</span>
<div class="name-rank"> </div>
<span class="merchant-name">{{userInfo.unitName}}</span> <div class="divider"></div>
<span <div class="type-address">
class="user-rank green" <p>场所类型:{{userInfo.smallPlaceTypeName}}</p>
v-if="userInfo.safeLevel==0" <p>{{userInfo.businessAddress}}</p>
@click="gotoPage('anquan_level')"
>安全等级:绿</span
>
<span
class="user-rank yellow"
v-if="userInfo.safeLevel==1"
@click="gotoPage('anquan_level')"
>安全等级:黄</span
>
<span
class="user-rank red"
v-if="userInfo.safeLevel==2"
@click="gotoPage('anquan_level')"
>安全等级:红</span
>
</div>
<div class="divider"></div>
<div class="type-address">
<p>场所类型:{{userInfo.smallPlaceTypeName}}</p>
<p>{{userInfo.businessAddress}}</p>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- 第三层:统计信息 --> </div>
<div <!-- 第三层:统计信息 -->
class="third-layer" <div class="third-layer" v-cloak>
v-cloak <div class="stats-header">
> <div class="stats-title" @click="openDebug">数据统计</div>
<div class="stats-header"> <!-- <van-cell-group> -->
<div class="stats-title" @click="openDebug">数据统计</div> <div @click="showPopup('showPopup4completionDate')" style="position: absolute; top: -0.08rem; right: 0.4rem">
<!-- <van-cell-group> --> <span class="formValue">{{showDate|formatterData}}</span><van-icon name="arrow-down" />
<div
@click="showPopup('showPopup4completionDate')"
style="position: absolute; top: -0.08rem; right: 0.4rem"
>
<span class="formValue">{{showDate|formatterData}}</span><van-icon name="arrow-down" />
</div>
<van-popup
v-model="showPopup4completionDate"
position="bottom"
>
<van-datetime-picker
v-model="selectedDate"
:min-date="minDate"
:max-date="maxDate"
type="year-month"
title="选择年月"
@confirm="confirm4completionDate"
@cancel="showPopup4completionDate=false"
:formatter="needData"
:filter1="filterYear"
/>
</van-popup>
<!-- </van-cell-group> -->
</div> </div>
<div class="stats-content"> <van-popup v-model="showPopup4completionDate" position="bottom">
<div class="stat-item"> <van-datetime-picker v-model="selectedDate" :min-date="minDate" :max-date="maxDate" type="year-month"
<div class="stat-value">{{userData.checkCount}}次</div> title="选择年月" @confirm="confirm4completionDate" @cancel="showPopup4completionDate=false"
<div class="stat-label">检查数</div> :formatter="needData" />
</div> </van-popup>
<div class="stat-item"> <!-- </van-cell-group> -->
<div class="stat-value">{{userData.checkSelfCount}}次</div> </div>
<div class="stat-label">自查数</div> <div class="stats-content">
</div> <div class="stat-item">
<div class="stat-item"> <div class="stat-value">{{userData.checkCount}}次</div>
<div class="stat-value">{{userData.hiddenCount}}处</div> <div class="stat-label">检查数</div>
<div class="stat-label">隐患数</div> </div>
</div> <div class="stat-item">
<div class="stat-item"> <div class="stat-value">{{userData.checkSelfCount}}次</div>
<div class="stat-value">{{userData.hiddenNoReCount}}处</div> <div class="stat-label">自查数</div>
<div class="stat-label">未整改</div> </div>
</div> <div class="stat-item">
<div class="stat-value">{{userData.hiddenCount}}处</div>
<div class="stat-label">隐患数</div>
</div>
<div class="stat-item">
<div class="stat-value">{{userData.hiddenNoReCount}}处</div>
<div class="stat-label">未整改</div>
</div> </div>
</div> </div>
</div>
<!-- 第三层统计信息之后新增提醒模块(商户专属) --> <!-- 第三层统计信息之后新增提醒模块(商户专属) -->
<div class="info-reminder" v-if="showShop"> <div class="info-reminder" v-if="showShop">
<!-- 第一个提醒项:整改未通过 --> <!-- 第一个提醒项:整改未通过 -->
<div class="reminder-item" v-for="item in remindStatistic" @click="navTo(`${item.name}`)"> <div class="reminder-item" v-for="item in remindStatistic" @click="navTo(`${item.name}`)">
<div class="reminder-badge" :class="`reminder-badge${item.icon}`">{{item.num}}</div> <div class="reminder-badge" :class="`reminder-badge${item.icon}`">{{item.num}}</div>
<img :src="`./image/code/home/icon${item.icon}.png`" class="reminder-img" alt="整改未通过"> <img :src="`./image/code/home/icon${item.icon}.png`" class="reminder-img" alt="整改未通过">
<p class="reminder-text">{{item.title}}</p> <p class="reminder-text">{{item.title}}</p>
</div> </div>
<!-- <div class="reminder-item" @click="navTo('nopass')"> <!-- <div class="reminder-item" @click="navTo('nopass')">
<div class="reminder-badge">3</div> <div class="reminder-badge">3</div>
<img src="./image/code/home/icon1.png" class="reminder-img" alt="整改未通过"> <img src="./image/code/home/icon1.png" class="reminder-img" alt="整改未通过">
<p class="reminder-text">整改未通过</p> <p class="reminder-text">整改未通过</p>
...@@ -276,34 +131,27 @@ ...@@ -276,34 +131,27 @@
<img src="./image/code/home/icon3.png" class="reminder-img" alt="整改未通过"> <img src="./image/code/home/icon3.png" class="reminder-img" alt="整改未通过">
<p class="reminder-text">整改超期</p> <p class="reminder-text">整改超期</p>
</div> --> </div> -->
</div> </div>
<!-- 原第三层统计信息 --> <!-- 原第三层统计信息 -->
<div class="third-layer" v-cloak> <div class="third-layer" v-cloak>
<!-- ... 原有统计内容保持不变 ... --> <!-- ... 原有统计内容保持不变 ... -->
</div> </div>
<!-- 第四层:检查专区 --> <!-- 第四层:检查专区 -->
<div <div class="fourth-layer" v-cloak>
class="fourth-layer" <h2>检查专区</h2>
v-cloak <div class="check-modules">
> <div class="check-module" v-for="(item,index) in menuList" :key="index" :class="item.className"
<h2>检查专区</h2> @click="scanCode(item.navTo)">
<div class="check-modules"> <p>{{item.title}} <van-icon name="arrow" /></p>
<div <p class="module-intro">{{item.remark}}</p>
class="check-module" <div class="new-badge" v-if="item.msgFlag"></div>
v-for="(item,index) in menuList"
:key="index"
:class="item.className"
@click="scanCode(item.navTo)"
>
<p>{{item.title}} <van-icon name="arrow" /></p>
<p class="module-intro">{{item.remark}}</p>
<div class="new-badge" v-if="item.msgFlag"></div>
</div>
</div> </div>
</div> </div>
</div> </div>
</body> </div>
</html> </body>
</html>
\ No newline at end of file
...@@ -18,26 +18,6 @@ window.onload = function () { ...@@ -18,26 +18,6 @@ window.onload = function () {
// 日期选择的最大范围,这里设置为当前日期的后 10 年 // 日期选择的最大范围,这里设置为当前日期的后 10 年
// maxDate: new Date(new Date().getFullYear() + 10, 11), // maxDate: new Date(new Date().getFullYear() + 10, 11),
maxDate: new Date(), maxDate: new Date(),
// checkModules: [
// {
// intro: '提交检查反馈',
// },
// {
// intro: '查看检查历史记录',
// },
// {
// intro: '提交检查反馈',
// },
// {
// intro: '下载检查报告',
// },
// {
// intro: '查看隐患详情',
// },
// {
// intro: '设置检查提醒',
// },
// ],
userInfo: { userInfo: {
userType: 'sj1', // 登录用户type userType: 'sj1', // 登录用户type
userType: 'consumers', // 登录用户type userType: 'consumers', // 登录用户type
...@@ -51,51 +31,7 @@ window.onload = function () { ...@@ -51,51 +31,7 @@ window.onload = function () {
}, },
showOrg: false, //是否显示组织 showOrg: false, //是否显示组织
showShop: false, //是否显示店铺 showShop: false, //是否显示店铺
// 登录用户type
// defaultMenuList: [
// {
// className: 'saoma',
// title: '扫码检查',
// remark: '',
// navTo: false,
// },
// {
// className: 'jiancha',
// title: '检查记录',
// remark: '',
// navTo: 'checkrecord-all',
// },
// {
// className: 'yinhuan',
// title: '隐患记录',
// remark: '',
// navTo: 'yh_check',
// },
// {
// className: 'yinhuan',
// title: '隐患整改',
// remark: '',
// navTo: 'yh_check',
// },
// {
// className: 'shangjia',
// title: '商家信息',
// remark: '',
// navTo: 'shanghu_detail-edit',
// },
// {
// className: 'zicha',
// title: '安全自查',
// remark: '',
// navTo: 'check_info',
// },
// {
// className: 'shangbao',
// title: '隐患上报',
// remark: '',
// navTo: 'shangbao-list',
// },
// ],
// 修改默认菜单结构为最小化配置 // 修改默认菜单结构为最小化配置
menuList: [], menuList: [],
// 初始化为空数组,等待接口数据填充 // 初始化为空数组,等待接口数据填充
...@@ -118,14 +54,6 @@ window.onload = function () { ...@@ -118,14 +54,6 @@ window.onload = function () {
}, },
computed: {}, computed: {},
methods: { methods: {
// 新增:年份倒序过滤函数
filterYear(type, options) {
console.log(options, 'options')
if (type === 'year') {
return options.reverse(); // 仅对年份类型反转选项数组
}
return options; // 其他类型保持原顺序
},
getRemindStatistic() { getRemindStatistic() {
http2.post( http2.post(
{ {
...@@ -281,9 +209,8 @@ window.onload = function () { ...@@ -281,9 +209,8 @@ window.onload = function () {
if (!res) { if (!res) {
// 中台返回为undefined 重新请求 // 中台返回为undefined 重新请求
vant.Toast.clear() vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => { setTimeout(() => {
// this.getList() this.getUserInfo()
}, 0) }, 0)
return return
} }
...@@ -319,51 +246,10 @@ window.onload = function () { ...@@ -319,51 +246,10 @@ window.onload = function () {
this.showShop = false //是否显示店铺 this.showShop = false //是否显示店铺
} }
/* if (this.userInfo.userType === 'consumers') { // 2025年5月14日新增消费者逻辑
// 根据url地址的merid获取商户信息
if (gemhoUtil.getParameter('merId')) { // 消费者直接在爱山东扫商户码进入首页
// this.getMerInfo()
param = {
merId: gemhoUtil.getParameter('merId'),
pageName: 'src/_consumer_home',
}
let url = gemhoUtil.setParameter(`${param.pageName}.html`, param)
gemhoUtil.navigatePage(url, '跳转中...')
return
} else { // 消费者不扫码后,直接退出到爱山东首页。(用户直接在爱山东点击应用进入首页)
vant.Dialog.alert({
title: '信息提示',
message: '请扫描商户码访问~',
}).then(() => { // 关闭当前访问页面回到爱山东
lightAppJssdk.navigation.close({
success: function (data) { },
fail: function (data) { },
})
});
}
return
} else */
// if (this.userInfo.userType === 'shop') {
// this.defaultMenuList[1].navTo = 'checkrecord'
// } else {
// this.defaultMenuList[1].navTo = 'shanghu_list'
// }
// // 2025年6月9日 跳转检查记录 统一跳转新页面。
// this.defaultMenuList[1].navTo = 'checkrecord-all'
console.log('菜单', result.data.modules) console.log('菜单', result.data.modules)
// 生成最终菜单列表 // 生成最终菜单列表
this.menuList = result.data.modules this.menuList = result.data.modules
// this.menuList = (result.data.modules || []).map(
// (moduleItem) => ({
// ...(this.defaultMenuList.find(
// (d) => d.title === moduleItem.title
// ) || {}),
// ...moduleItem,
// remark: moduleItem.remark || '',
// })
// )
} }
setTimeout(() => { setTimeout(() => {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -389,10 +275,7 @@ window.onload = function () { ...@@ -389,10 +275,7 @@ window.onload = function () {
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: { reqParams: {
sign: 6, sign: 6,
pageNum: this.page++, // 每次请求增加下一页
pageSize: this.size,
date: this.selectedDate, date: this.selectedDate,
sort: 'lawId,desc',
merId: gemhoUtil.getParameter('merId'), merId: gemhoUtil.getParameter('merId'),
}, },
}, },
...@@ -400,9 +283,8 @@ window.onload = function () { ...@@ -400,9 +283,8 @@ window.onload = function () {
if (!res) { if (!res) {
// 中台返回为undefined 重新请求 // 中台返回为undefined 重新请求
vant.Toast.clear() vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => { setTimeout(() => {
// this.getList() this.getUserData()
}, 0) }, 0)
return return
} }
......
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