Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
4f93e67d
Commit
4f93e67d
authored
Apr 29, 2021
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载文件
parent
8db45656
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
1 deletions
+72
-1
src/app.json
+2
-1
src/pages/downFile/index.vue
+57
-0
src/pages/downFile/main.js
+6
-0
src/pages/downFile/main.json
+7
-0
No files found.
src/app.json
View file @
4f93e67d
...
@@ -12,7 +12,8 @@
...
@@ -12,7 +12,8 @@
"pages/tabBar2/main"
,
"pages/tabBar2/main"
,
"pages/tabBar3/main"
,
"pages/tabBar3/main"
,
"pages/tabBar4/main"
,
"pages/tabBar4/main"
,
"pages/changeAdr/main"
"pages/changeAdr/main"
,
"pages/downFile/main"
],
],
"usingComponents"
:
{},
"usingComponents"
:
{},
"window"
:
{
"window"
:
{
...
...
src/pages/downFile/index.vue
0 → 100644
View file @
4f93e67d
<
template
>
<div
class=
"container"
>
<van-loading
style=
"margin-top:20%"
v-if=
"status"
size=
"24px"
vertical
>
下载中...
</van-loading>
</div>
</
template
>
<
script
>
export
default
{
data
(){
return
{
status
:
true
}
},
created
(){
// this.download()
},
methods
:
{
download
(){
let
down
=
wx
.
downloadFile
({
url
:
'http://bkzs.hfut.edu.cn/generic/web/viewer.html?file=/userfiles/1/files/files/2019/12/%E5%90%88%E8%82%A5%E5%B7%A5%E4%B8%9A%E5%A4%A7%E5%AD%A62019%E5%B9%B4%E6%8A%A5%E8%80%83%E6%8C%87%E5%8D%971.pdf'
,
success
:
(
data
)
=>
{
console
.
log
(
'下载成功'
,
data
)
console
.
log
(
data
.
tempFilePath
)
if
(
data
.
statusCode
==
200
){
wx
.
openDocument
({
filePath
:
data
.
tempFilePath
,
showMenu
:
true
,
fileType
:
'pdf'
,
success
:
function
(
res
)
{
console
.
log
(
'打开文档成功'
,
res
)
}
})
}
},
fail
:
(
err
)
=>
{
console
.
log
(
'下载失败'
,
err
)
}
})
down
.
onProgressUpdate
((
res
)
=>
{
console
.
log
(
res
,
'res'
)
if
(
res
.
progress
==
100
){
console
.
log
(
'下载成功'
)
this
.
status
=
false
}
})
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
</
style
>
\ No newline at end of file
src/pages/downFile/main.js
0 → 100644
View file @
4f93e67d
import
Vue
from
'vue'
import
App
from
'./index'
const
app
=
new
Vue
(
App
)
app
.
$mount
()
\ No newline at end of file
src/pages/downFile/main.json
0 → 100644
View file @
4f93e67d
{
"navigationBarTitleText"
:
"下载"
,
"usingComponents"
:
{
"van-loading"
:
"/static/vant/loading/index"
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment