This commit is contained in:
2025-06-19 17:33:18 +08:00
commit f8f31dc4d9
437 changed files with 103080 additions and 0 deletions
@@ -0,0 +1,5 @@
{
"usingComponents": {
},
"navigationBarTitleText": "环投监控小程序"
}
@@ -0,0 +1,270 @@
/* pages/maintenanceIndex/maintenanceIndex.wxss */
.container {
padding-top: 56px;
padding-bottom: 120px;
background: #EFF1F4;
overflow-y: auto;
position: relative;
>.bg {
width: 100%;
height: 128px;
background: linear-gradient(360deg, #538AFC 0%, #3679FC 100%);
position: absolute;
top: 0;
}
.user-container, .maintain-container, .workbench-container {
width: calc(100% - 26px);
margin: 0 auto 8px;
padding: 6px 12px;
box-sizing: border-box;
box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.1);
background: #fff;
border-radius: 8px;
}
.user-container {
// width: calc(100% - 26px);
// margin: 0 auto 8px;
padding: 40px 12px 18px;
// box-sizing: border-box;
// box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.1);
// background: #fff;
// border-radius: 8px;
position: relative;
// top: 56px;
// left: 13px;
// overflow: hidden;
.top {
width: calc(100% - 24px);
// margin-top: -32px;
margin-bottom: 14px;
display: flex;
position: absolute;
top: -32px;
.user-pic {
width: 64px;
height: 64px;
margin: 0 8px;
border-radius: 50%;
// border: 2px solid #FFFFFF;
box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
image {
width: 100%;
height: 100%;
display: block;
}
}
.user-inf {
.name {
margin-top: 8px;
color: #fff;
font-size: 15px;
}
.profession {
margin-top: 12px;
color: #333;
font-size: 13px;
display: flex;
align-items: center;
.icon {
width: 16px;
height: 16px;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
}
.btn-exit {
width: 20px;
height: 20px;
position: absolute;
top: 6px;
right: 0px;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
.btn-container {
width: 100%;
margin: 10px 0 0px;
.btn {
width: 100%;
height: 76px;
margin-bottom: 10px;
position: relative;
display: flex;
align-items: center;
justify-content: flex-end;
.bg {
width: 100%;
height: 100%;
border-radius: 8px;
overflow: hidden;
position: absolute;
image {
width: 100%;
height: 100%;
display: block;
}
}
.item {
width: 64%;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
margin-right: 4%;
.label {
font-size: 16px;
font-weight: bold;
color: #2E3A4F;
white-space: nowrap;
}
.val {
font-size: 32px;
font-weight: bold;
color: #4381FC;
text-align: center;
}
}
}
}
}
.maintain-container, .workbench-container {
.top {
margin-bottom: 8px;
color: #2E3A4F;
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
.icon {
width: 18px;
height: 18px;
margin-right: 4px;
border-radius: 50%;
background: #E2EAFB;
overflow: hidden;
image {
width: 100%;
height: 100%;
display: block;
}
}
.val {
font-size: 14px;
font-weight: bold;
}
}
.right {
display: flex;
align-items: center;
.icon {
width: 16px;
height: 16px;
margin-right: 4px;
border-radius: 4px;
overflow: hidden;
image {
width: 100%;
height: 100%;
display: block;
}
}
.val {
font-size: 14px;
font-weight: bold;
color: #4381FC;
}
}
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
>.btn {
width: calc((100% - 10px) / 2);
height: 64px;
line-height: 64px;
// background: linear-gradient(180deg, #3772F6 0%, #5AAEF7 100%);
border-radius: 8px;
color: #fff;
font-size: 14px;
font-weight: bold;
text-align: center;
position: relative;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
width: 100%;
height: 100%;
}
}
.val {
position: relative;
}
}
.record {
background: linear-gradient(180deg, #3BBA95 0%, #67D7B0 100%);
}
.UpkeepBill {
width: calc((100% - 12px) / 3);
.val {
margin-right: 4px;
text-align: right;
}
}
}
.workbench-list {
display: flex;
// justify-content: space-between;
flex-wrap: wrap;
>.btn {
width: calc(100% / 4);
// width: 56px;
// height: 62px;
margin-bottom: 18px;
display: flex;
flex-direction: column;
flex-wrap: wrap;
align-items: center;
.pic {
width: 36px;
height: 36px;
margin-bottom: 8px;
// background: #000;
image {
width: 100%;
height: 100%;
}
}
.title {
font-size: 14px;
font-weight: 400;
color: #2E3A4F;
white-space: nowrap;
}
}
}
}
.subscription{
width: calc(100% - 26px);
height: 56px;
margin: 0 auto 8px;
image{
width: 100%;
height: 100%;
}
}
}
@@ -0,0 +1,205 @@
import { getAction } from '../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
userInf: {},
infObj: {
totalCount: 0,
speedAlarmCount: 0,
fenceAlarmCount: 0
}
},
// 登出
logOut() {
// 清除缓存
wx.setStorageSync('token', '');
wx.setStorageSync('userInfo', '');
wx.reLaunch({
url: '/pages/login/login'
});
},
toVehicleMonitoring() {
wx.navigateTo({
url: '../vehicleMonitoring/global/global',
fail: e => {
console.log(e);
}
});
},
toFailureAler() {
wx.navigateTo({
url: '../vehicleMonitoring/failureAlert/failureAlert',
fail: e => {
console.log(e);
}
});
},
toPage(e: any) {
console.log(e.currentTarget.dataset.type);
if (e.currentTarget.dataset.type == 'apply') {
wx.navigateTo({
url: '../vehicleMaintenance/operation/maintainApply/maintainApply',
fail: e => {
console.log(e);
}
});
} else if (e.currentTarget.dataset.type == 'record') {
wx.navigateTo({
url: '../vehicleMaintenance/maintainRecord/maintainRecord',
fail: e => {
console.log(e);
}
});
} else if (e.currentTarget.dataset.type == 'report') {
wx.navigateTo({
url: '../statement/reportStatement/reportStatement',
fail: e => {
console.log(e);
}
});
} else if (e.currentTarget.dataset.type == 'upkeepApply') {
wx.setStorageSync('type', {
type: 'add'
});
wx.navigateTo({
url: '../UpkeepPlan/UpkeepPlanApply/UpkeepPlanApply',
fail: e => {
console.log(e);
}
});
} else if (e.currentTarget.dataset.type == 'upkeepPlanRecord') {
wx.navigateTo({
url: '../UpkeepPlan/UpkeepPlanRecord/UpkeepPlanRecord',
fail: e => {
console.log(e);
}
});
} else if (e.currentTarget.dataset.type == 'upkeepBillRecord') {
wx.navigateTo({
url: '../UpkeepBill/UpkeepBillRecord/UpkeepBillRecord',
fail: e => {
console.log(e);
}
});
}
},
// 数据录入
toDataEntry(e: any) {
if (e.currentTarget.dataset.type == 'upkeep') {
wx.navigateTo({
url: '../UpkeepBill/operation/dataEntryOne/dataEntryOne',
fail: e => {
console.log(e);
}
});
} else {
wx.navigateTo({
url: '../vehicleMaintenance/operation/dataEntryOne/dataEntryOne',
fail: e => {
console.log(e);
}
});
}
},
getUserInf() {
this.setData({
userInf: wx.getStorageSync('userInfo')
});
},
getInf() {
getAction('api/index/vehicleCount')
.then((res: any) => {
if (res.code == 200) {
this.setData({
infObj: res.result
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
})
.catch((err: any) => {
wx.showToast({
title: err.message,
icon: 'none'
});
});
},
messageSubscription() {
wx.getSetting({
withSubscriptions: true,
success: res => {
if (res.subscriptionsSetting.itemSettings) {
wx.showModal({
title: '提示',
content: '您已完成订阅,请到设置中心设置',
confirmText: '去设置',
success(res) {
if (res.confirm) {
wx.openSetting();
}
}
});
} else {
wx.requestSubscribeMessage({
tmplIds: ['1gdC7WQuVq3OLbx8fzlo4o2XtX0hQU7KmjkNvRUOrKw']
});
}
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.getUserInf();
this.getInf();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
selected: 0
});
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,195 @@
<!--pages/maintenanceIndex/maintenanceIndex.wxml-->
<wxs module="module" src="../module/module.wxs"></wxs>
<view class="container">
<view class="bg"></view>
<view class="user-container">
<view class="top">
<view class="user-pic">
<image wx:if="{{userInfo.avatarUrl}}" bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<image wx:else="" bindtap="bindViewTap" class="userinfo-avatar" src="../../images/default_pic.png" mode="cover"></image>
</view>
<view class="user-inf">
<view class="name">{{ userInf.realname }}</view>
<view class="profession">
<view class="icon"><image src="../../images/icon_logo.png" mode=""/></view>
{{ userInf.sysOrgName ? userInf.sysOrgName : '--' }}
</view>
</view>
<view class="btn-exit" catchtap="logOut">
<image src="../../images/btn_exit.png" mode=""/>
</view>
</view>
<view class="btn-container">
<view class="btn" catchtap="toVehicleMonitoring">
<view class="bg">
<image src="https://zuche.cdenvironment.com:25000/htfile/program/images/bg_btn2.png" mode=""/>
</view>
<view class="item">
<view class="label">车辆监控</view>
<view class="val">{{ infObj.totalCount }}</view>
</view>
</view>
<view class="btn" catchtap="toFailureAler">
<view class="bg">
<image src="https://zuche.cdenvironment.com:25000/htfile/program/images/bg_btn1.png" mode=""/>
</view>
<view class="item">
<view>
<view class="label">电子围栏</view>
<view class="val">{{ infObj.fenceAlarmCount }}</view>
</view>
<view>
<view class="label">超速告警</view>
<view class="val">{{ infObj.speedAlarmCount }}</view>
</view>
<view>
<view class="label">超时告警</view>
<view class="val">{{ infObj.stopAlarmCount }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="maintain-container" wx:if="{{module.buttonPermissions(userInf.auth,'UpkeepPlan:view')}}">
<view class="top">
<view class="left">
<view class="icon">
<image src="../../images/icon_maintain.png" mode=""/>
</view>
<view class="val">维修</view>
</view>
<view class="right" catch:tap="toDataEntry" wx:if="{{module.buttonPermissions(userInf.auth,'VehiclesMaintain:dataAdd')}}">
<view class="icon">
<image src="../../images/icon_add.png" mode=""/>
</view>
<view class="val">数据录入</view>
</view>
</view>
<view class="content">
<view class="btn apply" data-type="apply" catch:tap="toPage" wx:if="{{module.buttonPermissions(userInf.auth,'VehiclesMaintain:add')}}">
<view class="bg">
<image src="../../images/btn_maintain.png" mode=""/>
</view>
<view class="val">维修申请</view>
</view>
<view class="btn record" data-type="record" catch:tap="toPage">
<view class="bg">
<image src="../../images/btn_maintain_r.png" mode=""/>
</view>
<view class="val">维修记录</view>
</view>
</view>
</view>
<view class="maintain-container">
<view class="top">
<view class="left">
<view class="icon">
<image src="../../images/icon_maintain.png" mode=""/>
</view>
<view class="val">保养</view>
</view>
<view class="right" data-type="upkeep" catch:tap="toDataEntry" wx:if="{{module.buttonPermissions(userInf.auth,'UpkeepBill:dataAdd')}}">
<view class="icon">
<image src="../../images/icon_add.png" mode=""/>
</view>
<view class="val">数据录入</view>
</view>
</view>
<view class="content">
<view class="btn UpkeepBill" data-type="upkeepApply" catch:tap="toPage" wx:if="{{module.buttonPermissions(userInf.auth,'UpkeepPlan:add')}}">
<view class="bg">
<image src="../../images/btn_upkeep_l.png" mode=""/>
</view>
<view class="val">新增保养</view>
</view>
<view class="btn UpkeepBill" data-type="upkeepPlanRecord" catch:tap="toPage">
<view class="bg">
<image src="../../images/btn_upkeep_c.png" mode=""/>
</view>
<view class="val">保养计划</view>
</view>
<view class="btn UpkeepBill" data-type="upkeepBillRecord" catch:tap="toPage" wx:if="{{module.buttonPermissions(userInf.auth,'UpkeepBill:view')}}">
<view class="bg">
<image src="../../images/btn_upkeep_r.png" mode=""/>
</view>
<view class="val">保养台账</view>
</view>
</view>
</view>
<view class="workbench-container">
<view class="top">
<view class="left">
<view class="icon">
<image src="../../images/icon_workbench.png" mode=""/>
</view>
<view class="val">工作台</view>
</view>
<view class="right"></view>
</view>
<view class="workbench-list">
<navigator url="/pages/statement/reportStatement/reportStatement" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_workbench1.png" mode=""/>
</view>
<view class="title">统计报表</view>
</navigator>
<navigator url="/pages/violationReporting/violationReporting" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_workbench2.png" mode=""/>
</view>
<view class="title">违章上报</view>
</navigator>
<navigator url="/pages/accidentReporting/accidentReporting" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_workbench3.png" mode=""/>
</view>
<view class="title">事故上报</view>
</navigator>
<navigator url="/pages/insurancePolicyReport/insurancePolicyReport" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_workbench4.png" mode=""/>
</view>
<view class="title">出险上报</view>
</navigator>
<navigator url="/pages/eventReport/eventReportRecord/eventReportRecord" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_workbench5.png" mode=""/>
</view>
<view class="title">事件上报</view>
</navigator>
<navigator url="/pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_workbench6.png" mode=""/>
</view>
<view class="title">验车</view>
</navigator>
<navigator url="/packageA/pages/customerFollow/customerFollow" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_customerFollow.png" mode=""/>
</view>
<view class="title">客户回访</view>
</navigator>
<navigator url="/pages/costEstimation/costEstimationRecord/costEstimationRecord" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_costEstimationRecord.png" mode=""/>
</view>
<view class="title">财务测算</view>
</navigator>
<navigator url="/packageA/pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_vehicleDispatch.png" mode=""/>
</view>
<view class="title">加油充电登记</view>
</navigator>
<!-- <navigator url="/pages/accidentReporting/accidentReporting" hover-class="none" class="btn">
<view class="pic">
<image src="../../images/icon_workbench7.png" mode=""/>
</view>
<view class="title">巡检登记</view>
</navigator> -->
</view>
</view>
<!-- <view class="subscription" catch:tap="messageSubscription">
<image src="../../images/subscription.png" mode=""/>
</view> -->
</view>