|
@@ -23,6 +23,7 @@
|
|
<img class="activity-bg" src="../static/img/changePhoneActivity/activity-bg.png" />
|
|
<img class="activity-bg" src="../static/img/changePhoneActivity/activity-bg.png" />
|
|
<img class="time" src="../static/img/changePhoneActivity/time.png" />
|
|
<img class="time" src="../static/img/changePhoneActivity/time.png" />
|
|
<div class="login-container">
|
|
<div class="login-container">
|
|
|
|
+ <div class="ipt"></div>
|
|
<img class="login-bg" src="../static/img/changePhoneActivity/login-bg.png" />
|
|
<img class="login-bg" src="../static/img/changePhoneActivity/login-bg.png" />
|
|
<div class="login-row-select">
|
|
<div class="login-row-select">
|
|
<div class="login-row-title">平台:</div>
|
|
<div class="login-row-title">平台:</div>
|
|
@@ -189,15 +190,31 @@
|
|
stopManyClick(() => {
|
|
stopManyClick(() => {
|
|
var oInput = document.createElement('input'); //创建一个input
|
|
var oInput = document.createElement('input'); //创建一个input
|
|
oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
|
|
oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
|
|
- oInput.value = window.location.href || 'https://client.androidscloud.com/h5/microserviceUserH5/vcloud/invite.html';
|
|
|
|
- document.body.appendChild(oInput);//将input插入到body
|
|
|
|
- oInput.select(); // 选择对象
|
|
|
|
|
|
+ oInput.value = window.location.href;
|
|
|
|
+ $('.ipt')[0].appendChild(oInput);//将input插入到body
|
|
|
|
+ // oInput.select(); // 选择对象 ios不支持
|
|
|
|
+ selectText(oInput, 0, oInput.value.length);
|
|
document.execCommand("Copy"); // 执行浏览器复制命令
|
|
document.execCommand("Copy"); // 执行浏览器复制命令
|
|
toastr.error('复制当前网址成功!');
|
|
toastr.error('复制当前网址成功!');
|
|
oInput.style.display='none'; // 将input隐藏
|
|
oInput.style.display='none'; // 将input隐藏
|
|
|
|
+ oInput.blur();
|
|
oInput.remove(); // 将input销毁
|
|
oInput.remove(); // 将input销毁
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ // input自带的select()方法在苹果端无法进行选择,所以需要自己去写一个类似的方法
|
|
|
|
+ // 选择文本。createTextRange(setSelectionRange)是input方法
|
|
|
|
+ function selectText(textbox, startIndex, stopIndex) {
|
|
|
|
+ if (textbox.createTextRange) {//ie
|
|
|
|
+ const range = textbox.createTextRange();
|
|
|
|
+ range.collapse(true);
|
|
|
|
+ range.moveStart('character', startIndex);//起始光标
|
|
|
|
+ range.moveEnd('character', stopIndex - startIndex);//结束光标
|
|
|
|
+ range.select();//不兼容苹果
|
|
|
|
+ } else {//firefox/chrome
|
|
|
|
+ textbox.setSelectionRange(startIndex, stopIndex);
|
|
|
|
+ textbox.focus();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//点击选择框
|
|
//点击选择框
|
|
$('.login-row-select')[0].addEventListener('click',()=>{
|
|
$('.login-row-select')[0].addEventListener('click',()=>{
|
|
$('.options')[0].className = 'options show';
|
|
$('.options')[0].className = 'options show';
|