|
|
@@ -170,21 +170,26 @@ Page({
|
|
|
})
|
|
|
var today_stock_img = this.data.today_stock_img;
|
|
|
wx.chooseImage({
|
|
|
- count:1,
|
|
|
success: res=> {
|
|
|
const tempFilePaths = res.tempFilePaths
|
|
|
- wx.uploadFile({
|
|
|
- url: host+'/api/wx/uploadfile',
|
|
|
- filePath: tempFilePaths[0],
|
|
|
- name: 'file',
|
|
|
- success: res=> {
|
|
|
- const data = JSON.parse(res.data)
|
|
|
- today_stock_img.push(data.data.url)
|
|
|
- this.setData({
|
|
|
- today_stock_img: today_stock_img
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ for (let i = 0; i < tempFilePaths.length;i++){
|
|
|
+ wx.uploadFile({
|
|
|
+ url: host + '/api/wx/uploadfile',
|
|
|
+ filePath: tempFilePaths[i],
|
|
|
+ name: 'file',
|
|
|
+ header: {
|
|
|
+ 'Authorization': this.data.userInfo.token
|
|
|
+ },
|
|
|
+ success: res => {
|
|
|
+ const data = JSON.parse(res.data)
|
|
|
+ today_stock_img.push(data.data.url)
|
|
|
+ this.setData({
|
|
|
+ today_stock_img: today_stock_img
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
|