| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <!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"/>
- <style>
- .pear-btn-primary {
- width: 100%;
- margin-top: 10px;
- }
- .project-list-item .project-list-item-cover {
- width: 100%;
- display: block;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- }
- .layui-text button{
- text-align: center;
- }
- .project-list-item-body {
- padding: 10px;
- border: 1px solid #e8e8e8;
- }
- .project-list-item .project-list-item-cover {
- height: auto;
- }
- .project-list-item .project-list-item-text {
- text-align: center;
- height: 40px;
- overflow: hidden;
- margin-bottom: 0px;
- }
- .project-list-item .project-list-item-text button{
- width: 40%;
- height: 40px;
- border-radius: 10px;
- }
- .show-app{
- padding: 20px;
- }
- </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>
|