Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-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 ca17e1ec
authored
Oct 25, 2022
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
吸顶
1 parent
6dc7edca
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
8 deletions
components/Tab/Tab.wxss
pages/authentication/register/register.js
pages/checkProduct/checkProduct.js
pages/tab/discovery/components/product/product.js
pages/tab/discovery/discovery.js
pages/tab/discovery/discovery.scss
pages/tab/discovery/discovery.wxml
components/Tab/Tab.wxss
View file @
ca17e1e
...
...
@@ -4,7 +4,7 @@
.tab-box {
display: flex;
width: 100%;
height:
92r
px;
height:
46
px;
box-sizing: border-box;
border-bottom: 1rpx solid #EAEBEF;
}
...
...
pages/authentication/register/register.js
View file @
ca17e1e
...
...
@@ -130,6 +130,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
wx
.
$storage
.
rm
(
'userInfo'
)
wx
.
$storage
.
rm
(
'sessionId'
)
let
data
=
JSON
.
parse
(
decodeURIComponent
(
options
.
data
))
console
.
log
(
data
)
let
{
staffName
,
fileUrl
,
merchantId
,
type
}
=
data
...
...
pages/checkProduct/checkProduct.js
View file @
ca17e1e
...
...
@@ -48,6 +48,7 @@ Page({
this
.
setData
({
navStyle
:
scrollTop
==
0
?
navStyle
:
`background-color:
${
color
}
;`
})
wx
.
$eventbus
.
emit
(
'evt_page_scroll'
,{
scrollTop
})
},
// 分享按钮
sharehandle
()
{
...
...
pages/tab/discovery/components/product/product.js
View file @
ca17e1e
...
...
@@ -27,6 +27,24 @@ Component({
lifetimes
:{
ready
:
function
(){
this
.
getImgHeight
()
wx
.
$eventbus
.
on
(
'evt_page_scroll'
,
async
(
e
)
=>
{
// console.log(e)
let
heightTop
=
this
.
data
.
headerHeight
// 90 场景高度,8 场景margin-bottom
let
prodArr
=
await
this
.
getHeight
(
'.prod-wrap'
)
heightTop
+=
prodArr
[
0
].
height
let
imgArr
=
await
this
.
getHeight
(
'.img-item'
)
let
imgHeightArr
=
[]
imgArr
.
reduce
((
pre
,
cur
,
index
)
=>
{
imgHeightArr
.
push
(
pre
+
cur
.
height
)
return
pre
+
cur
.
height
},
heightTop
)
let
idx
=
imgHeightArr
.
findIndex
(
item
=>
item
>
e
.
scrollTop
)
if
(
idx
>-
1
){
this
.
setData
({
curTabIdx
:
idx
})
}
})
},
},
...
...
@@ -69,11 +87,31 @@ Component({
},
methods
:
{
changeTab
(
e
){
async
changeTab
(
e
){
let
idx
=
e
.
detail
this
.
setData
({
intoViewId
:
`to-
${
idx
}
`
})
let
heightTop
=
this
.
data
.
headerHeight
+
90
-
16
-
46
// 90 场景高度,16 可能是误差 , 46 tab高度
let
prodArr
=
await
this
.
getHeight
(
'.prod-wrap'
)
heightTop
+=
prodArr
[
0
].
height
let
imgArr
=
await
this
.
getHeight
(
'.img-item'
)
for
(
let
i
=
0
;
i
<
idx
;
i
++
){
heightTop
+=
imgArr
[
i
].
height
}
wx
.
pageScrollTo
({
scrollTop
:
heightTop
,
duration
:
0
})
},
getHeight
(
cla
){
return
new
Promise
((
resolve
,
reject
)
=>
{
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
query
.
selectAll
(
cla
).
boundingClientRect
((
rect
)
=>
{
resolve
(
rect
)
}).
exec
()
})
},
changeNav
(
event
){
this
.
setData
({
...
...
@@ -88,12 +126,10 @@ Component({
},
downVideo
(
e
)
{
let
{
url
}
=
e
.
target
.
dataset
console
.
log
(
url
)
wx
.
$api
.
showToast
(
'正在下载视频...'
)
wx
.
downloadFile
({
url
:
url
,
success
(
res
)
{
console
.
log
(
res
,
111
)
if
(
res
.
statusCode
===
200
)
{
wx
.
saveVideoToPhotosAlbum
({
...
...
pages/tab/discovery/discovery.js
View file @
ca17e1e
...
...
@@ -115,6 +115,7 @@ Page({
this
.
setData
({
navStyle
:
scrollTop
==
0
?
navStyle
:
`background-color:
${
color
}
;`
})
wx
.
$eventbus
.
emit
(
'evt_page_scroll'
,{
scrollTop
})
},
changeSwiper
(
e
){
...
...
pages/tab/discovery/discovery.scss
View file @
ca17e1e
...
...
@@ -4,11 +4,12 @@ page{
}
.container
{
position
:
relative
;
.header
{
padding-bottom
:
8px
;
}
.scene-wrap
{
white-space
:
nowrap
;
height
:
180rpx
;
margin-bottom
:
16rpx
;
height
:
90px
;
.scene-img
{
width
:
100%
;
}
...
...
pages/tab/discovery/discovery.wxml
View file @
ca17e1e
...
...
@@ -66,6 +66,6 @@
</view>
<!-- 在线客服 -->
<image
wx:if="{{showPage}}" class="chat" src="{{IMGURL}}customer_service
.png" bindtap="goConsult" />
<image
mode="aspectFit" wx:if="{{showPage}}" class="chat" src="{{IMGURL}}kefu
.png" bindtap="goConsult" />
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