init
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tab": "@vant/weapp/tab/index",
|
||||
"van-tabs": "@vant/weapp/tabs/index",
|
||||
"van-empty": "@vant/weapp/empty/index",
|
||||
"van-divider": "@vant/weapp/divider/index"
|
||||
},
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "环投监控小程序"
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
/* pages/manufacturerIndex/manufacturerIndex.wxss */
|
||||
|
||||
.container {
|
||||
padding-top: 56px;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
>.bg {
|
||||
width: 100%;
|
||||
height: 128px;
|
||||
background: linear-gradient(360deg, #538AFC 0%, #3679FC 100%);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
.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;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
.btn {
|
||||
width: calc((100% - 10px) / 2);
|
||||
height: 64px;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.item {
|
||||
width: 80%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.label {
|
||||
// margin-left: 10%;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.check {
|
||||
padding: 2px 8px;
|
||||
background: rgba(0,0,0,.2);
|
||||
border-radius: 16px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
// text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.val {
|
||||
margin-right: 6px;
|
||||
}
|
||||
.arrow {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-left: 1px solid transparent;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn-report {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
// margin-top: 8px;
|
||||
background: #EDF4FE;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #C4DAFA;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: block;
|
||||
}
|
||||
.val {
|
||||
margin-left: 12px;
|
||||
color: #2E3A4F;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-content {
|
||||
height: calc(100vh - 150px - 94px);
|
||||
overflow-y: auto;
|
||||
.top {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
.tab-container {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
.tabs {
|
||||
width: 100%;
|
||||
// overflow-x: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list {
|
||||
height: calc(100% - 48px);
|
||||
padding: 12px 0px;
|
||||
box-sizing: border-box;
|
||||
background: #EFF1F4;
|
||||
// overflow-y: auto;
|
||||
|
||||
.scroll-view_H {
|
||||
height: 100%;
|
||||
// padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.item {
|
||||
padding: 12px 10px;
|
||||
margin: 0 14px 8px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
.row:first-child {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.row {
|
||||
color: #2E3A4F;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.number-plate {
|
||||
display: flex;
|
||||
.status {
|
||||
padding: 0 6px;
|
||||
margin-right: 4px;
|
||||
border-radius: 2px;
|
||||
color: #FFFFFF;
|
||||
font-size: 14px;
|
||||
}
|
||||
.status1 {
|
||||
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
|
||||
}
|
||||
.status2 {
|
||||
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
|
||||
}
|
||||
.status3 {
|
||||
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
|
||||
}
|
||||
.val {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.project-name, .code {
|
||||
font-size: 14px;
|
||||
}
|
||||
.time {
|
||||
font-size: 14px;
|
||||
color: #858CA0;
|
||||
}
|
||||
.type-list {
|
||||
display: flex;
|
||||
.type {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
padding: 0 8px;
|
||||
margin-left: 5px;
|
||||
background: #FFF1F0;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #FFA39E;
|
||||
color: #FF4D4F;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
// pages/manufacturerIndex/manufacturerIndex.ts
|
||||
import { getAction } from '../../api/base';
|
||||
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
userInf: {},
|
||||
infObj: {
|
||||
totalCount: 0,
|
||||
speedAlarmCount: 0,
|
||||
fenceAlarmCount: 0
|
||||
},
|
||||
|
||||
tabList: [] as any,
|
||||
active: 0,
|
||||
showStatus: 0,
|
||||
|
||||
flowStatus: 3,
|
||||
current: 1,
|
||||
isLast: false,
|
||||
loading: false,
|
||||
list: [],
|
||||
repairOrUpkeep: 1 // 1为维修列表 2为保养列表
|
||||
},
|
||||
|
||||
// 登出
|
||||
logOut() {
|
||||
// 清除缓存
|
||||
wx.setStorageSync('token', '');
|
||||
wx.setStorageSync('userInfo', '');
|
||||
wx.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
},
|
||||
getUserInf() {
|
||||
this.setData({
|
||||
userInf: wx.getStorageSync('userInfo')
|
||||
});
|
||||
},
|
||||
// 变更tab
|
||||
tabOnChange(e: any) {
|
||||
console.log(e);
|
||||
this.setData({
|
||||
active: e.detail.index,
|
||||
flowStatus: this.data.tabList[e.detail.index].flowStatus,
|
||||
repairOrUpkeep: this.data.tabList[e.detail.index].repairOrUpkeep,
|
||||
list: [], // 初始化参数
|
||||
current: 1,
|
||||
isLast: false,
|
||||
loading: false
|
||||
});
|
||||
this.getTabList();
|
||||
this.getList();
|
||||
},
|
||||
toMaintainRecord() {
|
||||
wx.navigateTo({
|
||||
url: '../vehicleMaintenance/maintainRecord/maintainRecord',
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
toUpkeepRecord() {
|
||||
wx.navigateTo({
|
||||
url: '../UpkeepBill/UpkeepBillRecord/UpkeepBillRecord',
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
toDetailPage(e: any) {
|
||||
console.log(e.currentTarget.dataset.inf);
|
||||
wx.setStorageSync('selectMaintain', e.currentTarget.dataset.inf);
|
||||
let url = '' as any;
|
||||
if (this.data.flowStatus == 3 && this.data.repairOrUpkeep == 1)
|
||||
url = '../vehicleMaintenance/maintainSend/maintainSend';
|
||||
else if (this.data.flowStatus == 6 && this.data.repairOrUpkeep == 1)
|
||||
url = '../vehicleMaintenance/maintainProcedure/maintainProcedure';
|
||||
else if (this.data.flowStatus == 3 && this.data.repairOrUpkeep == 2)
|
||||
url = '../UpkeepBill/UpkeepBillSend/UpkeepBillSend';
|
||||
else if (this.data.flowStatus == 6 && this.data.repairOrUpkeep == 2)
|
||||
url = '../UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure';
|
||||
// 跳转到待报价详情
|
||||
wx.navigateTo({
|
||||
url: url,
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toPage(e: any) {
|
||||
if (e.currentTarget.dataset.type == 'eventReportRecord') {
|
||||
wx.navigateTo({
|
||||
url: '../eventReport/eventReportRecord/eventReportRecord',
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
getTabList() {
|
||||
getAction('api/vehicles/repair/getRepairShopPageStatic').then(
|
||||
(res: any) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res.result);
|
||||
this.setData({
|
||||
tabList: res.result
|
||||
});
|
||||
console.log(this.data.tabList);
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
getList() {
|
||||
let params = {
|
||||
flowStatus: this.data.flowStatus,
|
||||
pageNo: this.data.current,
|
||||
pageSize: 10
|
||||
};
|
||||
let url;
|
||||
if (this.data.repairOrUpkeep == 1) url = 'api/vehicles/repair/list';
|
||||
else url = 'api/vehicles/upkeepBill/list';
|
||||
wx.showLoading({
|
||||
title: '数据加载中'
|
||||
});
|
||||
getAction(url, params).then((res: any) => {
|
||||
wx.hideLoading();
|
||||
if (res.code == 200) {
|
||||
let data: any = { ...this.data };
|
||||
data.list = data.list.concat(res.result.records);
|
||||
console.log(data);
|
||||
this.setData(data);
|
||||
if (data.list.length == res.result.total) {
|
||||
this.setData({
|
||||
isLast: true
|
||||
});
|
||||
}
|
||||
// this.setData({
|
||||
// list: res.result.records
|
||||
// });
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
lower(e: any) {
|
||||
console.log(e.detail.direction == 'bottom');
|
||||
if (this.data.isLast) {
|
||||
wx.showToast({
|
||||
title: '已经是最后一页',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (e.detail.direction == 'bottom' && !this.data.loading) {
|
||||
// this.data.current += 1
|
||||
this.setData({
|
||||
current: (this.data.current += 1),
|
||||
loading: true
|
||||
});
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
// this.getUserInf();
|
||||
// this.getTabList();
|
||||
// this.getList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.setData({
|
||||
list: [], // 初始化参数
|
||||
current: 1,
|
||||
isLast: false,
|
||||
loading: false
|
||||
});
|
||||
this.getUserInf();
|
||||
this.getTabList();
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
list: [], // 初始化参数
|
||||
current: 1,
|
||||
isLast: false,
|
||||
loading: false
|
||||
});
|
||||
this.getUserInf();
|
||||
this.getTabList();
|
||||
this.getList();
|
||||
//停止下拉刷新
|
||||
wx.stopPullDownRefresh();
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {}
|
||||
});
|
||||
@@ -0,0 +1,82 @@
|
||||
<!--pages/manufacturerIndex/manufacturerIndex.wxml-->
|
||||
<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="toMaintainRecord">
|
||||
<view class="bg">
|
||||
<image src="../../images/btn_project_l.png" mode="" />
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">维修记录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" catchtap="toUpkeepRecord">
|
||||
<view class="bg">
|
||||
<image src="../../images/btn_project_r.png" mode="" />
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">保养台账</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-report" data-type="eventReportRecord" catch:tap="toPage">
|
||||
<image src="../../images/icon_workbench5.png" mode=""/>
|
||||
<view class="val">事件上报</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-content">
|
||||
<view class="top">
|
||||
<view class="tab-container">
|
||||
<view class="tabs">
|
||||
<van-tabs color="#4381FC" title-active-color="#4381FC" ellipsis="{{false}}" active="{{ active }}" bind:change="tabOnChange">
|
||||
<van-tab title-style="font-size:16px" wx:for="{{tabList}}" wx:key="index" title="{{item.flowName + '(' + item.count + ')' }}"></van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<scroll-view class="scroll-view_H" scroll-y="true" bindscrolltolower="lower" style="width: 100%">
|
||||
<view class="item" wx:for="{{list}}" wx:key="index" data-inf="{{item}}" catchtap="toDetailPage">
|
||||
<view class="row">
|
||||
<view class="code">{{item.orderNo}}</view>
|
||||
<view class="number-plate">
|
||||
<view class="status status1" wx:if="{{item.flowStatus == 2 || item.flowStatus == 3 || item.flowStatus == 6}}">{{item.flowStatus_dictText}}</view>
|
||||
<view class="status status2" wx:if="{{item.flowStatus == 4 || item.flowStatus == 5 || item.flowStatus == 7}}">{{item.flowStatus_dictText}}</view>
|
||||
<view class="status status3" wx:if="{{item.flowStatus == 8 || item.flowStatus == 9}}">{{item.flowStatus_dictText}}</view>
|
||||
<view class="val">{{item.plateNumber}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="project-name">{{item.projectId_dictText}}</view>
|
||||
<view class="time">{{item.repairTime || item.predictTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="is-last" wx:if="{{isLast && list.length > 0}}">
|
||||
<van-divider contentPosition="center">已加载完全部数据</van-divider>
|
||||
</view>
|
||||
<view class="no-data" wx:if="{{list.length == 0}}">
|
||||
<van-empty description="无数据" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user