{"id":31576,"date":"2024-11-25T17:20:37","date_gmt":"2024-11-25T09:20:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31576\/"},"modified":"2024-11-25T17:20:37","modified_gmt":"2024-11-25T09:20:37","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e4%b8%ad%e6%80%8e%e6%a0%b7%e5%ae%9e%e7%8e%b0%e5%9b%be%e7%89%87%e4%b8%8a%e4%bc%a0","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31576\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u600e\u6837\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20"},"content":{"rendered":"<p style=\"padding: 0px;margin-top: 0px;margin-bottom: 16px;font-size: 20px;line-height: 26px;text-align: justify;font-family:\"><span style=\"font-size: 14px\">\u8001\u89c4\u77e9\uff0c\u76f4\u63a5\u4e0a\u4ee3\u7801\u4e86\u3002<\/span><\/p>\n<pre>&lt;span style=\"font-size: 14px;\"&gt;handleCancelPic() { &nbsp; &nbsp; &nbsp; &nbsp;let id = this.data.dbId;&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp;wx.chooseImage({&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;count: 3, \/\/ \u9ed8\u8ba49&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeType: ['compressed'], \/\/ \u53ef\u4ee5\u6307\u5b9a\u662f\u539f\u56fe\u8fd8\u662f\u538b\u7f29\u56fe\uff0c\u9ed8\u8ba4\u4e8c\u8005\u90fd\u6709 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sourceType: ['album', 'camera'], \/\/ \u53ef\u4ee5\u6307\u5b9a\u6765\u6e90\u662f\u76f8\u518c\u8fd8\u662f\u76f8\u673a\uff0c\u9ed8\u8ba4\u4e8c\u8005\u90fd\u6709&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;success: res =&amp;gt; {&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \u8fd4\u56de\u9009\u5b9a\u7167\u7247\u7684\u672c\u5730\u6587\u4ef6\u8def\u5f84\u5217\u8868\uff0ctempFilePath\u53ef\u4ee5\u4f5c\u4e3aimg\u6807\u7b7e\u7684src\u5c5e\u6027\u663e\u793a\u56fe\u7247&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var tempFilePaths = res.tempFilePaths;&lt;br&gt;&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.setData({&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;src: tempFilePaths&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;})&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;upload(this,tempFilePaths,'','');&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp;})&lt;br&gt; &nbsp; &nbsp;}&lt;br&gt;\u7136\u540e\u4e00\u4e2a\u5c01\u88c5\u597d\u7684\u65b9\u6cd5function upload(page, path,way,id) {&lt;br&gt; &nbsp; &nbsp;console.log(path)&lt;br&gt; &nbsp;wx.showToast({&lt;br&gt; &nbsp; &nbsp;icon: \"loading\",&lt;br&gt; &nbsp; &nbsp;title: \"\u6b63\u5728\u4e0a\u4f20\"&lt;br&gt; &nbsp;});&lt;br&gt; &nbsp;var test = [],&lt;br&gt; &nbsp; &nbsp;that = this; &nbsp;for (var i = 0; i&lt;path.length i&gt;&lt;\/path.length&gt; &nbsp; &nbsp; &nbsp; &nbsp;wx.uploadFile({&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;url: api.CancelImg,&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;filePath: path[i], &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name: 'file',&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;header: { \"Content-Type\": \"multipart\/form-data\" },&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;success: res =&amp;gt; {&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;test.push(res);&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wx.setStorageSync('cancelImg',test)&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;console.log(test) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (res.statusCode != 200) { &lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wx.showModal({&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title: '\u63d0\u793a',&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;content: '\u4e0a\u4f20\u5931\u8d25',&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;showCancel: false&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return;&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}else {&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wx.showModal({&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title: '\u63d0\u793a',&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;content: '\u4e0a\u4f20\u6210\u529f',&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;showCancel: false&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}) &lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fail: function (e) {&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;console.log(e);&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wx.showModal({&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;title: '\u63d0\u793a',&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;content: '\u4e0a\u4f20\u5931\u8d25',&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;showCancel: false&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;})&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;complete: function () {&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wx.hideToast(); &nbsp;\/\/\u9690\u85cfToast&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp;})&lt;br&gt; &nbsp; &nbsp;}&lt;br&gt;&lt;\/span&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><span style=\"font-size: 14px\">\u8fd9\u4e2a\u662f\u591a\u4e2a\u56fe\u7247\u4e0a\u4f20\u7684\u65b9\u6cd5\uff0c\u5355\u4e2a\u56fe\u7247\u4e0a\u4f20\u7684\u8bdd\uff0c\u628a\u5faa\u73af\u53bb\u6389\u5c31\u597d\u3002\u4e3b\u8981\u662f\u56e0\u4e3a\u5fae\u4fe1\u5b98\u65b9\u9ed8\u8ba4\u7684\u5c31\u662f\u4e00\u6b21\u4e0a\u4f20\u4e00\u5f20\u56fe\u7247\u8fd9\u4e2a\u5f88\u86cb\u75bc\u3002\u53ea\u80fd\u8fd9\u4e48\u641e\u4e86\u3002\u3002\u3002<br \/><\/span><\/p>\n<p><span style=\"font-size: 14px\">\u76f8\u4fe1\u770b\u4e86\u672c\u6587\u6848\u4f8b\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86\u65b9\u6cd5\uff0c\u66f4\u591a\u7cbe\u5f69\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/span><\/p>\n<p><span style=\"font-size: 14px\">\u63a8\u8350\u9605\u8bfb\uff1a<\/span><\/p>\n<p><\/p>\n<p><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u600e\u6837\u5b9e\u73b0\u56fe\u7247\u4e0a\u4f20\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8001\u89c4\u77e9\uff0c\u76f4\u63a5\u4e0a\u4ee3\u7801\u4e86\u3002 &lt;span style=&#8221;font-size: 14px;&#8221;&gt;handleCancelPic() { &nbsp; &nbsp; &nbsp; &nbsp;let id = this.data.dbId;&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp;wx.chooseImage({&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;count: 3, \/\/ \u9ed8\u8ba49&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeType: [&#8216;compressed&#8217;], \/\/ \u53ef\u4ee5\u6307\u5b9a\u662f\u539f\u56fe\u8fd8\u662f\u538b\u7f29\u56fe\uff0c\u9ed8\u8ba4\u4e8c\u8005\u90fd\u6709 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sourceType: [&#8216;album&#8217;, &#8216;camera&#8217;], \/\/ \u53ef\u4ee5\u6307\u5b9a\u6765\u6e90\u662f\u76f8\u518c\u8fd8\u662f\u76f8\u673a\uff0c\u9ed8\u8ba4\u4e8c\u8005\u90fd\u6709&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;success: res =&amp;gt; {&lt;br&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-31576","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=31576"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31576\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}