123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- <!DOCTYPE html>
- <html lang="zh" style="font-size: 365.867px;">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
- <meta http-equiv="X-UA-Compatible" content="IE=8">
- <meta http-equiv="Expires" content="0">
- <meta http-equiv="Pragma" content="no-cache">
- <meta http-equiv="Cache-control" content="no-cache">
- <meta http-equiv="Cache" content="no-cache">
- <link rel="stylesheet" type="text/css" href="./static/public_css.css">
- <script type="text/javascript" src="./static/public.js"></script>
- <script type="text/javascript" src="./static/nanoid.js"></script>
- <script type="text/javascript" src="./static/jquery-2.1.0.js"></script>
- <script type="text/javascript" src="./static/clipboard.js"></script>
- <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> -->
- <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
- <title>长按二维码识别</title>
- <style>
- .container {
- background-color: #fff;
- min-height: 100vh;
- box-sizing: border-box;
- position: relative;
- }
- .container .context {
- position: fixed;
- bottom: 50vh;
- width: 100%;
- z-index: 100;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .container .context .tip {
- background-color: rgba(40, 40, 40, 0.8);
- color: aliceblue;
- font-size: 0.13rem;
- padding: 0.1rem;
- border-radius: 0.08rem;
- }
- .container .safe-wrap {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- padding-top: 0.08rem;
- }
- .container .safe-wrap .safe-i {
- width: 0.16rem;
- height: 0.16rem;
- }
- .container .safe-wrap .safe-t {
- display: flex;
- font-size: 0.13rem;
- color: #666;
- }
- .container .safe-wrap .safe-t .safe-t-h {
- color: #333;
- font-weight: 500;
- }
- .container .notice-wrap {
- margin-top: 1.2rem;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- .container .notice-wrap .wx-img {
- width: 0.75rem;
- height: 0.75rem;
- }
- .container .notice-wrap .t-1 {
- margin-top: 0.15rem;
- font-size: 0.13rem;
- color: #666;
- }
- .container .notice-wrap .t-2 {
- margin-top: 0.07rem;
- font-size: 0.15rem;
- color: #666;
- }
- .container .jumpWx-wrap {
- margin-top: 0.3rem;
- width: 100%;
- }
- .container .jumpWx-wrap .jumpWx-btn {
- width: 90%;
- margin: 0px auto;
- height: 0.42rem;
- font-size: 0.16rem;
- border-radius: 0.04rem;
- background-color: rgb(6, 174, 86);
- color: rgb(255, 255, 255);
- display: flex;
- justify-content: center;
- align-items: center;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .container .copy-wrap {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- position: fixed;
- bottom: 0.25rem;
- }
- .container .copy-wrap .copy-t {
- display: flex;
- font-size: 0.14rem;
- color: #777;
- }
- .container .copy-wrap .copy-t .copy-t-h {
- color: #0F80FF;
- font-weight: 500;
- }
- </style>
- <script type="text/javascript">
- var url_params = getQueryUrl();
- // 获取地址栏信息
- function getQueryUrl () {
- let url = window.location.href;
- let result = {};
- if (url.indexOf('?') > -1) {
- let str = url.split('?')[1];
- let temp = str.split('&');
- for (let i = 0; i < temp.length; i++) {
- let temp2 = temp[i].split('=');
- result[temp2[0]] = temp2[1]
- }
- }
- return result
- }
- function objectToUrlParams(obj) {
- let params = '';
- for (let key in obj) {
- if (obj.hasOwnProperty(key)) {
- params += key + '=' + encodeURIComponent(obj[key]) + '&';
- }
- }
- return params.slice(0, -1);
- }
- </script>
- </head>
- <body>
- <div id="app" class="container">
- <div class="context" v-show="isShowMsg">
- <span class="tip">{{ msg }}</span>
- </div>
- <div class="safe-wrap">
- <img class="safe-i" src="./static/icon1.png" />
- <div class="safe-t">本链接经过<div class="safe-t-h">SSL安全加密</div>,请放心访问</div>
- </div>
- <div class="notice-wrap">
- <img class="wx-img" src="./static/wx.png" />
- <div class="t-1">正在跳转到微信...</div>
- <div class="t-2">如果无法自动打开微信请点击下方按钮</div>
- </div>
- <div class="jumpWx-wrap">
- <a :href="urlScheme" class="jumpWx-btn">点击立即前往微信</a>
- </div>
- <div class="copy-wrap">
- <div class="copy-t">请点击上方按钮或<div id="cp" class="copy-t-h" :data-clipboard-text="urlScheme">复制链接</div>到手机微信打开。</div>
- </div>
- </div>
- <script>
- console.log('url_params => ', url_params)
- var app = new Vue({
- el: '#app',
- data() {
- return {
- isShowMsg: false,
- msg: '',
- urlScheme: '',
- }
- },
- watch: {
- isShowMsg(isShow) {
- if (isShow) {
- setTimeout(() => {
- this.isShowMsg = false
- this.msg = ''
- }, 2000)
- }
- },
- },
- mounted() {
- this.handleInitCp()
- this.handleGetScheme()
- },
- methods: {
- handleInitCp() {
- var cp = new ClipboardJS('#cp')
- cp.on('success', (params) => {
- this.msg = '链接已成功复制到剪贴板'
- this.isShowMsg = true
- })
- },
- handleGetScheme() {
- var queryParams = objectToUrlParams(url_params)
- console.log('queryParams => ', queryParams)
- $.ajax({
- type: "get",
- url: "/api/v2/qw/getScheme",
- dataType: 'json',
- data: {
- path: '/pages/subPackages/commonPages/lhKF',
- query: queryParams,
- },
- success: (res) => {
- console.log('res => ', res)
- if (res.errno == 0) {
- this.urlScheme = res.rst.url_scheme
- this.handleJumpToWx()
- } else {
- this.msg = res.err || '加载失败'
- this.isShowMsg = true
- }
- },
- error: () => {
- this.msg = '加载失败'
- this.isShowMsg = true
- }
- });
- },
- handleJumpToWx() {
- if (this.urlScheme.indexOf('://') == -1) {
- window.location.href = 'http://' + this.urlScheme
- } else {
- window.location.href = this.urlScheme
- }
- },
- },
- })
- </script>
- </body>
- </html>
|