起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2391|回复: 3

[结贴] 文件打开插件问题(cordova-open)

[复制链接]

12

主题

38

帖子

127

积分

初级会员

Rank: 2

积分
127
QQ
发表于 2017-6-21 14:45:56 | 显示全部楼层 |阅读模式
        Model.prototype.openFile = function(fileUrl){
                if(this.wx){
                        warning.onAlert();
                }else {
//                        var open = cordova.plugins.disusered.open;

                        function success() {
                          console.log('Success');
                          alert("Success");
                        }
                       
                        function error(code) {
                                alert(code);
                          if (code === 1) {
                            console.log('No file handler found');
                            alert("No file handler found");
                          } else {
                            console.log('Undefined error');
                            alert("Undefined error");
                          }
                        }
                        cordova.plugins.disusered.open(fileUrl, success, error);
                }
        }
       
        Model.prototype.button2Click = function(event){
                this.openFile('http://192.168.8.34/Rec/courseFile/1000100000/201762009311812312/20170508.doc');
               
        };
Model.prototype.button1Click = function(event){
                this.openFile('http://192.168.8.34/Rec/courseFile/1000100000/201612070302136078/201612070302136078.ppt');
        };

        Model.prototype.button3Click = function(event){
                this.openFile('http://192.168.8.34/Rec/courseFile/1000100000/201612070239318852/201612070239318852.pptx');
        };

        Model.prototype.button4Click = function(event){
                this.openFile('http://192.168.8.34/Rec/courseFile/1000100000/201762009311812312/2017620095952.docx');
        };

        Model.prototype.button6Click = function(event){
                this.openFile('http://192.168.8.34/Rec/20170504-225935/HD/resource/videos/1_1.mp4');
        };

        Model.prototype.button5Click = function(event){
                this.openFile('http://imgsrc.baidu.com/imgad/pic/item/caef76094b36acaf0accebde76d98d1001e99ce7.jpg');
        };

        Model.prototype.button7Click = function(event){
                this.openFile('http://192.168.8.34/hls/1493174178997_01_H.m3u8');
        };

        Model.prototype.button10Click = function(event){
                this.openFile('http://192.168.8.34/Rec/courseFile/1000100000/201612070239318852/201612070239318852.swf');
        };

        Model.prototype.button11Click = function(event){
                this.openFile('http://192.168.8.34/Rec/courseFile/1000100000/201612070239318852/201612070239318852.pdf');
        };

        Model.prototype.button12Click = function(event){
                this.openFile('rtmp://192.168.8.34/live/1493174178997_01_H');
        };

        Model.prototype.button8Click = function(event){
                this.openFile('http://192.168.8.34/Rec/courseFile/1000100000/201762009311812312/2017620095357.xls');
        };

        Model.prototype.button9Click = function(event){
                this.openFile('http://192.168.8.34/Rec/excel/import_registration_user.xlsx');
        };

使用此方法进行文件打开,在安卓系统中没有任何问题,在苹果系统中就出现APP闪退现象。我的IOS版本是10.3.2。

发表于 2017-6-21 15:14:19 | 显示全部楼层
本帖最后由 liangyongfei 于 2017-6-21 15:17 编辑

手机中打开文件建议参考:
http://docs.wex5.com/open-file/是否正常??

其他ios的版本呢??有没有问题??
麻烦您先重现下!如果只是这个版本有问题,
希望把手机型号版本说清楚!我们重现下!

qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

12

主题

38

帖子

127

积分

初级会员

Rank: 2

积分
127
QQ
 楼主| 发表于 2017-6-21 16:03:00 | 显示全部楼层
liangyongfei 发表于 2017-6-21 15:14
手机中打开文件建议参考:
http://docs.wex5.com/open-file/是否正常??

我使用3.7版本打包解决了此问题。
回复 支持 反对

使用道具 举报

52

主题

158

帖子

522

积分

高级会员

Rank: 4

积分
522
QQ
发表于 2017-8-24 15:28:10 | 显示全部楼层
您好,我在做APP中查看文档的时候有问题,能否将你的打开文档的代码分享下?万分感谢。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-5-3 18:57 , Processed in 0.094592 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表