...
|
...
|
@@ -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,26 +23,35 @@ class HaveGainVerifyPage extends Page { |
|
|
});
|
|
|
|
|
|
clipboard.on('success', function(e) {
|
|
|
let hasFooter = {
|
|
|
leftBtnText: '取消',
|
|
|
rightBtnText: '去添加'
|
|
|
};
|
|
|
that.copyDialog();
|
|
|
e.clearSelection();
|
|
|
});
|
|
|
|
|
|
if (isWeixin) {
|
|
|
hasFooter = {
|
|
|
centerBtnText: '确认'
|
|
|
};
|
|
|
}
|
|
|
clipboard.on('error', function() {
|
|
|
that.copyDialog();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
dialog.showDialog({
|
|
|
dialogText: '“有货有赚”服务号已经复制,请去微信搜索添加',
|
|
|
hasClass: 'dialog-text-apply',
|
|
|
hasFooter: hasFooter
|
|
|
}, function() {
|
|
|
window.location.href = 'weixin://';
|
|
|
});
|
|
|
copyDialog() {
|
|
|
let ua = navigator.userAgent.toLowerCase();
|
|
|
let isWeixin = ua.indexOf('micromessenger') !== -1;
|
|
|
let hasFooter = {
|
|
|
leftBtnText: '取消',
|
|
|
rightBtnText: '去添加'
|
|
|
};
|
|
|
|
|
|
e.clearSelection();
|
|
|
if (isWeixin) {
|
|
|
hasFooter = {
|
|
|
centerBtnText: '确认'
|
|
|
};
|
|
|
}
|
|
|
|
|
|
dialog.showDialog({
|
|
|
dialogText: '“有货有赚”服务号已经复制,请去微信搜索添加',
|
|
|
hasClass: 'dialog-text-apply',
|
|
|
hasFooter: hasFooter
|
|
|
}, function() {
|
|
|
window.location.href = 'weixin://';
|
|
|
});
|
|
|
}
|
|
|
}
|
...
|
...
|
|