Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TripFriend
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
TripFriend
Commits
c4a3b37a
Commit
c4a3b37a
authored
Mar 17, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存视频
parent
2ad80a63
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
7 deletions
+83
-7
app.json
app.json
+0
-1
video.js
pages/video/video.js
+36
-1
video.wxml
pages/video/video.wxml
+2
-2
video.wxss
pages/video/video.wxss
+3
-0
video_t.js
pages/video/video_t/video_t.js
+36
-0
video_t.wxml
pages/video/video_t/video_t.wxml
+2
-2
video_t.wxss
pages/video/video_t/video_t.wxss
+4
-1
No files found.
app.json
View file @
c4a3b37a
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
"navigationBarTitleText"
:
"WeChat"
,
"navigationBarTitleText"
:
"WeChat"
,
"navigationBarTextStyle"
:
"black"
"navigationBarTextStyle"
:
"black"
},
},
"style"
:
"v2"
,
"sitemapLocation"
:
"sitemap.json"
,
"sitemapLocation"
:
"sitemap.json"
,
"tabBar"
:
{
"tabBar"
:
{
"selectedColor"
:
"#d4237a"
,
"selectedColor"
:
"#d4237a"
,
...
...
pages/video/video.js
View file @
c4a3b37a
...
@@ -714,6 +714,41 @@ Page({
...
@@ -714,6 +714,41 @@ Page({
result
=
Nyear
+
"-"
+
Nmonth
+
"-"
+
Ndate
result
=
Nyear
+
"-"
+
Nmonth
+
"-"
+
Ndate
}
}
return
result
;
return
result
;
}
},
down_sp
:
function
(){
let
VideoAddress
=
this
.
data
.
videoList
[
this
.
data
.
current
].
VideoAddress
wx
.
downloadFile
({
url
:
VideoAddress
,
//仅为示例,并非真实的资源
success
(
res
)
{
// 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
if
(
res
.
statusCode
===
200
)
{
wx
.
playVoice
({
filePath
:
res
.
tempFilePath
})
}
wx
.
saveVideoToPhotosAlbum
({
filePath
:
res
.
tempFilePath
,
success
:
function
(
data
)
{
wx
.
showModal
({
title
:
'下载成功'
,
content
:
'视频以保存至您的手机'
,
confirmText
:
'确定'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
},
})
}
})
},
})
})
\ No newline at end of file
pages/video/video.wxml
View file @
c4a3b37a
...
@@ -22,10 +22,10 @@
...
@@ -22,10 +22,10 @@
<text class="btnBoxText">{{item.CommentNum}}</text>
<text class="btnBoxText">{{item.CommentNum}}</text>
</view>
</view>
<
view class='btnTx'
>
<
button class='btnTx' bindtap="down_sp"
>
<image style="width:69rpx;height:62rpx" src='../../images/index/fx.png'></image>
<image style="width:69rpx;height:62rpx" src='../../images/index/fx.png'></image>
</
view
>
</
button
>
<view class='btnTx' style="margin-top:20rpx">
<view class='btnTx' style="margin-top:20rpx">
<image style="width:69rpx;height:62rpx;marginTop:20rpx" src='../../images/index/sp.png'></image>
<image style="width:69rpx;height:62rpx;marginTop:20rpx" src='../../images/index/sp.png'></image>
</view>
</view>
...
...
pages/video/video.wxss
View file @
c4a3b37a
...
@@ -337,3 +337,6 @@ slider{
...
@@ -337,3 +337,6 @@ slider{
color: #111111;
color: #111111;
padding-left:20rpx
padding-left:20rpx
}
}
button::after{
border: none
}
pages/video/video_t/video_t.js
View file @
c4a3b37a
...
@@ -688,5 +688,41 @@ Page({
...
@@ -688,5 +688,41 @@ Page({
}
}
return
result
;
return
result
;
}
}
,
down_sp
:
function
()
{
let
VideoAddress
=
this
.
data
.
videoList
[
this
.
data
.
current
].
VideoAddress
wx
.
downloadFile
({
url
:
VideoAddress
,
//仅为示例,并非真实的资源
success
(
res
)
{
// 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
if
(
res
.
statusCode
===
200
)
{
wx
.
playVoice
({
filePath
:
res
.
tempFilePath
})
}
wx
.
saveVideoToPhotosAlbum
({
filePath
:
res
.
tempFilePath
,
success
:
function
(
data
)
{
wx
.
showModal
({
title
:
'下载成功'
,
content
:
'视频以保存至您的手机'
,
confirmText
:
'确定'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
},
})
}
})
},
})
})
\ No newline at end of file
pages/video/video_t/video_t.wxml
View file @
c4a3b37a
...
@@ -22,10 +22,10 @@
...
@@ -22,10 +22,10 @@
<text class="btnBoxText">{{item.CommentNum}}</text>
<text class="btnBoxText">{{item.CommentNum}}</text>
</view>
</view>
<view class='btnTx'
>
<button class='btnTx' bindtap="down_sp"
>
<image style="width:69rpx;height:62rpx" src='../../../images/index/fx.png'></image>
<image style="width:69rpx;height:62rpx" src='../../../images/index/fx.png'></image>
</
view
>
</
button
>
<view class='btnTx' style="margin-top:20rpx">
<view class='btnTx' style="margin-top:20rpx">
<image style="width:69rpx;height:62rpx;marginTop:20rpx" src='../../../images/index/sp.png'></image>
<image style="width:69rpx;height:62rpx;marginTop:20rpx" src='../../../images/index/sp.png'></image>
</view>
</view>
...
...
pages/video/video_t/video_t.wxss
View file @
c4a3b37a
...
@@ -347,4 +347,7 @@ slider{
...
@@ -347,4 +347,7 @@ slider{
width: 40rpx;
width: 40rpx;
height: 40rpx;
height: 40rpx;
}
}
\ No newline at end of file
button::after{
border: none
}
\ 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