Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fb7f082b
authored
Oct 24, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix;添加视频下载
1 parent
a54a5b91
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
19 deletions
pages/tab/index/components/product/product.js
pages/tab/index/components/product/product.scss
pages/tab/index/components/product/product.wxml
pages/tab/index/index.js
pages/tab/index/index.scss
pages/tab/index/components/product/product.js
View file @
fb7f082
...
@@ -53,6 +53,7 @@ Component({
...
@@ -53,6 +53,7 @@ Component({
},
},
lifetimes
:
{
lifetimes
:
{
ready
:
function
()
{
ready
:
function
()
{
console
.
log
(
'window'
,
window
)
if
(
!
this
.
data
.
outshowVideo
){
if
(
!
this
.
data
.
outshowVideo
){
this
.
setData
({
this
.
setData
({
...
@@ -148,14 +149,26 @@ Component({
...
@@ -148,14 +149,26 @@ Component({
},
},
// 视频下载
// 视频下载
downVideo
(
e
){
downVideo
(
e
){
let
{
src
}
=
e
.
currentTarget
.
dataset
let
{
url
}
=
e
.
target
.
dataset
console
.
log
(
'src: '
,
src
);
console
.
log
(
url
)
wx
.
saveVideoToPhotosAlbum
({
wx
.
$api
.
showToast
(
'正在下载视频...'
)
filePath
:
src
,
wx
.
downloadFile
({
success
(
res
)
{
url
:
url
,
console
.
log
(
'视频下载'
,
res
)
success
(
res
)
{
}
// console.log(res,111)
})
if
(
res
.
statusCode
===
200
)
{
wx
.
saveVideoToPhotosAlbum
({
filePath
:
res
.
tempFilePath
,
success
(
res
)
{
setTimeout
(()
=>
{
wx
.
$api
.
showToast
(
'下载成功!'
)
},
2000
)
}
})
}
}
})
},
},
saleTextChange
(
e
)
{},
saleTextChange
(
e
)
{},
changeTab
(
e
)
{
changeTab
(
e
)
{
...
@@ -170,9 +183,11 @@ wx.saveVideoToPhotosAlbum({
...
@@ -170,9 +183,11 @@ wx.saveVideoToPhotosAlbum({
});
});
},
},
scrolltoupper
(
event
)
{
scrolltoupper
(
event
)
{
console
.
log
(
event
.
detail
.
scrollHeight
,
event
.
detail
.
scrollTop
)
const
idx
=
this
.
data
.
heightArr
.
findIndex
(
const
idx
=
this
.
data
.
heightArr
.
findIndex
(
(
item
)
=>
item
>
event
.
detail
.
scroll
Top
(
item
)
=>
item
>
event
.
detail
.
scroll
Height
);
);
console
.
log
(
'idx'
,
idx
)
this
.
setData
({
this
.
setData
({
curTabIdx
:
idx
,
curTabIdx
:
idx
,
});
});
...
...
pages/tab/index/components/product/product.scss
View file @
fb7f082
...
@@ -144,8 +144,8 @@
...
@@ -144,8 +144,8 @@
}
}
.project-img
{
.project-img
{
height
:
1600rpx
;
//
height: 1600rpx;
white-space
:
nowrap
;
//
white-space: nowrap;
.img-item
{
.img-item
{
position
:
relative
;
position
:
relative
;
}
}
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
}
}
.stickyTab
{
.stickyTab
{
position
:
sticky
;
position
:
sticky
;
z-index
:
1
;
z-index
:
2
;
background-color
:
#f5f7fb
;
background-color
:
#f5f7fb
;
}
}
// .out-tab{
// .out-tab{
...
@@ -326,6 +326,7 @@
...
@@ -326,6 +326,7 @@
font-size
:
0
;
font-size
:
0
;
}
}
.video-item
{
.video-item
{
position
:
relative
;
width
:
calc
(
50%
-
12rpx
);
width
:
calc
(
50%
-
12rpx
);
margin-bottom
:
32rpx
;
margin-bottom
:
32rpx
;
}
}
...
@@ -334,6 +335,14 @@
...
@@ -334,6 +335,14 @@
height
:
590rpx
;
height
:
590rpx
;
// border: 1rpx dashed #AFB0B2;
// border: 1rpx dashed #AFB0B2;
}
}
.video-item
.download
{
position
:
absolute
;
top
:
0
;
right
:
2px
;
font-size
:
26rpx
;
color
:
#666
;
z-index
:
1
;
}
.video-item
:nth-child
(
even
)
{
.video-item
:nth-child
(
even
)
{
margin-left
:
22rpx
;
margin-left
:
22rpx
;
}
}
...
...
pages/tab/index/components/product/product.wxml
View file @
fb7f082
...
@@ -25,9 +25,6 @@
...
@@ -25,9 +25,6 @@
<image class="icon" src="{{IMGURL}}share.png" />
<image class="icon" src="{{IMGURL}}share.png" />
<text>分享</text>
<text>分享</text>
</view>
</view>
<!-- <view class="" bindtap="downVideo" data-src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/video/360_AR.mp4?v=" hover-class="none" hover-stop-propagation="false">
视频下载
</view> -->
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -86,6 +83,7 @@
...
@@ -86,6 +83,7 @@
<view class="video-list">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<view class="video-item">
<view class="video-item">
<view class="download" bindtap="downVideo" data-url="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}">视频下载</view>
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" />
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" />
<view class="video-text">{{item.name}}</view>
<view class="video-text">{{item.name}}</view>
</view>
</view>
...
...
pages/tab/index/index.js
View file @
fb7f082
...
@@ -317,11 +317,11 @@ Page({
...
@@ -317,11 +317,11 @@ Page({
break
break
case
'protectMembrane'
:
case
'protectMembrane'
:
// 漆面保护膜
// 漆面保护膜
profit
=
(
flow
*
0.05
*
3000
*
12
).
toFixed
(
0
)
profit
=
(
sales
*
0.05
*
3000
*
12
).
toFixed
(
0
)
break
break
case
'colorMembrane'
:
case
'colorMembrane'
:
// 改色膜
// 改色膜
profit
=
(
flow
*
0.05
*
5000
*
12
).
toFixed
(
0
)
profit
=
(
sales
*
0.05
*
5000
*
12
).
toFixed
(
0
)
break
break
case
'digitBeauty'
:
case
'digitBeauty'
:
// 数字化美容
// 数字化美容
...
...
pages/tab/index/index.scss
View file @
fb7f082
...
@@ -10,7 +10,7 @@ page {
...
@@ -10,7 +10,7 @@ page {
width
:
100%
;
width
:
100%
;
background-size
:
100%
100%
;
background-size
:
100%
100%
;
margin-bottom
:
32rpx
;
margin-bottom
:
32rpx
;
z-index
:
1
;
z-index
:
2
;
.header
{
.header
{
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
...
@@ -330,7 +330,7 @@ page {
...
@@ -330,7 +330,7 @@ page {
width
:
60px
;
width
:
60px
;
height
:
60px
;
height
:
60px
;
border-radius
:
50%
;
border-radius
:
50%
;
z-index
:
1
;
z-index
:
2
;
}
}
.output-value
{
.output-value
{
position
:
fixed
;
position
:
fixed
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment