lsbrige.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. <html lang="zh-CN">
  2. <head>
  3. <title>外部H5 jssdk demo页面</title>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1,viewport-fit=cover" />
  7. <meta name="format-detection" content="telephone=yes">
  8. <style>
  9. html {
  10. overflow-y: auto;
  11. }
  12. body {
  13. padding: 0 10px;
  14. overflow-y: auto;
  15. }
  16. button {
  17. background: #2196F3;
  18. text-align: center;
  19. margin: 10px 0;
  20. padding: 5px 10px;
  21. border-radius: 5px;
  22. color: #fff;
  23. display: block;
  24. width: 100%;
  25. border: none;
  26. }
  27. #userInfo {
  28. background: #FF5722;
  29. color: #fff;
  30. margin: 10px 0;
  31. word-break: break-all;
  32. }
  33. #jump {
  34. position: absolute;
  35. bottom: 10px;
  36. transform: translateY(-50%);
  37. right: 10px;
  38. background: red;
  39. color: #fff;
  40. border-radius: 10px;
  41. font-size: 12px;
  42. padding: 5px 10px;
  43. }
  44. </style>
  45. <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
  46. <!-- <script src="../../src/ls-sdk.js"></script> -->
  47. <script src="https://cdn-prod.internetofcity.cn/jssdk/jlingxi-1.0.9.min.js"></script>
  48. <script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
  49. <script>
  50. // init vConsole
  51. var vConsole = new VConsole();
  52. </script>
  53. <script>
  54. var appId = 'B1334087658781568';
  55. var userAccessToken = "";
  56. //授权
  57. async function handleAuthorization() {
  58. console.log('start');
  59. userAccessToken = "";
  60. // 应该由服务端发起请求
  61. var rt = await fetchInitCode({
  62. });
  63. console.log('rt', rt);
  64. rt = JSON.parse(rt)
  65. var data = rt.data;
  66. console.log('ls',ls);
  67. console.log('到这里了0');
  68. //成功回调
  69. ls.ready(function() {
  70. console.log('到这里了1');
  71. //自定义逻辑,如:
  72. //1.调用 JSSDK 里提供的交互方法
  73. //2.如需获取用户信息,需要在此处调用 ls.userAuth(Objectobject)方法获取requestCode。
  74. // userAuth根据appid会自动判断是否需要登录、认证和授权。
  75. ls.userAuth({
  76. appId: appId, //从开放平台申请到的 appId
  77. }, function (res) {
  78. console.log(res)
  79. if (res.code === 200) {
  80. requestCode = res.data.requestCode; //获取到requestcode
  81. } else if (res.code === 9005) {
  82. // 认证失败或登录失败
  83. console.log('认证失败或登录失败')
  84. alert('认证失败或登录失败')
  85. // 如果在此处调用ls.close()关闭页面,需要延迟0.5秒执行,否则ls.close()会无效。
  86. } else {
  87. // 其余情况
  88. alert('userAuth error')
  89. // 如果在此处调用ls.close()关闭页面,需要延迟0.5秒执行,否则ls.close()会无效。
  90. }
  91. });
  92. });
  93. console.log('到这里了5');
  94. ls.error(function (e) {
  95. alert(e)
  96. });
  97. console.log('到这里了6');
  98. // 确保ready方法初始化以后调用config方法
  99. ls.config({
  100. debug: true, //开发时建议把调试模式开启
  101. appId: appId,
  102. initCode: data.initCode,
  103. });
  104. console.log('到这里了end');
  105. alert('end')
  106. }
  107. //获取用户信息
  108. async function getUserInfo() {
  109. // if (!userAccessToken ) {
  110. // alert("no userAccessToken");
  111. // return;
  112. // }
  113. // if (!requestCode) {
  114. // alert("no requestCode");
  115. // return;
  116. // }
  117. console.log('getUserInfo:',requestCode,userAccessToken);
  118. if (!userAccessToken && !requestCode) {
  119. alert("请先授权");
  120. return;
  121. }
  122. //授权过了无需再重复获取userAccessToken
  123. if (!userAccessToken) {
  124. //获取用户访问令牌 userAccessToken
  125. var userAccess = await fetchUserAccessToken(requestCode);
  126. userAccessToken = userAccess.data.data.userAccessToken;
  127. }
  128. //获取用户信息 userInfo
  129. var user = await fetchUserInfo(userAccessToken);
  130. if (user.data.code == 200) {
  131. var userInfo = user.data.data;
  132. document.getElementById('userInfo').append(JSON.stringify(userInfo));
  133. } else {
  134. alert(user.data.info)
  135. }
  136. }
  137. const baseUrl = 'http://localhost:9001/'
  138. // 使用ajax的方法
  139. function httpPostLocaltion(url, data) {
  140. console.log('请求', url);
  141. return new Promise((resolve, reject) => {
  142. const xhr = new XMLHttpRequest();
  143. xhr.open('post', url, true);
  144. xhr.onreadystatechange = function () {
  145. if (xhr.readyState === 4) {
  146. // console.log('获取数据1', xhr.response);
  147. if (xhr.status === 200) {
  148. // alert(xhr.responseText);
  149. // return xhr.response
  150. resolve(xhr.response);
  151. } else {
  152. reject('异常失败', xhr.status)
  153. }
  154. }
  155. }
  156. // const data = {
  157. // name:'zt'
  158. // }
  159. xhr.send(JSON.stringify(data));
  160. });
  161. // // 注意,设置请求头的信息必须写在下面,否则会报错
  162. // // 设置以json传参
  163. // xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
  164. // // 解决跨域问题
  165. // xhr.setRequestHeader("Access-Control-Allow-Origin", "*");
  166. // // 设置请求体携带的参数
  167. }
  168. function test() {
  169. // httpPostLocaltion("http://localhost:9001/wx/LingXiConnectController/initCode", {}).then((e) => {
  170. // // console.log('this..............');
  171. // console.log('获取数据', e);
  172. // })
  173. return fetchUserAccessToken('ssdfs')
  174. }
  175. async function fetchInitCode(option) {
  176. return httpPostLocaltion("http://localhost:9001/wx/LingXiConnectController/initCode", option)
  177. }
  178. async function fetchUserAccessToken(requestCode) {
  179. alert(111)
  180. return httpPostLocaltion("https://testapi.internetofcity.cn/api/auth/open-platform/request-code/check", {requestCode:requestCode})
  181. // return await axios.post('https://testapi.internetofcity.cn/api/auth/open-platform/request-code/check', {
  182. // requestCode
  183. // });
  184. }
  185. async function fetchUserInfo(userAccessToken) {
  186. return await axios.post('https://testapi.internetofcity.cn/api/auth/open-platform/user-info/get', {
  187. userAccessToken
  188. });
  189. }
  190. function handlePay() {
  191. ls.lsPay({
  192. orderId: 'xxx',
  193. version: '' // version为2:新版支付;空:老版支付
  194. }, (res) => { })
  195. }
  196. function handlePreviewFile() {
  197. ls.previewFile({
  198. url: 'http://super-app-resource-test-new.oss-cn-north-2-gov-1.aliyuncs.com/test/lxsdk_%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0API%E6%8E%A5%E5%85%A5%E6%96%87%E6%A1%A3.pdf'
  199. }, (res) => { })
  200. }
  201. function handleOpenSystemBroswer() {
  202. ls.openSystemBroswer({
  203. url: 'http://www.baidu.com'
  204. }, (res) => { })
  205. }
  206. function handleOpenWxMini() {
  207. ls.openWxMini({
  208. userName: 'gh_9281387f863a',
  209. path: 'pages/index/index'
  210. }, (res) => { })
  211. }
  212. function lsqrCode() {
  213. ls.qrCode(function (res) {
  214. alert(JSON.stringify(res))
  215. })
  216. };
  217. function lsclose() {
  218. // console.log('lsclose', ls.close)
  219. console.log('window.bridge', window.bridge)
  220. ls.close();
  221. }
  222. function lscallNo() {
  223. ls.callNo({
  224. tel: '88888888'
  225. })
  226. }
  227. function lslocation() {
  228. ls.location({
  229. type: 'gcj02'
  230. }, function (res) {
  231. alert(JSON.stringify(res))
  232. });
  233. }
  234. function lsCheckIdentity() {
  235. ls.checkIdentity({
  236. type: '2',
  237. appId: 'YOUR_APP_ID'
  238. }, function (res) {
  239. alert(JSON.stringify(res))
  240. });
  241. }
  242. function showNav() {
  243. ls.navigationStatus({
  244. navigationShow: true,
  245. navigationBarBackgroundColor: "#ffffff",
  246. navigationBarTitleText: "业务demo",
  247. navigationBarTitleColor: "#000000",
  248. });
  249. }
  250. function hideNav() {
  251. ls.navigationStatus({
  252. navigationShow: false,
  253. })
  254. }
  255. function handleGetVersion() {
  256. console.log(ls)
  257. ls.getVersion(function (res) {
  258. alert(JSON.stringify(res))
  259. })
  260. }
  261. function clipboard() {
  262. ls.clipboard(function (res) {
  263. alert(JSON.stringify(res))
  264. })
  265. }
  266. function getRandomColor() {
  267. var colorValue = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f'];
  268. var s = "#";
  269. for (var i = 0; i < 6; i++) {
  270. s += colorValue[Math.floor(Math.random() * 16)];
  271. }
  272. return s;
  273. }
  274. // 上传图片鉴黄
  275. function handleUploadImgToCheck() {
  276. ls.lsUploadPhotoCheck(function (res) {
  277. alert(JSON.stringify(res))
  278. })
  279. }
  280. function handleShare(type, type1) {
  281. let shareObj = {}
  282. let mini = {
  283. title: '测试分享小程序',
  284. userName: 'gh_9281387f863a',
  285. icon: 'https://super-app-01.oss-cn-north-2-gov-1.aliyuncs.com/lx/images/jiayuan/jiayuan_share.jpg',
  286. path: 'pages/index/index'
  287. }
  288. let h5 = {
  289. title: '测试分享H5',
  290. content: '遇见最美家园无锡市#最美无锡 魅力家园#活动开始啦快来为你心中的“最美”点赞投票吧!',
  291. shareUrl: `https://cdn.internetofcity.cn/app/openWeapp/open-weapp.html?path=${encodeURIComponent(
  292. 'pages/youth/home/index/index.html'
  293. )}`,
  294. icon: 'https://super-app-01.oss-cn-north-2-gov-1.aliyuncs.com/lx/images/jiayuan/jiayuan_share.jpg',
  295. }
  296. let img = {
  297. title: '测试分享图片',
  298. content: '测试分享图片',
  299. image: 'https://super-app-01.oss-cn-north-2-gov-1.aliyuncs.com/lx/images/jiayuan/jiayuan.jpg',
  300. icon: 'https://super-app-01.oss-cn-north-2-gov-1.aliyuncs.com/lx/images/jiayuan/jiayuan_share.jpg',
  301. }
  302. // 自定义分享
  303. if (type === '999') {
  304. if (type1 === '1') {
  305. shareObj.data = [{
  306. type: type1,
  307. platformType: '1',
  308. ...h5
  309. },
  310. {
  311. type: type1,
  312. platformType: '2',
  313. ...h5
  314. }
  315. ]
  316. } else if (type1 === '3') { // 图片
  317. shareObj.data = [{
  318. type: type1,
  319. platformType: '1',
  320. ...img
  321. },
  322. {
  323. type: type1,
  324. platformType: '2',
  325. ...img
  326. }
  327. ]
  328. } else if (type1 === '2') { // 小程序
  329. shareObj.data = [{
  330. type: type1,
  331. platformType: '1',
  332. ...mini
  333. }]
  334. } else if (type1 === '1003') {
  335. shareObj.data = [{
  336. platformType: '1003',
  337. linkPath: 'lssmartcity://app?url=copy_action&content=https://www.baidu.com'
  338. }]
  339. }
  340. } else if (type === '1') { // 链接
  341. shareObj = h5
  342. } else if (type === '2') { // 小程序
  343. shareObj = mini
  344. } else if (type === '3') { // 图片
  345. shareObj = img
  346. }
  347. console.log({
  348. type,
  349. ...shareObj
  350. })
  351. // 2.3.1
  352. ls.share({
  353. type,
  354. ...shareObj
  355. }, function (res) { })
  356. }
  357. function handleIdCardOcr(type) {
  358. ls.idCardOcr({
  359. type: type,
  360. appId: 'YOUR_APP_ID'
  361. }, function (res) {
  362. alert(JSON.stringify(res))
  363. })
  364. }
  365. function handlemapNavi() {
  366. ls.lsMapNavi({
  367. lng: '120.301663',
  368. lat: '31.574729',
  369. name: '',
  370. }, function (res) {
  371. alert(JSON.stringify(res))
  372. })
  373. }
  374. function handleStartVoiceRecognizer() {
  375. ls.lsStartVoiceRecognizer(function (res) {
  376. alert(JSON.stringify(res))
  377. })
  378. }
  379. function handleStopVoiceRecognizer() {
  380. ls.lsStopVoiceRecognizer(function (res) {
  381. alert(JSON.stringify(res))
  382. })
  383. }
  384. function handleSavePhoto() {
  385. ls.lsSavePhoto({
  386. url: 'http://super-app-01.oss-cn-north-2-gov-1.aliyuncs.com/lx/images/medicare/bottom-top.png'
  387. }, function (res) {
  388. alert(JSON.stringify(res))
  389. })
  390. }
  391. function handlePrint() {
  392. ls.lxPrint({
  393. contents: [
  394. {
  395. "printerCmd": 1
  396. },
  397. {
  398. "value": 1,
  399. "printerCmd": 10
  400. },
  401. {
  402. "value": 1,
  403. "printerCmd": 8
  404. },
  405. {
  406. "width": 0,
  407. "printerCmd": 14,
  408. "height": 0
  409. },
  410. {
  411. "printerCmd": 0,
  412. "text": "无锡市统一公共支付平台缴费通知单"
  413. },
  414. {
  415. "printerCmd": 1
  416. },
  417. {
  418. "value": 0,
  419. "printerCmd": 8
  420. },
  421. {
  422. "printerCmd": 0,
  423. "text": "2021年12月14日"
  424. },
  425. {
  426. "printerCmd": 1
  427. },
  428. {
  429. "printerCmd": 1
  430. },
  431. {
  432. "value": 0,
  433. "printerCmd": 10
  434. },
  435. {
  436. "value": 30,
  437. "printerCmd": 25
  438. },
  439. {
  440. "printerCmd": 0,
  441. "text": "【执收单位】:"
  442. },
  443. {
  444. "value": 200,
  445. "printerCmd": 25
  446. },
  447. {
  448. "printerCmd": 0,
  449. "text": "无锡灵锡大数据有限公司无锡灵锡大数据有限公司无锡灵锡大数据有限公司无锡灵锡大数据有限公司无锡灵锡大数据有限公司"
  450. },
  451. {
  452. "printerCmd": 1
  453. },
  454. {
  455. "printerCmd": 1
  456. },
  457. {
  458. "value": 30,
  459. "printerCmd": 25
  460. },
  461. {
  462. "printerCmd": 0,
  463. "text": "【缴款识别码】:"
  464. },
  465. {
  466. "value": 200,
  467. "printerCmd": 25
  468. },
  469. {
  470. "printerCmd": 0,
  471. "text": "WXLX233333333333333"
  472. },
  473. {
  474. "printerCmd": 1
  475. },
  476. {
  477. "printerCmd": 1
  478. },
  479. {
  480. "value": 30,
  481. "printerCmd": 25
  482. },
  483. {
  484. "printerCmd": 0,
  485. "text": "【缴费人】:"
  486. },
  487. {
  488. "value": 200,
  489. "printerCmd": 25
  490. },
  491. {
  492. "printerCmd": 0,
  493. "text": "无锡市雪浪小镇管委会"
  494. },
  495. {
  496. "printerCmd": 1
  497. },
  498. {
  499. "printerCmd": 1
  500. },
  501. {
  502. "value": 30,
  503. "printerCmd": 25
  504. },
  505. {
  506. "printerCmd": 0,
  507. "text": "【收款人】:"
  508. },
  509. {
  510. "value": 200,
  511. "printerCmd": 25
  512. },
  513. {
  514. "printerCmd": 0,
  515. "text": "无锡市财政局"
  516. },
  517. {
  518. "printerCmd": 1
  519. },
  520. {
  521. "printerCmd": 1
  522. },
  523. {
  524. "value": 30,
  525. "printerCmd": 25
  526. },
  527. {
  528. "printerCmd": 0,
  529. "text": "【收款银行】:"
  530. },
  531. {
  532. "value": 200,
  533. "printerCmd": 25
  534. },
  535. {
  536. "printerCmd": 0,
  537. "text": "无锡市农村商业银行滨湖支行"
  538. },
  539. {
  540. "printerCmd": 1
  541. },
  542. {
  543. "printerCmd": 1
  544. },
  545. {
  546. "value": 30,
  547. "printerCmd": 25
  548. },
  549. {
  550. "printerCmd": 0,
  551. "text": "【收款账号】:"
  552. },
  553. {
  554. "value": 200,
  555. "printerCmd": 25
  556. },
  557. {
  558. "printerCmd": 0,
  559. "text": "214000233333333333"
  560. },
  561. {
  562. "printerCmd": 1
  563. },
  564. {
  565. "printerCmd": 1
  566. },
  567. {
  568. "value": 30,
  569. "printerCmd": 25
  570. },
  571. {
  572. "printerCmd": 0,
  573. "text": "【收款金额】:"
  574. },
  575. {
  576. "value": 200,
  577. "printerCmd": 25
  578. },
  579. {
  580. "printerCmd": 0,
  581. "text": "2333.00"
  582. },
  583. {
  584. "printerCmd": 1
  585. },
  586. {
  587. "printerCmd": 1
  588. },
  589. {
  590. "value": 0,
  591. "printerCmd": 25
  592. },
  593. {
  594. "value": 1,
  595. "printerCmd": 10
  596. },
  597. {
  598. "printerCmd": 0,
  599. "text": "————————————————————"
  600. },
  601. {
  602. "printerCmd": 1
  603. },
  604. {
  605. "printerCmd": 1
  606. },
  607. {
  608. "size": 12,
  609. "printerCmd": 27,
  610. "level": 1,
  611. "text": "http:\/\/www.baidu.com"
  612. },
  613. {
  614. "printerCmd": 1
  615. },
  616. {
  617. "printerCmd": 0,
  618. "text": "使用灵锡App扫码支付"
  619. },
  620. {
  621. "printerCmd": 1
  622. },
  623. {
  624. "printerCmd": 0,
  625. "text": "————————————————————"
  626. },
  627. {
  628. "printerCmd": 1
  629. },
  630. {
  631. "printerCmd": 1
  632. },
  633. {
  634. "size": 12,
  635. "printerCmd": 27,
  636. "level": 1,
  637. "text": "http:\/\/www.baidu.com"
  638. },
  639. {
  640. "printerCmd": 1
  641. },
  642. {
  643. "printerCmd": 0,
  644. "text": "使用灵锡App扫码支付"
  645. },
  646. {
  647. "printerCmd": 1
  648. },
  649. {
  650. "printerCmd": 1
  651. },
  652. {
  653. "printerCmd": 1
  654. }
  655. ]
  656. }, function (res) {
  657. alert(JSON.stringify(res))
  658. });
  659. }
  660. function handleConnectPrinter() {
  661. ls.lxPrinterConnect(function (res) {
  662. alert(JSON.stringify(res))
  663. })
  664. }
  665. function handleCheckScheme() {
  666. console.log(ls.lxCheckScheme)
  667. ls.lxCheckScheme({
  668. scheme: 'xxx'
  669. }, function (res) {
  670. alert(JSON.stringify(res))
  671. })
  672. }
  673. function handleAbcPay() {
  674. ls.bankAbcPay({
  675. TokenID: '12345'
  676. }, function (res) {
  677. alert(JSON.stringify(res))
  678. })
  679. }
  680. function handleInjectYySdk() {
  681. ls.injectYySdk({}, function (res) {
  682. alert(JSON.stringify(res))
  683. })
  684. }
  685. </script>
  686. <body>
  687. <button onClick="test()" style="background:green">测试test</button>
  688. <button onClick="handleAuthorization()" style="background:green">授权2222</button>
  689. <span style="color:red;font-size:12px;font-weight:500">每次站点入口需重新请求授权,不要用自己缓存的用户信息,会导致app切换用户或者注销时用户信息不对</span>
  690. <button onClick="getUserInfo()" style="background:green">获取用户信息</button>
  691. <p style="font-size:12px;padding-bottom: 10px;">用户令牌(userAccessToken)自行做缓存处理,本案例暂不实现</p>
  692. <button onClick="window.location.reload()">刷新</button>
  693. <button onClick="lsclose()">关闭页面</button>
  694. <button onClick="lscallNo()">拨打电话</button>
  695. <!-- <button onClick="lsshare()">分享</button> -->
  696. <button onClick="lsqrCode()">打开摄像头扫码</button>
  697. <button onClick="lslocation()">获取地理位置信息</button>
  698. <button onClick="ls.goback()">返回上一级</button>
  699. <button onClick="showNav()">显示导航栏</button>
  700. <button onClick="hideNav()">隐藏导航栏</button>
  701. <button onClick="clipboard()">剪贴</button>
  702. <button onClick="handlePay()">灵锡支付</button>
  703. <button onClick="lsCheckIdentity()">人脸校验</button>
  704. <button onClick="handleGetVersion()">获取App版本</button>
  705. <button onClick="handlePreviewFile()">文件预览</button>
  706. <button onClick="handleOpenSystemBroswer()">打开系统浏览器</button>
  707. <button onClick="handleOpenWxMini()">打开微信小程序</button>
  708. <button onClick="handleShare('1')">分享H5</button>
  709. <button onClick="handleShare('2')">分享小程序</button>
  710. <button onClick="handleShare('3')">分享图片</button>
  711. <button onClick="handleShare('999', '1')">自定义分享:h5</button>
  712. <button onClick="handleShare('999', '2')">自定义分享:小程序</button>
  713. <button onClick="handleShare('999', '3')">自定义分享:图片</button>
  714. <button onClick="handleShare('999', '1003')">自定义分享:复制url</button>
  715. <button onClick="handleUploadImgToCheck()">上传图片鉴黄</button>
  716. <button onClick="handlemapNavi()">导航</button>
  717. <button onClick="handleStartVoiceRecognizer()">语音识别,开始</button>
  718. <button onClick="handleStopVoiceRecognizer()">语音识别,结束</button>
  719. <button onClick="handleSavePhoto()">保存图片</button>
  720. <button onClick="handlePrint()">打印</button>
  721. <button onClick="handleConnectPrinter()">连接打印机</button>
  722. <button onClick="handleIdCardOcr('face')">身份证OCR-face</button>
  723. <button onClick="handleIdCardOcr('back')">身份证OCR-back</button>
  724. <button onClick="handleAbcPay()">农行支付</button>
  725. <button onClick="handleCheckScheme()">检查是否安装白名单程序</button>
  726. <button onClick="handleInjectYySdk()">注入一元sdk</button>
  727. <input type="file" capture="camera" accept='image/*'>
  728. <div id="userInfo"></div>
  729. <div onClick="window.location.href='./h1.html'" id="jump">二级页面</div>
  730. </body>
  731. </html>