Browse Source

待巡检/巡检记录列表样式

master
liujiangyong 2 years ago
parent
commit
0dff71216e
  1. 3
      weapp/app.json
  2. 11
      weapp/app.wxss
  3. 83
      weapp/images/noData.svg
  4. 8
      weapp/images/title_icon.svg
  5. 72
      weapp/package/polling/polling.js
  6. 7
      weapp/package/polling/polling.json
  7. 162
      weapp/package/polling/polling.wxml
  8. 119
      weapp/package/polling/polling.wxss

3
weapp/app.json

@ -60,5 +60,6 @@
"requiredPrivateInfos": [
"getLocation"
],
"sitemapLocation": "sitemap.json"
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
}

11
weapp/app.wxss

@ -1,4 +1,13 @@
/**app.wxss**/
.page {
/* vant 全局CSS变量 */
/* DropdownMenu */
--dropdown-menu-background-color: transparent;
--dropdown-menu-box-shadow: none;
--dropdown-menu-title-active-text-color: #1684FF;
--dropdown-menu-option-active-color: #1684FF;
}
.container {
height: 100%;
display: flex;
@ -7,4 +16,4 @@
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
}

83
weapp/images/noData.svg

@ -0,0 +1,83 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 160 160" class="design-iconfont">
<defs>
<linearGradient x1="64.0223567%" y1="100%" x2="64.0223567%" y2="0%" id="s2fs8drhk__qf86cq597c">
<stop stop-color="#FFF" stop-opacity=".5" offset="0%"/>
<stop stop-color="#F2F3F5" offset="100%"/>
</linearGradient>
<linearGradient x1="64.0223567%" y1="96.9562861%" x2="64.0223567%" y2="0%" id="s2fs8drhk__28u4feifyd">
<stop stop-color="#F2F3F5" stop-opacity=".3" offset="0%"/>
<stop stop-color="#F2F3F5" offset="100%"/>
</linearGradient>
<linearGradient x1="64.0223567%" y1="100%" x2="64.0223567%" y2="0%" id="s2fs8drhk__gho4xp3qwe">
<stop stop-color="#FFF" stop-opacity=".5" offset="0%"/>
<stop stop-color="#F2F3F5" offset="100%"/>
</linearGradient>
<linearGradient x1="64.0223567%" y1="100%" x2="64.0223567%" y2="0%" id="s2fs8drhk__zohxw5n7lf">
<stop stop-color="#FFF" stop-opacity=".5" offset="0%"/>
<stop stop-color="#F2F3F5" offset="100%"/>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="s2fs8drhk__z7sfnjiieg">
<stop stop-color="#F2F3F5" offset="0%"/>
<stop stop-color="#DCDEE0" offset="100%"/>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="s2fs8drhk__yra10mwv4h">
<stop stop-color="#F2F3F5" offset="0%"/>
<stop stop-color="#DCDEE0" offset="100%"/>
</linearGradient>
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="s2fs8drhk__3f25wad1zi">
<stop stop-color="#DCDEE0" offset="0%"/>
<stop stop-color="#DCDEE0" offset="100%"/>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="s2fs8drhk__cwfw88cqyj">
<stop stop-color="#FFF" offset="0%"/>
<stop stop-color="#FFF" offset="100%"/>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="s2fs8drhk__j75attqvvk">
<stop stop-color="#F2F3F5" offset="0%"/>
<stop stop-color="#DCDEE0" offset="100%"/>
</linearGradient>
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="s2fs8drhk__kzic7cqewl">
<stop stop-color="#F2F3F5" offset="0%"/>
<stop stop-color="#DCDEE0" offset="100%"/>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="s2fs8drhk__cokg8ot95n">
<stop stop-color="#F2F3F5" offset="0%"/>
<stop stop-color="#DCDEE0" offset="100%"/>
</linearGradient>
<linearGradient x1="50%" y1="100%" x2="50%" y2="0%" id="s2fs8drhk__bi9rguiu0o">
<stop stop-color="#FFF" offset="0%"/>
<stop stop-color="#DCDEE0" offset="100%"/>
</linearGradient>
<radialGradient cx="50%" cy="0%" fx="50%" fy="0%" r="100%" gradientTransform="matrix(0 1 -.54835 0 .5 -.5)" id="s2fs8drhk__mfg86bwylm">
<stop stop-color="#EBEDF0" offset="0%"/>
<stop stop-color="#FFF" stop-opacity="0" offset="100%"/>
</radialGradient>
<path id="s2fs8drhk__spe0bjiowa" d="M0 0H160V160H0z"/>
<mask id="s2fs8drhk__vncae2ppsb" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="160" height="160" fill="#fff">
<use xlink:href="#s2fs8drhk__spe0bjiowa"/>
</mask>
</defs>
<g fill="none" fill-rule="evenodd">
<path d="M2,131 L2,53 L22,53 L22,73 L36,73 L36,131 L2,131 Z" fill="url(#s2fs8drhk__qf86cq597c)" opacity=".80000001" transform="matrix(-1 0 0 1 38 0)"/>
<path d="M35.5,15 C39.327645,15 42.5643772,17.5299978 43.6291434,21.0089401 L43.7508207,21.0038068 L43.7508207,21.0038068 L44,21 C48.418278,21 52,24.581722 52,29 C52,33.418278 48.418278,37 44,37 C43.6613564,37 43.3276273,36.9789588 43.0000487,36.9381123 L43,37 L29,37 L29.000839,36.8258699 C28.519064,36.9397414 28.0165691,37 27.5,37 C23.9101491,37 21,34.0898509 21,30.5 C21,27.0730453 23.6520344,24.2655065 27.0157184,24.0177681 C27.0052347,23.8469908 27,23.6741067 27,23.5 C27,18.8055796 30.8055796,15 35.5,15 Z" fill="url(#s2fs8drhk__28u4feifyd)" opacity=".80000001"/>
<path d="M133,34 L151,34 L151,48 L159,48 L159,131 L133,131 L133,34 Z" fill="url(#s2fs8drhk__gho4xp3qwe)" opacity=".80000001"/>
<path d="M95,12 L117.231445,12 L117.231445,26 L126,26 L126,132 L95,132 L95,12 Z" fill="url(#s2fs8drhk__zohxw5n7lf)" opacity=".80000001"/>
<g transform="translate(41 41)">
<rect fill="url(#s2fs8drhk__z7sfnjiieg)" fill-rule="nonzero" y="12" width="78" height="86" rx="2"/>
<path d="M39,0 C41.9730632,0 44.4410745,2.16238395 44.9170737,5.00019152 L56.9000002,5 C59.7166523,5 62,7.28334768 62,10.0999998 L62,14 C62,15.1045695 61.1045695,16 60,16 L18,16 C16.8954305,16 16,15.1045695 16,14 L16,10.0999998 C16,7.28334768 18.2833477,5 21.0999998,5 L33.0829263,5.00019152 C33.5589255,2.16238395 36.0269368,0 39,0 Z" fill="url(#s2fs8drhk__yra10mwv4h)"/>
<rect fill="url(#s2fs8drhk__3f25wad1zi)" style="mix-blend-mode:multiply" opacity=".30000001" x="25" y="10" width="28" height="2" rx="1"/>
<rect fill="url(#s2fs8drhk__cwfw88cqyj)" fill-rule="nonzero" x="7" y="23" width="64" height="68" rx="1"/>
<path d="M30.1065538,49.6091353 L39,58.503 L47.8934462,49.6091353 C48.6744948,48.8280867 49.9408247,48.8280867 50.7218733,49.6091353 L53.3908647,52.2781267 C54.1719133,53.0591753 54.1719133,54.3255052 53.3908647,55.1065538 L44.497,64 L53.3908647,72.8934462 C54.1719133,73.6744948 54.1719133,74.9408247 53.3908647,75.7218733 L50.7218733,78.3908647 C49.9408247,79.1719133 48.6744948,79.1719133 47.8934462,78.3908647 L39,69.497 L30.1065538,78.3908647 C29.3255052,79.1719133 28.0591753,79.1719133 27.2781267,78.3908647 L24.6091353,75.7218733 C23.8280867,74.9408247 23.8280867,73.6744948 24.6091353,72.8934462 L33.503,64 L24.6091353,55.1065538 C23.8280867,54.3255052 23.8280867,53.0591753 24.6091353,52.2781267 L27.2781267,49.6091353 C28.0591753,48.8280867 29.3255052,48.8280867 30.1065538,49.6091353 Z" fill="url(#s2fs8drhk__j75attqvvk)" fill-rule="nonzero"/>
<rect fill="url(#s2fs8drhk__kzic7cqewl)" fill-rule="nonzero" opacity=".5" x="24" y="31" width="30" height="6" rx="1"/>
</g>
<path fill="url(#s2fs8drhk__mfg86bwylm)" d="M0 139H160V160H0z"/>
<g fill-rule="nonzero" opacity=".60000002">
<path d="M6.45961736,3.50937356 L10.6431425,18.7350517 C10.7894694,19.2675993 10.4763757,19.8179357 9.94382812,19.9642626 C9.85750968,19.9879802 9.76839742,20 9.67887986,20 L1.3118296,20 C0.75954485,20 0.3118296,19.5522847 0.3118296,19 C0.3118296,18.9104824 0.323849448,18.8213702 0.34756697,18.7350517 L4.5310921,3.50937356 C4.67741898,2.97682602 5.22775544,2.66373231 5.76030299,2.81005919 C6.10042883,2.9035148 6.36616175,3.16924773 6.45961736,3.50937356 Z" fill="url(#s2fs8drhk__cokg8ot95n)" transform="translate(134 115)"/>
<path fill="url(#s2fs8drhk__bi9rguiu0o)" d="M3.99662162 20H6.994087840000001V30H3.99662162z" transform="translate(134 115)"/>
<g>
<path d="M6.45961736,3.50937356 L10.6431425,18.7350517 C10.7894694,19.2675993 10.4763757,19.8179357 9.94382812,19.9642626 C9.85750968,19.9879802 9.76839742,20 9.67887986,20 L1.3118296,20 C0.75954485,20 0.3118296,19.5522847 0.3118296,19 C0.3118296,18.9104824 0.323849448,18.8213702 0.34756697,18.7350517 L4.5310921,3.50937356 C4.67741898,2.97682602 5.22775544,2.66373231 5.76030299,2.81005919 C6.10042883,2.9035148 6.36616175,3.16924773 6.45961736,3.50937356 Z" fill="url(#s2fs8drhk__cokg8ot95n)" transform="translate(15 115)"/>
<path fill="url(#s2fs8drhk__bi9rguiu0o)" d="M3.99662162 20H6.994087840000001V30H3.99662162z" transform="translate(15 115)"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

8
weapp/images/title_icon.svg

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="design-iconfont">
<g fill-rule="nonzero" fill="none">
<path d="M16.7142857,1.28571428 L16.7142857,3.85714285 L1.28571428,3.85714285 L1.28571428,1.28571428 L16.7142857,1.28571428 Z M16.7142857,0 L1.28571428,0 C0.514285717,0 0,0.514285717 0,1.28571428 L0,3.85714285 C0,4.62857142 0.514285717,5.14285715 1.28571428,5.14285715 L16.7142857,5.14285715 C17.4857143,5.14285715 18,4.62857143 18,3.85714285 L18,1.28571428 C18,0.514285717 17.4857143,0 16.7142857,0 Z M16.7142857,7.71428572 L16.7142857,10.2857143 L1.28571428,10.2857143 L1.28571428,7.71428572 L16.7142857,7.71428572 Z M16.7142857,6.42857143 L1.28571428,6.42857143 C0.514285717,6.42857143 0,6.94285715 0,7.71428572 L0,10.2857143 C0,11.0571428 0.514285717,11.5714286 1.28571428,11.5714286 L16.7142857,11.5714286 C17.4857143,11.5714286 18,11.0571428 18,10.2857143 L18,7.71428572 C18,6.94285715 17.4857143,6.42857143 16.7142857,6.42857143 Z M16.7142857,14.1428572 L16.7142857,16.7142857 L1.28571428,16.7142857 L1.28571428,14.1428572 L16.7142857,14.1428572 Z M16.7142857,12.8571428 L1.28571428,12.8571428 C0.514285717,12.8571428 0,13.3714286 0,14.1428572 L0,16.7142857 C0,17.4857143 0.514285717,18 1.28571428,18 L16.7142857,18 C17.4857143,18 18,17.4857143 18,16.7142857 L18,14.1428572 C18,13.3714286 17.4857143,12.8571428 16.7142857,12.8571428 L16.7142857,12.8571428 Z" fill-opacity=".85" fill="#000" transform="translate(3 3)"/>
<path d="M3.21428572,1.92857143 C3.6,1.92857143 3.85714285,2.18571428 3.85714285,2.57142857 C3.85714285,2.95714285 3.6,3.21428572 3.21428572,3.21428572 C2.82857143,3.21428572 2.57142857,2.95714285 2.57142857,2.57142857 C2.57142857,2.18571428 2.82857142,1.92857143 3.21428572,1.92857143 Z" fill="#006BE3" transform="translate(3 3)"/>
<path d="M3.21428572,8.35714285 C3.6,8.35714285 3.85714285,8.6142857 3.85714285,9 C3.85714285,9.3857143 3.6,9.64285715 3.21428572,9.64285715 C2.82857143,9.64285715 2.57142857,9.38571428 2.57142857,9 C2.57142857,8.61428572 2.82857142,8.35714285 3.21428572,8.35714285 L3.21428572,8.35714285 Z" fill="#006BE3" transform="translate(3 3)"/>
<path d="M3.21428572,14.7857143 L5.78571428,14.7857143 C6.17142857,14.7857143 6.42857143,15.0428571 6.42857143,15.4285714 C6.42857143,15.8142857 6.17142858,16.0714286 5.78571428,16.0714286 L3.21428572,16.0714286 C2.82857143,16.0714286 2.57142857,15.8142857 2.57142857,15.4285714 C2.57142857,15.0428572 2.82857142,14.7857143 3.21428572,14.7857143 Z" fill="#006BE3" transform="translate(3 3)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

72
weapp/package/polling/polling.js

@ -15,7 +15,7 @@ Page({
page: 0, //当前页
count: '', //总条数
hidden: true,
currentTab: '0',
currentTab: 0,
/* 巡检记录 */
ResList: [ //阅读状态
{
@ -31,12 +31,12 @@ Page({
text: '异常',
}
],
ResIndex: 0, //巡检结果
ResIndex: 'all', //巡检结果
recordDataList: [],
isPickerRender: false,
isPickerShow: false,
startTime: "开始日期", //开始日期
endTime: "结束日期", //结束日期
startTime: moment().subtract(7, 'days').valueOf(), //开始日期
endTime: moment().startOf('days').valueOf(), //结束日期
pickerConfig: { //自定义时间选择器配置项
endDate: true, //是否需要结束时间,为true时显示开始时间和结束时间两个picker
column: "day", //可选的最小时间范围day、hour、minute、second
@ -50,18 +50,18 @@ Page({
},
// 顶部tab切换
clickTab (e) {
onChange(event) {
this.setData({
currentTab: e.currentTarget.dataset.current
currentTab: event.detail.name
})
if (e.currentTarget.dataset.current == '0') {
if (event.detail.name === 0) {
this.setData({
page: 0,
dataList: []
}, () => {
this.getPatrolPlan();
})
} else if (e.currentTarget.dataset.current == '1') {
} else if (event.detail.name === 1) {
this.getPatrolRecord();
}
},
@ -112,44 +112,22 @@ Page({
/***** 巡检记录的方法 *****/
// 巡检结果
bindPickerRes (e) {
let that = this;
that.setData({
ResIndex: e.detail.value
this.setData({
ResIndex: e.detail
})
},
// 时间选择器显示
pickerShow: function () {
// 时间选择
onStartTimeChange (event) {
this.setData({
isPickerShow: true,
isPickerRender: true,
startTime: event.detail,
});
},
// 时间选择器隐藏
pickerHide: function () {
onEndTimeChange (event) {
this.setData({
isPickerShow: false,
endTime: event.detail,
});
},
// 获取选择时间
setPickerTime: function (val) {
let data = val.detail;
this.setData({
startTime: data.startTime,
endTime: data.endTime
});
},
// 清空提交日期筛选框
bindClearDate () {
this.setData({
startTime: '开始日期',
endTime: '结束日期'
})
},
// 查询
bindSearch () {
this.getPatrolRecord();
@ -166,14 +144,12 @@ Page({
// 获取巡检记录
getPatrolRecord: function () {
let that = this;
let { endTime, startTime, ResList, ResIndex } = that.data;
let sevenYearAgo = moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00');
let currentData = moment().startOf('days').format('YYYY-MM-DD 23:59:59');
let alarm = ResList[ResIndex].value == 'all' ? 'null' : ResList[ResIndex].value == 'normal' ? false : true;
let { endTime, startTime, ResIndex } = that.data;
let alarm = ResIndex == 'all' ? 'null' : ResIndex == 'normal' ? false : true;
wx.showLoading({
title: '加载中'
})
Request.get(getPatrolRecord('all', startTime == '开始日期' ? sevenYearAgo : startTime + ' 00:00:00', endTime == '结束日期' ? currentData : endTime + ' 23:59:59', alarm, 'null')).then(res => {
Request.get(getPatrolRecord('all', moment(startTime).format('YYYY-MM-DD') + ' 00:00:00', moment(endTime).format('YYYY-MM-DD') + ' 23:59:59', alarm, 'null')).then(res => {
if (res.length == 0) {
that.setData({
recordDataList: res,
@ -241,7 +217,7 @@ Page({
*/
onPullDownRefresh () {
let that = this;
if (that.data.currentTab == '0') {
if (that.data.currentTab === 0) {
that.setData({
dataList: [],
page: 0, //当前页
@ -250,12 +226,12 @@ Page({
that.getPatrolPlan()
// 手动控制回弹
wx.stopPullDownRefresh();
} else if (that.data.currentTab == '1') {
} else if (that.data.currentTab === 1) {
that.setData({
recordDataList: [],
ResIndex: 0, //巡检结果
startTime: "开始日期", //开始日期
endTime: "结束日期", //结束日期
ResIndex: 'all', //巡检结果
startTime: moment().subtract(7, 'days').valueOf(), //开始日期
endTime: moment().startOf('days').valueOf(), //结束日期
})
that.getPatrolRecord()
// 手动控制回弹
@ -268,7 +244,7 @@ Page({
*/
onReachBottom () {
let _that = this;
if (_that.data.currentTab == '0') {
if (_that.data.currentTab === 0) {
let page = _that.data.page + 1; //获取当前页数并+1
let { dataList, count } = _that.data;
if (dataList.length == count) {

7
weapp/package/polling/polling.json

@ -4,6 +4,11 @@
"navigationBarTitleText": "巡检",
"enablePullDownRefresh": true,
"usingComponents": {
"timePicker": "/components/timePicker/index"
"timePicker": "/components/timePicker/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
"van-dropdown-item": "@vant/weapp/dropdown-item/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
}
}

162
weapp/package/polling/polling.wxml

@ -1,99 +1,83 @@
<!-- package/polling/polling.wxml -->
<view class="page">
<!-- 顶部tab切换 -->
<view class='swiper-tab'>
<view class="swiper-tab-item" data-current="0" bindtap="clickTab" style="{{currentTab=='0' ? 'color:#1979ff' : 'color:black'}}">待巡检</view>
<view class="swiper-tab-item" data-current="1" bindtap="clickTab" style="{{currentTab=='1' ? 'color:#1979ff' : 'color:black'}}">巡检记录</view>
</view>
<!-- 待巡检 -->
<view class="wait-patrol" wx:if="{{currentTab=='0'}}">
<view class="contentBox">
<block wx:for="{{dataList}}" wx:key='*this'>
<view class="listBox">
<view style="padding-bottom:40rpx;overflow: hidden;">
<view class="titleBox" style="width: 630rpx; margin: 0 auto;">
<view class="title">{{item.name}}</view>
<van-tabs active="{{ currentTab }}" bind:change="onChange" color="#006BE3">
<van-tab title="待巡检">
<view class="wait-patrol">
<view class="contentBox">
<block wx:for="{{dataList}}" wx:key='*this'>
<view class="listBox">
<view style="overflow: hidden;">
<view class="titleBox" style="width: 630rpx; margin: 0 auto;">
<image class="icon" src="../../images/title_icon.svg"></image>
<view class="title">{{item.name}}</view>
</view>
<view style="width: 630rpx; margin: 0 auto;">
<text class="text-key">计划时间:</text>
<text class="text-value">{{item.startTime}}至{{item.endTime}}</text>
</view>
<view style="width: 630rpx; margin: 8px auto 0;">
<text class="text-key">计划时间:</text>
<text class="text-value">{{item.way}}({{item.frequency}})</text>
</view>
<view class="divider"></view>
<view class="btn" data-item="{{item}}" bindtap="bindStart">开始巡检</view>
</view>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
计划时间:
<text>{{item.startTime}}至{{item.endTime}}</text>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
计划时间:
<text>{{item.way}}({{item.frequency}})</text>
</view>
<view class="btn" data-item="{{item}}" bindtap="bindStart">开始巡检</view>
</view>
</block>
</view>
</block>
</view>
<!-- 暂无数据 -->
<view hidden="{{hidden}}">
<image class="noData" src="../../images/noData.png"></image>
<view class="noTxt">暂无数据~</view>
</view>
</view>
<!-- 巡检记录 -->
<view id="patrol-record" wx:elif="{{currentTab=='1'}}">
<view style="box-shadow:0px 0px 5px #7e7e7e;padding: 15px;background: #fff;position:fixed;top:100rpx;left:0;width: 100%;">
<view style="display: flex;">
<view style="line-height:50rpx;">时间范围:</view>
<view style="display: flex;">
<!-- 自定义时间选择器 -->
<view class="page-date" style="{{startTime != '开始日期' && endTime != '结束日期' ? 'float:left' : ''}}" bindtap="pickerShow">
<view style="{{startTime == '开始日期' && endTime == '结束日期' ? 'color:#ccc;' : ''}}">
{{startTime}}
<text style="margin: 0 20rpx;color:#000;">至</text>
{{endTime}}
</view>
</view>
<view class="clearDate" wx:if="{{startTime != '开始日期' && endTime != '结束日期'}}" bindtap="bindClearDate">
<image src="/images/close.svg"></image>
</view>
<timePicker pickerShow="{{isPickerShow}}" id="picker" wx:if="{{isPickerRender}}" bind:hidePicker="pickerHide" bind:setPickerTime="setPickerTime" config="{{pickerConfig}}"></timePicker>
</view>
</view>
<view style='display:flex;margin-top:28rpx;'>
<view style="line-height: 55rpx;">巡检结果:</view>
<picker class='my-picker' bindchange="bindPickerRes" value="{{ResIndex}}" rangeKey='text' range='{{ResList}}' style="border:2rpx solid #ccc;padding:6rpx 42rpx;border-radius: 6rpx;">
{{ResList[ResIndex].text}}
<image style="width:20rpx;height:20rpx;margin-left:10rpx;" src="../../images/down.svg" />
</picker>
<view style="padding:6rpx 64rpx;background:#1979ff;border-radius:6rpx;color:#fff;margin-left:70rpx;" bindtap="bindSearch">
查询
<!-- 暂无数据 -->
<view hidden="{{hidden}}">
<image class="noData" src="../../images/noData.svg"></image>
<view class="noTxt">暂无数据</view>
</view>
</view>
</view>
<view class="contentBox">
<block wx:for="{{recordDataList}}" wx:key='*this'>
<view class="listBox">
<view style="padding-bottom:40rpx;overflow: hidden;">
<view class="titleBox" style="width: 630rpx; margin: 0 auto;">
<view class="title">{{item.points.project.name}}</view>
</van-tab>
<van-tab title="巡检记录">
<view id="patrol-record">
<van-dropdown-menu>
<van-dropdown-item title="{{ '时间' }}" bind:close="bindSearch">
<view style="max-height:60%; display:flex" class="time-option">
<van-datetime-picker show-toolbar="{{false}}" type="date" value="{{ startTime }}" bind:input="onStartTimeChange" min-date="{{1640966400000}}"/>
<view style="display:flex; align-items:center">至</view>
<van-datetime-picker show-toolbar="{{false}}" type="date" value="{{ endTime }}" bind:input="onEndTimeChange" min-date="{{1640966400000}}"/>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
本次巡检日期:
<text>{{item.inspectionTime}}</text>
</van-dropdown-item>
<van-dropdown-item title="{{ '巡检结果' }}" bind:close="bindSearch" bind:change="bindPickerRes" value="{{ ResIndex }}" options="{{ ResList }}" />
</van-dropdown-menu>
<view class="contentBox">
<block wx:for="{{recordDataList}}" wx:key='*this'>
<view class="listBox">
<view style="overflow: hidden;">
<view class="titleBox" style="width: 630rpx; margin: 0 auto;">
<image class="icon" src="../../images/title_icon.svg"></image>
<view class="title">{{item.points.project.name}}</view>
</view>
<view style="width: 630rpx; margin: 0 auto;">
<text class="text-key">本次巡检日期:</text>
<text class="text-value">{{item.inspectionTime}}</text>
</view>
<view class="flex-between" style="width: 630rpx; margin: 8px auto 0;">
<view style="width: 315rpx">
<text class="text-key">巡检人:</text>
<text class="text-value">{{item.points.user.name}}</text>
</view>
<view style="width: 315rpx">
<text class="text-key">巡检结果:</text>
<text class="text-value" style="font-weight: 600; color: {{item.alarm ? '#ff0000d9' : '#006BE3'}}">{{item.alarm ? '异常' : '正常'}}</text>
</view>
</view>
<view class="divider"></view>
<view class="btn" data-item="{{item}}" bindtap="bindDetail">查看详情</view>
</view>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
巡检人:
<text>{{item.points.user.name}}</text>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
巡检结果:
<text>{{item.alarm ? '异常' : '正常'}}</text>
</view>
<view class="btn" data-item="{{item}}" bindtap="bindDetail">查看详情</view>
</view>
</block>
</view>
</block>
</view>
<!-- 暂无数据 -->
<view hidden="{{recordHidden}}">
<image class="noData" src="../../images/noData.png"></image>
<view class="noTxt">暂无数据~</view>
</view>
</view>
<!-- 暂无数据 -->
<view hidden="{{recordHidden}}">
<image class="noData" src="../../images/noData.svg"></image>
<view class="noTxt">暂无数据</view>
</view>
</view>
</van-tab>
</van-tabs>
</view>

119
weapp/package/polling/polling.wxss

@ -16,7 +16,6 @@
top: 0;
z-index: 100;
background: #fff;
border-bottom: 2rpx solid #e8e8e8;
}
.swiper-tab-item {
@ -27,18 +26,34 @@
position: relative;
}
.divider {
width: 100%;
height: 0px;
border-top: 1px solid #F5F5F5;
margin-top: 19px;
margin-bottom: 9px;
}
.flex-between {
display: flex;
justify-content: space-between;
}
.time-option .van-picker{
width: 45vw;
}
.wait-patrol {
/* 暂无数据 */
}
.wait-patrol .contentBox {
padding: 110rpx 30rpx 20rpx;
padding: 0rpx 30rpx 20rpx;
}
.wait-patrol .listBox {
background-color: #fff;
border-radius: 10rpx;
box-shadow: 0rpx 0rpx 10rpx #ddd;
margin: 30rpx auto;
overflow: hidden;
}
@ -46,27 +61,49 @@
.wait-patrol .titleBox {
overflow: hidden;
padding-bottom: 20rpx;
padding-top: 40rpx;
padding-top: 38rpx;
}
.wait-patrol .icon {
float: left;
width: 24px;
height: 24px;
margin-right: 5px;
}
.wait-patrol .title {
float: left;
font-size: 32rpx;
width: 460rpx;
font-size: 16px;
line-height: 24px;
font-weight: bold;
color: #333333;
}
.wait-patrol .text-key {
font-weight: 400;
font-size: 14px;
color: #000000a6;
}
.wait-patrol .text-value {
font-weight: 400;
font-size: 14px;
color: #000000d9;
}
.wait-patrol .btn {
width: 130rpx;
float: right;
margin-right: 12px;
margin-bottom: 10px;
width: 76px;
height: 26px;
background: #1684FF;
border-radius: 16px;
font-weight: 400;
font-size: 13px;
line-height: 26px;
color: #FFFFFF;
text-align: center;
font-size: 30rpx;
padding: 20rpx;
background: #1979ff;
color: #fff;
border-radius: 10rpx;
float: left;
margin-left: 30rpx;
margin-top: 20rpx;
}
.wait-patrol .noData {
@ -91,13 +128,13 @@
}
#patrol-record .contentBox {
padding: 300rpx 30rpx 20rpx;
padding: 0rpx 30rpx 20rpx;
margin-top: -15px;
}
#patrol-record .listBox {
background-color: #fff;
border-radius: 10rpx;
box-shadow: 0rpx 0rpx 10rpx #ddd;
margin: 30rpx auto;
overflow: hidden;
}
@ -105,27 +142,49 @@
#patrol-record .titleBox {
overflow: hidden;
padding-bottom: 20rpx;
padding-top: 40rpx;
padding-top: 38rpx;
}
#patrol-record .icon {
float: left;
width: 24px;
height: 24px;
margin-right: 5px;
}
#patrol-record .title {
float: left;
font-size: 32rpx;
width: 460rpx;
font-size: 16px;
line-height: 24px;
font-weight: bold;
color: #333333;
}
#patrol-record .text-key {
font-weight: 400;
font-size: 14px;
color: #000000a6;
}
#patrol-record .text-value {
font-weight: 400;
font-size: 14px;
color: #000000d9;
}
#patrol-record .btn {
width: 130rpx;
float: right;
margin-right: 12px;
margin-bottom: 10px;
width: 76px;
height: 26px;
background: #1684FF;
border-radius: 16px;
font-weight: 400;
font-size: 13px;
line-height: 26px;
color: #FFFFFF;
text-align: center;
font-size: 30rpx;
padding: 20rpx;
background: #1979ff;
color: #fff;
border-radius: 10rpx;
float: left;
margin-left: 30rpx;
margin-top: 20rpx;
}
#patrol-record .page-date {
@ -149,7 +208,7 @@
width: 254rpx;
height: 298rpx;
display: block;
margin: 280rpx auto 16rpx;
margin: 100rpx auto 16rpx;
}
#patrol-record .noTxt {

Loading…
Cancel
Save