This commit is contained in:
shilixia 2020-04-20 12:41:42 +08:00
parent d69c974eac
commit 0394028e34
3 changed files with 24 additions and 8 deletions

4
app.js
View File

@ -97,8 +97,8 @@ App({
perms:[],
openid:null
},
//serverUrl: 'https://safeyun.ctcshe.com/',
serverUrl: 'http://127.0.0.1:8000/',
serverUrl: 'https://safeyun.ctcshe.com/',
// serverUrl: 'http://127.0.0.1:8000/',
//serverUrl: 'http://10.21.28.148:8000/',
//serverUrl: 'http://192.168.0.103:8000/',
//serverUrl:'http://10.0.11.195:8000/',

View File

@ -90,13 +90,18 @@ Page({
if (res.statusCode === 200) {
var yhdata = res.data
//格式化隐患信息
if(yhdata.yhtp!=null)
{
for (var i = 0; i < yhdata.yhtp.length; i++) {
yhdata.yhtp[i] = this.data.serverUrl + yhdata.yhtp[i];
}
}
if(yhdata.yhtp!=null)
{
for (var i = 0; i < yhdata.zghtp.length; i++) {
yhdata.zghtp[i] = this.data.serverUrl + yhdata.zghtp[i];
}
}
this.setData(yhdata)
}
}

View File

@ -87,17 +87,22 @@ Page({
filePath: that.data.yhtp1[x],
name: 'upfile',
success(res) {
var obj = JSON.parse(res.data);
that.data.yhtp1[x] = obj['filepath']
x = x + 1
if(x<y){
that.upimg(x, y)
}
else {
that.upimgs(0,that.data.zghtp1.length)
}
}
})
}
else {
that.upimgs(0,that.data.zghtp1.length)
}
},
deleteImages: function (e) {
var that = this;
@ -143,6 +148,7 @@ Page({
//上传图片
upimgs:function(x,y){
var that=this
console.log(y)
if(x<y){
wx.uploadFile({
@ -157,14 +163,20 @@ Page({
var obj = JSON.parse(res.data);
that.data.zghtp1[x] = obj['filepath']
x = x + 1
if(x<y){
that.upimgs(x, y)
}
else {
that.addjob()
}
}
})
}
else {
that.addjob()
}
},
submit: function () {
@ -174,9 +186,8 @@ Page({
else {
this.upimg(0, this.data.yhtp1.length)
this.upimgs(0, this.data.zghtp1.length)
this.addjob()
}
},
Tap1: function (x) {