{"id":14465,"date":"2023-12-11T11:36:13","date_gmt":"2023-12-11T03:36:13","guid":{"rendered":"https:\/\/h5app.yimenapp.cn\/h5app\/?p=14465"},"modified":"2023-12-11T11:36:13","modified_gmt":"2023-12-11T03:36:13","slug":"%e7%bd%91%e9%a1%b5%e6%89%93%e5%8c%85app%e5%be%ae%e4%bf%a1h5%e6%94%af%e4%bb%98%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/h5app.yimenapp.cn\/h5app\/2023\/appkfa\/14465\/","title":{"rendered":"\u7f51\u9875\u6253\u5305app\u5fae\u4fe1h5\u652f\u4ed8\u5982\u4f55\u5b9e\u73b0?"},"content":{"rendered":"<p>\u7f51\u9875\u6253\u5305 App \u53ef\u4ee5\u8ba9\u6211\u4eec\u5c06\u7f51\u9875\u5c01\u88c5\u6210\u4e00\u4e2a app\uff0c\u5728\u624b\u673a\u4e0a\u76f4\u63a5\u8bbf\u95ee\u7f51\u9875\uff0c\u65e0\u9700\u518d\u6253\u5f00\u6d4f\u89c8\u5668\u7b49\u64cd\u4f5c\u3002\u800c\u5fae\u4fe1 H5 \u652f\u4ed8\u662f\u6307\u5728\u5fae\u4fe1\u516c\u4f17\u53f7\u6216\u5fae\u4fe1\u5185\u6253\u5f00\u7684 H5 \u7f51\u9875\uff0c\u901a\u8fc7\u5fae\u4fe1\u652f\u4ed8\u5b8c\u6210\u7684\u652f\u4ed8\u884c\u4e3a\u3002<\/p>\n<p>\u7f51\u9875\u6253\u5305 App \u5fae\u4fe1 H5 \u652f\u4ed8\u7684\u539f\u7406\u4e3a\uff1a<\/p>\n<p>1.\u5148\u5c06\u7f51\u9875\u6253\u5305\u6210 app \u7684\u5f62\u5f0f\uff0c\u5e76\u4e0a\u4f20\u81f3\u5e94\u7528\u5546\u5e97\uff0c\u7528\u6237\u4e0b\u8f7d\u5e76\u5b89\u88c5 app \u5230\u624b\u673a\u3002<\/p>\n<p>2.\u7528\u6237\u5728 app \u4e2d\u6253\u5f00\u5bf9\u5e94\u7684\u7f51\u9875\uff0c\u8fdb\u884c\u5546\u54c1\u8d2d\u4e70\u64cd\u4f5c\u3002<\/p>\n<p>3.\u5728\u652f\u4ed8\u9875\u9762\uff0c\u7528\u6237\u9009\u62e9\u5fae\u4fe1\u652f\u4ed8\uff0c\u5e76\u8f93\u5165\u76f8\u5e94\u7684\u652f\u4ed8\u4fe1\u606f\u3002<\/p>\n<p>4.\u5fae\u4fe1\u670d\u52a1\u7aef\u5c06\u652f\u4ed8\u8bf7\u6c42\u53d1\u9001\u7ed9\u7528\u6237\u5728\u5fae\u4fe1\u4e2d\u7684\u8d26\u53f7\uff0c\u7528\u6237\u786e\u8ba4\u540e\uff0c\u5fae\u4fe1\u5c06\u652f\u4ed8\u7ed3\u679c\u8fd4\u56de\u7ed9 app\u3002<\/p>\n<p>5.app \u5c06\u652f\u4ed8\u7ed3\u679c\u5c55\u793a\u7ed9\u7528\u6237\u5e76\u8bb0\u5f55\u652f\u4ed8\u4fe1\u606f\uff0c\u540c\u65f6\u5c06\u652f\u4ed8\u7ed3\u679c\u53d1\u9001\u7ed9\u670d\u52a1\u5668\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7f51\u9875\u6253\u5305 app \u5fae\u4fe1 H5 \u652f\u4ed8\u7684\u7b80\u5355\u539f\u7406\u4ecb\u7ecd\u3002<\/p>\n<p>\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u7f51\u9875\u6253\u5305 app \u5fae\u4fe1 H5 \u652f\u4ed8\u7684\u5b9e\u73b0\u8fc7\u7a0b\uff1a<\/p>\n<p>1.\u7f51\u9875\u6253\u5305 app<\/p>\n<p>\u7f51\u9875\u6253\u5305 app \u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5de5\u5177\u8fdb\u884c\u5b9e\u73b0\uff0c\u6bd4\u5982 Phonegap\uff0cCordova \u7b49\u7b49\u3002\u5176\u4e2d\uff0c\u501f\u52a9 Cordova \u5b9e\u73b0\u7f51\u9875\u6253\u5305 app \u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p>(1) \u5b89\u88c5 Cordova\u3002\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7535\u8111\u7684\u64cd\u4f5c\u7cfb\u7edf\u6765\u9009\u62e9\u5bf9\u5e94\u7684\u5de5\u5177\u5b89\u88c5\uff0c\u6bd4\u5982\u5728 Windows \u4e0a\u53ef\u4e0b\u8f7d\u5b89\u88c5 exe \u6587\u4ef6\u6765\u5b89\u88c5 Cordova\u3002<\/p>\n<p>(2) Cordova \u521b\u5efa\u5e94\u7528\u3002\u8f93\u5165\u547d\u4ee4 cordova create myApp com.example.myApp MyApp\uff0c\u521b\u5efa\u4e00\u4e2a\u5e94\u7528\u540d\u4e3a myApp\uff0c\u5305\u540d\u4e3a com.example.myApp \u7684\u5e94\u7528\u3002<\/p>\n<p>(3) \u6dfb\u52a0\u5e73\u53f0\u3002\u6211\u4eec\u9700\u8981\u4e3a\u6253\u5305 app \u6dfb\u52a0\u5e73\u53f0\uff0c\u6240\u4ee5\u9700\u8981\u8f93\u5165\u547d\u4ee4 cordova platform add android\uff0c\u6dfb\u52a0\u5b89\u5353\u5e73\u53f0\u3002<\/p>\n<p>(4) \u521b\u5efa\u63d2\u4ef6\u3002\u4e3a\u4e86\u5b9e\u73b0\u5fae\u4fe1 H5 \u652f\u4ed8\u529f\u80fd\uff0c\u6211\u4eec\u9700\u8981\u81ea\u5df1\u7f16\u5199\u63d2\u4ef6\u3002<\/p>\n<p>(5) \u7f16\u5199\u63d2\u4ef6\u3002\u5728 Cordova \u5e94\u7528\u4e2d\u521b\u5efa plug<a href=\"https:\/\/h5app.yimenapp.cn\/h5-app-1888.html\">\u524d\u7aefapp\u5f00\u53d1\u548ch5<\/a>in.xml \u6587\u4ef6\uff0c\u589e\u52a0\u9700\u8981\u4f7f\u7528\u7684\u63d2\u4ef6\uff0c\u540c\u65f6\u5728 Java \u6587\u4ef6\u4e2d\u7f16\u5199\u5177\u4f53\u7684\u529f\u80fd\u3002<\/p>\n<p>(6) \u6839\u636e\u9700\u6c42\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<p>(7) \u5b89\u88c5\u63d2\u4ef6\u3002\u5b89\u88c5\u63d2\u4ef6\u540e\uff0c\u5c31\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u8c03\u7528\u5bf9\u5e94\u7684\u63d2\u4ef6\u529f\u80fd\u3002<\/p>\n<p>2.\u5b9e\u73b0\u5fae\u4fe1 H5 \u652f\u4ed8<\/p>\n<p>\u5728\u7f51\u9875\u6253\u5305 app \u4e2d\u5b9e\u73b0\u5fae\u4fe1 H5 \u652f\u4ed8\uff0c\u9700\u8981\u5f00\u53d1\u8005\u81ea\u884c\u7f16\u5199\u5fae\u4fe1\u652f\u4ed8\u7684\u76f8\u5173\u4ee3\u7801\uff0c\u5176\u4e2d\uff0c\u4f7f\u7528\u5fae\u4fe1 JsAPI \u63a5\u53e3 canPay \u6765\u5224\u65ad\u5f53\u524d\u8bbe\u5907\u7684\u5fae\u4fe1\u652f\u4ed8\u662f\u5426\u53ef\u7528\uff0c\u5982\u679c\u53ef\u7528\uff0c\u5219\u901a\u8fc7 chooseWXPay \u65b9\u6cd5\u5b8c\u6210\u652f\u4ed8\u3002<\/p>\n<p>\uff081\uff09\u5f15\u5165\u5fae\u4fe1 JsAPI<\/p>\n<p>\u6211\u4eec\u9700\u8981\u5728 html \u6587<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/ag\/96\/sucai\/12.jpg\" \/><\/figure>\n<\/p>\n<p>\u4ef6\u4e2d\u5f15\u5165\u5fae\u4fe1 jsapi \u7684\u5e93\u6587\u4ef6\uff1a<\/p>\n<p>&#8220;`<\/p>\n<\/p>\n<p>&#8220;`<\/p>\n<p>\uff082\uff09\u521d\u59cb\u5316\u5fae\u4fe1 JsAPI<\/p>\n<p>\u6211\u4eec\u9700\u8981\u5728\u7f51\u9875\u4e2d\u521d\u59cb\u5316\u5fae\u4fe1 JsAP<a href=\"https:\/\/h5app.yimenapp.cn\/h5-app-732.html\">h5\u52a0\u58f3\u5236\u4f5capp<\/a>I\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>wx.config({<\/p>\n<p>   debug: false,<\/p>\n<p>   appId: &#8221;,<\/p>\n<p>   timestamp: ,<\/p>\n<p>   nonceStr: &#8221;,<\/p>\n<p>   signature: &#8221;,<\/p>\n<p>   jsApiList: [&#8216;chooseWXPay&#8217;]<\/p>\n<p>});<\/p>\n<p>&#8220;`<\/p>\n<p>(3) \u83b7\u53d6\u7528\u6237\u6388\u6743<\/p>\n<p>\u5f15\u5165\u5fae\u4fe1 jsapi \u5e93\u6587\u4ef6\u5e76\u521d\u59cb\u5316\u540e\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u83b7\u53d6\u7528\u6237\u6388\u6743\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>wx.checkJsApi({<\/p>\n<p>   jsApiList: [&#8216;chooseWXPay&#8217;], \/\/ \u9700\u8981\u68c0\u6d4b\u7684JS\u63a5\u53e3\u5217\u8868\uff0c\u901a\u8fc7JS-SDK\u7684getJSApiTicket\u7968\u636e\u8ba1\u7b97\u51fa<\/p>\n<p>   success: function (res) {<\/p>\n<p>   },<\/p>\n<p>   fail: function(res) {<\/p>\n<p>      \/\/ \u63d0\u793a\u7528\u6237\u6388\u6743\u5931\u8d25<\/p>\n<p>   }<\/p>\n<p>});<\/p>\n<p>&#8220;`<\/p>\n<p>(4) \u8c03\u7528\u5fae\u4fe1 H5 \u652f\u4ed8<\/p>\n<p>\u83b7\u53d6\u7528\u6237\u6388\u6743\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u652f\u4ed8\u9875\u9762\u4e2d\u8c03\u7528\u5fae\u4fe1 H5 \u652f\u4ed8\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>wx.chooseWXPay({<\/p>\n<p>   timestamp: &#8221;,<\/p>\n<p>   nonceStr: &#8221;,<\/p>\n<p>   package: &#8221;,<\/p>\n<p>   signType: &#8221;,<\/p>\n<p>   paySign: &#8221;,<\/p>\n<p>   success: function (res) {<\/p>\n<p>      \/\/ \u63d0\u793a\u7528\u6237\u652f\u4ed8\u6210\u529f<\/p>\n<p>   },<\/p>\n<p>   fail: function(res) {<\/p>\n<p>      \/\/ \u63d0\u793a\u7528\u6237\u652f\u4ed8\u5931\u8d25<\/p>\n<p>   }<\/p>\n<p>});<\/p>\n<p>&#8220;`<\/p>\n<p>\u4ee5\u4e0a\u662f\u5b9e\u73b0\u7f51\u9875\u6253\u5305 app \u5fae\u4fe1 H5 \u652f\u4ed8\u7684\u5b9e\u73b0\u8fc7\u7a0b\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u9700\u8981\u5f00\u53d1\u8005\u5bf9\u5fae\u4fe1 H5 \u652f\u4ed8\u6709\u4e00\u5b9a\u4e86\u89e3\uff0c\u540c\u65f6\u9700\u8981\u9632\u6b62\u652f\u4ed8\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u6f0f\u6d1e\uff0c\u4fdd\u62a4\u7528\u6237\u652f\u4ed8\u5b89\u5168\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u9875\u6253\u5305 App \u53ef\u4ee5\u8ba9\u6211\u4eec\u5c06\u7f51\u9875\u5c01\u88c5\u6210\u4e00\u4e2a app\uff0c\u5728\u624b\u673a\u4e0a\u76f4\u63a5\u8bbf\u95ee\u7f51\u9875\uff0c\u65e0\u9700\u518d\u6253\u5f00\u6d4f\u89c8\u5668\u7b49\u64cd\u4f5c\u3002\u800c\u5fae\u4fe1 H5 \u652f\u4ed8\u662f\u6307\u5728\u5fae\u4fe1\u516c\u4f17\u53f7\u6216\u5fae\u4fe1\u5185\u6253\u5f00\u7684 H5 \u7f51\u9875\uff0c\u901a\u8fc7\u5fae\u4fe1\u652f\u4ed8\u5b8c\u6210\u7684\u652f\u4ed8\u884c\u4e3a\u3002\u7f51\u9875\u6253\u5305<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20562,10613,226,32,206],"topic":[],"class_list":["post-14465","post","type-post","status-publish","format-standard","hentry","category-appkfa","tag-app-h5--","tag-appvueh5","tag-226","tag-32","tag-206"],"_links":{"self":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/14465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/comments?post=14465"}],"version-history":[{"count":1,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/14465\/revisions"}],"predecessor-version":[{"id":14482,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/14465\/revisions\/14482"}],"wp:attachment":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/media?parent=14465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/categories?post=14465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/tags?post=14465"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/topic?post=14465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}