var Constant = require('../../utils/constant.js');
|
var app = getApp();
|
import Request from "../../utils/api"
|
Page({
|
data: {
|
//报修图片
|
imagesList: [],
|
currentUserID: 1,
|
currentCorpID: 1,
|
currentEmployeeID: 1, //当前用户ID
|
RequestEntity: {}
|
},
|
//查看图片
|
previewImage: function (e) {
|
var that = this;
|
var imagesList = [];
|
var current = e.target.dataset.src.OriginPath;
|
var images = that.data.imagesList;
|
for (var i = 0; i < images.length; i++) {
|
imagesList.push(images[i].OriginPath)
|
}
|
// console.log(current, imagesList, "bigPicture:大图", "smallPicture:小图")
|
wx.previewImage({
|
current: current,
|
urls: imagesList
|
})
|
},
|
onLoad: function (options) {
|
//console.log(options.id)
|
if (options.id == '' || options.id == undefined)
|
return;
|
var requestformid = options.id;
|
var that = this;
|
|
var userInfo = app.globalData.userInfo;
|
if (userInfo) {
|
this.setData({
|
currentCorpID: userInfo.CorpID,
|
currentEmployeeID: userInfo.EmployeeID
|
});
|
}
|
|
|
Request({
|
url: Constant.BASE_SERVER_URL + "Repair/RepairRequestForm/Mobile/GetMyPendingDetailByID@V1.0",
|
method: 'GET',
|
data: {
|
CorpID: userInfo.CorpID,
|
ID: requestformid
|
},
|
header: {
|
'content-type': 'application/json'
|
},
|
fail: function (err) {
|
// wx.showModal({
|
// title: '',
|
// content: '通讯失败',
|
// })
|
}, //请求失败
|
success: function (res) {
|
// console.log(res.data.Data)
|
var result = res.data;
|
if (result.Code != 0) {
|
wx.showModal({
|
title: '',
|
content: result.Message,
|
});
|
return;
|
}
|
var RequestEntity = result.Data;
|
var imagesList = [];
|
if (RequestEntity.FileList != null && RequestEntity.FileList.length > 0) {
|
for (var i = 0; i < RequestEntity.FileList.length; i++) {
|
var big_image_name = Constant.BASE_SERVER_URL + RequestEntity.FileList[i].StorageUrl;
|
|
var m = {};
|
m.OriginPath = big_image_name;
|
m.ThumbPath = big_image_name;
|
imagesList.push(m);
|
}
|
}
|
//console.log(imagesList)
|
that.setData({
|
RequestEntity: RequestEntity,
|
imagesList: imagesList
|
})
|
}
|
});
|
},
|
|
onReady: function () {},
|
onShow: function () {},
|
onHide: function () {},
|
onUnload: function () {},
|
onPullDownRefresh: function () {},
|
onReachBottom: function () {},
|
onShareAppMessage: function () {
|
return Constant.Share;
|
},
|
})
|