Compare commits

...

2 Commits

  1. 9
      weapp/app.json
  2. 1
      weapp/images/down.svg
  3. 2
      weapp/package/basic/basic.wxml
  4. 85
      weapp/package/inspectionRecord/inspectionRecord.js
  5. 6
      weapp/package/inspectionRecord/inspectionRecord.json
  6. 40
      weapp/package/inspectionRecord/inspectionRecord.wxml
  7. 47
      weapp/package/inspectionRecord/inspectionRecord.wxss
  8. 18
      weapp/package/polling/polling.js
  9. 21
      weapp/package/polling/polling.wxml
  10. 38
      weapp/package/polling/polling.wxss
  11. 138
      weapp/package/startInspection/startInspection.js
  12. 6
      weapp/package/startInspection/startInspection.json
  13. 87
      weapp/package/startInspection/startInspection.wxml
  14. 85
      weapp/package/startInspection/startInspection.wxss
  15. 2
      weapp/pages/index/index.wxml
  16. 28
      weapp/project.private.config.json

9
weapp/app.json

@ -9,7 +9,9 @@
"root": "package",
"pages": [
"polling/polling",
"basic/basic"
"basic/basic",
"startInspection/startInspection",
"inspectionRecord/inspectionRecord"
]
}],
"window": {
@ -41,5 +43,10 @@
}
]
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"sitemapLocation": "sitemap.json"
}

1
weapp/images/down.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1636808259588" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3680" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M1005.9 333L576 762.9c-17.3 17.3-40.2 26.7-64.7 26.7s-47.4-9.5-64.7-26.7L16.8 333c-22.3-22.3-22.3-58.5 0-80.8 22.3-22.3 58.5-22.3 80.8 0l413.8 413.7 413.8-413.8c22.3-22.3 58.5-22.3 80.8 0 11.2 11.2 16.7 25.8 16.7 40.5-0.1 14.6-5.6 29.2-16.8 40.4z m0 0" fill="#929292" p-id="3681"></path></svg>

After

Width:  |  Height:  |  Size: 668 B

2
weapp/package/basic/basic.wxml

@ -22,7 +22,7 @@
<view class='content'>
<view class='title'>部门:</view>
<view class='value'>
管理部门
{{userInfo.deptName || '--'}}
</view>
</view>
<view class='content'>

85
weapp/package/inspectionRecord/inspectionRecord.js

@ -0,0 +1,85 @@
// package/inspectionRecord/inspectionRecord.js
Page({
/**
* 页面的初始数据
*/
data: {
ResList: [ //阅读状态
{
value: 'normal',
text: '正常',
},
{
value: 'abnormal',
text: '异常',
}
],
ResIndex: 0, //巡检结果
dataList: [1, 2, 3, 4, 5,]
},
// 巡检结果
bindPickerRes(e) {
let that = this;
that.setData({
ResIndex: e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

6
weapp/package/inspectionRecord/inspectionRecord.json

@ -0,0 +1,6 @@
{
"navigationBarBackgroundColor": "#1979ff",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "巡检记录",
"enablePullDownRefresh": false
}

40
weapp/package/inspectionRecord/inspectionRecord.wxml

@ -0,0 +1,40 @@
<!--package/inspectionRecord/inspectionRecord.wxml-->
<view style="box-shadow:0px 0px 5px #7e7e7e;padding: 15px;background: #fff;position:fixed;top:0;left:0;width: 100%;">
<view style="display: flex;">
<view style="line-height:50rpx;">时间范围:</view>
<view style="display: flex;">
<view style="border:2rpx solid #ccc;padding:6rpx 16rpx;margin-right:20rpx;border-radius:6rpx;">2022-12-15</view>
<view style="line-height: 55rpx;">至</view>
<view style="border:2rpx solid #ccc;padding:6rpx 16rpx;margin-left:20rpx;border-radius:6rpx;">2022-12-26</view>
</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 20rpx;border-radius: 6rpx;">
{{ResList[ResIndex].text}}
<image style="width:20rpx;height:20rpx;margin-left:10rpx;" src="../../images/down.svg" />
</picker>
</view>
</view>
<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">结构物A</view>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
本次巡检日期:<text>2022-12-21 17:00</text>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
巡检人:<text>巡检人</text>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
巡检结果:<text>异常</text>
</view>
<view class="btn" bindtap="bindStart">查看详情</view>
</view>
</view>
</block>
</view>

47
weapp/package/inspectionRecord/inspectionRecord.wxss

@ -0,0 +1,47 @@
/* package/inspectionRecord/inspectionRecord.wxss */
page{
background: #F7F7FA;
}
.my-picker {
white-space: nowrap;
width: 100rpx;
}
.contentBox {
padding: 210rpx 30rpx 20rpx;
}
.listBox {
background-color: #fff;
border-radius: 10rpx;
box-shadow: 0rpx 0rpx 10rpx #ddd;
margin: 30rpx auto;
overflow: hidden;
}
.titleBox {
overflow: hidden;
padding-bottom: 20rpx;
padding-top: 40rpx;
}
.title {
float: left;
font-size: 32rpx;
width: 460rpx;
font-weight: bold;
}
.btn {
width: 130rpx;
text-align: center;
font-size: 30rpx;
padding: 20rpx;
background: #1979ff;
color: #fff;
border-radius: 10rpx;
float: left;
margin-left: 30rpx;
margin-top: 20rpx;
}

18
weapp/package/polling/polling.js

@ -5,12 +5,26 @@ Page({
* 页面的初始数据
*/
data: {
dataList: [1, 2, 3, 4, 5,]
},
// 顶部tab切换
clickTab(e) {
this.setData({
currentTab: e.currentTarget.dataset.current
})
if (e.currentTarget.dataset.current == '0') {
wx.navigateTo({
url: '/package/inspectionRecord/inspectionRecord',
})
}
},
// 开始巡检
bindStart() {
wx.navigateTo({
url: '/package/startInspection/startInspection',
})
},
/**

21
weapp/package/polling/polling.wxml

@ -6,6 +6,25 @@
<!-- <view class="swiper-tab-item active" data-current="1" bindtap="clickTab">问题上报</view> -->
</view>
<view class='swiper-tab' style="top:100rpx;">
<view class="swiper-tab-item" data-current="0" bindtap="clickTab">待巡检</view>
<view class="swiper-tab-item">待巡检</view>
</view>
<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">结构物A巡检计划</view>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
计划时间:<text>2022-12-21至2023-01-15</text>
</view>
<view style="line-height:50rpx;font-size:28rpx;width: 630rpx; margin: 0 auto;">
计划时间:<text>周期巡检(3天一次)</text>
</view>
<view class="btn" bindtap="bindStart">开始巡检</view>
</view>
</view>
</block>
</view>
</view>

38
weapp/package/polling/polling.wxss

@ -30,4 +30,42 @@
.active {
color: #1979ff;
position: relative;
}
.contentBox {
padding: 210rpx 30rpx 20rpx;
}
.listBox {
background-color: #fff;
border-radius: 10rpx;
box-shadow: 0rpx 0rpx 10rpx #ddd;
margin: 30rpx auto;
overflow: hidden;
}
.titleBox {
overflow: hidden;
padding-bottom: 20rpx;
padding-top: 40rpx;
}
.title {
float: left;
font-size: 32rpx;
width: 460rpx;
font-weight: bold;
}
.btn {
width: 130rpx;
text-align: center;
font-size: 30rpx;
padding: 20rpx;
background: #1979ff;
color: #fff;
border-radius: 10rpx;
float: left;
margin-left: 30rpx;
margin-top: 20rpx;
}

138
weapp/package/startInspection/startInspection.js

@ -0,0 +1,138 @@
// package/startInspection/startInspection.js
Page({
/**
* 页面的初始数据
*/
data: {
dataList: [1, 2, 3]
},
handleChangeTwo(e) {
this.setData({
changeTwo: e.detail.value
})
},
handleChangeThree(e) {
this.setData({
changeThree: e.detail.value
})
},
showModal() {
this.setData({
showModal: true
})
},
bindCancel() {
this.setData({
showModal: false
})
},
selfLocation() {
const self = this
wx.showLoading({
title: '定位中',
mask: true,
});
wx.getLocation({
type: 'gcj02',
success: (res) => {
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
this.latitude = res.latitude
this.longitude = res.longitude
getGeocoder({ lat: latitude, long: longitude }).then(res => { // 获取详细信息的接口
const data = res.data;
self.userAddress.userAddressdetail = ''
var params = {
text: data.address
}
parseAddress(params).then(res => { // 粘贴详细信息的接口
console.log(res)
if (res.status == 200 && res.message == "success") {
this.$forceUpdate(); // 定位后,界面没有反应,因此加上强制刷新
this.userAddress.userAddressdetail = res.data.town + res.data.detail;
this.$set(this.userAddress, 'selectAddress', parseInt(res.data.county_info.city_id));
this.addressInfo[0] = res.data.province_info ? res.data.province_info : {};
this.addressInfo[1] = res.data.city_info ? res.data.city_info : {};
this.addressInfo[2] = res.data.county_info ? res.data.county_info : {};
}
}).catch(res => {
console.log("没有地址信息")
})
wx.hideLoading();
})
},
fail: (res) => {
console.log(res)
wx.hideLoading();
wx.showToast({
title: res.errMsg,
icon: 'none',
duration: 1000
});
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

6
weapp/package/startInspection/startInspection.json

@ -0,0 +1,6 @@
{
"navigationBarBackgroundColor": "#1979ff",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "开始巡检",
"enablePullDownRefresh": false
}

87
weapp/package/startInspection/startInspection.wxml

@ -0,0 +1,87 @@
<!--package/startInspection/startInspection.wxml-->
<view class="box">
<view class="titleFirst">巡检要求</view>
<view class="txt">
<view style="float: left;font-weight: bold;">结构物名称</view>
<view style="float:left;width:70%;margin-left:40rpx;">结构物名称</view>
</view>
<view class="txt">
<view style="float: left;font-weight: bold;">开始时间</view>
<view style="float:left;width:70%;margin-left:40rpx;">2022-12-25</view>
</view>
<view class="txt">
<view style="float: left;font-weight: bold;">结束时间</view>
<view style="float:left;width:70%;margin-left:40rpx;">2023-01-15</view>
</view>
<view class="txt">
<view style="float: left;font-weight: bold;">巡检方式</view>
<view style="float:left;width:70%;margin-left:40rpx;">周期巡检</view>
</view>
<view class="txt">
<view style="float: left;font-weight: bold;">巡检频次</view>
<view style="float:left;width:70%;margin-left:40rpx;">3天一次</view>
</view>
<view class="txt">
<view style="float: left;font-weight: bold;">巡检人</view>
<view style="float:left;width:70%;margin-left:40rpx;">巡检人</view>
</view>
<view class="txt">
<view style="float: left;font-weight: bold;">巡检单位</view>
<view style="float:left;width:70%;margin-left:40rpx;">巡检单位</view>
</view>
<view class="txt">
<view style="float: left;font-weight: bold;">巡检点位</view>
<view style="float:left;width:70%;margin-left:40rpx;">点位A、点位B、点位C</view>
</view>
<view class="line"></view>
<view class="titleFirst">巡检结果录入</view>
<block wx:for="{{dataList}}" wx:key="*this">
<view style="margin-bottom: 60rpx;">
<view class="txt" style="margin-bottom: 20rpx;">
<view style="float: left;font-weight: bold;">巡检点位</view>
<view style="float:left;width:55%;margin-left:40rpx;">点位A</view>
<view class="startBtn" bindtap="showModal">开始巡检</view>
</view>
<view class="txt" style="margin-bottom: 20rpx;">
<view style="float: left;font-weight: bold;">上次巡检日期</view>
<view style="float:left;width:55%;margin-left:40rpx;">2022-10-26</view>
</view>
<view class="txt" style="margin-bottom: 20rpx;">
<view style="float: left;font-weight: bold;">巡检人</view>
<view style="float:left;width:55%;margin-left:40rpx;">巡检人A</view>
</view>
<view class="txt" style="margin-bottom: 20rpx;">
<view style="float: left;font-weight: bold;">本次巡检日期</view>
<view style="float:left;width:55%;margin-left:40rpx;">2022-12-23</view>
</view>
</view>
</block>
<view class="modal" wx:if="{{showModal}}">
<view class="popBox">
<view style="padding:20rpx 30rpx;overflow: hidden;">
<view style="float: left;">当前点位:</view>
<view style="float:left;width: 75%;">点位A</view>
</view>
<view style="padding:20rpx 30rpx;overflow: hidden;">
<view style="float: left;">当前位置:</view>
<view style="float:left;width: 75%;">点位A</view>
</view>
<radio-group style="padding:10px 15px;display:flex;justify-content: space-evenly;" bindchange="handleChangeTwo">
<radio style="color:#1979ff;" color="#1979ff" value="normal">正常</radio>
<radio style="color:#CC0000;" color="#CC0000" value="abnormal">异常</radio>
</radio-group>
<textarea style="width: 84%;margin:0 auto;border:2rpx solid #ccc;padding:20rpx;height: 120rpx;border-radius: 10rpx;" placeholder="请输入巡查详情" maxlength="-1" wx:if="{{changeTwo == 'abnormal'}}"></textarea>
<radio-group style="padding:10px 15px;display:flex;justify-content: space-evenly;" bindchange="handleChangeThree" wx:if="{{changeTwo == 'abnormal'}}">
<radio style="color:#FF9900;" color="#FF9900" value="slight">轻微</radio>
<radio style="color:#FF3300;" color="#FF3300" value="moderate">中度</radio>
<radio style="color:#990000;" color="#990000" value="severity">严重</radio>
</radio-group>
<view class="btnBox">
<view class="cancel" bindtap="bindCancel">取消</view>
<view class="submit">提交</view>
</view>
</view>
</view>
</view>

85
weapp/package/startInspection/startInspection.wxss

@ -0,0 +1,85 @@
/* package/startInspection/startInspection.wxss */
.box {
width: 696rpx;
margin: 0 auto;
padding: 30rpx 0;
}
.titleFirst {
font-size: 32rpx;
margin-bottom: 30rpx;
}
.txt {
width: 100%;
overflow: hidden;
margin-bottom: 40rpx;
color: #333;
font-size: 28rpx;
}
.line {
width: 100%;
height: 2rpx;
background: #ccc;
margin-bottom: 40rpx;
}
.startBtn {
float: right;
padding: 10rpx 20rpx;
background: #1979ff;
color: #fff;
border-radius: 10rpx;
font-size: 26rpx;
}
.modal {
background: rgba(0, 0, 0, 0.6);
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 10;
height: 100%;
}
.popBox {
position: absolute;
top: 50%;
left: 50%;
z-index: 1000;
background: #fff;
width: 95%;
margin-left: -356rpx;
margin-top: -500rpx;
padding: 20rpx 0;
}
.btnBox {
padding: 30rpx;
overflow: hidden;
font-size: 30rpx;
}
.cancel {
width: 180rpx;
float: left;
text-align: center;
background: #fff;
border: 2rpx solid #1979ff;
border-radius: 10rpx;
padding: 12rpx 0;
color: #1979ff;
}
.submit {
width: 180rpx;
float: right;
text-align: center;
border-radius: 10rpx;
padding: 12rpx 0;
background: #1979ff;
color: #fff;
border: 2rpx solid #1979ff;
}

2
weapp/pages/index/index.wxml

@ -8,7 +8,7 @@
</view>
<view style="margin-top: 117rpx;">
<block wx:for="{{dataList}}">
<block wx:for="{{dataList}}" wx:key='*this'>
<view style="padding-bottom: 60rpx;">
<image style="width: 100%;height: 372rpx;display: block;" src="https://dingyue.ws.126.net/2021/0428/099be11ej00qs9xld006bc000xc00m7m.jpg"></image>
<view class="box">

28
weapp/project.private.config.json

@ -5,32 +5,6 @@
"compileHotReLoad": false,
"urlCheck": false
},
"condition": {
"miniprogram": {
"list": [
{
"name": "",
"pathName": "pages/login/login",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "package/polling/polling",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "package/basic/basic",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
},
"condition": {},
"libVersion": "2.29.0"
}
Loading…
Cancel
Save