×

注意!页面内容来自https://ask.dcloud.net.cn/question/48119,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

<> .markdown-body img { display: none; } .center_image { max-width: 800px !important; text-align: center; } .show_span { margin-left: 10px; } .label_show_span { margin-left: 8px; } .new_bug_show { margin-top: 20px; } .label_show_span.markitup-box .label_show_span { font-size: 16px; margin-left: 0; } .markdown-body { margin: 20px 0; } .aw-comment-detail img { max-width: 100%; } <> .markdown-body h2 { border-bottom: none; } .markitup-box a { color: #428bca; } .ai-tag { font-size: 12px; color: #ccc; } .aw-replay-box-control .btn { line-height: normal; } .robot-quick-answer { margin-left: 10px; } .aw-thanks { color: #22ac38; } .aw-thanks .fa.fa-heart { color: #22ac38; } .aw-suspend-panel { position: fixed; top: 200px; margin-left: -70px; } .aw-suspend-panel .aw-panel-btn { padding: 10px; background: #eee; border-radius: 50%; margin-top: 10px; } .aw-suspend-panel .aw-panel-btn a:visited.aw-suspend-panel .aw-panel-btn a:focus.aw-suspend-panel .aw-panel-btn a:hover { text-decoration: none; color: #999; } .content-box { padding: 16px; overflow: auto; font-size: 14px; line-height: 1.45; border-radius: 5px; border: 1px solid #ccc; margin-bottom: 30px; overflow: hidden; } .content-inner-p { width: 50%; line-height: 2; float: left; } .content-inner-p > span:first-child { display: inline-block; width: 200px; color: #333; font-size: 14px; font-weight: bold; } .title-line { position: relative; color: #333; font-size: 14px; padding-left: 40px; margin: 20px 0; /* border-bottom: 1px #dfe6df solid; */ } .title-line::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; margin: auto 0; height: 1px; width: 100%; background-color: #dfe6df; z-index: -1; } .title-line span { padding: 0 15px; background-color: #fff; z-index: 2; } .aw-mod-body{ word-wrap: break-word; } .paid-tip { color: red; position: relative; font-size: 9px; } .paid-tip .paid-level { width: 10px !important; height: 10px !important; position: relative !important; border-radius: 50% !important; left: 0 !important; top: 0 !important; background-color: red; margin-right: 4px; padding: 2px; } .paid-tip .paid-level.paid-level-3{ background: url("//img-cdn-tc.dcloud.net.cn/static/common/sponsor-3.png") no-repeat; background-size: 100% 100%; /*background-color: #fb6f18;*/ } .paid-tip .paid-level.paid-level-2 { background-color: #ffb400; } .paid-tip .paid-level.paid-level-1{ background-color: #bbc0f0; } .paid-tip .paid-text-1{ color: #bbc0f0; } .paid-tip .paid-text-2{ color: #ffb400; } .paid-tip .paid-text-3{ color: #fb6f18; } .vote-mode a.active .fa-thumbs-down{ color: #c7254e; }
靓仔
靓仔
  • 发布:2017-09-27 17:38
  • 更新:2018-11-10 12:52
  • 阅读:1485

最新云端打包安卓apk,无法调用下载功能

分类:HBuilder

hbuilder版本 8.8.0 提交代码到云端打包,无法调用下载功能, 代码走到plus.downloader.createDownload就不继续往下走了

另外最新版本的Hbuilder8.8.3 调用plus.gallery.save报错,错误信息 code 12 message UNKNOWEN ERROR

2017-09-27 17:38 负责人:无 分享
已邀请:
DCloud_Android_ST

DCloud_Android_ST

目前测试最新版本未发现你描述的问题,可能代码使用不同,请描述清楚问题步骤及而是手机型号,系统版本,并提供一下相对应的测试DEMO工程。方便我们测试并及时修改 谢谢!

靓仔

靓仔 (作者) - IT

手机机型 米4,
Hbuilder版本 HBuilder 8.8.0.201706142254

下面是我的下载函数

参数data是一个图片地址数组, index 是要下载的图片数量

recursive_save(dataindex) {
var i = index >= data.length ? data.length - 1 : index;
if(i<0){
plus.io.resolveLocalFileSystemURL( '_downloads/share/yibei/'function(entry){
if(entry.isDirectory){
entry.removeRecursively();
}
} );
return false;
}

  plus.nativeUI.showWaiting();  
  var dtask=nullthat = this;  

  var pic = data[i]sd_path;  
  var regexp = /\/.*\/(.*\.jpeg|.*\.jpg|.*\.png)/i;  
  var pic_name;  
  if(pic.match(regexp)){  
      pic_name = RegExp.$1;  
  }  
  console.log("开始下载1");  
  dtask = plus.downloader.createDownload( this.pic_domain pic ,{  
      filename:'share/yibei/'  
  },function(d,status){  
    console.log("开始下载2");  
    console.log(d.state);  
      if (d.state == 4 
  • h***@163.com

    你这个把{

    filename:'share/yibei/'

    } 改为 {} 试下

    2018-11-10 12:54

h***@163.com

h***@163.com

我是保存到相册的时候,code 12,代码如下

plus.downloader.createDownload('https://ws2.sinaimg.cn/large/006tNbRwly1funi7tgar5j30iq0ow431.jpg'{}(downloadstatus) =>{  
                    console.log(download,status)  
                    if(status == 200){  
                        plus.gallery.save(download.filename  (e) => {  
                            console.log(e)  
                            this.$toast({  
                                message: '保存到相册成功' 
                                position: 'bottom' 
                            })  
                        }(e) => {  
                            console.log(e)  
                            this.$toast({  
                                message: '保存到相册失败' 
                                position: 'bottom' 
                            })  
                        } )  

                    }  

                }).start()

该问题目前已经被锁定无法添加新回复

<> .bdqctloud_div { padding-top: 20px; margin-bottom: 20px; border: 1px dashed #cccccc; position: relative; border-left: none; border-right: none; padding-bottom: 20px; padding-left: 20px; } .bdqctloud_left { position: relative; margin-left: 3vw; width: 500px; } .bdqctloud_articel{ position: relative; margin-left: 2vw; width: 500px; } .dcloud_news { color: #f9f9f9 !important; cursor: default; } .aw-footer .divider { margin-left: 10px; margin-right: 10px; } /*.ad_dev_right{*/ /* position: relative;*/ /* left: 580px;*/ /* top: 25px;*/ /*}*/