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 d197aa50
authored
May 29, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改tab点击跳转
1 parent
eeb681a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
17 deletions
components/proDetail/proDetail.js
components/proDetail/proDetail.js
View file @
d197aa5
...
@@ -90,25 +90,57 @@ Component({
...
@@ -90,25 +90,57 @@ Component({
let
{
attr
}
=
e
.
currentTarget
.
dataset
let
{
attr
}
=
e
.
currentTarget
.
dataset
this
.
data
[
attr
]
&&
this
.
data
[
attr
].
pause
()
this
.
data
[
attr
]
&&
this
.
data
[
attr
].
pause
()
},
},
getInfo
()
{
// getInfo() {
let
{
activeNavIdx
,
actNum
}
=
this
.
data
// let { activeNavIdx, actNum } = this.data
const
spcList
=
[
99
]
// 订阅模块需要特殊处理
// const spcList = [99] // 订阅模块需要特殊处理
const
senceList
=
this
.
data
.
productData
[
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
// const senceList = this.data.productData[actNum].filter(item => item.name != '全部')
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
// for (let i = 0; i < senceList.length; i++) {
let
item
=
senceList
[
i
]
// let item = senceList[i]
let
proIdList
=
item
?.
productList
.
map
(
k
=>
k
.
id
)
// let proIdList = item?.productList.map(k => k.id)
if
(
proIdList
.
includes
(
activeNavIdx
))
{
// if (proIdList.includes(activeNavIdx)) {
let
proInfo
=
item
.
productList
.
find
(
k
=>
k
.
id
==
activeNavIdx
)
// let proInfo = item.productList.find(k => k.id == activeNavIdx)
// this.setData({
// proInfo,
// productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
// tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
// prodItemVideo: item.videoList.length ? spcList.includes(actNum) ? item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
// })
// break
// }
// }
// },
async
loadImg
(
e
){
this
.
data
.
loadedNum
+=
1
if
(
e
.
currentTarget
.
dataset
.
len
==
this
.
data
.
loadedNum
){
let
imgTopArr
=
[];
const
topList
=
await
this
.
getDomInfo
(
'.calc-wrap'
)
const
top
=
topList
.
reduce
((
prev
,
cur
)
=>
{
return
prev
+
cur
.
height
;
},
0
)
imgTopArr
.
push
(
top
)
const
imgList
=
await
this
.
getDomInfo
(
'.img-items'
)
imgList
.
reduce
((
prev
,
cur
,
index
)
=>
{
if
(
index
<
imgList
.
length
-
1
){
imgTopArr
.
push
(
prev
+
cur
.
height
)
}
return
prev
+
cur
.
height
;
},
top
)
this
.
setData
({
this
.
setData
({
proInfo
,
imgTopArr
productImgs
:
spcList
.
includes
(
actNum
)
?
proInfo
.
sceneImgs
:
(
proInfo
.
productImgs
?
proInfo
.
productImgs
:
item
.
productImgs
),
tabList
:
spcList
.
includes
(
actNum
)
?
proInfo
.
tabList
:
norTabList
,
prodItemVideo
:
item
.
videoList
.
length
?
spcList
.
includes
(
actNum
)
?
item
.
videoList
[
proInfo
.
currentIndex
]
:
item
.
videoList
[
activeNavIdx
]
:
item
.
noVideoPicture
[
0
]
})
})
break
}
}
}
},
},
getDomInfo
(
dom
){
return
new
Promise
((
resolve
,
reject
)
=>
{
let
query
=
wx
.
createSelectorQuery
().
in
(
this
);
query
.
selectAll
(
dom
)
.
boundingClientRect
((
rt
)
=>
{
resolve
(
rt
)
})
.
exec
();
})
},
getImgHeight
()
{
getImgHeight
()
{
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
let
heightArr
=
[]
let
heightArr
=
[]
...
@@ -119,7 +151,7 @@ Component({
...
@@ -119,7 +151,7 @@ Component({
let
_this
=
this
let
_this
=
this
query
query
.
selectAll
(
'.img-item'
)
.
selectAll
(
'.img-item
s
'
)
.
boundingClientRect
(
react
=>
{
.
boundingClientRect
(
react
=>
{
react
.
forEach
((
item
,
index
)
=>
{
react
.
forEach
((
item
,
index
)
=>
{
//44 tab的高度
//44 tab的高度
...
...
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