Commit b41ec423 by 梁建民

格式化

parent c3026ab2
Showing with 8 additions and 5 deletions
......@@ -74,17 +74,20 @@ const getData = (url, type, param, callBack, loading, isheader) => {
};
//上传文件
const uploadFile = (url,paths,callBack) => {
const uploadFile = (url, paths, callBack) => {
wx.showLoading({
title: '上传中',
mask:true
mask: true
})
for (var i = 0; i < paths.length; i++) {
wx.uploadFile({
url: url,
filePath: paths[i],
name: 'upload',
formData: { token: wx.getStorageSync('access_token'), source: 2},
formData: {
token: wx.getStorageSync('access_token'),
source: 2
},
header: {
"Content-Type": "multipart/form-data"
},
......@@ -120,13 +123,13 @@ const uploadFile = (url,paths,callBack) => {
}
};
const chooseImg = (url,num, callback) => {
const chooseImg = (url, num, callback) => {
wx.chooseImage({
count: num,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
uploadFile(url,res.tempFilePaths, (rtn) => {
uploadFile(url, res.tempFilePaths, (rtn) => {
callback(rtn)
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment