Commit b0d2ed7bf060376eb717dec34091fe139edeed78
1 parent
9578af1a
上传图片再选择后就上传
Showing
3 changed files
with
3 additions
and
5 deletions
pages/user/add_comment/add_comment.js
| @@ -166,12 +166,12 @@ Page({ | @@ -166,12 +166,12 @@ Page({ | ||
| 166 | // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 | 166 | // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 | 
| 167 | var tempFilePaths = res.tempFilePaths; | 167 | var tempFilePaths = res.tempFilePaths; | 
| 168 | 168 | ||
| 169 | - e.uploadFile("/api/weshop/comment/uploadCommentImg", { | 169 | + getApp().request.uploadFile("/api/weshop/comment/uploadCommentImg", { | 
| 170 | filePath: tempFilePaths[0], | 170 | filePath: tempFilePaths[0], | 
| 171 | name: "file", | 171 | name: "file", | 
| 172 | success: function (e) { | 172 | success: function (e) { | 
| 173 | if(e.data.code==0) { | 173 | if(e.data.code==0) { | 
| 174 | - s.data.uploadPath.push(e.data.data); | 174 | + that.data.uploadPath.push(e.data.data); | 
| 175 | imgs.push(tempFilePaths[0]); | 175 | imgs.push(tempFilePaths[0]); | 
| 176 | that.setData({ | 176 | that.setData({ | 
| 177 | imgs: imgs | 177 | imgs: imgs | 
pages/user/add_comment/add_comment.wxml
pages/user/add_comment/add_comment.wxss
