Skip to content

Commit

Permalink
Merge pull request #37 from ZheminZhang/master
Browse files Browse the repository at this point in the history
拉取
  • Loading branch information
shanzhiq authored Aug 4, 2019
2 parents 93a6068 + 4e05eba commit 8eda37a
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 181 deletions.
61 changes: 33 additions & 28 deletions pages/BillInfo/Billinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,38 +139,43 @@ Page({
"&itemId=" +
that.data.itemId;
var tempPath = [];

wx.showLoading({
title: "请稍等..."
});
that.download(url_, 0, tempPath);
},
download(url, index, tempPath) {
var that = this;
if (index < 9) {
wx.downloadFile({
url: url + "&index=" + index,
success: function(res) {
console.log(index, "------", res);
if (res.statusCode == 666) {
that.setData({
imageSrc: tempPath
});
console.log(tempPath);
var urlTemp =
"../BillImage/BillImage" +
"?filePath=" +
JSON.stringify(tempPath);
wx.navigateTo({
url: urlTemp
});
} else {
tempPath.push(res.tempFilePath);
console.log(index);
that.download(url, index + 1, tempPath);
}
},
fail: function(res) {
console.log("********", res);

wx.downloadFile({
url: url + "&index=" + index,
success: function(res) {
console.log(index, "------", res);
if (res.statusCode == 200) {
tempPath.push(res.tempFilePath);
console.log(index);
that.download(url, index + 1, tempPath);
} else {
wx.hideLoading();
that.setData({
imageSrc: tempPath
});
console.log(tempPath);
var urlTemp =
"../BillImage/BillImage" + "?filePath=" + JSON.stringify(tempPath);
wx.navigateTo({
url: urlTemp
});
}
});
}
},
fail: function(res) {
wx.hideLoading();
wx.showToast({
title: "附件下载失败",
icon: "none"
});
console.log("********", res);
}
});
}
});
2 changes: 1 addition & 1 deletion pages/Sign/Sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Page({
//tp是决定是拒绝同意的标志
toDetail: function(e) {
wx.showLoading({
title: "请稍后...",
title: "请稍等...",
mask: true
});
setTimeout(() => {
Expand Down
66 changes: 33 additions & 33 deletions pages/SignBill/SignBill.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,44 +71,44 @@ Page({
that.data.party;
var tempPath = [];
wx.showLoading({
title: "请稍等"
title: "请稍等..."
});
setTimeout(function() {
wx.hideLoading();
}, 2000);
that.download(url_, 0, tempPath);
},
download(url, index, tempPath) {
var that = this;
if (index < 9) {
wx.downloadFile({
url: url + "&index=" + index,
success: function(res) {
console.log(url);
console.log(index, "------", res);
if (res.statusCode == 666) {
that.setData({
imageSrc: tempPath
});
console.log(tempPath);
var urlTemp =
"../BillImage/BillImage" +
"?filePath=" +
JSON.stringify(tempPath);
wx.navigateTo({
url: urlTemp
});
} else {
tempPath.push(res.tempFilePath);
console.log(index);
that.download(url, index + 1, tempPath);
}
},
fail: function(res) {
console.log("********", res);

wx.downloadFile({
url: url + "&index=" + index,
success: function(res) {
console.log(url);
console.log(index, "------", res);
if (res.statusCode == 200) {
tempPath.push(res.tempFilePath);
console.log(index);
that.download(url, index + 1, tempPath);
} else {
wx.hideLoading();
that.setData({
imageSrc: tempPath
});
console.log(tempPath);
var urlTemp =
"../BillImage/BillImage" + "?filePath=" + JSON.stringify(tempPath);
wx.navigateTo({
url: urlTemp
});
}
});
}
},
fail: function(res) {
wx.hideLoading();
wx.showToast({
title: "附件下载失败",
icon: "none"
});
console.log("********", res);
}
});
},
/* 加载页面 */
onLoad: function(options) {
Expand Down Expand Up @@ -157,7 +157,7 @@ Page({
t2 = "拒签";
}
wx.showLoading({
title: "请稍后...",
title: "请稍等...",
mask: true
});
wx.request({
Expand Down
36 changes: 16 additions & 20 deletions pages/apply/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ Page({
end: "2100-06-01",
name: "",
new: false,
radioItems: [
{ name: '是'},
{ name: '否', checked: 1 }
]
radioItems: [{ name: "是" }, { name: "否", checked: 1 }]
},
radioChange(e) {
const checked = e.detail.value
const changed = {}
const checked = e.detail.value;
const changed = {};
for (let i = 0; i < this.data.radioItems.length; i++) {
if (checked.indexOf(this.data.radioItems[i].name) !== -1) {
changed['radioItems[' + i + '].checked'] = 1;
changed["radioItems[" + i + "].checked"] = 1;
} else {
changed['radioItems[' + i + '].checked'] = 0;
changed["radioItems[" + i + "].checked"] = 0;
}
}
this.setData(changed);
Expand All @@ -47,13 +44,13 @@ Page({
date = util.formatToDate(date) / 1000 + 14400;
var that = this;
if (this.data.radioItems[0].checked)
var attachment=this.data.radioItems[0].checked;
else{
attachment=0;
var attachment = this.data.radioItems[0].checked;
else {
attachment = 0;
}
console.log(attachment);
wx.showLoading({
title: "请稍后...",
title: "请稍等...",
mask: true
});
wx.request({
Expand All @@ -66,7 +63,7 @@ Page({
recordStartTime: recordST,
recordEndTime: recordET,
timeStamp: date,
attachment:attachment,
attachment: attachment
},
method: "POST",
success: function(e) {
Expand Down Expand Up @@ -130,15 +127,14 @@ Page({
recordEndTime: util.formatTime(new Date(), "yyyy-MM-dd")
});
} else {
var options=wx.getStorageSync('infoQuery');
var options = wx.getStorageSync("infoQuery");
const changed = {};
if (options.attachment == 0) {
changed['radioItems[' + 1 + '].checked'] = 1;
changed['radioItems[' + 0 + '].checked'] = 0;
}
else {
changed['radioItems[' + 1 + '].checked'] = 0;
changed['radioItems[' + 0 + '].checked'] = 1;
changed["radioItems[" + 1 + "].checked"] = 1;
changed["radioItems[" + 0 + "].checked"] = 0;
} else {
changed["radioItems[" + 1 + "].checked"] = 0;
changed["radioItems[" + 0 + "].checked"] = 1;
}
this.setData({
new: false,
Expand Down
34 changes: 17 additions & 17 deletions pages/authorize/authorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ Page({
type: [],
recordId: "",
tp: "",
radioItems: [{
name: '是',
checked:0,
radioItems: [
{
name: "是",
checked: 0
},
{
name: '否',
checked:0,
name: "否",
checked: 0
}
]
},
Expand Down Expand Up @@ -88,7 +89,7 @@ Page({
attachment = 0;
}
wx.showLoading({
title: "请稍后...",
title: "请稍等...",
mask: true
});
wx.request({
Expand All @@ -106,7 +107,7 @@ Page({
recordEndTime: recordET,
tag: tag,
recordId: this.data.recordId,
attachment:attachment,
attachment: attachment
},
success: function(e) {
wx.hideLoading();
Expand Down Expand Up @@ -150,14 +151,13 @@ Page({
// 加载url中的参数,同时完成unix转普通时间
onLoad: function(option) {
const changed = {};
var options = wx.getStorageSync('infoQuery');
if(options.attachment==0){
changed['radioItems[' + 1 + '].checked'] = 1;
changed['radioItems[' + 0 + '].checked'] =0;
}
else{
changed['radioItems[' + 1 + '].checked'] = 0;
changed['radioItems[' + 0 + '].checked'] = 1;
var options = wx.getStorageSync("infoQuery");
if (options.attachment == 0) {
changed["radioItems[" + 1 + "].checked"] = 1;
changed["radioItems[" + 0 + "].checked"] = 0;
} else {
changed["radioItems[" + 1 + "].checked"] = 0;
changed["radioItems[" + 0 + "].checked"] = 1;
}
console.log(options.attachment);
this.setData({
Expand All @@ -169,8 +169,8 @@ Page({
id: options.id,
type: options.type,
recordId: options.recordId,
tp: option.tp,//记录的是申请或授权状态
tp: option.tp //记录的是申请或授权状态
});
this.setData(changed);
}
});
});
Loading

0 comments on commit 8eda37a

Please sign in to comment.