Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
0605e2ff
Commit
0605e2ff
authored
Nov 25, 2019
by
sujie@126.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
96d3f9fe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
9 deletions
+43
-9
websiteindex.js
service/customer/websiteindex.js
+1
-1
onlineclassroomplay.js
src/pages/websiteindex/onlineclassroomplay.js
+11
-0
onlineclassroomplay.wxml
src/pages/websiteindex/onlineclassroomplay.wxml
+3
-3
index.js
utilities/index.js
+24
-2
wxApi.js
utilities/wxApi.js
+4
-3
No files found.
service/customer/websiteindex.js
View file @
0605e2ff
...
...
@@ -137,7 +137,7 @@ function onlinecoursesverifypwd (data) {
return
wxRequest
({
url
:
apis
.
customer
.
websiteindex
.
onlinecoursesverifypwd
,
data
,
method
:
'
GE
T'
,
method
:
'
POS
T'
,
errorresolve
:
1
,
})
}
...
...
src/pages/websiteindex/onlineclassroomplay.js
View file @
0605e2ff
...
...
@@ -945,4 +945,15 @@ Page({
})
})
},
// 课件图片
prevContentImg
(
e
)
{
const
{
dataset
}
=
e
.
currentTarget
;
const
current
=
dataset
.
src
;
const
images
=
this
.
data
.
coursesDetail
.
content
.
images
;
wxPreviewImage
({
urls
:
[
current
],
current
:
current
,
type
:
'media'
})
},
})
\ No newline at end of file
src/pages/websiteindex/onlineclassroomplay.wxml
View file @
0605e2ff
...
...
@@ -5,11 +5,11 @@
<view class="media-box">
<block wx:if="{{coursesDetail.hasInputPwd && coursesDetail.content}}">
<view class="image-box" wx:if="{{coursesDetail.content.type == 1 || coursesDetail.content.type == 4 || coursesDetail.content.type == 5}}">
<swiper indicator-dots="{{swiperSetting.indicatorDots}}" bindchange="imageSwiperChange" autoplay="{{swiperSetting.autoplay}}" interval="{{swiperSetting.interval}}" duration="{{swiperSetting.duration}}">
<swiper
style="height: 392rpx;"
indicator-dots="{{swiperSetting.indicatorDots}}" bindchange="imageSwiperChange" autoplay="{{swiperSetting.autoplay}}" interval="{{swiperSetting.interval}}" duration="{{swiperSetting.duration}}">
<block wx:for="{{coursesDetail.content.images}}" wx:key="{{index}}">
<swiper-item style="height: 392rpx;">
<view class="swiper-item">
<image
class="" wx:if="{{index == 0 || (index >= imageCurrent-3 && index <= imageCurrent+3) }}" src="{{coursesDetail.content.type == 1 ? filter.imagify(item, 'image/resize,w_400/format,jpg/quality,q_60') : filter.mediaPng(item, 'image/resize,w_400/format,jpg/quality,q_6
0')}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
<view class="swiper-item"
bindtap="prevContentImg" data-src="{{item}}"
>
<image
class="" wx:if="{{index == 0 || (index >= imageCurrent-3 && index <= imageCurrent+3) }}" src="{{coursesDetail.content.type == 1 ? filter.imagify(item, 'image/resize,w_400/format,jpg/quality,q_100') : filter.mediaPng(item, 'image/resize,w_400/format,jpg/quality,q_10
0')}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
</view>
</swiper-item>
</block>
...
...
utilities/index.js
View file @
0605e2ff
...
...
@@ -79,7 +79,28 @@ function imagify(src, params) {
}
return
_src
;
}
function
mediaimagify
(
src
,
params
)
{
console
.
log
(
src
,
'src'
)
var
reg
=
/
(((
^https
?
:
(?:\/\/)?)(?:[
-;:&=
\+\$
,
\w]
+@
)?[
A-Za-z0-9.-
]
+|
(?:
www.|
[
-;:&=
\+\$
,
\w]
+@
)[
A-Za-z0-9.-
]
+
)((?:\/[\+
~%
\/
.
\w
-_
]
*
)?\??(?:[
-
\+
=&;%@.
\w
_
]
*
)
#
?(?:[\w]
*
))?)
$/g
;
if
(
reg
.
test
(
src
))
{
return
src
;
}
if
(
!
src
)
return
;
var
_src
=
src
;
if
(
src
.
indexOf
(
'//tmp'
)
!=
-
1
)
{
return
_src
;
}
if
(
src
.
indexOf
(
'media.shangjiadao.cn'
)
==
-
1
)
{
_src
=
'https://media.shangjiadao.cn/'
+
src
;
}
if
(
src
.
indexOf
(
'x-oss-process'
)
!=
-
1
){
return
_src
;
}
if
(
params
)
{
_src
=
_src
+
'?x-oss-process='
+
params
;
}
return
_src
;
}
function
timestampToTime
(
timestamp
)
{
var
date
=
new
Date
(
timestamp
*
1000
);
//时间戳为10位需*1000,时间戳为13位的话不需乘1000
var
Y
=
date
.
getFullYear
()
+
'-'
;
...
...
@@ -472,5 +493,6 @@ export {
voiceTimeFormat
,
getFlatternDistance
,
copyContent
,
debounce
debounce
,
mediaimagify
}
\ No newline at end of file
utilities/wxApi.js
View file @
0605e2ff
import
{
imagify
imagify
,
mediaimagify
}
from
'./index.js'
;
import
{
constants
...
...
@@ -247,8 +248,8 @@ function wxSaveImageToPhotosAlbum ({filePath}) {
}
function
wxPreviewImage
(
data
)
{
let
_urls
=
data
.
urls
||
[];
_urls
=
_urls
.
map
(
ele
=>
imagify
(
ele
));
let
_current
=
imagify
(
data
.
current
);
_urls
=
_urls
.
map
(
ele
=>
data
.
type
&&
data
.
type
==
'media'
?
mediaimagify
(
ele
)
:
imagify
(
ele
));
let
_current
=
data
.
type
&&
data
.
type
==
'media'
?
mediaimagify
(
data
.
current
)
:
imagify
(
data
.
current
);
return
new
Promise
((
reslve
,
reject
)
=>
{
wx
.
previewImage
({
current
:
_current
,
// 当前显示图片的http链接
...
...
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