1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | data() { return { title: '2019XXXX,冲呀', desc: '分享内容描述', share_url: 'http://example.com', image_url: 'https://example.com/image.jpg', } },
methods: { shareUC() { const isiOS = /(iPhone|iPad|iPod)/.test(navigator.userAgent); // 判断应用平台 if (isiOS) { if (ucbrowser.web_shareEX) { ucbrowser.web_shareEX( JSON.stringify({ title: this.title, content: this.desc, sourceUrl: this.share_url, imageUrl: this.image_url, source: 'Example Source', target: '' }) ) } else { ucbrowser.web_share(this.title, this.desc, this.share_url, undefined, '', 'Example Source', this.image_url); } } else { ucweb.startRequest('shell.page_share', [this.title, this.desc, this.share_url, '', '', 'Example Source', this.image_url]); } }, } |