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

2
weapp/pages/index/index.wxml

@ -10,7 +10,7 @@
<view style="margin-top: 140rpx;"> <view style="margin-top: 140rpx;">
<block wx:for="{{dataList}}" wx:key='*this'> <block wx:for="{{dataList}}" wx:key='*this'>
<view style="padding-bottom: 60rpx;"> <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 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 class="box">
<view style="font-weight:bold;font-size:32rpx;">{{item.name}}</view> <view style="font-weight:bold;font-size:32rpx;">{{item.name}}</view>

Loading…
Cancel
Save