|
...
|
...
|
@@ -20,6 +20,7 @@ Page({ |
|
|
|
time:'',
|
|
|
|
image:'',
|
|
|
|
},
|
|
|
|
defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
|
|
|
|
tpl:{},
|
|
|
|
},
|
|
|
|
|
|
...
|
...
|
@@ -158,7 +159,7 @@ Page({ |
|
|
|
},
|
|
|
|
submit(){
|
|
|
|
if(!this.checkHasSubmit()){
|
|
|
|
return util.toast('请完善信息',none)
|
|
|
|
return util.toast('请等待图片上传完成','none')
|
|
|
|
}
|
|
|
|
let opt=this.data.options
|
|
|
|
let param={
|
|
...
|
...
|
@@ -182,4 +183,38 @@ Page({ |
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
chooseImage(){
|
|
|
|
wx.chooseImage({
|
|
|
|
count:1,
|
|
|
|
sizeType:'compressed',
|
|
|
|
sourceType:'album',
|
|
|
|
success:res=>{
|
|
|
|
const tempFilePaths = res.tempFilePaths[0]
|
|
|
|
this.setData({
|
|
|
|
defImage:tempFilePaths,
|
|
|
|
})
|
|
|
|
wx.uploadFile({
|
|
|
|
url:util.cgi('App.Examples_Upload.UploadQn'),
|
|
|
|
filePath:tempFilePaths,
|
|
|
|
name:'file',
|
|
|
|
success:upres=>{
|
|
|
|
try{
|
|
|
|
upres=JSON.parse(upres.data)
|
|
|
|
console.log('upres',upres)
|
|
|
|
if(upres.ret==200){
|
|
|
|
util.toast('图片上传完成','none')
|
|
|
|
this.setData({
|
|
|
|
[`form.image`]:upres.data,
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
util.toast(upres.msg||'上传出错','none')
|
|
|
|
}
|
|
|
|
}catch (e){
|
|
|
|
util.toast('上传出错','none')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|