{"id":16637,"date":"2023-03-20T14:48:19","date_gmt":"2023-03-20T06:48:19","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=16637"},"modified":"2023-03-20T14:48:19","modified_gmt":"2023-03-20T06:48:19","slug":"writepos76-%e9%80%82%e7%94%a8%e4%ba%8e-xp-76xx-%e7%b3%bb%e5%88%97%e9%92%88%e5%bc%8f%e6%89%93%e5%8d%b0%e6%9c%ba-app%e5%bc%80%e5%8f%91%e6%8e%a5%e5%85%a5%e8%8a%af%e7%83%a8%e6%89%93%e5%8d%b0%e6%9c%ba","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/16637\/","title":{"rendered":"writePos76\u00a0\u9002\u7528\u4e8e XP-76xx \u7cfb\u5217\u9488\u5f0f\u6253\u5370\u673a APP\u5f00\u53d1\u63a5\u5165\u82af\u70e8\u6253\u5370\u673a\u80fd\u529b\uff0c\u5b9e\u73b0APP\u8054\u673a\u82af\u70e8\u6253\u5370\u673a\u65e0\u7ebf\u6253\u5370"},"content":{"rendered":"\n<figure id=\"pid16585\" class=\"wp-block-table\"><table><tbody><tr><td>\u7528\u505a\u7f51\u9875\u7684\u6280\u672f\u505a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.yimenapp.com\/\" target=\"_blank\">APP<\/a>\uff01<br><span class=\"wpcom_keyword_link\"><a href=\"https:\/\/www.yimenapp.com\" title=\"\u5f00\u53d1APP\u4ece\u4e00\u95e8\u5f00\u59cb\">\u4e00\u95e8<\/a><\/span>\u63d0\u4f9b\u6807\u51c6\u5316\u7684<strong>jsbridge-mini.js\u5e93<\/strong>\uff0c\u60a8\u53ea\u9700\u8981\u5728\u9875\u9762<strong>\u5f15\u7528<\/strong>\u5e76<strong>\u6267\u884c<\/strong>JS\u5373\u53ef\u5b9e\u73b0\u5404\u79cd<strong>\u539f\u751fAPP\u3001\u539f\u751fPC<\/strong>\u7684\u529f\u80fd\u80fd\u529b\u3002<br><br><strong>==================APP\u7aef==================<\/strong><br><strong>\u3010APP\u7aef\u3011\uff08\u5b89\u5353\u7248&amp;\u82f9\u679c\u7248\uff09<\/strong>\u76ee\u524d\u63d0\u4f9b200+\u539f\u751f\u529f\u80fd\uff0c2000+JS\u6620\u5c04\u63a5\u53e3\uff0c\u7528\u505a\u7f51\u7ad9\u7684\u6280\u672f\u5373\u53ef\u5b9e\u73b0\u5404\u79cd\u539f\u751fAPP\u80fd\u529b\u3001APP demo\u5730\u5740<a rel=\"noreferrer noopener\" href=\"https:\/\/www.yimenapp.com\/doc\/demo.cshtml\" target=\"_blank\">https:\/\/www.yimenapp.com\/doc\/demo.cshtml<\/a>\u4e0b\u8f7d\u6559\u7a0b\uff1a<br>\u2666\u00a0<strong>JS-SDK<\/strong>\u00a0\u5f15\u7528\u65b9\u5f0f\uff1a<br>\u2666 \u666e\u901a\u7f51\u9875 script \u65b9\u5f0f\u52a0\u8f7d\uff1a\u4e0b\u8f7d\u6700\u65b0\u7248\uff0c\u8bf7\u5728\u9875\u9762\u4e0a\u8c03\u7528 jsBridge \u63a5\u53e3\u4e4b\u524d\u5f15\u7528 jsbridge-mini.js \u5e93\uff1b<br>\u2666 js module \u65b9\u5f0f\u5f15\u7528\uff1anpm install ym-jsbridge\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/www.npmjs.com\/package\/ym-jsbridge\" target=\"_blank\">\u5177\u4f53\u8bf7\u53c2\u8003 npm package<\/a><\/td><\/tr><\/tbody><\/table><figcaption>\u4e00\u95e8APP\u5f00\u53d1\u5e73\u53f0\u901a\u7528JS<\/figcaption><\/figure>\n\n\n\n<p>writePos76\u00a0\u9002\u7528\u4e8e XP-76xx \u7cfb\u5217\u9488\u5f0f\u6253\u5370\u673a APP\u5f00\u53d1\u63a5\u5165<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/xinhuadayinji\/\" title=\"\u82af\u70e8\u6253\u5370\u673a\" target=\"_blank\">\u82af\u70e8\u6253\u5370\u673a<\/a><\/span>\u80fd\u529b\uff0c\u5b9e\u73b0APP\u8054\u673a<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e8%8a%af%e7%83%a8\/\" title=\"\u82af\u70e8\" target=\"_blank\">\u82af\u70e8<\/a><\/span>\u6253\u5370\u673a\u65e0\u7ebf\u6253\u5370<\/p>\n\n\n\n<p>\u6838\u5fc3\u4ee3\u7801\u793a\u4f8b\uff0c\u8be6\u60c5\u53c2\u9605demo<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>jsBridge.xprinter.writePos76({\n  cmds: [\n    {\n      \/\/\u521d\u59cb\u5316\u6253\u5370\u673a\n      cmd: &quot;initializePrinter&quot;,\n      arg: []\n    },\n    {\n      \/\/\u6253\u5370\u6587\u5b57\n      cmd: &quot;text&quot;,\n      arg: [ &quot;XP-76xx \u7cfb\u5217\u9488\u5f0f\u6253\u5370\u673a&quot; ]\n    },\n    {\n      \/\/\u6253\u5370\u5e76\u6362\u884c\n      cmd: &quot;printAndFeedLine&quot;,\n      arg: [ ]\n    }\n  ]\n}, function(succ, data) {\n  if (!succ) {\n    alert(JSON.stringify(data));\n  }\n});\n\n\/*\n1.\u652f\u6301\u7684\u6307\u4ee4\u96c6\u8bf7\u53c2\u8003\u6253\u5370\u8bbe\u5907\u7684\u3010\u5b98\u65b9\u6587\u6863\u3011\uff1b\n2.\u6307\u4ee4\u4f7f\u7528\u8bf4\u660e\n{\n  \/\/\u6307\u4ee4\u5217\u8868\n  cmds: [\n    \/\/\u5355\u4e2a\u6307\u4ee4\u5305\u62ec\u6307\u4ee4\u540d\u79f0\u548c\u53c2\u6570\n    {\n      cmd: &quot;&quot;,  \/\/\u6307\u4ee4\u540d\u79f0\uff0c\u5373\u6587\u6863\u91cc\u9762\u7684\u65b9\u6cd5\u540d\u79f0\uff0c\u6ce8\u610f\u533a\u5206\u5927\u5c0f\u5199\n      arg: []   \/\/\u6307\u4ee4\u53c2\u6570\uff0c\u5373\u5bf9\u5e94\u7684\u65b9\u6cd5\u53c2\u6570\uff0c\u6ce8\u610f\u53c2\u6570\u987a\u5e8f\u548c\u7c7b\u578b\u9700\u4e0e\u6587\u6863\u4e00\u81f4\n                \/\/Bitmap \u56fe\u7247\u7c7b\u578b\u8bf7\u4f7f\u7528\u56fe\u7247\u7684 Base64 \u7f16\u7801\u5b57\u7b26\u4e32\n                \/\/BmpType\uff0cAlignType \u679a\u4e3e\u7c7b\u578b\u8bf7\u4f7f\u7528\u679a\u4e3e\u540d\u79f0\u5b57\u7b26\u4e32\n                \/\/byte[] \u4e8c\u8fdb\u5236\u6570\u7ec4\u8bf7\u4f7f\u752816\u8fdb\u5236\u5b57\u7b26\u4e32\u8868\u793a\n    },\n    ...\n  ]\n}\n*\/<\/code><\/pre><\/div>\n\n\n\n<p>A\u6807\u7b7e\u6267\u884cJS\u793a\u4f8b\u4ee3\u7801<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;zhixing()&quot;&gt;\u6267\u884c&lt;\/a&gt; \n&lt;!-- \u5199\u5165\u4e00\u4e2aA\u6807\u7b7ehref\u503c\u4e3a&quot;javascript:void(0)&quot;\uff0c\u5b9a\u4e49\u70b9\u51fb\u4e8b\u4ef6onclick\uff1b--&gt;\n&lt;script src=&quot;\u60a8\u7684\u670d\u52a1\u5668URL\/jsbridge-mini.js&quot;&gt;&lt;\/script&gt;\n&lt;!-- \u5728\u60a8\u7684\u670d\u52a1\u5668\u5f15\u5165\u4e00\u95e8JS\u5730\u5740\uff0c\u8bf7\u4e0b\u8f7djsbridge-mini.js\u4e0a\u4f20\u60a8\u81ea\u5df1\u7684\u670d\u52a1\u5668\u83b7\u53d6\u94fe\u63a5\uff1b--&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nfunction zhixing() {\n\n\n&lt;!--\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u590d\u5236JS\u6838\u5fc3\u4ee3\u7801\u5230\u6b64{}\u62ec\u53f7\u5185--&gt;\njsBridge.xprinter.writePos76({\n  cmds: [\n    {\n      \/\/\u521d\u59cb\u5316\u6253\u5370\u673a\n      cmd: &quot;initializePrinter&quot;,\n      arg: []\n    },\n    {\n      \/\/\u6253\u5370\u6587\u5b57\n      cmd: &quot;text&quot;,\n      arg: [ &quot;XP-76xx \u7cfb\u5217\u9488\u5f0f\u6253\u5370\u673a&quot; ]\n    },\n    {\n      \/\/\u6253\u5370\u5e76\u6362\u884c\n      cmd: &quot;printAndFeedLine&quot;,\n      arg: [ ]\n    }\n  ]\n}, function(succ, data) {\n  if (!succ) {\n    alert(JSON.stringify(data));\n  }\n});\n\n\/*\n1.\u652f\u6301\u7684\u6307\u4ee4\u96c6\u8bf7\u53c2\u8003\u6253\u5370\u8bbe\u5907\u7684\u3010\u5b98\u65b9\u6587\u6863\u3011\uff1b\n2.\u6307\u4ee4\u4f7f\u7528\u8bf4\u660e\n{\n  \/\/\u6307\u4ee4\u5217\u8868\n  cmds: [\n    \/\/\u5355\u4e2a\u6307\u4ee4\u5305\u62ec\u6307\u4ee4\u540d\u79f0\u548c\u53c2\u6570\n    {\n      cmd: &quot;&quot;,  \/\/\u6307\u4ee4\u540d\u79f0\uff0c\u5373\u6587\u6863\u91cc\u9762\u7684\u65b9\u6cd5\u540d\u79f0\uff0c\u6ce8\u610f\u533a\u5206\u5927\u5c0f\u5199\n      arg: []   \/\/\u6307\u4ee4\u53c2\u6570\uff0c\u5373\u5bf9\u5e94\u7684\u65b9\u6cd5\u53c2\u6570\uff0c\u6ce8\u610f\u53c2\u6570\u987a\u5e8f\u548c\u7c7b\u578b\u9700\u4e0e\u6587\u6863\u4e00\u81f4\n                \/\/Bitmap \u56fe\u7247\u7c7b\u578b\u8bf7\u4f7f\u7528\u56fe\u7247\u7684 Base64 \u7f16\u7801\u5b57\u7b26\u4e32\n                \/\/BmpType\uff0cAlignType \u679a\u4e3e\u7c7b\u578b\u8bf7\u4f7f\u7528\u679a\u4e3e\u540d\u79f0\u5b57\u7b26\u4e32\n                \/\/byte[] \u4e8c\u8fdb\u5236\u6570\u7ec4\u8bf7\u4f7f\u752816\u8fdb\u5236\u5b57\u7b26\u4e32\u8868\u793a\n    },\n    ...\n  ]\n}\n*\/\n\n}\n&lt;\/script&gt;\n&lt;!--\u6267\u884c\u6838\u5fc3\u4ee3\u7801\uff1b\n\/\/\u5982\u679c\u9700\u8981\u8fdb\u5165\u9875\u9762\u5c31\u6267\u884c\uff0c\u53bb\u6389\u70b9\u51fb\u4e8b\u4ef6\u5373\u53ef\uff1b--&gt;<\/code><\/pre><\/div>\n\n\n\n<p>\u6309\u94ae\u6267\u884cJS\u793a\u4f8b\u4ee3\u7801<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;button onclick=&quot;zhixing()&quot; &gt;\u6267\u884c&lt;\/button&gt;\n&lt;!-- \/\/\u5199\u4e00\u4e2a\u6309\u94ae\uff0c\u5b9a\u4e49\u70b9\u51fb\u6267\u884c\u4e8b\u4ef6\uff1b --&gt;\n&lt;script src=&quot;\u60a8\u7684\u670d\u52a1\u5668URL\/jsbridge-mini.js&quot;&gt;&lt;\/script&gt;\n&lt;!-- \/\/\u5728\u60a8\u7684\u670d\u52a1\u5668\u5f15\u5165\u4e00\u95e8JS\u5730\u5740\uff0c\u8bf7\u4e0b\u8f7djsbridge-mini.js\u4e0a\u4f20\u60a8\u81ea\u5df1\u7684\u670d\u52a1\u5668\u83b7\u53d6\u94fe\u63a5\uff1b --&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nfunction zhixing() {\n\n\n&lt;!--\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u590d\u5236JS\u6838\u5fc3\u4ee3\u7801\u5230\u6b64{}\u62ec\u53f7\u5185--&gt;\njsBridge.xprinter.writePos76({\n  cmds: [\n    {\n      \/\/\u521d\u59cb\u5316\u6253\u5370\u673a\n      cmd: &quot;initializePrinter&quot;,\n      arg: []\n    },\n    {\n      \/\/\u6253\u5370\u6587\u5b57\n      cmd: &quot;text&quot;,\n      arg: [ &quot;XP-76xx \u7cfb\u5217\u9488\u5f0f\u6253\u5370\u673a&quot; ]\n    },\n    {\n      \/\/\u6253\u5370\u5e76\u6362\u884c\n      cmd: &quot;printAndFeedLine&quot;,\n      arg: [ ]\n    }\n  ]\n}, function(succ, data) {\n  if (!succ) {\n    alert(JSON.stringify(data));\n  }\n});\n\n\/*\n1.\u652f\u6301\u7684\u6307\u4ee4\u96c6\u8bf7\u53c2\u8003\u6253\u5370\u8bbe\u5907\u7684\u3010\u5b98\u65b9\u6587\u6863\u3011\uff1b\n2.\u6307\u4ee4\u4f7f\u7528\u8bf4\u660e\n{\n  \/\/\u6307\u4ee4\u5217\u8868\n  cmds: [\n    \/\/\u5355\u4e2a\u6307\u4ee4\u5305\u62ec\u6307\u4ee4\u540d\u79f0\u548c\u53c2\u6570\n    {\n      cmd: &quot;&quot;,  \/\/\u6307\u4ee4\u540d\u79f0\uff0c\u5373\u6587\u6863\u91cc\u9762\u7684\u65b9\u6cd5\u540d\u79f0\uff0c\u6ce8\u610f\u533a\u5206\u5927\u5c0f\u5199\n      arg: []   \/\/\u6307\u4ee4\u53c2\u6570\uff0c\u5373\u5bf9\u5e94\u7684\u65b9\u6cd5\u53c2\u6570\uff0c\u6ce8\u610f\u53c2\u6570\u987a\u5e8f\u548c\u7c7b\u578b\u9700\u4e0e\u6587\u6863\u4e00\u81f4\n                \/\/Bitmap \u56fe\u7247\u7c7b\u578b\u8bf7\u4f7f\u7528\u56fe\u7247\u7684 Base64 \u7f16\u7801\u5b57\u7b26\u4e32\n                \/\/BmpType\uff0cAlignType \u679a\u4e3e\u7c7b\u578b\u8bf7\u4f7f\u7528\u679a\u4e3e\u540d\u79f0\u5b57\u7b26\u4e32\n                \/\/byte[] \u4e8c\u8fdb\u5236\u6570\u7ec4\u8bf7\u4f7f\u752816\u8fdb\u5236\u5b57\u7b26\u4e32\u8868\u793a\n    },\n    ...\n  ]\n}\n*\/\n\n}\n&lt;\/script&gt;\n&lt;!-- \/\/\u6267\u884c\u6838\u5fc3\u4ee3\u7801\uff1b\n\/\/\u5982\u679c\u9700\u8981\u8fdb\u5165\u9875\u9762\u5c31\u6267\u884c\uff0c\u53bb\u6389\u70b9\u51fb\u4e8b\u4ef6\u5373\u53ef\uff1b --&gt;<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>writePos76\u00a0\u9002\u7528\u4e8e XP-76xx \u7cfb\u5217\u9488\u5f0f\u6253\u5370\u673a APP\u5f00\u53d1\u63a5\u5165\u82af\u70e8\u6253\u5370\u673a\u80fd\u529b\uff0c\u5b9e\u73b0APP\u8054\u673a\u82af\u70e8\u6253\u5370\u673a\u65e0\u7ebf\u6253\u5370<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[723],"tags":[8180,1439],"special":[],"attr":[],"class_list":["post-16637","post","type-post","status-publish","format-standard","hentry","category-app109","tag-8180","tag-xinhuadayinji","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/16637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=16637"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/16637\/revisions"}],"predecessor-version":[{"id":16638,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/16637\/revisions\/16638"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=16637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=16637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=16637"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=16637"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=16637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}