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 dc017aff
authored
Oct 26, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:滚动添加
1 parent
956b351a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
45 deletions
pages/checkProduct/checkProduct.wxml
pages/tab/index/components/product/product.js
pages/tab/index/components/product/product.wxml
pages/tab/index/index.js
pages/tab/index/index.scss
pages/checkProduct/checkProduct.wxml
View file @
dc017af
...
...
@@ -5,7 +5,8 @@
<!-- <view style="height:{{headerHeight}}px">
</view> -->
<product stickyTop="{{headerHeight}}" class="productCon" style="padding-top:{{headerHeight}}px" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" bindauthorized="authorizedFn" />
<!-- style="padding-top:{{headerHeight}}px" -->
<product stickyTop="{{headerHeight}}" class="productCon" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" bindauthorized="authorizedFn" />
<!-- 分享弹框 -->
<!-- <view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
...
...
pages/tab/index/components/product/product.js
View file @
dc017af
...
...
@@ -54,10 +54,13 @@ Component({
},
lifetimes
:
{
ready
:
function
()
{
this
.
init
();
this
.
getImgHeight
();
console
.
log
(
'ready'
)
//获取当前路径
let
currentUrl
=
this
.
getCurrentPageUrl
()
// console.log('currentUrl: ', currentUrl);
if
(
currentUrl
==
'/pages/tab/index/index'
){
if
(
currentUrl
==
'/pages/tab/index/index'
){
this
.
setData
({
currentUrl
:
false
})
...
...
@@ -77,6 +80,7 @@ Component({
// return pre+cur.height
// },heightTop)
let
imgTopArr
=
this
.
data
.
imgTopArr
console
.
log
(
'imgTopArr: '
,
imgTopArr
);
if
(
imgTopArr
.
length
==
0
)
return
wx
.
nextTick
(()
=>
{
...
...
@@ -96,8 +100,6 @@ Component({
})
}
this
.
init
();
this
.
getImgHeight
();
//如果不是分享,初始化的时候调用函数
if
(
!
this
.
data
.
isShare
)
{
// console.log(131546)
...
...
@@ -149,7 +151,7 @@ Component({
activeNavIdx
:
0
,
});
// 每次切换场景,重新获取流程图高度
this
.
getImgHeight
();
//
this.getImgHeight();
this
.
getMoreFn
();
// this
if
(
this
.
data
.
wrapactiveNavIdx
){
...
...
@@ -159,7 +161,6 @@ Component({
}
},
},
/**
* 组件的方法列表
*/
...
...
@@ -219,12 +220,18 @@ Component({
changeTab
(
e
)
{
let
idx
=
e
.
detail
;
let
{
imgTopArr
,
stickyTop
}
=
this
.
data
console
.
log
(
'idx: '
,
imgTopArr
[
idx
]);
console
.
log
(
'idx: '
,
imgTopArr
[
idx
]
,
stickyTop
);
// this.setData({
// intoViewId: `to-${idx}`,
// });
// wx.$eventbus.emit('evt_page_index',idx)
wx
.
pageScrollTo
({
scrollTop
:
imgTopArr
[
idx
]
-
stickyTop
+
88
+
34
})
//判断当前路径
let
currentUrl
=
this
.
getCurrentPageUrl
()
if
(
currentUrl
==
'/pages/tab/index/index'
){
wx
.
pageScrollTo
({
scrollTop
:
imgTopArr
[
idx
]
-
stickyTop
+
88
+
34
})
}
else
{
wx
.
pageScrollTo
({
scrollTop
:
(
imgTopArr
[
idx
]
-
stickyTop
)})
}
},
// async changeTab(e){
// let idx = e.detail
...
...
@@ -274,10 +281,12 @@ Component({
let
imgTopArr
=
[]
let
s
=
0
;
let
top
let
_this
=
this
query
.
selectAll
(
".img-item"
)
.
boundingClientRect
((
react
)
=>
{
react
.
forEach
((
item
,
index
)
=>
{
console
.
log
(
'item: '
,
item
);
// if(index == 0){
// console.log('item top: ', item);
...
...
@@ -288,7 +297,6 @@ Component({
// heightArr.push(s);
imgTopArr
.
push
(
s
)
});
console
.
log
(
'没有处理过的heightArr'
,
heightArr
)
// heightArr = heightArr.map((item)=>{
// item += top
...
...
@@ -297,29 +305,12 @@ Component({
// this.data.heightArr = heightArr;
// // console.log(heightArr[heightArr.length-1])
// this.data.allHeight = heightArr[heightArr.length - 1];
// console.log('imgTopArr',imgTopArr)
_this
.
setData
({
imgTopArr
})
})
.
exec
();
this
.
setData
({
imgTopArr
// heightArr,
// allHeight:heightArr[heightArr.length - 1]
})
// let query = wx.createSelectorQuery().in(this);
// let heightArr = [];
// let s = 0;
// query
// .selectAll(".img-item")
// .boundingClientRect((react) => {
// react.forEach((item) => {
// // s += item.height;
// heightArr.push(item.top);
// });
// this.data.heightArr = heightArr;
// // console.log(heightArr[heightArr.length-1])
// this.data.allHeight = heightArr[heightArr.length - 1];
// })
// .exec();
},
// 获取用户信息
getUserInfo
({
detail
})
{
...
...
pages/tab/index/components/product/product.wxml
View file @
dc017af
<!-- pages/tab/discovery/components/product/product.wxml -->
<view class="prod-wrap" >
<view class="big-title">特色产品
{{origin}}
</view>
<view class="big-title">特色产品</view>
<scroll-view class="nav-wrap" scroll-x="{{true}}" wx:if="{{!isShare && origin =='home'}}">
<block wx:for="{{navList}}" wx:key="index">
<text class='nav {{activeNavIdx==index ? "active-nav": ""}}' bindtap="changeNav" data-index="{{index}}">{{item}}</text>
...
...
@@ -40,12 +40,11 @@
productHeight
/>
</view>
<!-- style="{height:{{allHeight}}px}" -->
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
<scroll-view
class="project-img"
scroll-into-view="{{intoViewId}}"
bindscroll="scrolltoupper"
scroll-y="{{true}}"
>
<block wx:for="{{tab}}" wx:key="index">
<!-- wx:if="{{showVideo && index==5 && tab.length < 5}}" -->
...
...
pages/tab/index/index.js
View file @
dc017af
...
...
@@ -311,17 +311,17 @@ Page({
visible
:
false
})
// this.showCase();
if
(
!
this
.
data
.
isFirst
)
{
//
if (!this.data.isFirst) {
wx
.
showToast
({
title
:
'测算结果已在页面内同步展示'
,
icon
:
'none'
,
duration
:
2000
})
}
else
{
this
.
setData
({
isFirst
:
false
})
}
//
} else {
//
this.setData({
//
isFirst: false
//
})
//
}
},
// // 获取场景下的产品类型
// getProductType(sceneIndex, tabIndex) {
...
...
pages/tab/index/index.scss
View file @
dc017af
...
...
@@ -386,18 +386,18 @@ page {
position
:
fixed
;
right
:
-4px
;
top
:
60%
;
width
:
6
0
px
;
height
:
6
0
px
;
width
:
6
4
px
;
height
:
6
4
px
;
border-radius
:
50%
;
z-index
:
2
;
}
.output-value
{
position
:
fixed
;
right
:
5
px
;
right
:
-2
px
;
top
:
70%
;
width
:
40
px
;
height
:
50
px
;
width
:
64
px
;
height
:
64
px
;
// border-radius: 50%;
z-index
:
1
;
}
...
...
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