Browse Source

巡检录入UI

master
liujiangyong 1 year ago
parent
commit
7af91ea37b
  1. 3
      weapp/images/landmark.svg
  2. 4
      weapp/package/inspectionInput/inspectionInput.js
  3. 7
      weapp/package/inspectionInput/inspectionInput.json
  4. 37
      weapp/package/inspectionInput/inspectionInput.wxml
  5. 77
      weapp/package/inspectionInput/inspectionInput.wxss

3
weapp/images/landmark.svg

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" class="design-iconfont">
<path d="M9.28125,0.5625 C5.713875,0.5625 2.8125,3.459375 2.8125,7.02 C2.8125,8.341875 3.21075,9.61425 3.9555,10.6846875 C3.992625,10.7488125 4.0303125,10.8106875 4.07475,10.870875 L8.796375,17.08425 C8.924625,17.2265625 9.09675,17.3053125 9.28125,17.3053125 C9.4635,17.3053125 9.63675,17.226 9.7869375,17.0578125 L14.486625,10.8703125 C14.53275,10.8084375 14.5726875,10.7409375 14.5940625,10.7015625 C15.348162,9.62213129 15.7517457,8.33675159 15.7500056,7.02 C15.7500056,3.459375 12.8480625,0.5625 9.28125,0.5625 Z M9.28125,9.3290625 C8.00685028,9.32844541 6.97329051,8.29664682 6.9705,7.02225 C7.00433139,5.77052682 8.02878846,4.7733845 9.28096875,4.7733845 C10.533149,4.7733845 11.5576061,5.77052682 11.5914375,7.02225 C11.5883382,8.29620767 10.5552111,9.32757387 9.28125,9.3285 L9.28125,9.3290625 Z" fill="#D32E2E" fill-rule="nonzero"/>
</svg>

After

Width:  |  Height:  |  Size: 936 B

4
weapp/package/inspectionInput/inspectionInput.js

@ -141,7 +141,7 @@ Page({
}, },
handleChangeTwo (e) { handleChangeTwo (e) {
const isNormal = e.detail.value === 'normal'; const isNormal = e.detail === 'normal';
const inspectContent = this.data.inspectContent; const inspectContent = this.data.inspectContent;
inspectContent[e.currentTarget.dataset.item].isNormal = isNormal; inspectContent[e.currentTarget.dataset.item].isNormal = isNormal;
if (isNormal) { // 清除异常数据 if (isNormal) { // 清除异常数据
@ -156,7 +156,7 @@ Page({
handleChangeThree (e) { handleChangeThree (e) {
const inspectContent = this.data.inspectContent; const inspectContent = this.data.inspectContent;
inspectContent[e.currentTarget.dataset.item].level = e.detail.value; inspectContent[e.currentTarget.dataset.item].level = e.detail;
this.setData({ this.setData({
inspectContent inspectContent
}) })

7
weapp/package/inspectionInput/inspectionInput.json

@ -8,6 +8,11 @@
"t-cell-group": "tdesign-miniprogram/cell-group/cell-group", "t-cell-group": "tdesign-miniprogram/cell-group/cell-group",
"t-cell": "tdesign-miniprogram/cell/cell", "t-cell": "tdesign-miniprogram/cell/cell",
"t-picker": "tdesign-miniprogram/picker/picker", "t-picker": "tdesign-miniprogram/picker/picker",
"t-picker-item": "tdesign-miniprogram/picker-item/picker-item" "t-picker-item": "tdesign-miniprogram/picker-item/picker-item",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-icon": "@vant/weapp/icon/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index"
} }
} }

37
weapp/package/inspectionInput/inspectionInput.wxml

@ -8,29 +8,37 @@
</view> </view>
<view style="padding:20rpx 30rpx;overflow: hidden;"> <view style="padding:20rpx 30rpx;overflow: hidden;">
<view style="float: left;">当前点位:</view> <view style="float: left;">当前点位:</view>
<view style="float:left;width:480rpx;text-align: justify;">{{itemData.name}}</view> <view style="float:right;">{{itemData.name}}</view>
</view> </view>
<view class="divider" />
<view style="padding:20rpx 30rpx;overflow: hidden;"> <view style="padding:20rpx 30rpx;overflow: hidden;">
<view style="float: left;">当前位置:</view> <view style="float: left;">当前位置:</view>
<view style="float:left;width:480rpx;text-align: justify;" wx:if="{{address}}"> <view style="float:right;" wx:if="{{address}}">
{{address}} {{address}}
</view> </view>
<view style="float:left;width:480rpx;text-align: justify;" bindtap="selfLocation" wx:if="{{!address}}"> <view style="float:right;">
点击获取当前位置 <image wx:if="{{!address}}" class="icon" src="../../images/landmark.svg" />
<view style="display: inline-block;" bindtap="selfLocation" wx:if="{{!address}}">
点击获取
</view> </view>
</view> </view>
</view>
<view class="divider" />
<view wx:for="{{checkItems}}" wx:key="id"> <view wx:for="{{checkItems}}" wx:key="id">
<view class="flex-between">
<view class="item-name">{{item.name}}:</view> <view class="item-name">{{item.name}}:</view>
<radio-group style="padding:10px 15px;display:flex;justify-content: space-evenly;" data-item="{{item.name}}" bindchange="handleChangeTwo"> <van-radio-group style="padding:10px 15px;" data-item="{{item.name}}" bindchange="handleChangeTwo">
<radio style="color:#1979ff;" color="#1979ff" value="normal">正常</radio> <van-radio style="margin-right: 20px;" class="radio-text" color="#1979ff" name="normal">正常</van-radio>
<radio style="color:#CC0000;" color="#CC0000" value="abnormal">异常</radio> <van-radio class="radio-text" checked-color="#CC0000" name="abnormal">异常</van-radio>
</radio-group> </van-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="{{inspectContent[item.name].isNormal === false}}" data-item="{{item.name}}" bindinput="bindInput"></textarea> </view>
<radio-group style="padding:10px 15px;display:flex;justify-content: space-evenly;" data-item="{{item.name}}" bindchange="handleChangeThree" wx:if="{{inspectContent[item.name].isNormal === false}}"> <view class="divider" />
<radio style="color:#FF9900;" color="#FF9900" value="轻微">轻微</radio> <van-radio-group class="flex-end" style="padding:10px 15px;" data-item="{{item.name}}" bindchange="handleChangeThree" wx:if="{{inspectContent[item.name].isNormal === false}}">
<radio style="color:#FF3300;" color="#FF3300" value="中度">中度</radio> <van-radio style="margin-right: 20px;" class="radio-text" checked-color="#FF9900" name="轻微">轻微</van-radio>
<radio style="color:#990000;" color="#990000" value="严重">严重</radio> <van-radio style="margin-right: 20px;" class="radio-text" checked-color="#FF3300" name="中度">中度</van-radio>
</radio-group> <van-radio class="radio-text" checked-color="#990000" name="严重">严重</van-radio>
</van-radio-group>
<textarea class="textarea" placeholder="请输入巡查详情" maxlength="-1" wx:if="{{inspectContent[item.name].isNormal === false}}" data-item="{{item.name}}" bindinput="bindInput"></textarea>
<view class="weui-uploader" style="padding: 20rpx 30rpx;overflow-y:scroll;" wx:if="{{inspectContent[item.name].isNormal === false}}"> <view class="weui-uploader" style="padding: 20rpx 30rpx;overflow-y:scroll;" wx:if="{{inspectContent[item.name].isNormal === false}}">
<view class="img-v weui-uploader__bd" style="overflow:hidden;"> <view class="img-v weui-uploader__bd" style="overflow:hidden;">
<view class='pic' wx:for="{{inspectContent[item.name].imgs}}" wx:for-item="img" wx:key="*this"> <view class='pic' wx:for="{{inspectContent[item.name].imgs}}" wx:for-item="img" wx:key="*this">
@ -44,6 +52,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="divider" />
</view> </view>
<view class="btnBox"> <view class="btnBox">
<view class="cancel" bindtap="bindCancel">取消</view> <view class="cancel" bindtap="bindCancel">取消</view>

77
weapp/package/inspectionInput/inspectionInput.wxss

@ -1,4 +1,20 @@
/* package/inspectionInput/inspectionInput.wxss */ /* package/inspectionInput/inspectionInput.wxss */
.divider {
width: 100%;
height: 0px;
border-top: 1px solid #F5F5F5;
}
.flex-between {
display: flex;
justify-content: space-between;
}
.flex-end {
display: flex;
justify-content: flex-end;
}
.popBox { .popBox {
position: absolute; position: absolute;
left: 50%; left: 50%;
@ -14,31 +30,37 @@
} }
.btnBox { .btnBox {
padding: 30rpx; padding: 50px 30rpx;
overflow: hidden; overflow: hidden;
font-size: 30rpx; font-size: 30rpx;
display: flex;
justify-content: space-between;
} }
.cancel { .cancel {
width: 180rpx; width: 38vw;
float: left; height: 42px;
line-height: 42px;
text-align: center; text-align: center;
background: #fff; background: #fff;
border: 2rpx solid #1979ff; border: 1px solid #006BE3;
border-radius: 10rpx; border-radius: 24px;
padding: 12rpx 0; font-weight: 600;
color: #1979ff; font-size: 16px;
color: #1684FF;
} }
.submit { .submit {
width: 180rpx; width: 38vw;
float: right; height: 42px;
line-height: 42px;
text-align: center; text-align: center;
border-radius: 10rpx; background: #1684FF;
padding: 12rpx 0; border: 1px solid #006BE3;
background: #1979ff; border-radius: 24px;
color: #fff; font-weight: 600;
border: 2rpx solid #1979ff; font-size: 16px;
color: #FFFFFF;
} }
.pic { .pic {
@ -60,10 +82,33 @@
} }
.upload { .upload {
width: 160rpx; width: 63px;
height: 160rpx; height: 63px;
} }
.block { .block {
display: block; display: block;
} }
.icon {
width: 18px;
height: 18px;
margin-right: 5px;
}
.radio-text {
font-size: 14px;
color: #323233;
}
.van-radio-group {
display: flex;
}
.textarea {
width: 84%;
margin: 0 auto;
padding: 20rpx;
height: 120rpx;
border: 1px solid #61616166;
}
Loading…
Cancel
Save