猎豆优选小程序

index.html 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <!DOCTYPE html>
  2. <html lang="zh" style="font-size: 365.867px;">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
  7. <meta http-equiv="X-UA-Compatible" content="IE=8">
  8. <meta http-equiv="Expires" content="0">
  9. <meta http-equiv="Pragma" content="no-cache">
  10. <meta http-equiv="Cache-control" content="no-cache">
  11. <meta http-equiv="Cache" content="no-cache">
  12. <link rel="stylesheet" type="text/css" href="./static/public_css.css">
  13. <script type="text/javascript" src="./static/public.js"></script>
  14. <script type="text/javascript" src="./static/nanoid.js"></script>
  15. <script type="text/javascript" src="./static/jquery-2.1.0.js"></script>
  16. <script type="text/javascript" src="./static/clipboard.js"></script>
  17. <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> -->
  18. <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
  19. <title>长按二维码识别</title>
  20. <style>
  21. .container {
  22. background-color: #fff;
  23. min-height: 100vh;
  24. box-sizing: border-box;
  25. position: relative;
  26. }
  27. .container .context {
  28. position: fixed;
  29. bottom: 50vh;
  30. width: 100%;
  31. z-index: 100;
  32. display: flex;
  33. justify-content: center;
  34. align-items: center;
  35. }
  36. .container .context .tip {
  37. background-color: rgba(40, 40, 40, 0.8);
  38. color: aliceblue;
  39. font-size: 0.13rem;
  40. padding: 0.1rem;
  41. border-radius: 0.08rem;
  42. }
  43. .container .safe-wrap {
  44. display: flex;
  45. justify-content: center;
  46. align-items: center;
  47. width: 100%;
  48. padding-top: 0.08rem;
  49. }
  50. .container .safe-wrap .safe-i {
  51. width: 0.16rem;
  52. height: 0.16rem;
  53. }
  54. .container .safe-wrap .safe-t {
  55. display: flex;
  56. font-size: 0.13rem;
  57. color: #666;
  58. }
  59. .container .safe-wrap .safe-t .safe-t-h {
  60. color: #333;
  61. font-weight: 500;
  62. }
  63. .container .notice-wrap {
  64. margin-top: 1.2rem;
  65. display: flex;
  66. flex-direction: column;
  67. justify-content: center;
  68. align-items: center;
  69. }
  70. .container .notice-wrap .wx-img {
  71. width: 0.75rem;
  72. height: 0.75rem;
  73. }
  74. .container .notice-wrap .t-1 {
  75. margin-top: 0.15rem;
  76. font-size: 0.13rem;
  77. color: #666;
  78. }
  79. .container .notice-wrap .t-2 {
  80. margin-top: 0.07rem;
  81. font-size: 0.15rem;
  82. color: #666;
  83. }
  84. .container .jumpWx-wrap {
  85. margin-top: 0.3rem;
  86. width: 100%;
  87. }
  88. .container .jumpWx-wrap .jumpWx-btn {
  89. width: 90%;
  90. margin: 0px auto;
  91. height: 0.42rem;
  92. font-size: 0.16rem;
  93. border-radius: 0.04rem;
  94. background-color: rgb(6, 174, 86);
  95. color: rgb(255, 255, 255);
  96. display: flex;
  97. justify-content: center;
  98. align-items: center;
  99. overflow: hidden;
  100. white-space: nowrap;
  101. text-overflow: ellipsis;
  102. }
  103. .container .copy-wrap {
  104. display: flex;
  105. justify-content: center;
  106. align-items: center;
  107. width: 100%;
  108. position: fixed;
  109. bottom: 0.25rem;
  110. }
  111. .container .copy-wrap .copy-t {
  112. display: flex;
  113. font-size: 0.14rem;
  114. color: #777;
  115. }
  116. .container .copy-wrap .copy-t .copy-t-h {
  117. color: #0F80FF;
  118. font-weight: 500;
  119. }
  120. </style>
  121. <script type="text/javascript">
  122. var url_params = getQueryUrl();
  123. // 获取地址栏信息
  124. function getQueryUrl () {
  125. let url = window.location.href;
  126. let result = {};
  127. if (url.indexOf('?') > -1) {
  128. let str = url.split('?')[1];
  129. let temp = str.split('&');
  130. for (let i = 0; i < temp.length; i++) {
  131. let temp2 = temp[i].split('=');
  132. result[temp2[0]] = temp2[1]
  133. }
  134. }
  135. return result
  136. }
  137. function objectToUrlParams(obj) {
  138. let params = '';
  139. for (let key in obj) {
  140. if (obj.hasOwnProperty(key)) {
  141. params += key + '=' + encodeURIComponent(obj[key]) + '&';
  142. }
  143. }
  144. return params.slice(0, -1);
  145. }
  146. </script>
  147. </head>
  148. <body>
  149. <div id="app" class="container">
  150. <div class="context" v-show="isShowMsg">
  151. <span class="tip">{{ msg }}</span>
  152. </div>
  153. <div class="safe-wrap">
  154. <img class="safe-i" src="./static/icon1.png" />
  155. <div class="safe-t">本链接经过<div class="safe-t-h">SSL安全加密</div>,请放心访问</div>
  156. </div>
  157. <div class="notice-wrap">
  158. <img class="wx-img" src="./static/wx.png" />
  159. <div class="t-1">正在跳转到微信...</div>
  160. <div class="t-2">如果无法自动打开微信请点击下方按钮</div>
  161. </div>
  162. <div class="jumpWx-wrap">
  163. <a :href="urlScheme" class="jumpWx-btn">点击立即前往微信</a>
  164. </div>
  165. <div class="copy-wrap">
  166. <div class="copy-t">请点击上方按钮或<div id="cp" class="copy-t-h" :data-clipboard-text="urlScheme">复制链接</div>到手机微信打开。</div>
  167. </div>
  168. </div>
  169. <script>
  170. console.log('url_params => ', url_params)
  171. var app = new Vue({
  172. el: '#app',
  173. data() {
  174. return {
  175. isShowMsg: false,
  176. msg: '',
  177. urlScheme: '',
  178. }
  179. },
  180. watch: {
  181. isShowMsg(isShow) {
  182. if (isShow) {
  183. setTimeout(() => {
  184. this.isShowMsg = false
  185. this.msg = ''
  186. }, 2000)
  187. }
  188. },
  189. },
  190. mounted() {
  191. this.handleInitCp()
  192. this.handleGetScheme()
  193. },
  194. methods: {
  195. handleInitCp() {
  196. var cp = new ClipboardJS('#cp')
  197. cp.on('success', (params) => {
  198. this.msg = '链接已成功复制到剪贴板'
  199. this.isShowMsg = true
  200. })
  201. },
  202. handleGetScheme() {
  203. var queryParams = objectToUrlParams(url_params)
  204. console.log('queryParams => ', queryParams)
  205. $.ajax({
  206. type: "get",
  207. url: "/api/v2/qw/getScheme",
  208. dataType: 'json',
  209. data: {
  210. path: '/pages/subPackages/commonPages/lhKF',
  211. query: queryParams,
  212. },
  213. success: (res) => {
  214. console.log('res => ', res)
  215. if (res.errno == 0) {
  216. this.urlScheme = res.rst.url_scheme
  217. this.handleJumpToWx()
  218. } else {
  219. this.msg = res.err || '加载失败'
  220. this.isShowMsg = true
  221. }
  222. },
  223. error: () => {
  224. this.msg = '加载失败'
  225. this.isShowMsg = true
  226. }
  227. });
  228. },
  229. handleJumpToWx() {
  230. if (this.urlScheme.indexOf('://') == -1) {
  231. window.location.href = 'http://' + this.urlScheme
  232. } else {
  233. window.location.href = this.urlScheme
  234. }
  235. },
  236. },
  237. })
  238. </script>
  239. </body>
  240. </html>