| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>推广链接</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <link rel="stylesheet" href="../../component/pear/css/pear.css"/>
- <link rel="stylesheet" href="../../admin/css/other/console1.css?v=v2.0.3"/>
- <link rel="stylesheet" href="../../public/css/sponsored_links/sponsored_links.css?v=v2.0.3"/>
- <style>
- .pear-btn-primary {
- width: 100%;
- margin-top: 10px;
- }
- </style>
- </head>
- <body class="pear-container">
- <input type="text" id="link" required lay-verify="required" placeholder="" readonly autocomplete="off" class="layui-input">
- <textarea hidden id="taCode" rows="8" style="resize: none"></textarea>
- <button id="btCopy" type="button" class="pear-btn pear-btn-primary">复制链接</button>
- <script src="../../component/layui/layui.js"></script>
- <script src="../../component/pear/pear.js"></script>
- <script src="../../app/app.js?v=v2.0.3"></script>
- <script src="../../config/config.js?v=v2.0.3"></script>
- <script src="../../public/config/login.js?v=v2.0.3"></script>
- <script>
- layui.use(['jquery','layer',], function () {
- let $ = layui.jquery;
- let layer = layui.layer;
- let url = window.location.search;
- let link = url.split('?|||')[1];
- $('#taCode').text(link);
- $('#link').val(link);
- // 复制文本内容到剪切板
- $("#btCopy").click(function() {
- copyText($("#taCode").val());
- layer.msg('复制链接成功!快去分享吧!')
- });
- function copyText(obj) {
- if (!obj) {
- return false;
- }
- var text;
- if (typeof(obj) == 'object') {
- if (obj.nodeType) { // DOM node
- obj = $(obj); // to jQuery object
- }
- try {
- text = obj.text();
- if (!text) { // Maybe <textarea />
- text = obj.val();
- }
- } catch (err) { // as JSON
- text = JSON.stringify(obj);
- }
- } else {
- text = obj;
- }
- //var $temp = $('<input>'); // Line feed is not supported
- var $temp = $('<textarea>');
- $('body').append($temp);
- $temp.val(text).select();
- var res = document.execCommand('copy');
- $temp.remove();
- return res;
- }
- });
- </script>
- </body>
- </html>
|