qrcodeShare.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title>二维码分享</title>
  8. <style>
  9. html body {
  10. position: relative;
  11. }
  12. .api_layout {
  13. margin: 25px 12px 0 12px;
  14. background: #fff;
  15. text-align: center;
  16. box-shadow: 0px 0px 5px 5px rgba(0, 0, 0, 0.1);
  17. border-radius: 10px;
  18. }
  19. header {
  20. height: 58px;
  21. line-height: 58px;
  22. font-size: 18px;
  23. color: #333333;
  24. border-bottom: solid 1px #E0E1E2;
  25. }
  26. .footer {
  27. height: 40px;
  28. line-height: 40px;
  29. font-size: 12px;
  30. color: #6C6F74;
  31. border-top: solid 1px #E0E1E2;
  32. }
  33. .qrcode_img {
  34. margin: 17px;
  35. width: 300px;
  36. height: 300px;
  37. margin: 0 auto;
  38. }
  39. .qrcode_img img {
  40. display: block;
  41. width: 100%;
  42. height: 100%;
  43. }
  44. .handle_item {
  45. margin: 80px 20px 0 20px;
  46. text-align: center;
  47. display: flex;
  48. justify-content: space-between;
  49. align-items: center;
  50. }
  51. .handle_item .handle_item_contaoner {
  52. width: 100%;
  53. height: 35px;
  54. /*width: 145px;
  55. height: 35px;*/
  56. background: rgba(255, 255, 255, 1);
  57. border-radius: 5px;
  58. display: flex;
  59. align-items: center;
  60. justify-content: center;
  61. }
  62. /*.handle_item_contaoner div:first-child {
  63. line-height: 16px;
  64. }*/
  65. .handle_item_contaoner div:first-child img{
  66. width: 16px;
  67. height: 16px;
  68. display: block;
  69. line-height: 16px;
  70. }
  71. .handle_item_contaoner div:last-child {
  72. margin-left: 8px;
  73. }
  74. </style>
  75. </head>
  76. <body style="background-color:#009FE8;">
  77. <div class="api_layout">
  78. <header>
  79. App下载二维码
  80. </header>
  81. <div class="qrcode_img">
  82. <img src="" id="qrOssImg" alt="">
  83. </div>
  84. <div class="footer" onclick="handleDownLoadQrCode()">
  85. 扫一扫下载
  86. </div>
  87. </div>
  88. <div class="handle_item">
  89. <div class="handle_item_contaoner" onclick="handleDownLoadQrImg()">
  90. <!-- -->
  91. <div><img src="../../image/downLoadQrCode.png" alt=""></div>
  92. <div>保存到手机</div>
  93. </div>
  94. <!-- <div class="handle_item_contaoner">
  95. <div><img src="../../image/shareImg.png" alt=""></div>
  96. <div>分享</div>
  97. </div> -->
  98. </div>
  99. </body>
  100. </html>
  101. <script type="text/javascript" src="../../script/api.js"></script>
  102. <!-- <script src="../../script/aui-toast.js" charset="utf-8"></script> -->
  103. <!-- <script src="../../script/fastclick.min.js" charset="utf-8"></script> -->
  104. <script src="../../script/config.js" charset="utf-8"></script>
  105. <script type="text/javascript">
  106. var token, uuid, headers,imgSrc = '',qr_oss_mg='';
  107. var toast = new auiToast();
  108. apiready = function() {
  109. var info = $api.getStorage('data'),
  110. user = JSON.parse(info).data.user;
  111. token = JSON.parse(info).data.access_token;
  112. uuid = JSON.parse(info).data.user.staff_num;
  113. headers = {
  114. "Authorization": "Bearer " + token
  115. };
  116. imgSrc = `https://jiewei-icon.oss-cn-beijing.aliyuncs.com/下载二维码/${ossImgName}.png`
  117. qr_oss_mg = $api.byId('qrOssImg');
  118. qr_oss_mg.src = imgSrc
  119. };
  120. function handleDownLoadQrImg() {
  121. api.saveMediaToAlbum({
  122. path: imgSrc
  123. }, function(ret, err) {
  124. if (ret && ret.status) {
  125. api.toast({
  126. msg: '保存成功',
  127. duration: 2000,
  128. location: 'bottom',
  129. });
  130. } else {
  131. alert('保存失败');
  132. }
  133. });
  134. }
  135. </script>