-
Notifications
You must be signed in to change notification settings - Fork 0
/
doubble.html
103 lines (100 loc) · 2.24 KB
/
doubble.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="https://b.yzcdn.cn/v2/image/yz_fc.ico">
<title>数据转换器</title>
<style>
textarea{
width: 1000px;
height: 200px;
padding:10px;
font-size: 14px;
display: block;
margin:20px auto;
border:1px solid #ddd;
border-radius:5px;
}
.copy-box{
width: 1000px;
height: 200px;
}
.switch{
display: inline-block;
width: 200px;
height: 50px;
margin:0 auto;
line-height: 50px;
text-align: center;
border-radius: 5px;
font-size: 16px;
text-decoration: none;
background:#f60;
color:#fff;
}
.desc-info{
font-size: 14px;
font-weight: bold;
width: 1000px;
margin:10px auto;
}
.power{
font-size: 12px;
text-align: center;
line-height: 100px;
color:#666;
}
.controller{
width: 1000px;
margin:0 auto;
}
</style>
</head>
<div class="desc-info">
<p style="font-size:14px; line-height: 20px;">
<b style="color:#f30;">填写格式:</b>
Banner链接、活动链接交替填写,每个链接一行,回车换行<br/>
</p>
</div>
<textarea class="js-data-str"></textarea>
<p class="desc-info">2、复制以下输入框内容直接填入对应白名单即可</p>
<textarea class="copy-box js-copy" readonly></textarea>
<div class="controller">
<a href="javascript:void(0)" class="switch js-go">一键转换</a>
<a href="javascript:void(0)" class="switch js-clear" style="background:#999;">清除</a>
</div>
<p class="power">Powered by 旺仔</p>
<body>
<script src="https://su.yzcdn.cn/pf/build/js/common_6670cc0117d1219e8fe17aa74ccfed0d.js"></script>
<script>
var go = $('.js-go');
var data = $('.js-data-str');
var nCopy = $('.js-copy');
go.on('click', function(){
var strArray = [];
var resultStr = '';
var str = $.trim(data.val());
str = str.replace(/\s+/g, ',');
strArray = str.split(',');
var len = strArray.length - 1;
var result = strArray.map(function(item, i){
if(i%2 != 1){
resultStr += item + '__';
} else {
if(len == i){
resultStr += item;
} else {
resultStr += item + '&&';
}
}
});
nCopy.val('');
nCopy.val(resultStr);
});
$('.js-clear').on('click', function(){
nCopy.val('');
data.val('');
});
</script>
</body>
</html>