wx
.uploadFile
({
url
:
'http://192.168.3.12:19080/staticData/api/v1/cloud/mgr/uploadFile'
,
// url: 'http://192.168.3.253:8001/api/v1/cloud/mgr/uploadFile',
filePath
: tempFilePaths
[
0
],
name
:
'file'
,
formData
:
{
'user'
:
'test'
,
cloudType
:
3
,
//int Y 云服务商类型,1-七牛云,2-QQ云,3-阿里云,4-AWS S3
resType
:
1
,
//int Y 云上传类型,1-图片,2-视频,3-数据文件,4-其他
key
:
'crm/partner/'
+ timeMark
+ imgType
,
//String Y 云存储的key
file
: tempFilePaths
[
0
]
//File Y 上传的文件
},
header
:
{
'content-type'
:
'application/x-www-form-urlencoded'
},
// {"error_info": "http://ddp-imgsoss-cn-hangzhou.aliyuncs.com/crm/partner/39035115.jpg", "error_code": 0 }
method
:
'post'
,
success
:
function
(ress
)
{
var data
= JSON
.parse
(ress
.data
).error_info
;
var url
=
'http://ddp-imgs.oss-cn-hangzhou.aliyuncs.com:80'
+ data
.substring
(data
.lastIndexOf
(
"/crm"
), data
.length
);
var urlImg
=
'markImgUrl['
+ index
+
']'
;
console
.log
(url
);
//do something
that
.setData
({
[urlImg
]: url
})
console
.log
(that
.data
.markImgUrl
);
}, fail
:
function
(err
)
{
console
.log
(err
)
}
})