Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 31c7db49
authored
Sep 05, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit 修复
1 parent
07977df4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
28 deletions
pages/common/caseDetail.vue
pages/common/components/AudioComponent.vue
pages/common/caseDetail.vue
View file @
31c7db4
<
template
>
<view
class=
"case-box"
>
<view
class=
"nav-bar"
>
<view
class=
"back"
@
click=
"back"
>
<uni-icons
type=
"left"
:size=
"20"
color=
"#000"
></uni-icons>
<view
class=
"back"
@
click=
"back"
>
<uni-icons
type=
"left"
:size=
"20"
color=
"#000"
></uni-icons>
</view>
{{
caseObject
.
title
}}
</view>
<view
class=
"case-content"
>
<view
class=
"left-menu"
>
<view
class=
"title"
>
方案目录
</view>
<scroll-view
scroll-y
class=
"scroll"
:scroll-into-view=
"`menu-$
{currentId}`" @scroll="menuScroll">
<view
class=
"scroll-content"
id=
"scroll-content"
>
<scroll-view
scroll-y
class=
"scroll"
:scroll-into-view=
"`menu-$
{currentId}`"
@scroll="menuScroll"
>
<view
class=
"scroll-content"
id=
"scroll-content"
>
<template
v-for=
"(item, index) in detailInfo"
>
<view
class=
"item"
:key=
"index"
>
<view
:class=
"['name', isLast(index), isActive(item)]"
@
click=
"menuClick(item)"
>
<view
class=
"text text-hide"
:id=
"`menu-$
{item.id}`">
{{
item
.
headings
}}
</view>
<view
class=
"item"
:key=
"index"
>
<view
:class=
"['name', isLast(index), isActive(item)]"
@
click=
"menuClick(item)"
>
<view
class=
"text text-hide"
:id=
"`menu-$
{item.id}`"
>
{{
item
.
headings
}}
</view>
</view>
<template
v-if=
"item.children && item.children.length"
>
<template
v-for=
"(i, j) in item.children"
>
<view
:class=
"['name', isLast(index, j, item.children), isActive(i)]"
:key=
"j"
@
click=
"menuClick(i)"
>
<view
class=
"text"
:id=
"`menu-$
{i.id}`">
<view
:class=
"['name', isLast(index, j, item.children), isActive(i)]"
:key=
"j"
@
click=
"menuClick(i)"
>
<view
class=
"text"
:id=
"`menu-$
{i.id}`"
>
<view
class=
"icon"
></view>
<view
class=
"text-hide"
>
{{
i
.
headings
}}
</view>
</view>
...
...
@@ -29,40 +60,96 @@
</view>
</template>
<
template
v-if=
"currentId"
>
<view
class=
"block"
:style=
"blockTop"
></view>
<view
class=
"block"
:style=
"blockTop"
></view>
</
template
>
</view>
</scroll-view>
</view>
<scroll-view
class=
"right-content"
scroll-y
:scroll-into-view=
"`case-${contentId}`"
@
scroll=
"contentScroll"
enable-flex
>
<scroll-view
class=
"right-content"
scroll-y
:scroll-into-view=
"`case-${contentId}`"
@
scroll=
"contentScroll"
enable-flex
>
<!-- scroll-with-animation -->
<
template
v-for=
"(item, index) in detailInfo"
>
<view
class=
"detail-item"
:key=
"item.id"
>
<view
class=
"item-title"
:id=
"`case-$
{item.id}`">
{{
item
.
headings
}}
</view>
<view
class=
"detail-item"
:key=
"item.id"
>
<view
class=
"item-title"
:id=
"`case-$
{item.id}`"
>
{{
item
.
headings
}}
</view>
<template
v-if=
"item.audio"
>
<audio-component
:src=
"item.audio"
@
onPlay=
"onPlay(item)"
:ref=
"`audio-$
{item.id}`" :audioKey="`key${item.id}`" />
<audio-component
:src=
"item.audio"
@
onPlay=
"onPlay(item)"
:ref=
"`audio-$
{item.id}`"
:audioKey="`key${item.id}`"
/>
</
template
>
<view
class=
"item-content"
>
<rich-text
:nodes=
"item.content"
></rich-text>
</view>
<
template
v-for=
"(i, ind) in item.imgList"
>
<view
class=
"picture"
:key=
"`img-$
{index}-${ind}`" :id="`img-${index}-${ind}`" :data-item="item" :data-index="ind">
<image
:src=
"i.url"
class=
"item-img"
mode=
"widthFix"
@
load=
"imgLoad"
v-if=
"i.visible"
></image>
<view
class=
"picture"
:key=
"`img-$
{index}-${ind}`"
:id="`img-${index}-${ind}`"
:data-item="item"
:data-index="ind"
>
<image
:src=
"i.url"
class=
"item-img"
mode=
"widthFix"
@
load=
"imgLoad"
v-if=
"i.visible"
></image>
</view>
</
template
>
<
template
v-if=
"item.children && item.children.length"
>
<template
v-for=
"(i, s) in item.children"
>
<view
class=
"sub-item-content"
:key=
"s"
>
<view
class=
"item-title sub-item-title flex"
:id=
"`case-$
{i.id}`">
{{
i
.
headings
}}
</view>
<view
class=
"sub-item-content"
:key=
"s"
>
<view
class=
"item-title sub-item-title flex"
:id=
"`case-$
{i.id}`"
>
{{
i
.
headings
}}
</view>
<template
v-if=
"i.audio"
>
<audio-component
:src=
"i.audio"
@
onPlay=
"onPlay(i)"
:ref=
"`audio-$
{i.id}`" :audioKey="`key${i.id}`" />
<audio-component
:src=
"i.audio"
@
onPlay=
"onPlay(i)"
:ref=
"`audio-$
{i.id}`"
:audioKey="`key${i.id}`"
/>
</
template
>
<view
class=
"item-content"
>
<rich-text
:nodes=
"i.content"
></rich-text>
</view>
<
template
v-for=
"(c, k) in i.imgList"
>
<view
class=
"picture"
:key=
"`cimg-$
{s}-${k}`" :id="`cimg-${s}-${k}`" :data-item="i" :data-index="k" data-is-child>
<image
:src=
"c.url"
class=
"item-img"
mode=
"widthFix"
@
load=
"imgLoad"
v-if=
"c.visible"
></image>
<view
class=
"picture"
:key=
"`cimg-$
{s}-${k}`"
:id="`cimg-${s}-${k}`"
:data-item="i"
:data-index="k"
data-is-child
>
<image
:src=
"c.url"
class=
"item-img"
mode=
"widthFix"
@
load=
"imgLoad"
v-if=
"c.visible"
></image>
</view>
</
template
>
</view>
...
...
@@ -230,17 +317,21 @@ export default {
await
detailInfo
.
map
(
async
e
=>
{
let
query
=
uni
.
createSelectorQuery
()
query
.
select
(
`#case-
${
e
.
id
}
`
).
boundingClientRect
(
data
=>
{
topList
.
push
(
data
.
top
-
itemHeight
+
contentScrollNumber
)
e
.
top
=
data
.
top
-
itemHeight
+
contentScrollNumber
itemList
.
push
(
e
)
if
(
data
)
{
topList
.
push
(
data
.
top
-
itemHeight
+
contentScrollNumber
)
e
.
top
=
data
.
top
-
itemHeight
+
contentScrollNumber
itemList
.
push
(
e
)
}
}).
exec
()
if
(
e
.
children
)
e
.
children
.
map
(
i
=>
{
let
c_query
=
uni
.
createSelectorQuery
()
c_query
.
select
(
`#case-
${
i
.
id
}
`
).
boundingClientRect
((
data
)
=>
{
topList
.
push
(
data
.
top
-
itemHeight
+
contentScrollNumber
)
i
.
top
=
data
.
top
-
itemHeight
+
contentScrollNumber
itemList
.
push
(
i
)
if
(
data
)
{
topList
.
push
(
data
.
top
-
itemHeight
+
contentScrollNumber
)
i
.
top
=
data
.
top
-
itemHeight
+
contentScrollNumber
itemList
.
push
(
i
)
}
}).
exec
()
})
})
...
...
pages/common/components/AudioComponent.vue
View file @
31c7db4
...
...
@@ -44,12 +44,15 @@ export default {
},
computed
:
{
},
destroyed
()
{
this
.
innerAudioContext
[
this
.
audioKey
].
destroy
()
},
mounted
()
{
},
methods
:
{
init
(
src
)
{
const
innerAudioContext
=
uni
.
createInnerAudioContext
(),
{
audioKey
}
=
this
{
audioKey
}
=
this
innerAudioContext
.
src
=
src
innerAudioContext
.
sessionCategory
=
'soloAmbient'
innerAudioContext
.
onCanplay
(
this
.
onCanplay
)
...
...
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