uniapp share

wxShare() {
              
                downPdf({
                    flag: 'user',
                    pernr: this.userinFor.pernr
                }).then(res => {
                    this.shareUrl = res[1].data;
                    let url = ` ${this.$baseUrl}/images/userinformation/${this.shareUrl}`;
                    var dtask = plus.downloader.createDownload(
                        url, {
                            filename: '_doc/pdf/' + this.shareUrl
                        },
                        function(d, status) {
                            // 下载完成
                            if (status == 200) {
                                FileShare.render({
                                        type: 'SYSTEM', //QQ为QQ,微信为WX,系统默认是SYSTEM,不填写默认SYSTEM
                                        filePath: plus.io.convertLocalFileSystemURL(d.filename)
                                    },
                                    result => {}
                                );
                            } else {
                                'Download failed: ' + status;
                            }
                        }
                    );
                    dtask.start();
                  
                });
            },

 

Guess you like

Origin blog.csdn.net/qq_45555960/article/details/112617619
Recommended