Authored by 王水玲

有货有赚 复制粘贴

... ... @@ -27,8 +27,7 @@ class HaveGainApplyPage extends Page {
}
init() {
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
let that = this;
let clipboard = new Clipboard('.added', {
text: function() {
return '有货有赚';
... ... @@ -42,6 +41,20 @@ class HaveGainApplyPage extends Page {
});
clipboard.on('success', function(e) {
that.copyDialog();
e.clearSelection();
});
clipboard.on('error', function() {
that.copyDialog();
});
this.bindEvents();
}
copyDialog() {
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
let hasFooter = {
leftBtnText: '取消',
rightBtnText: '去添加'
... ... @@ -60,11 +73,6 @@ class HaveGainApplyPage extends Page {
}, function() {
window.location.href = 'weixin://';
});
e.clearSelection();
});
this.bindEvents();
}
bindEvents() {
... ...
... ... @@ -15,8 +15,7 @@ class HaveGainVerifyPage extends Page {
}
init() {
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
let that = this;
let clipboard = new Clipboard('.add-btn', {
text: function() {
return '有货有赚';
... ... @@ -24,6 +23,18 @@ class HaveGainVerifyPage extends Page {
});
clipboard.on('success', function(e) {
that.copyDialog();
e.clearSelection();
});
clipboard.on('error', function() {
that.copyDialog();
});
}
copyDialog() {
let ua = navigator.userAgent.toLowerCase();
let isWeixin = ua.indexOf('micromessenger') !== -1;
let hasFooter = {
leftBtnText: '取消',
rightBtnText: '去添加'
... ... @@ -42,9 +53,6 @@ class HaveGainVerifyPage extends Page {
}, function() {
window.location.href = 'weixin://';
});
e.clearSelection();
});
}
}
... ...