Browse Source

(*)巡检计划数据解码问题修改

master
Archer_cdm 2 years ago
parent
commit
a3b758fe2e
  1. 4
      weapp/package/polling/polling.js
  2. 5
      weapp/package/startInspection/startInspection.js
  3. 2
      weapp/pages/index/index.wxml

4
weapp/package/polling/polling.js

@ -30,9 +30,9 @@ Page({
// 开始巡检
bindStart(e) {
let data = e.currentTarget.dataset.item;
let data = JSON.stringify(e.currentTarget.dataset.item);
wx.navigateTo({
url: '/package/startInspection/startInspection?data=' + JSON.stringify(data),
url: '/package/startInspection/startInspection?data=' + encodeURIComponent(data),
})
},

5
weapp/package/startInspection/startInspection.js

@ -277,11 +277,9 @@ Page({
title: '加载中'
})
Request.get(getPatrolRecord(dataList.id, 'null', 'null', 'null', pointId)).then(res => {
console.log(res);
dataList.points.map(e => {
res.map(i => {
wx.hideLoading();
console.log(i, '------');
if (i == null) {
e.lastInspectionTime = moment().format('YYYY-MM-DD');
e.inspectionTime = moment().format('YYYY-MM-DD');
@ -360,8 +358,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options, '-------');
let that = this;
let data = JSON.parse(options.data);
let data = JSON.parse(decodeURIComponent(options.data));
let points = data.points.map(e => {
return e.name
}).join('、')

2
weapp/pages/index/index.wxml

@ -10,7 +10,7 @@
<view style="margin-top: 140rpx;">
<block wx:for="{{dataList}}" wx:key='*this'>
<view style="padding-bottom: 60rpx;">
<image wx:if="{{item.img != null || item.img.length > 0}}" style="width: 100%;height: 372rpx;display: block;" src="{{imgUrl + item.img[0]}}"></image>
<image wx:if="{{item.img != null && item.img.length > 0}}" style="width: 100%;height: 372rpx;display: block;" src="{{imgUrl + item.img[0]}}"></image>
<view wx:if="{{item.img == null || item.img.length == 0}}" style="width: 100%;height: 372rpx;line-height: 372rpx;text-align: center;background: #fff;border-bottom: 2rpx solid #ccc;">暂无图片</view>
<view class="box">
<view style="font-weight:bold;font-size:32rpx;">{{item.name}}</view>

Loading…
Cancel
Save