...
|
...
|
@@ -38,19 +38,26 @@ class NewHome extends Page { |
|
|
}
|
|
|
|
|
|
copyShareUrl() {
|
|
|
this.selector.$wxcs.click(function() {
|
|
|
this.selector.$wxcs.click(()=> {
|
|
|
let clipboard = new Clipboard('#wxcs', {
|
|
|
text: ()=> {
|
|
|
return location.origin + $(this).attr('data-url');
|
|
|
text: () => {
|
|
|
return location.origin + this.selector.$wxcs.attr('data-url');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
clipboard.on('success', function(e) {
|
|
|
clipboard.on('success', (e) => {
|
|
|
e.clearSelection();
|
|
|
tip.show('复制分享地址成功');
|
|
|
$.ajax({
|
|
|
method: 'get',
|
|
|
url: '/home/getCodeUrl',
|
|
|
success: (data) => {
|
|
|
this.selector.$wxcs.attr('data-url', data.data);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
clipboard.on('error', function() {
|
|
|
clipboard.on('error', () => {
|
|
|
tip.show('复制失败');
|
|
|
});
|
|
|
|
...
|
...
|
|