{"id":185378,"date":"2023-06-08T15:57:48","date_gmt":"2023-06-08T07:57:48","guid":{"rendered":"http:\/\/www.idc.net\/help\/185378\/"},"modified":"2023-06-08T15:57:48","modified_gmt":"2023-06-08T07:57:48","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%95%99%e7%a8%8b%ef%bc%9a%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f-%e7%94%a8%e6%88%b7%e4%bf%a1%e6%81%af%c2%b7%e6%8e%88%e6%9d%83","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/185378\/","title":{"rendered":"\u540e\u6d6a\u4e91\u5c0f\u7a0b\u5e8f\u6559\u7a0b\uff1a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f \u7528\u6237\u4fe1\u606f\u00b7\u6388\u6743"},"content":{"rendered":"<h2>\u6388\u6743<\/h2>\n<p>\u90e8\u5206\u63a5\u53e3\u9700\u8981\u7ecf\u8fc7\u7528\u6237\u6388\u6743\u540c\u610f\u624d\u80fd\u8c03\u7528\u3002\u6211\u4eec\u628a\u8fd9\u4e9b\u63a5\u53e3\u6309\u4f7f\u7528\u8303\u56f4\u5206\u6210\u591a\u4e2a&nbsp;scope&nbsp;\uff0c\u7528\u6237\u9009\u62e9\u5bf9&nbsp;scope&nbsp;\u6765\u8fdb\u884c\u6388\u6743\uff0c\u5f53\u6388\u6743\u7ed9\u4e00\u4e2a&nbsp;scope&nbsp;\u4e4b\u540e\uff0c\u5176\u5bf9\u5e94\u7684\u6240\u6709\u63a5\u53e3\u90fd\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u3002<\/p>\n<p>\u6b64\u7c7b\u63a5\u53e3\u8c03\u7528\u65f6\uff1a<\/p>\n<ul>\n<li>\u5982\u679c\u7528\u6237\u672a\u63a5\u53d7\u6216\u62d2\u7edd\u8fc7\u6b64\u6743\u9650\uff0c\u4f1a\u5f39\u7a97\u8be2\u95ee\u7528\u6237\uff0c\u7528\u6237\u70b9\u51fb\u540c\u610f\u540e\u65b9\u53ef\u8c03\u7528\u63a5\u53e3\uff1b<\/li>\n<li>\u5982\u679c\u7528\u6237\u5df2\u6388\u6743\uff0c\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u63a5\u53e3\uff1b<\/li>\n<li>\u5982\u679c\u7528\u6237\u5df2\u62d2\u7edd\u6388\u6743\uff0c\u5219\u4e0d\u4f1a\u51fa\u73b0\u5f39\u7a97\uff0c\u800c\u662f\u76f4\u63a5\u8fdb\u5165\u63a5\u53e3 fail \u56de\u8c03\u3002\u8bf7\u5f00\u53d1\u8005\u517c\u5bb9\u7528\u6237\u62d2\u7edd\u6388\u6743\u7684\u573a\u666f\u3002<\/li>\n<\/ul>\n<h3>\u83b7\u53d6\u7528\u6237\u6388\u6743\u8bbe\u7f6e<\/h3>\n<p>\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528&nbsp;wx.getSetting&nbsp;\u83b7\u53d6\u7528\u6237\u5f53\u524d\u7684\u6388\u6743\u72b6\u6001\u3002<\/p>\n<h3>\u6253\u5f00\u8bbe\u7f6e\u754c\u9762<\/h3>\n<p>\u7528\u6237\u53ef\u4ee5\u5728\u5c0f\u7a0b\u5e8f\u8bbe\u7f6e\u754c\u9762\uff08\u300c\u53f3\u4e0a\u89d2\u300d - \u300c\u5173\u4e8e\u300d - \u300c\u53f3\u4e0a\u89d2\u300d - \u300c\u8bbe\u7f6e\u300d\uff09\u4e2d\u63a7\u5236\u5bf9\u8be5\u5c0f\u7a0b\u5e8f\u7684\u6388\u6743\u72b6\u6001\u3002<\/p>\n<p>\u5f00\u53d1\u8005\u53ef\u4ee5\u8c03\u7528&nbsp;wx.openSetting&nbsp;\u6253\u5f00\u8bbe\u7f6e\u754c\u9762\uff0c\u5f15\u5bfc\u7528\u6237\u5f00\u542f\u6388\u6743\u3002<\/p>\n<h3>\u63d0\u524d\u53d1\u8d77\u6388\u6743\u8bf7\u6c42<\/h3>\n<p>\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528&nbsp;wx.authorize&nbsp;\u5728\u8c03\u7528\u9700\u6388\u6743 API \u4e4b\u524d\uff0c\u63d0\u524d\u5411\u7528\u6237\u53d1\u8d77\u6388\u6743\u8bf7\u6c42\u3002<\/p>\n<h3>scope \u5217\u8868<\/h3>\n<table>\n<thead>\n<tr>\n<th>scope<\/th>\n<th>\u5bf9\u5e94\u63a5\u53e3<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>scope.userInfo<\/td>\n<td>wx.getUserInfo<\/td>\n<td>\u7528\u6237\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>scope.userLocation<\/td>\n<td>wx.getLocation,&nbsp;wx.chooseLocation<\/td>\n<td>\u5730\u7406\u4f4d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>scope.userLocationBackground<\/td>\n<td>wx.startLocationUpdateBackground<\/td>\n<td>\u540e\u53f0\u5b9a\u4f4d<\/td>\n<\/tr>\n<tr>\n<td>scope.address<\/td>\n<td>wx.chooseAddress<\/td>\n<td>\u901a\u8baf\u5730\u5740<\/td>\n<\/tr>\n<tr>\n<td>scope.invoiceTitle<\/td>\n<td>wx.chooseInvoiceTitle<\/td>\n<td>\u53d1\u7968\u62ac\u5934<\/td>\n<\/tr>\n<tr>\n<td>scope.invoice<\/td>\n<td>wx.chooseInvoice<\/td>\n<td>\u83b7\u53d6\u53d1\u7968<\/td>\n<\/tr>\n<tr>\n<td>scope.werun<\/td>\n<td>wx.getWeRunData<\/td>\n<td>\u5fae\u4fe1\u8fd0\u52a8\u6b65\u6570<\/td>\n<\/tr>\n<tr>\n<td>scope.record<\/td>\n<td>wx.startRecord<\/td>\n<td>\u5f55\u97f3\u529f\u80fd<\/td>\n<\/tr>\n<tr>\n<td>scope.writePhotosAlbum<\/td>\n<td>wx.saveImageToPhotosAlbum,&nbsp;wx.saveVideoToPhotosAlbum<\/td>\n<td>\u4fdd\u5b58\u5230\u76f8\u518c<\/td>\n<\/tr>\n<tr>\n<td>scope.camera<\/td>\n<td>camera&nbsp;\u7ec4\u4ef6<\/td>\n<td>\u6444\u50cf\u5934<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u6388\u6743\u6709\u6548\u671f<\/h3>\n<p>\u4e00\u65e6\u7528\u6237\u660e\u786e\u540c\u610f\u6216\u62d2\u7edd\u8fc7\u6388\u6743\uff0c\u5176\u6388\u6743\u5173\u7cfb\u4f1a\u8bb0\u5f55\u5728\u540e\u53f0\uff0c\u76f4\u5230\u7528\u6237\u4e3b\u52a8\u5220\u9664\u5c0f\u7a0b\u5e8f\u3002<\/p>\n<h3>\u6700\u4f73\u5b9e\u8df5<\/h3>\n<p>\u5728\u771f\u6b63\u9700\u8981\u4f7f\u7528\u6388\u6743\u63a5\u53e3\u65f6\uff0c\u624d\u5411\u7528\u6237\u53d1\u8d77\u6388\u6743\u7533\u8bf7\uff0c\u5e76\u5728\u6388\u6743\u7533\u8bf7\u4e2d\u8bf4\u660e\u6e05\u695a\u8981\u4f7f\u7528\u8be5\u529f\u80fd\u7684\u7406\u7531\u3002<\/p>\n<h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ol>\n<li>wx.authorize({scope: \"scope.userInfo\"})\uff0c\u4e0d\u4f1a\u5f39\u51fa\u6388\u6743\u7a97\u53e3\uff0c\u8bf7\u4f7f\u7528&nbsp;&lt;button open-type=\"getUserInfo\"\/&gt;<\/li>\n<li>\u9700\u8981\u6388\u6743&nbsp;scope.userLocation\u3001scope.userLocationBackground&nbsp;\u65f6\u5fc5\u987b\u914d\u7f6e\u5730\u7406\u4f4d\u7f6e\u7528\u9014\u8bf4\u660e\u3002<\/li>\n<\/ol>\n<h3>\u540e\u53f0\u5b9a\u4f4d<\/h3>\n<p>\u4e0e\u5176\u5b83\u7c7b\u578b\u6388\u6743\u4e0d\u540c\u7684\u662f\uff0cscope.userLocationBackground \u4e0d\u4f1a\u5f39\u7a97\u63d0\u9192\u7528\u6237\u3002\u9700\u8981\u7528\u6237\u5728\u8bbe\u7f6e\u9875\u4e2d\uff0c\u4e3b\u52a8\u5c06\u201c\u4f4d\u7f6e\u4fe1\u606f\u201d\u9009\u9879\u8bbe\u7f6e\u4e3a\u201c\u4f7f\u7528\u5c0f\u7a0b\u5e8f\u671f\u95f4\u548c\u79bb\u5f00\u5c0f\u7a0b\u5e8f\u540e\u201d\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u8c03\u7528wx.openSetting\uff0c\u6253\u5f00\u8bbe\u7f6e\u9875\u3002<\/p>\n<\/p>\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6388\u6743 \u90e8\u5206\u63a5\u53e3\u9700\u8981\u7ecf\u8fc7\u7528\u6237\u6388\u6743\u540c\u610f\u624d\u80fd\u8c03\u7528\u3002\u6211\u4eec\u628a\u8fd9\u4e9b\u63a5\u53e3\u6309\u4f7f\u7528\u8303\u56f4\u5206\u6210\u591a\u4e2a&nbsp;scope&nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":185379,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182398],"tags":[],"class_list":["post-185378","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mini-program"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/185378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=185378"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/185378\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/185379"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=185378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=185378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=185378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}