-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.js
88 lines (87 loc) · 3.04 KB
/
index.js
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
var myApp = new Framework7({
modalTitle: 'QQIP探测',
material: true,
swipePanel: 'left',
});
var clipboard = new Clipboard('#copy');
clipboard.on('success', function(e) {
myApp.addNotification({
message: '复制成功',
hold: 1500
});
e.clearSelection()
});
var $$ = Dom7;
var mainView = myApp.addView('.view-main', {});
$$(document).on('ajaxStart', function(e) {
myApp.showIndicator()
});
$$(document).on('ajaxComplete', function(e) {
myApp.hideIndicator()
});
$$('#token').on("focusout", function(e) {
var ts = new Date().getTime().toString();
$$('#get-submit').attr('href', '/data.php?token=' + $$('#token').val() + '&_ts=' + ts)
});
$$('.panel-left').on('open', function() {
$$('.statusbar-overlay').addClass('with-panel-left')
});
$$('.panel-left').on('close', function() {
$$('.statusbar-overlay').removeClass('with-panel-left')
});
$$('#collect-submit').on('click', function(e) {
if ($$("#url").val() == "") {
myApp.addNotification({
message: '请填写跳转链接。',
hold: 1500
});
return
}
if ($$("#shareid").val() == "") {
myApp.addNotification({
message: '警告:你没填Shareid!',
hold: 1500
});
return
}
var ts = new Date().getTime().toString();
var token = CryptoJS.MD5(ts);
var url = "mqqapi://share/to_fri?file_type=news&src_type=web&version=1&generalpastboard=1";
url = url + "&file_type=news&share_id=";
url = url + $$("#shareid").val();
url = url + "&url=";
url = url + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse($$("#url").val())));
url = url + "&image_url=";
url = url + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse("https://love.kke.moe/share.php?_U=" + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse($$("#cover").val()))) + "&_T=" + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(token))))));
url = url + "&title=";
url = url + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse($$("#title").val())));
url = url + "&description=";
url = url + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse($$("#summary").val())));
if ($$("#music").val() != "") {
url = url + "&req_type=";
url = url + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(2)));
url = url + "&audioUrl=";
url = url + encodeURIComponent(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse($$("#music").val())))
}
url = url + "&callback_type=scheme&thirdAppDisplayName=UVE=&app_name=UVE=&cflag=0&shareType=0";
window.open(url);
myApp.alert('你的token是:<br/><a id="copy" data-clipboard-text="' + token + '">' + token + '</a><br/>你可以用这个Token来取回数据。')
});
function ipip(ip) {
myApp.showIndicator();
$.ajax({
url: "/ip.php?ip=" + ip,
success: function(data) {
myApp.alert(data, '归属地');
myApp.hideIndicator()
}
})
}
myApp.addNotification({
message: '此应用仅在酷安网发布。',
hold: 10000
});
myApp.addNotification({
message: '如果出现404,请将跳转链接改为腾讯的链接后再试。',
hold: 1500
});