Commit 6b0321f0 by 王锐

success 回调

parent cbb9e6fc
...@@ -196,15 +196,17 @@ ...@@ -196,15 +196,17 @@
$("#filedownload").on("click", function() { $("#filedownload").on("click", function() {
var arr = ["http://img-cdn-qiniu.dcloud.net.cn/static/images/activity/plugin-side.png", var arr = ["http://k5.jst-gov.com/Storages/Reports/Pdf/71230dcf6f8548f9a0101be4e3340a1f/JST-DW201900049AT.pdf"]
"https://www.baidu.com/img/bd_logo1.png"
]
//http://img-cdn-qiniu.dcloud.net.cn/static/images/activity/plugin-side.png //http://img-cdn-qiniu.dcloud.net.cn/static/images/activity/plugin-side.png
// var downUrl = "https://www.baidu.com/img/bd_logo1.png" // var downUrl = "https://www.baidu.com/img/bd_logo1.png"
var savePath = "image/" var savePath = "pdf/"
function success(res) { function success(res) {
alert(res) // alert(res)
console.log(1)
plus.runtime.openFile(res, {}, function(e) {
alert('打开失败')
})
} }
function error(res) { function error(res) {
...@@ -213,6 +215,9 @@ ...@@ -213,6 +215,9 @@
function presence(res) { function presence(res) {
alert(res) alert(res)
plus.runtime.openFile(res, {}, function(e) {
alert('打开失败')
})
} }
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
...@@ -222,7 +227,12 @@ ...@@ -222,7 +227,12 @@
$("#uuid").on("click", function() { $("#uuid").on("click", function() {
getUuid(function success(res) { getUuid(function success(res) {
alert(res) // alert(res)
console.log(2)
alert(1)
plus.runtime.openFile(res, {}, function(e) {
alert('打开失败')
})
}) })
}) })
$("#upload").on("click", function() { $("#upload").on("click", function() {
...@@ -274,4 +284,7 @@ ...@@ -274,4 +284,7 @@
plus.nativeUI.showWaiting('指纹识别中...'); plus.nativeUI.showWaiting('指纹识别中...');
} }
} }
</script> </script>
...@@ -188,7 +188,7 @@ function readerFile(path, name, success, error) { ...@@ -188,7 +188,7 @@ function readerFile(path, name, success, error) {
setUrlFromLocal(d.filename, callback) setUrlFromLocal(d.filename, callback)
function callback(res) { function callback(res) {
alert(res) success(res)
} }
} else { } else {
//下载失败,需删除 本地临时文件,否则下次进来时会检查到文件已存在 //下载失败,需删除 本地临时文件,否则下次进来时会检查到文件已存在
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment