Archer_cdm
2 years ago
10 changed files with 345 additions and 29 deletions
@ -0,0 +1,96 @@ |
|||
// package/inspectionRecord/inspectionRecordDetail/inspectionRecordDetail.js
|
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
dataList: '', |
|||
imgUrl: getApp().globalData.imgUrl |
|||
}, |
|||
|
|||
// 预览图片
|
|||
previewImg: function (e) { |
|||
//获取当前图片的下标
|
|||
var index = e.currentTarget.dataset.index; |
|||
//所有图片
|
|||
var imgs = this.data.dataList.imgs; |
|||
wx.previewImage({ |
|||
//当前显示图片
|
|||
current: imgs[index], |
|||
//所有图片
|
|||
urls: imgs |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad(options) { |
|||
let that = this; |
|||
let data = JSON.parse(options.data) |
|||
if (data.points.imgs != undefined) { |
|||
let newArr = data.points.imgs.map(e => { |
|||
e = that.data.imgUrl + e; |
|||
return e; |
|||
}) |
|||
that.setData({ |
|||
dataList: { ...data, imgs: newArr } |
|||
}) |
|||
} else { |
|||
that.setData({ |
|||
dataList: data |
|||
}) |
|||
} |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady() { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow() { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide() { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload() { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh() { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom() { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage() { |
|||
|
|||
} |
|||
}) |
@ -0,0 +1,6 @@ |
|||
{ |
|||
"navigationBarBackgroundColor": "#1979ff", |
|||
"navigationBarTextStyle": "white", |
|||
"navigationBarTitleText": "巡检记录详情", |
|||
"enablePullDownRefresh": false |
|||
} |
@ -0,0 +1,77 @@ |
|||
<!--package/inspectionRecord/inspectionRecordDetail/inspectionRecordDetail.wxml--> |
|||
<view class="page"> |
|||
<view class='list'> |
|||
<view class='content'> |
|||
<view class='title'>结构物名称:</view> |
|||
<view class='value'> |
|||
{{dataList.points.project.name}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>巡检人:</view> |
|||
<view class='value'> |
|||
{{dataList.points.user.name}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>巡检单位:</view> |
|||
<view class='value'> |
|||
{{dataList.points.user.department.name}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>巡检频次:</view> |
|||
<view class='value'> |
|||
{{dataList.points.frequency}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>上次巡检日期:</view> |
|||
<view class='value'> |
|||
{{dataList.lastInspectionTime}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>本次巡检日期:</view> |
|||
<view class='value'> |
|||
{{dataList.inspectionTime}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>巡检结果:</view> |
|||
<view class='value'> |
|||
{{dataList.alarm ? '异常' : '正常'}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>当前点位:</view> |
|||
<view class='value'> |
|||
{{dataList.points.itemData.name}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>当前位置:</view> |
|||
<view class='value'> |
|||
{{dataList.points.address}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>巡检详情:</view> |
|||
<view class='value'> |
|||
{{dataList.points.msgInp || '--'}} |
|||
</view> |
|||
</view> |
|||
<view class='content'> |
|||
<view class='title'>异常等级:</view> |
|||
<view class='value'> |
|||
{{dataList.points.changeThree || '--'}} |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="img-v weui-uploader__bd" style="overflow:hidden;"> |
|||
<view class='pic' wx:for="{{dataList.imgs}}" wx:for-item="item" wx:key="*this"> |
|||
<image class='weui-uploader__img showImg' src="{{item}}" data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
@ -0,0 +1,71 @@ |
|||
/* package/inspectionRecord/inspectionRecordDetail/inspectionRecordDetail.wxss */ |
|||
page { |
|||
background-color: #F7F7FA; |
|||
} |
|||
|
|||
.page { |
|||
padding: 30rpx; |
|||
} |
|||
|
|||
.header-item-container { |
|||
width: 100%; |
|||
height: 180rpx; |
|||
background: rgb(255, 255, 255); |
|||
border-radius: 10rpx; |
|||
flex-direction: row; |
|||
display: flex; |
|||
justify-content: start; |
|||
align-items: center; |
|||
box-shadow: 0rpx 0rpx 16rpx #ccc; |
|||
} |
|||
|
|||
.logo { |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
padding: 30rpx; |
|||
} |
|||
|
|||
.userName { |
|||
font-size: 36rpx; |
|||
font-weight: 600; |
|||
} |
|||
|
|||
.list { |
|||
color: #6C6C6C; |
|||
background: #fff; |
|||
padding: 20rpx 30rpx; |
|||
box-sizing: border-box; |
|||
width: 100%; |
|||
margin: 40rpx auto; |
|||
border-radius: 10rpx; |
|||
box-shadow: 0rpx 0rpx 16rpx #ccc; |
|||
} |
|||
|
|||
.content { |
|||
width: 100%; |
|||
overflow: hidden; |
|||
margin: 30rpx auto; |
|||
} |
|||
|
|||
.title { |
|||
float: left; |
|||
} |
|||
|
|||
.value { |
|||
float: left; |
|||
text-align: justify; |
|||
width: 400rpx; |
|||
word-break: break-word; |
|||
} |
|||
|
|||
.pic { |
|||
float: left; |
|||
position: relative; |
|||
margin-right: 8px; |
|||
margin-bottom: 8px; |
|||
} |
|||
|
|||
.showImg { |
|||
width: 160rpx; |
|||
height: 160rpx; |
|||
} |
Loading…
Reference in new issue