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 | 166 | // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 |
167 | 167 | var tempFilePaths = res.tempFilePaths; |
168 | 168 | |
169 | - e.uploadFile("/api/weshop/comment/uploadCommentImg", { | |
169 | + getApp().request.uploadFile("/api/weshop/comment/uploadCommentImg", { | |
170 | 170 | filePath: tempFilePaths[0], |
171 | 171 | name: "file", |
172 | 172 | success: function (e) { |
173 | 173 | if(e.data.code==0) { |
174 | - s.data.uploadPath.push(e.data.data); | |
174 | + that.data.uploadPath.push(e.data.data); | |
175 | 175 | imgs.push(tempFilePaths[0]); |
176 | 176 | that.setData({ |
177 | 177 | imgs: imgs | ... | ... |
pages/user/add_comment/add_comment.wxml