|
@@ -74,9 +74,10 @@
|
|
|
<input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="inviteCopy" value="">
|
|
|
<script>
|
|
|
toastr.options.positionClass = 'toast-center-center';
|
|
|
- toastr.options.timeOut = '3000';
|
|
|
+ toastr.options.timeOut = '1500';
|
|
|
</script>
|
|
|
<script type="text/javascript">
|
|
|
+ let timer,flag = true;
|
|
|
var url = window.location.href;
|
|
|
url = url.split('/')
|
|
|
// var baseUrl = url[0] + '//' + url[2]
|
|
@@ -85,6 +86,7 @@
|
|
|
var n2 = loc.indexOf("=");//取得=号的位置
|
|
|
// var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
|
|
|
var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
|
|
|
+
|
|
|
|
|
|
var u = navigator.userAgent;
|
|
|
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
@@ -102,17 +104,18 @@
|
|
|
$('#invitationCode').text(res.data.invitationCode)
|
|
|
//加载数据
|
|
|
$('#passwordCopy').val($('#invitationCode').text());
|
|
|
-
|
|
|
//复制按钮
|
|
|
$('.btn-code-copy').on('click', function () {
|
|
|
- var input = document.getElementById("passwordCopy");
|
|
|
- // 选中文本
|
|
|
- input.select();
|
|
|
- // 执行浏览器复制命令
|
|
|
- document.execCommand("copy");
|
|
|
- toastr.error('复制成功', 0)
|
|
|
+ stopManyClick(() =>{
|
|
|
+ var input = document.getElementById("passwordCopy");
|
|
|
+ // 选中文本
|
|
|
+ input.select();
|
|
|
+ // 执行浏览器复制命令
|
|
|
+ // document.activeElement.blur();
|
|
|
+ document.execCommand("copy");
|
|
|
+ toastr.error('复制成功', 0)
|
|
|
+ })
|
|
|
});
|
|
|
-
|
|
|
if (res.data.friendList.length > 0) {
|
|
|
var str = ''
|
|
|
for (var i = 0; i < res.data.friendList.length; i++) {
|
|
@@ -138,18 +141,21 @@
|
|
|
})
|
|
|
|
|
|
$("#recv_ipt").bind('input propertychange', function (e) {
|
|
|
- var ipt_phones = $('#recv_ipt').val();
|
|
|
- var c = $(this);
|
|
|
- if (/[^\d]/.test(c.val())) {//替换非数字字符
|
|
|
- var temp_amount = c.val().replace(/[^\d]/g, '');
|
|
|
- $(this).val(temp_amount);
|
|
|
- toastr.error('请输入正确的手机号')
|
|
|
- }
|
|
|
- if (ipt_phones.length >= 12) {
|
|
|
- toastr.error('请输入正确的手机号')
|
|
|
- var recvstr = ipt_phones.substring(0, 11)
|
|
|
- $("#recv_ipt").val(recvstr);
|
|
|
- }
|
|
|
+ stopManyClick(() =>{
|
|
|
+ var ipt_phones = $('#recv_ipt').val();
|
|
|
+ var c = $(this);
|
|
|
+ if (/[^\d]/.test(c.val())) {//替换非数字字符 v1/promote
|
|
|
+ var temp_amount = c.val().replace(/[^\d]/g, '');
|
|
|
+ $(this).val(temp_amount);
|
|
|
+ toastr.error('请输入正确的手机号')
|
|
|
+ }
|
|
|
+ if (ipt_phones.length >= 12) {
|
|
|
+ toastr.error('请输入正确的手机号')
|
|
|
+ var recvstr = ipt_phones.substring(0, 11)
|
|
|
+ $("#recv_ipt").val(recvstr);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
});
|
|
|
function handleShow() {
|
|
|
$('.dialog').animate({top: '2.4rem'},"fast");
|
|
@@ -207,16 +213,19 @@
|
|
|
dataType: 'json',
|
|
|
cache: false,
|
|
|
success: function (res) {
|
|
|
- //加载数据
|
|
|
- var copyBefore = JSON.stringify(res.data.url);
|
|
|
- var copyUrl = copyBefore.split('"');
|
|
|
- $('#inviteCopy').val(copyUrl[1]);
|
|
|
- var input = document.getElementById("inviteCopy");
|
|
|
- // 选中文本
|
|
|
- input.select();
|
|
|
- // 执行浏览器复制命令
|
|
|
- document.execCommand("copy");
|
|
|
- toastr.error('复制成功')
|
|
|
+ stopManyClick(() =>{
|
|
|
+ //加载数据
|
|
|
+ var copyBefore = JSON.stringify(res.data.url);
|
|
|
+ var copyUrl = copyBefore.split('"');
|
|
|
+ console.log(copyUrl[1])
|
|
|
+ $('#inviteCopy').val(copyUrl[1]);
|
|
|
+ var input = document.getElementById("inviteCopy");
|
|
|
+ // 选中文本
|
|
|
+ input.select();
|
|
|
+ // 执行浏览器复制命令
|
|
|
+ document.execCommand("copy");
|
|
|
+ toastr.error('复制成功')
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -297,6 +306,15 @@
|
|
|
})
|
|
|
}
|
|
|
getInvitationRecently()
|
|
|
+ //防止提示一秒内重复显示
|
|
|
+ function stopManyClick(fn) {
|
|
|
+ if (flag) {
|
|
|
+ fn();
|
|
|
+ }
|
|
|
+ flag = false;
|
|
|
+ if(timer){clearTimeout(timer);}
|
|
|
+ timer = setTimeout(() => {flag = true}, 1500);
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
|