ahyd_DIB/pages/examine/index.vue
2023-05-17 18:52:06 +08:00

540 lines
21 KiB
Vue

<template>
<scroll-view :style="{height:windowHeight+'px',overflow:'hidden'}" :show-scrollbar="false" scroll-with-animation enable-flex scroll-y="true" @scroll="handlePageScroll">
<view class="main">
<view class="heard">
<image class="headerBg" src="/static/images/examine/bg.png"></image>
<view class="contentHeard">
<!-- 顶部标题 -->
<view class="top" :style="{height:menu.bottom+'px'}">
<view class="titleModule" :style="{height:(menu.bottom-menu.top)+'px'}">
<image @click="handleBack" class="img" src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/navigation-left.svg"></image>
<text class="title">考评考核</text>
</view>
</view>
<view :style="{height:menu.bottom+'px'}">
</view>
<!-- 选择片区 -->
<div class="picker">
<div class="selectService" @click="handleShowPopup">
<image class="img" src="/static/images/examine/fixed.svg"></image>
<view class="select">
<view class="selectContent">
<view class="name">皖中</view>
<p class="area">片区</p>
<image class="rightArrow" src="https://eshangtech.com/ShopICO/ahyd-BID/commercial/rightArrow.svg"></image>
</view>
</view>
</div>
</div>
<!-- 选择月份 -->
<view class="monthTabs">
<scroll-view class="big" :show-scrollbar="false" scroll-with-animation scroll-x="true" enable-flex :scrollIntoView="current" >
<div :id="'item'+item.value" :class="selectMonth===item.value?'monthItem selectItem':'monthItem'" v-for="(item,index) in monthList" :key="index" @click="handleSelectMonth(item.value)">{{item.label}}</div>
</scroll-view>
</view>
</view>
</view>
<view class="content">
<view style="height: 50px">
<view class="tab">
<view :class="selectTab===item.value?'tabItem selectItem':'tabItem'" v-for="(item,index) in tabList" :key="index" @click="handleChangeTab(item.value)">{{item.label}}</view>
</view>
</view>
<view v-if="selectTab===1" class="serviceList" :style="{height:scrollTop<95?'calc(100vh - 256px)':'calc(100vh - 150px)',overflow:scrollTop<95?'hidden':'scroll'}">
<view class="serviceItem" v-for="item in 5">
<view class="itemTitle">
<text class="title">新桥服务区</text>
<text :class="selectMonth%3===0?'secondUnit':'unit'">{{selectMonth%3===0?`${Math.abs(selectMonth/3)===1?'一':Math.abs(selectMonth/3)===2?'二':Math.abs(selectMonth/3)===3?'三':'四'}季度`:'月度'}}</text>
</view>
<view class="detail">
<view class="detailTop">
<view class="left">
<image class="icon" src="/static/images/examine/NS.svg"></image>
<text class="type">南区</text>
</view>
<view class="right">
89
<text class="unit">分</text>
</view>
</view>
<view class="detailMessage">
<view class="message" style="margin-bottom: 4px">
<image class="icon" src="/static/images/examine/time.svg"></image>
<text class="value">2023/05/11 14:21:03</text>
</view>
<view class="message">
<image class="icon" src="/static/images/examine/user.svg"></image>
<text class="value">陈佳、赵卓雅、张三、李文文、胡静</text>
</view>
</view>
</view>
<view class="detail">
<view class="detailTop">
<view class="left">
<image class="icon" src="/static/images/examine/NS.svg"></image>
<text class="type">南区</text>
</view>
<view class="right">
89
<text class="unit">分</text>
</view>
</view>
<view class="detailMessage">
<view class="message" style="margin-bottom: 4px">
<image class="icon" src="/static/images/examine/time.svg"></image>
<text class="value">2023/05/11 14:21:03</text>
</view>
<view class="message">
<image class="icon" src="/static/images/examine/user.svg"></image>
<text class="value">陈佳、赵卓雅、张三、李文文、胡静</text>
</view>
</view>
</view>
</view>
</view>
</view>
<uniPopup type="bottom" :round="true" :show="showPop" @hidePopup="hidePopup">
<view class="popup">
<view class="top">
<text class="popupTitle">选择片区</text>
<image @click="hidePopup" class="close" src="/static/images/examine/close.svg"></image>
</view>
<view class="list">
<view class="item" v-for="(item,index) in areaList" :key="index">{{item.label}}<text class="unit">片区</text></view>
</view>
</view>
</uniPopup>
</view>
</scroll-view>
</template>
<script>
import uniPopup from '@/components/uni-popup'
export default {
components:{
uniPopup
},
data(){
return {
monthList:[{label:'1月',value:1},{label:'2月',value:2},{label:'3月',value:3},{label:'4月',value:4},{label:'5月',value:5},{label:'6月',value:6},{label:'7月',value:7},
{label:'8月',value:8},{label:'9月',value:9},{label:'10月',value:10},{label:'11月',value:11},{label:'12月',value:12}],
selectMonth:0,
current:'',
menu:{},
statusBarHeight:'',
showPop:false,
areaList:[{label:'皖中',value:'皖中'},{label:'皖中',value:'皖中'},{label:'皖中',value:'皖中'}],// 片区列表
tabList:[{label:'考核管理',value:1},{label:'日常巡检',value:2},{label:'晨会管理',value:3}],// tab选项卡
selectTab:1,// 选中的tab选项卡
serviceList:[],// 服务区列表
scrollTop:0,// 页面整体滚动了多少
windowHeight:0,// 页面高度
}
},
onLoad(){
// 获取手机参数对页面进行适配
let systemInfo = uni.getSystemInfoSync()
this.windowHeight = systemInfo.windowHeight
this.statusBarHeight = Number(systemInfo.statusBarHeight)
this.menu = uni.getMenuButtonBoundingClientRect()
const date = new Date()
let month = date.getMonth() + 1
this.monthList = this.monthList.filter(item=>item.value<=month)
},
onReady(){
var _this = this;
_this.getThisMonth()
},
methods:{
// 拿到当前月份 用于页面一开始自动滚动到相对应的月份
getThisMonth(){
const date = new Date()
const month = date.getMonth() + 1
this.selectMonth = month
this.current='item'+month
},
// 是否显示弹出框
handleShowPopup(){
this.showPop = true
},
// 弹出框点击蒙层关闭
hidePopup(){
this.showPop = false
},
// 点击月份改变选中月份
handleSelectMonth(value){
this.selectMonth = value
},
// 点击选项卡改变选项卡
handleChangeTab(value){
this.selectTab = value
},
// 页面的整体滚动
handlePageScroll(e){
this.scrollTop = e.detail.scrollTop
},
// 返回按钮的方法
handleBack(){
uni.switchTab({
url: '/pages/userCenter/userCenter'
})
},
}
}
</script>
<style scoped lang="scss">
@import '/static/public/font/stylesheet.css';
.main{
width: 100%;
height: calc(100vh + 105px);
.heard{
width: 100%;
height: 185px;
position: relative;
.contentHeard{
width: 100%;
height: 100%;
position: absolute;
box-sizing: border-box;
padding: 0 16px;
top: 0;left: 0;
z-index: 2;
.top{
width: 100%;
position: fixed;
left: 0;
background-image: url("https://eshangtech.com/ShopICO/ahyd-BID/examine/bg.png");
background-position: 0 0;
z-index:99;
.titleModule{
width: 100%;
bottom: 0;
position: absolute;
display: flex;
justify-content: center;
.img{
width: 24px;
height: 24px;
position: absolute;
left: 16px;
}
.title{
font-size: 18px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 28px;
}
}
}
.picker{
.selectService{
display: flex;
align-items: center;
.img{
width: 40px;
height: 40px;
z-index: 2;
}
.select{
height: 32px;
min-width: 110px;
background: #F8F8FA;
border-radius: 0 16px 16px 0;
transform: translateX(-20px);
box-sizing: border-box;
padding-left: 25px;
display: flex;
align-items: center;
position: relative;
.selectContent{
display: flex;
align-items: center;
.name{
font-size: 14px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #160002;
}
.area{
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #786B6C;
margin-left: 2px;
}
.rightArrow{
position: absolute;
right: 2px;
width: 24px;
height: 12px;
}
}
}
}
}
.monthTabs{
width: 100%;
height: 32px;
border-radius: 17px;
box-sizing: border-box;
border: 1px solid #BF99FE;
background: linear-gradient(180deg, #8338FF 0%, #A976FF 100%);
overflow: hidden;
padding: 2px 0;
margin-top: 16px;
.big{
text-align: center;
white-space: nowrap;
.monthItem{
display: inline-block;
width: 55px;
height: 24px;
font-size: 14px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #B8C2FF;
line-height: 24px;
margin-right: 4px;
text-align: center;
border-radius: 12px;
}
.selectItem{
background: #fff;
}
.monthItem:first-child{
margin-left: 4px;
}
}
}
}
.headerBg{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 366px;
z-index: 1;
}
}
.content{
width: 100%;
box-sizing: border-box;
padding: 16px 16px 4px;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
position: relative;
background: #fff;
z-index:99;
.tab{
width: 100%;
height: 38px;
background: #F3F1F5;
border-radius: 4px;
box-sizing: border-box;
padding: 4px;
display: flex;
justify-content: space-between;
align-items: center;
.tabItem{
width: 33%;
height: 100%;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #786B6C;
text-align: center;
line-height: 30px;
}
.selectItem{
background: #fff;
font-size: 14px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #8441F3;
border-radius: 4px;
}
}
.serviceList{
width: 100%;
.serviceItem{
width: 100%;
height: 270px;
box-sizing: border-box;
padding: 16px;
border-radius: 8px;
margin-bottom: 12px;
background: linear-gradient(314deg, #FFF1F8 0%, #F2F2FF 32%, #FCFAFF 54%, #FCF6FF 70%, #F2EAFF 100%);
.itemTitle{
display: flex;
align-items: center;
.title{
font-size: 18px;
font-family: AlimamaShuHeiTi;
color: #33077A;
line-height: 26px;
}
.unit{
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3B48E3;
line-height: 12px;
padding: 3px 4px;
background: rgba(59, 72, 227, 0.1);
margin-left: 8px;
border-radius: 2px;
}
.secondUnit{
background:rgba(0, 147, 46, 0.1);
border-radius: 2px;
font-size: 12px;
padding: 3px 4px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #00932E;
margin-left: 8px;
line-height: 12px;
}
}
.detail{
margin-top: 18px;
.detailTop{
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgba(212, 196, 244, 0.2);
padding: 0 0 8px;
.left{
display: flex;
align-items: center;
.icon{
width: 22px;
height: 22px;
}
.type{
font-size: 14px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #160002;
line-height: 20px;
margin-left: 8px;
}
}
.right{
font-size: 22px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #160002;
line-height: 22px;
.unit{
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #786B6C;
line-height: 18px;
margin-left: 2px;
}
}
}
.detailMessage{
margin-top: 14px;
.message{
display: flex;
align-items: center;
.icon{
width: 16px;
height: 16px;
}
.value{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #160002;
line-height: 20px;
margin-left: 8px;
width: 90%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
}
}
}
.popup{
width: 100%;
height: 60vh;
box-sizing: border-box;
padding: 16px;
.top{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.popupTitle{
font-size: 16px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #160002;
line-height: 22px;
}
.close{
width: 20px;
height: 20px;
}
}
.list{
width: 100%;
margin-top: 12px;
.item{
width: 100%;
font-size: 14px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #160002;
line-height: 20px;
text-align: left;
padding:12px 0;
.unit{
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #786B6C;
line-height: 18px;
}
}
}
}
::-webkit-scrollbar {
width: 4px;
height: 4px;
color:transparent;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
border-radius: 10px;
background-color:transparent;
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color:transparent;
}
.notice{
font-size: 12px;
color: gray;
}
}
</style>